<!--hide this script from non-javascript-enabled browsers

/*

#####################################################

# File : js/user.js

# Created By : Manish Sharma

# Created On : 17 June 2008

######################################################

*/





/*

######################################################################################################

# Function Name : fnCheck_Cust_Email()

# Created By : Manish Sharma

# Created On : 17 June 2008

# Parmeter : id - check request come from which page

# Description : Function to check the validation of customer email address for uniqueness 

######################################################################################################

*/

var setCust_Email_ExistValue = 0 ;

function fnCheck_Cust_Email(id)

{    

	var strMail = fnGetFieldValue('cust_email');



    xmlHttp=fnGetXmlHttpObject();

	if(xmlHttp==null)

          {

			alert (errorArray[60]);

            return;

          } 

          

		var url="/user_ajax_request.php";

		url=url+"?rq_id="+1+"&email="+strMail+"&checkPageId="+id;

		url=url+"&sid="+Math.random();

		xmlHttp.onreadystatechange=fnCheck_Cust_Email_Respo;

        xmlHttp.open("GET",url,true);

        xmlHttp.send(null);

}

function fnCheck_Cust_Email_Respo()

{

	   

   if(xmlHttp.readyState==4)

    {

		 

	   if(xmlHttp.responseText == 1)

       { 

			 document.getElementById("cust_email").style.backgroundColor = "red";

			 fnFocusAndAlert(errorArray[76] ,'cust_email');

			 setCust_Email_ExistValue = 0;

			 return false;

	   }

        if(xmlHttp.responseText == 0)

	   { 

			 document.getElementById("cust_email").style.backgroundColor = "white";

			 setCust_Email_ExistValue = 1;

			 return true;

	   }

    }   

}

/*

######################################################################################################

# Function Name : fnCust_Signup_Validation()

# Created By : Manish Sharma

# Created On : 17 June 2008

# Parmeter : id - check request come from which page  

# Description : Function to check the validation of customer signup form 

######################################################################################################

*/

function fnCust_Signup_Validation(id) // id user for check page edit or signup

{  

   var strFirstName = fnGetFieldValue('cust_fname');

   var strLastName = fnGetFieldValue('cust_lname');

   

    var strMail = fnGetFieldValue('cust_email');

  

   if(id==0)

     { 

        var strMail = fnGetFieldValue('cust_email');

        var strMailVerify = fnGetFieldValue('varify_cust_email'); 

        var strPass = fnGetFieldValue('cust_pass');

        var str_re_pass = fnGetFieldValue('cust_re_pass');

     }

   var strSecondaryMail = fnGetFieldValue('cust_email2');    

   var strAddr = fnGetFieldValue('cust_addr');

   var strCity = fnGetFieldValue('cust_city');

   var strState = fnGetFieldValue('cust_state');

   var strCountry = fnGetFieldValue('cust_country');

   var strZip = fnGetFieldValue('cust_zip');

   var strPhone = fnGetFieldObject('cust_phone');

   var strProvince = fnGetFieldValue('Province');

   

   if(isBlank(strFirstName))   //check customer first name field blank or not 

     {

		fnFocusAndAlert(errorArray[3] ,'cust_fname'); 

        return false;

     }

   

   if(isBlank(strLastName))   //check customer last name field blank or not 

     {

		fnFocusAndAlert(errorArray[4] ,'cust_lname'); 

        return false;

     }

 

  

   

if(id==0)

 { 

     if(isBlank(strMail))   //check customer mail address field blank or not 

     {

		fnFocusAndAlert(errorArray[11] ,'cust_email'); 

        return false;

     }

     else

     {

        //check email address is valid or not

         if(!isValidEmail(strMail))

         {

			 fnFocusAndAlert(errorArray[8] ,'cust_email'); 

             return false;

         }

         else

         {  

             if(isBlank(strMailVerify))   //check customer mail address field blank or not 

             {

				fnFocusAndAlert(errorArray[125] ,'varify_cust_email'); 

                return false;

             }

             else

             {

             

                 //check email address is valid or not

                 if(!isValidEmail(strMailVerify))

                 {

					 fnFocusAndAlert(errorArray[8] ,'varify_cust_email'); 

                     return false;

                 }

                 else

                 {

                      if(!isBlank(strMail) && !isBlank(strMailVerify)) 

                       {                                                   // password and confirm password both should be same check here.

                          if(strMail != strMailVerify) 

                         {

							fnFocusAndAlert(errorArray[126] ,'varify_cust_email');

                            return false;

                         }

                       }

                 

                 }

            

         

				 fnCheck_Cust_Email(id);

                 for(i=0;i<10000;i++)  // just for set the value below

                 {

                 } 

				 if(setCust_Email_ExistValue ==0)

                 {

                      return false; 

                 }  

             

             } 

         }

     }



   if(isBlank(strPass))    //check password field blank or not

     {

		fnFocusAndAlert(errorArray[1] ,'cust_pass'); 

        return false;

     }

    

     

   if(isBlank(str_re_pass))    //check password field blank or not

     {

		fnFocusAndAlert(errorArray[14] ,'cust_re_pass'); 

        return false;

     }

   

  

     //check password length( more then 4 and less then 15)

     var passLength = strPass.length;

     var rePassLength = str_re_pass.length;

     

   if(passLength <=5 || passLength >15) 

     {

		fnFocusAndAlert(errorArray[124] ,'cust_pass');

        return false;

     }

     

     if(rePassLength<=5 ||rePassLength >15)

     {

		fnFocusAndAlert(errorArray[124] ,'cust_re_pass');

        return false;

     }

     

   if(!isBlank(strPass) && !isBlank(str_re_pass)) 

   {                                                   // password and confirm password both should be same check here.

      if(strPass != str_re_pass) 

     {

		fnFocusAndAlert(errorArray[77] ,'cust_pass');

        return false;

     }

   }

 }    



 

      

    if(!isBlank(strSecondaryMail))   //check customer secondary mail address validation

     {

        //check email address is valid or not

         if(!isValidEmail(strSecondaryMail))

         {

			 fnFocusAndAlert(errorArray[8] ,'cust_email2'); 

             return false;

         }

     } 

    

    if(isBlank(strAddr))    //check Address field blank or not

     {

		fnFocusAndAlert(errorArray[6] ,'cust_addr'); 

        return false;

     }

     

    if(isBlank(strCity))    //check city field blank or not

     {

		fnFocusAndAlert(errorArray[22] ,'cust_city'); 

        return false;

     }

     

    if(strState==-1)    //check state field blank or not

     {

		fnFocusAndAlert(errorArray[130] ,'cust_state'); 

        return false;

     }

     

   if(strState=='notusa')

   {

        if(isBlank(strProvince))    

        {

		   fnFocusAndAlert(errorArray[132] ,'Province'); 

           return false;

        }

   

   }  

     

     if(strCountry==-1)    //check country field blank or not

     {

		fnFocusAndAlert(errorArray[131] ,'cust_country'); 

        return false;

     }     

     

                     

    if(isBlank(strZip))    //check zipcode field blank or not

     {

		fnFocusAndAlert(errorArray[75] ,'cust_zip'); 

        return false;

     }

    

    if(isBlank(strPhone.value))    //check phone field blank or not

     {

		fnFocusAndAlert(errorArray[7] ,'cust_phone'); 

        return false;

     }

     else

     {

        if(!fnIsNumber(strPhone,'Phone Number'))   // check phone number is numeric

        {

            fnPutFocus('cust_phone');

            return false;

        }

     } 

     

     if(document.getElementById('tc_cust_signup').checked==false)

        {



			fnFocusAndAlert(errorArray[99] , 'tc_cust_signup')

            return false;

        } 

          

 }



/*

######################################################################################################

# Function Name :fnCheckCustLogin()

# Created By : Manish Sharma

# Created On : 17 June 2008

# Description : Function to check the validation of customer login form

######################################################################################################

*/

function fnCheckCustLogin()

{

    var strEmail = fnGetFieldValue('cust_login');

	var Pass = fnGetFieldValue('cust_login_pass');

    

    if(isBlank(strEmail))    //check login email field blank or not

     {

		fnFocusAndAlert(errorArray[11] ,'cust_login'); 

        return false;

	 }

     else

     {

        //check email address is valid or not

         if(!isValidEmail(strEmail))

         {

			 fnFocusAndAlert(errorArray[8] ,'cust_login'); 

             return false;

         }

     } 

     

     if(isBlank(Pass))    //check password login field blank or not

     {

	   fnFocusAndAlert(errorArray[1] ,'cust_login_pass'); 

       return false;

     }

}


function fnSaveSelectedServices()
{
	var checks = document.getElementsByName('optional_serv[]');
	var exist_NDT_id =new Array(); 
	for(i=0;i<checks.length;i++)
	  {
		if(checks[i].checked)
		{
		   exist_NDT_id[i] = checks[i].value+'*^';	
		  
		}
	  }
	   
	document.getElementById('opt_serv_sess_login').value=exist_NDT_id;  
	
	

}



/*

######################################################################################################

# Function Name :fnCheckCustForgetPass()

# Created By : Manish Sharma

# Created On : 17 June 2008

# Description : customer forget password validation

######################################################################################################

*/

function fnCheckCustForgetPass()

{

    var strEmail = fnGetFieldValue('cust_email');

   

    if(isBlank(strEmail))    //check login email field blank or not

     {

		fnFocusAndAlert(errorArray[11] ,'cust_email'); 

        return false;

     }

     else

     {

        //check email address is valid or not

         if(!isValidEmail(strEmail))

         {

			 fnFocusAndAlert(errorArray[8] ,'cust_email'); 

             return false;

         }

         

     } 

}

/* 

###################################################################################

# Function Name : fngetLocationDataUser()

# Created By : Manish Sharma

# Created On : 18 June 2008

# Parameter : pagename - check request come from which page.

# Description : For get location name according to vendor. (ajax request)

# OnSuccess : get location selectbox.

####################################################################################

*/  

function fngetLocationDataUser(pagename)

{

	var vendor_id = document.getElementById('Vendor_info').value;

	 //alert(vendor_id);

    if(vendor_id== -1)

    {

		alert(errorArray[55]);

        document.getElementById('Location_info_div').innerHTML ='<select name="Location_info" id="Location_info" onchange="fnCheckVendor();"><option value=-1>Select Location</option></select>';

        return false;

    }



    xmlHttp=fnGetXmlHttpObject();

    if(xmlHttp==null)

      {

		alert (errorArray[60]);

        return;

      } 

    var url="/user_ajax_request.php";

    url=url+"?rq_id="+2+"&id="+vendor_id;

    url=url+"&sid="+Math.random();

    xmlHttp.onreadystatechange=fngetLocationDataUserStateChanged;

    xmlHttp.open("GET",url,true);

    xmlHttp.send(null);



}



 function fngetLocationDataUserStateChanged()

 {

    

   if(xmlHttp.readyState==1 || xmlHttp.readyState==2 || xmlHttp.readyState==3)

    {

        document.getElementById('Location_info_div').innerHTML = '<img src="../images/loading.gif" />';

    }

     

   if(xmlHttp.readyState==4)

    {

		//alert(xmlHttp.responseText);

       document.getElementById('Location_info_div').innerHTML = xmlHttp.responseText;   //Update the location dropdown box

    } 

 }



 /* 

###################################################################################

# Function Name : fnReservSearchValidation()

# Created By : Manish Sharma

# Created On : 18 June 2008

# Description : For reservation page search validation

# OnSuccess : show reservation page with search data

####################################################################################

*/ 

function fnReservSearchValidation()

{

   var strAirportValue = fnGetFieldValue('airport_name_vals');

   var strCheckInDate = fnGetFieldValue('check_in_date');

   var strCheckOutDate = fnGetFieldValue('check_out_date');

   var strCheckInTime =  fnGetFieldValue('check_in_time');

   var strCheckOutTime = fnGetFieldValue('check_out_time');    

	 /*var checkedButton = "";   

	 for (i=0;i<document.final_reservation.airport_name_vals.length;i++) 

	 {      

	   if (document.final_reservation.airport_name_vals[i].checked)

         {

		 checkedButton=document.final_reservation.airport_name_vals[i].value ; 

		 }

	 }

   if(isBlank(checkedButton))    // check airport blank or not

	 {

		fnFocusAndAlert(errorArray[83] ,'airport_name_vals'); 

		return false;

	 }*/  

    
	if(strAirportValue==-1)    // check airport blank or not

	 {

		fnFocusAndAlert(errorArray[83] ,'airport_name_vals'); 

		return false;

	 }
	 
     // for check in date 

   if(isBlank(strCheckInDate))    // check check-in date blank or not

     {

        fnFocusAndAlert(errorArray[81] ,'check_in_date'); 

        return false;

     }

       

   var arrIndate=strCheckInDate.split('/');

   var intInMonth = arrIndate[0];

   var intInDay =   arrIndate[1];

   var strInYear_day =  arrIndate[2];

   

   var arrInYear_day_array = strInYear_day.split('-');

   

   var intInYear = arrInYear_day_array[0];

   

   var strCompleteInDate = intInDay+'/'+intInMonth+'/'+intInYear;

   

   if(!fncheckDate(strCompleteInDate))

    {

        fnFocusAndAlert(errorArray[78] , 'check_in_date')

        return false;

    }

    // for check-out date



   if(isBlank(strCheckOutDate)) // check check-out date blank or not

     {

        fnFocusAndAlert(errorArray[82] ,'check_out_date'); 

        return false;

     }



   var arrOutdate=strCheckOutDate.split('/');

   var intOutMonth = arrOutdate[0];

   var intOutDay =   arrOutdate[1];

   var intOutYear_day =  arrOutdate[2];

   

   var arrOutYear_day_array = intOutYear_day.split('-');

   

   var intOutYear = arrOutYear_day_array[0];

   

   var strCompleteOutDate = intOutDay+'/'+intOutMonth+'/'+intOutYear;

   

   if(!fncheckDate(strCompleteOutDate))

    {

        fnFocusAndAlert(errorArray[79] , 'check_out_date')

        return false;

    }

 

 

 

 if(strCheckInTime==-1)

    {

      fnFocusAndAlert(errorArray[84] , 'check_in_time')

        return false;

    }

 

 if(strCheckOutTime==-1)

    {

      fnFocusAndAlert(errorArray[85] , 'check_out_time')

        return false;

    }

    

 // check out date grater then check in date

 

 if(!isEarlierOrEqualReserv(strCompleteInDate,strCompleteOutDate)) 

 {

    fnFocusAndAlert(errorArray[80] , 'check_out_date')

    return false;

 }  

    

    return true;

 // checkout time is greater then checkout time for same day  

 /*if(!isEarlierOrEqual(strCompleteInDate,strCompleteOutDate)) 

 {

     var arrInTime =  strCheckInTime.split(':');

     var arrInTime1 = arrInTime[1].split(' ');

      

	 //alert(arrInTime[0] + arrInTime1[0] +arrInTime1[1] );

      

     var arrOutTime =  strCheckOutTime.split(':');

     var arrOutTime1 = arrOutTime[1].split(' '); 

      

	 //alert(arrOutTime[0] + arrOutTime1[0] +arrOutTime1[1] );

     

     var intInHours = 0;

     var intOutHours = 0;

   

   // for in time am/pm calculation  

    if(arrInTime1[1]=='AM')

    {

      

       if(arrInTime[0]==12)

       {

            intInHours = '0';

       }

       else

       {

         intInHours = arrInTime[0];

       }

    }

    else

    {

       if(arrInTime[0]==12)

       {

          intInHours = arrInTime[0];

       }

       else

       {

            intInHours = parseInt(arrInTime[0]) + 12;

       }

    }   

   

   // for out time am/pm calculation

             

     if(arrOutTime1[1]=='AM')

    {

      

       if(arrOutTime[0]==12)

       {

            intOutHours = '0';

       }

       else

       {

         intOutHours = arrOutTime[0];

       }

    }

    else

    {

       if(arrOutTime[0]==12)

       {

          intOutHours = arrOutTime[0];

       }

       else

       {

            intOutHours = parseInt(arrOutTime[0]) + 12;

       }

    }   

     

  

if(intInHours <= intOutHours) 

{



  if(arrInTime1[1] == arrOutTime1[1] )

  {  

     if(arrInTime1[0] == '00')

     {  

       

       if(arrInTime1[0] < arrOutTime1[0] ) 

       {

           

       }

       else

       {

          fnFocusAndAlert(errorArray[116] , 'check_in_time')

          return false;

       }

     }

     

     if(arrOutTime1[0] == '00')

     {  

       

       if(arrOutTime1[0] > arrInTime1[0]) 

       {

            

       }

       else

       {

          fnFocusAndAlert(errorArray[116] , 'check_in_time')

          return false;

       }

     }

        

        

     if(arrOutTime1[0] != '00' && arrInTime1[0] != '00')

     {  

       

       if(arrOutTime1[0] > arrInTime1[0] ) 

       {

            

       }

       else

       {

          fnFocusAndAlert(errorArray[116] , 'check_in_time')

          return false;

       }

     }

  }   

       

}

else

{

     fnFocusAndAlert(errorArray[116] , 'check_in_time')

     return false;

}



}     */

    

    

 

}



/* 

################################################################################

# Function Name : fnMoveReservationPart3()

# Created By : Manish Sharma

# Created On : 23 June 2008

# Description : For reservation form submit according to select facility

# OnSuccess : redirect to reservation location sub part 3.

####################################################################################

*/



function fnMoveReservationPart3(selectFaclility,table_id)

{

  // document.getElementById('reservationpart2').action=HTTP_DOMAIN+"/BookIt-First/"+selectFaclility+"/"+table_id+"/";

   document.getElementById('final_reservation').action=HTTP_DOMAIN+"/BookIt-First/"+selectFaclility+"/"+table_id+"/";

   document.final_reservation.submit();

}





function fnMoveReservationPart4(selectFaclility,table_id,preAssignId)

{

  // document.getElementById('reservationpart2').action=HTTP_DOMAIN+"/BookIt-First/"+selectFaclility+"/"+table_id+"/"+

 // preAssignId+"/";

   document.getElementById('final_reservation').action=HTTP_DOMAIN+"/BookIt-First/"+selectFaclility+"/"+table_id+"/"+preAssignId+"/";



   document.final_reservation.submit();

}



  



/* 

#################################################################################################

# Function Name : fnRedirectReservationPart3()

# Created By : Manish Sharma

# Created On : 24 July 2008

# Description : just redirect the page for fill all information  for complete the reservation

# OnSuccess : redirect to reservation location part 3

#################################################################################################

*/

function fnRedirectReservationPart3(selectFaclility,table_id)

{   

	document.getElementById('reservation_sub3').action=HTTP_DOMAIN+"/BookIt-Second/"+selectFaclility+"/"+table_id+"/";

  //document.getElementById('reservation_sub3').action=HTTPS_DOMAIN+"/BookIt-Second/"+selectFaclility+"/"+table_id+"/";

  document.reservation_sub3.submit();

}



/* 

################################################################################

# Function Name : fnOpenZDiv()

# Created By : Manish Sharma

# Created On : 18 June 2008

# Description : For open z-index div for airport list

# OnSuccess : open airport z-index div

####################################################################################

*/



function fnOpenZDiv(id)

{

    document.getElementById('check_in_time').style.visibility="hidden";

    document.getElementById('check_out_time').style.visibility="hidden"; 

    document.getElementById(id).style.display="block";   

}



/* 

################################################################################

# Function Name : fnCloseAirportDiv()

# Created By : Manish Sharma

# Created On : 18 June 2008

# Description : For close z-index div for airport list

# OnSuccess : close airport z-index div

####################################################################################

*/

function fnCloseAirportDiv(id)

{

    document.getElementById(id).style.display="none";

    document.getElementById('check_in_time').style.visibility="visible";

    document.getElementById('check_out_time').style.visibility="visible"; 

} 



  /* 

################################################################################

# Function Name : fnShowAirportInput()

# Created By : Manish Sharma

# Created On : 18 June 2008

# Description : for select airport value from z-index div show into the text box.

# OnSuccess : show the airport name in to the airport text box

####################################################################################

*/

function fnShowAirportInput(vals)

{

  var airport =  vals.split('(');

  var airport_value = airport[0]+' ' +'('+airport[1];

  document.getElementById('airport_name_vals_show').value = airport_value; 

   document.getElementById('airport_name_vals').value = vals;

   document.getElementById('airport_name').style.display="none";

   document.getElementById('check_in_time').style.visibility="visible";

   document.getElementById('check_out_time').style.visibility="visible";

}  



  /* 

################################################################################

# Function Name : fnCalenderShow()

# Created By : Manish Sharma

# Created On : 18 June 2008

# Description : show calender for check-in and check-out date.

# OnSuccess : show calender and fill the date on corresponding text box.

####################################################################################

*/

function fnCalenderShow(inputid, triggerid)

{ 



    Calendar.setup({

        inputField     :    inputid,     // id of the input field

        ifFormat       :    "%m/%d/%Y-%A",      // format of the input field

        button         :    triggerid,  // trigger for the calendar (button ID)

        align          :    "Tl",           // alignment (defaults to "Bl")

        singleClick    :    true

    }); 

    

  

}



/* 

####################################################################################################################

# Function Name : selected()  , closeHandler(),  showCalendar

# Created By : Manish Sharma

# Created On : 03 August 2008

# Description : below all three function show calender for check-in and check-out date. on one click on the image.

# OnSuccess : return the date according to format

####################################################################################################################

*/





// This function gets called when the end-user clicks on some date.

function selected(cal, date) {

  cal.sel.value = date; // just update the date in the input field.

  if (cal.dateClicked && (cal.sel.id == "check_in_date" || cal.sel.id == "check_out_date"))

	// if we add this call we close the calendar on single-click.

    // just to exemplify both cases, we are using this only for the 1st

    // and the 3rd field, while 2nd and 4th will still require double-click.

	cal.callCloseHandler();

}



// And this gets called when the end-user clicks on the _selected_ date,

// or clicks on the "Close" button.  It just hides the calendar without

// destroying it.

function closeHandler(cal) {

  cal.hide();                        // hide the calendar

//  cal.destroy();

  _dynarch_popupCalendar = null;

}



// This function shows the calendar under the element having the given id.

// It takes care of catching "mousedown" signals on document and hiding the

// calendar if the click was outside.

function showCalendar(id, format, showsTime, showsOtherMonths) 

{



  var el = document.getElementById(id);

  if (_dynarch_popupCalendar != null) {

    // we already have some calendar created

    _dynarch_popupCalendar.hide();                 // so we hide it first.

  } else {

    // first-time call, create the calendar.

	var cal = new Calendar(1, null, selected, closeHandler);

    // uncomment the following line to hide the week numbers

    // cal.weekNumbers = false;

    if (typeof showsTime == "string") {

      cal.showsTime = true;

      cal.time24 = (showsTime == "24");

    }

    if (showsOtherMonths) {

      cal.showsOtherMonths = true;

    }

    _dynarch_popupCalendar = cal;                  // remember it in the global var

    cal.setRange(2008, 2070);        // min/max year allowed.

    cal.setDateStatusHandler(dateStatus);

    cal.create();

  }

  



  _dynarch_popupCalendar.setDateFormat(format);    // set the specified date format

  _dynarch_popupCalendar.parseDate(el.value);      // try to parse the text in field

  _dynarch_popupCalendar.sel = el;                 // inform it what input field we use



  // the reference element that we pass to showAtElement is the button that

  // triggers the calendar.  In this example we align the calendar bottom-right

  // to the button.

  

  _dynarch_popupCalendar.showAtElement(el.nextSibling, "Br");        // show the calendar



  return false;

}



 /* 

################################################################################

# Function Name : fnOpenCompareLocation()

# Created By : Manish Sharma

# Created On : 18 June 2008

# Description : open popup-window for compare location(self and valet on reservation part-2)

# OnSuccess : show all extra location offered facility

####################################################################################

*/ 



function fnOpenCompareLocation()

{

            var couponPopup = window.open ("location_compare.html","CompareLocation","location=0,status=0,scrollbars=0,width=730,height=570,menubar=0,resizable=0,screenX=200,screenY=300"); 

}   

    

 /* 

################################################################################

# Function Name : fnCust_checkout_signup_valid()

# Created By : Manish Sharma

# Created On : 24 June 2008

# Description : checkout signup validation

# OnSuccess : return true

####################################################################################

*/ 



function fnCust_checkout_signup_valid(id)

{



  var strFirstName = fnGetFieldValue('cust_fname');

  var strLastName = fnGetFieldValue('cust_lname');

  var strMail = fnGetFieldValue('cust_email');

  

   if(id==0)

   {

		 var strMailVerify = fnGetFieldValue('verify_cust_email');  

		var strPass = fnGetFieldValue('new_cust_pass');

		var str_re_pass = fnGetFieldValue('new_cust_pass_conf');

   }

   var strSecond_mail = fnGetFieldValue('cust_email2'); 

  var strAddr = fnGetFieldValue('cust_addr');

  var strCity = fnGetFieldValue('cust_city');

  var strState = fnGetFieldValue('cust_state');

   var strCountry = fnGetFieldValue('cust_country');

   var strProvince = fnGetFieldValue('Province'); 

  var strZip = fnGetFieldValue('cust_zip');

  var strPhone = fnGetFieldObject('cust_phone');

   

     if(isBlank(strFirstName))   //check customer first name field blank or not 

     {

        fnFocusAndAlert(errorArray[3] ,'cust_fname'); 

        return false;

     }

   

     if(isBlank(strLastName))   //check customer last name field blank or not 

     {

        fnFocusAndAlert(errorArray[4] ,'cust_lname'); 

        return false;

     }

  

     if(isBlank(strMail))   //check customer mail address field blank or not 

	 {

        fnFocusAndAlert(errorArray[11] ,'cust_email'); 

        return false;

     }

     else

	 {

        //check email address is valid or not

         if(!isValidEmail(strMail))

         {

             fnFocusAndAlert(errorArray[8] ,'cust_email'); 

             return false;

         }

         else

		 {

           

           if(id==0)

		   { 

			 

           if(isBlank(strMailVerify))   //check customer mail address field blank or not 

			 {

                fnFocusAndAlert(errorArray[125] ,'verify_cust_email'); 

                return false;

             }

             else

			 {

             

                 //check email address is valid or not

                 if(!isValidEmail(strMailVerify))

                 {

                     fnFocusAndAlert(errorArray[8] ,'verify_cust_email'); 

                     return false;

                 }

                 else

                 {

					  if(!isBlank(strMail) && !isBlank(strMailVerify)) 

                       {                                                   // password and confirm password both should be same check here.

                          if(strMail != strMailVerify) 

                         {

                            fnFocusAndAlert(errorArray[126] ,'verify_cust_email');

                            return false;

                         }

                       }

                 

				 }

		   var strMail = fnGetFieldValue('cust_email'); 
		   var randomN0 = Math.random();
		   var response = "";
			new Ajax.Request('/user_ajax_request.php',
					  {
						 method:'get',
						 asynchronous: false,
						 parameters: {rq_id: 1,email: strMail,checkPageId:id,sid:randomN0},
						 onSuccess: function(transport)
						 {
							 response = transport.responseText;
							 
						}
					  });
		  
		  if(response == 1)
				   { 

						 $("cust_email").style.backgroundColor = "#FFFFC0";

						 fnFocusAndAlert(errorArray[76] ,'cust_email');

						 setCust_Email_ExistValue = 0;

						 return false;

				   }

		  if(response == 0)
				   { 

						 $("cust_email").style.backgroundColor = "#FFFFFF";

						 setCust_Email_ExistValue = 1;

				   }	
			 //fnCheck_Cust_Email(id);

			// for(i=0;i<100000;i++)  // just for set the value below

			 //{

			 //} 

			 

			/*if(setCust_Email_ExistValue ==0)

             {

                  return false; 

             }  */ 

			 }   

		   }  

		 }

	 }





	 if(!isBlank(strSecond_mail))   //check customer mail address field blank or not 

	 {      

       //check email address is valid or not

         if(!isValidEmail(strSecond_mail))

         {

             fnFocusAndAlert(errorArray[8] ,'cust_email2'); 

             return false;

		 }

	 }


     

     

	 if(id==0)
	 {

       if(isBlank(strPass))    //check password field blank or not

		 {

            fnFocusAndAlert(errorArray[1] ,'new_cust_pass'); 

            return false;

		 }

        

         //check password length( more then 4 and less then 15)

         var passLength = strPass.length;

         var rePassLength = str_re_pass.length;

     

       if((passLength <=5 || passLength >15) ) 

		 {

            fnFocusAndAlert(errorArray[124] ,'new_cust_pass');

            return false;

         }  

         

        

       if(isBlank(str_re_pass))    //check password field blank or not

		 {

            fnFocusAndAlert(errorArray[14] ,'new_cust_pass_conf'); 

            return false;

         }



     

       if(rePassLength<=5 ||rePassLength >15) 

		 {

            fnFocusAndAlert(errorArray[124] ,'new_cust_pass_conf');

            return false;

         }  

     

       if(!isBlank(strPass) && !isBlank(str_re_pass)) 

	   {                                                   // password and confirm password both should be same check here.

          if(strPass != str_re_pass) 

		 {

            fnFocusAndAlert(errorArray[77] ,'new_cust_pass');

            return false;

         }

       }

 

	 }

    

    

 

    

    if(isBlank(strAddr))    //check Address field blank or not

     {

        fnFocusAndAlert(errorArray[6] ,'cust_addr'); 

        return false;

	 }

     

   if(isBlank(strCity))    //check city field blank or not

     {

        fnFocusAndAlert(errorArray[22] ,'cust_city'); 

        return false;

	 }

     

   if(strState==-1)    //check state field blank or not

     {

        fnFocusAndAlert(errorArray[23] ,'cust_state'); 

        return false;

	 }

     

     if(strState=='notusa')

   {

        if(isBlank(strProvince))    

        {

           fnFocusAndAlert(errorArray[132] ,'Province'); 

           return false;

		}

   

   }  

     

     if(strCountry==-1)    //check country field blank or not

     {

        fnFocusAndAlert(errorArray[131] ,'cust_country'); 

        return false;

	 }  

     

                     

   if(isBlank(strZip))    //check zipcode field blank or not

     {

        fnFocusAndAlert(errorArray[75] ,'cust_zip'); 

        return false;

	 }

    

   if(isBlank(strPhone.value))    //check phone field blank or not

     {

        fnFocusAndAlert(errorArray[7] ,'cust_phone'); 

        return false;

	 }

     else

     {

        if(!fnIsNumber(strPhone,'Phone Number'))   // check phone number is numeric

        {

            fnPutFocus('cust_phone');

            return false;

		}

	 }

   

   

   if(document.getElementById('car_year'))

   {

     if(!isBlank(document.getElementById('car_year').value))    //check phone field blank or not

     { 

        if(!fnIsNumber(document.getElementById('car_year'),'Car year'))   // check phone number is numeric

        {

            fnPutFocus('car_year');

            return false;

		}

	 } 

   }

     

}    



 /*

######################################################################################################

# Function Name : fnCheckVendor()

# Created By : Manish Sharma

# Created On : 27 June 2008

# Description : Function to check the the vendor select or not(if location select==-1)

######################################################################################################

*/   

function fnCheckVendor()

{



    var strLocation = fnGetFieldValue('Location_info');

    

    

   if(strLocation==-1)    //check location field blank or not

     {

        

        fnFocusAndAlert(errorArray[55] , 'Vendor_info')

        return false;

     }

}



 /*

######################################################################################################

# Function Name : fnReservGratuityCheck()

# Created By : Manish Sharma

# Created On : 17 July 2008

# Description : reservation step-3 when check graduity check box then open amount text box for that

######################################################################################################

*/ 

function fnReservGratuityCheck(Id,checkboxId)

{

    if(document.getElementById(checkboxId).checked==true)

    {

        fnOpenDiv(Id);

    }

    else

    {

		fnCloseDiv(Id);

    }





}  



/*

######################################################################################################

# Function Name : fnCheckPayOption()

# Created By : Manish Sharma

# Created On : 18 July 2008

# Description : reservation step-4 when transection complete and submit the card detail

######################################################################################################

*/ 

function fnCheckPayOption(val)

{



    //get pay method radio button value

    for(payMethodNo = 0; payMethodNo < document.final_reservation.payMethod.length; payMethodNo++)

    {

       if (document.final_reservation.payMethod[payMethodNo].checked == true)

       {

          var intPayMethod = document.final_reservation.payMethod[payMethodNo].value;

          

          break;

       }

    }



  

   

  if(intPayMethod==1)

  {  

    var d = new Date(); 

    var creditCardNumber = fnGetFieldValue('creditCardNumber'); 

    var verificationNo = fnGetFieldValue('cvv2Number');

    var expDateMonth = fnGetFieldValue('expDateMonth');

    var expDateYear = fnGetFieldValue('expDateYear');

        

    if(isBlank(creditCardNumber))    //check card number field blank or not

         {

            fnFocusAndAlert(errorArray[96] , 'creditCardNumber')

            return false;

         }  

       

    if(isBlank(verificationNo))

       {

          fnFocusAndAlert(errorArray[97] , 'cvv2Number')

          return false;

       }

       





if(expDateYear < d.getFullYear())

    {

       fnFocusAndAlert(errorArray[118] , 'expDateYear')

       return false;

    }

   

   if((expDateMonth < d.getMonth()+1) &&(expDateYear == d.getFullYear()) )

        {

           fnFocusAndAlert(errorArray[117] , 'expDateMonth')

           return false;

        }       

    

        

 

  }

  

  

    if(document.getElementById('tc').checked==false)

        {



            fnFocusAndAlert(errorArray[99] , 'tc')

            return false;

        }

            

   

}  

/*

############################################################################################################################

# Function Name : fnCheckPayOptChngPrice()

# Created By : Manish Sharma

# Created On : 22 July 2008

# Description : reservation step-4 when transection complete and select the payment method and pay option , than according  

#               to pay option calculate the amount and show in the amount text box

############################################################################################################################

*/ 

function fnCheckPayOptChngPrice()
{
	 
	 
   var basePrice = fnGetFieldValue('one_day_base_price');

   var fullPay = fnGetFieldValue('full_pay'); 

   var oneDayPay = fnGetFieldValue('oneday_pay'); 

   var noPay = fnGetFieldValue('no_pay');

 
   
   var p_c_servchrg = fnGetFieldValue('pcservchrg');

   var servchrg = fnGetFieldValue('servchrg');

   var gratuity = fnGetFieldValue('gratuitytotal'); 

 

   var payOneDayReamin = fnGetFieldValue('onedayRemain');

   var noPayRemain = fnGetFieldValue('nopayRemain');

   

   if(servchrg=='')

   {

    servchrg = '0.00';

   }

   

   if(gratuity=='')

   {

    gratuity = '0.00';

   }



   var payAtLoadZeroTable = '<table width="100%"><tr><td colspan="2"><input type="checkbox" name="tc" id="tc"/> *I agree with service agreement <a href="javascript:void(0)" onclick="fnPopupTermsCondition(); return false; ">(Terms & Conditions)</a> and cancellation policy <a href="javascript:void(0)" onclick="fnPopupCancellationPolicy(); return false; ">(Cancellation Policy)</a></td></tr><tr><td><input name="btnsubmit"  align="right" class="btn" type="submit" value="Complete Reservation"/> </td></tr></form></table>';

   

   var payOneDayDetail = '<table width="100%" align="left"><tr><td>One Day Charge:</td><td>$'+basePrice+'</td></tr><tr><td> Reservation Deposit:</td><td>$'+p_c_servchrg+'</td></tr><tr><td>Service Charges (discount may apply):</td><td> $'+servchrg+'</td></tr><tr><td>Gratuity:</td><td> $'+gratuity+'</td></tr></table>';

   

   var payAtLoadDetail = '<table width="100%" align="left"><tr><td> Reservation Deposit:</td><td>$'+p_c_servchrg+'</td></tr><tr><td>Service Charges (discount may apply):</td><td> $'+servchrg+'</td></tr><tr><td>Gratuity:</td><td> $'+gratuity+'</td></tr></table>';

   

  // var payRemainMsg = 'You pay at lot (Note: Amount will differ if number of days stayed changes): $';



   var  payRemainMsg = fnGetFieldValue('onedayRemainMessage');                       

   



    //get pay option radio button value

	var intPayOptionCount = 0;

  

    for(i=0;i<4;i++)

    {

       if(document.final_reservation.pay_option[i].checked == true)

       {

          var intPayOption = document.final_reservation.pay_option[i].value;

		  intPayOptionCount++;

          break;

       }

    }        

    

	  

    //get pay method radio button value

    var intPayMethodCount = 0;

    //document.final_reservation.payMethod.length

    for(payMethodNo = 0; payMethodNo < 2 ; payMethodNo++)

    {

       if (document.final_reservation.payMethod[payMethodNo].checked == true)

       {

          var intPayMethod = document.final_reservation.payMethod[payMethodNo].value;

          intPayMethodCount++;

          break;

       }

    }

   



    

	if(intPayOptionCount==0)

    {

	  alert(errorArray[102]);

      return false;

    }

 

   

  if(noPay=='0.00' && intPayOption==3)

  { 

			 fnCloseDiv('ccTable');

			 fnCloseDiv('exCheckTable');

			 fnCloseDiv('paymentMethodOption');

			 fnClearInnerHTML('show_payment_detail');

             fnClearInnerHTML('show_remain_payment_detail');

			 fnFillInnerHTML('payatloadzero',payAtLoadZeroTable);

             //fnOpenDiv('directReserv');

  }

  else

  { 

    fnOpenDiv('paymentMethodOption'); 

    

	//fnCloseDiv('directReserv');

    fnClearInnerHTML('payatloadzero'); 

    if(intPayMethodCount==0)

    {

	  alert(errorArray[103]);

      return false;

    }

  } 

    

 

 

 

 

    //means do-direct

    if(intPayMethod==1)

    { 

      if(intPayOption==1) //means whole payment

      {

		   //alert('whole payment1');

           fnOpenDiv('ccTable'); 

		   fnCloseDiv('exCheckTable');

		   //fnCloseDiv('directReserv');

           fnClearInnerHTML('show_payment_detail');

           fnClearInnerHTML('show_remain_payment_detail');

           fnClearInnerHTML('payatloadzero'); 

           fnSetFieldValue('amount',fullPay);

      }    



      if(intPayOption==2) //means pay one day only

      {

		 //alert('one day payment1');

         fnOpenDiv('ccTable');

		 fnCloseDiv('exCheckTable');

		 //fnCloseDiv('directReserv');

         

         fnFillInnerHTML('show_payment_detail',payOneDayDetail)

         fnFillInnerHTML('show_remain_payment_detail',payRemainMsg+payOneDayReamin);

         fnClearInnerHTML('payatloadzero');

         fnSetFieldValue('amount',oneDayPay);

          

      }

      

      if(intPayOption==3) //means no payment

      {

		 //alert('no payment1');

         fnOpenDiv('ccTable');

		 fnCloseDiv('exCheckTable');

		 //fnCloseDiv('directReserv');

         fnFillInnerHTML('show_payment_detail',payAtLoadDetail)

         fnFillInnerHTML('show_remain_payment_detail',payRemainMsg+noPayRemain);

         fnClearInnerHTML('payatloadzero');

         

         if(noPay=='0.00')

         {

			 fnCloseDiv('ccTable');

			 fnCloseDiv('exCheckTable');

			 fnCloseDiv('paymentMethodOption'); 

             fnClearInnerHTML('show_payment_detail');

             fnClearInnerHTML('show_remain_payment_detail'); 

             //fnOpenDiv('directReserv');

			 fnFillInnerHTML('payatloadzero',payAtLoadZeroTable);

             

         }

         else

         {

            fnSetFieldValue('amount',noPay);

         }   

      }

    

    }

 

    //means exp-checkout

    if(intPayMethod==2)

    {

      if(intPayOption==1) //means whole payment

      {

		   //alert('whole payment2');

           fnOpenDiv('exCheckTable'); 

		   fnCloseDiv('ccTable');

		  // fnCloseDiv('directReserv');

           fnClearInnerHTML('payatloadzero');

           fnClearInnerHTML('show_payment_detail_exp'); 

           fnClearInnerHTML('show_remain_payment_detail_exp'); 

           fnSetFieldValue('paymentAmount',fullPay);

      }    



      if(intPayOption==2) //means pay one day only

      {

		 //alert('one day payment2');

         fnOpenDiv('exCheckTable');

		 fnCloseDiv('ccTable');

		 //fnCloseDiv('directReserv');

         fnFillInnerHTML('show_payment_detail_exp',payOneDayDetail); 

         fnFillInnerHTML('show_remain_payment_detail_exp',payRemainMsg+payOneDayReamin);

         fnClearInnerHTML('payatloadzero');

         fnSetFieldValue('paymentAmount',oneDayPay);

         

      }

      

      if(intPayOption==3) //means no payment

      {

		 //alert('no payment2');

         fnOpenDiv('exCheckTable');

		 fnCloseDiv('ccTable');

		 //fnCloseDiv('directReserv');

         fnClearInnerHTML('payatloadzero');

         fnFillInnerHTML('show_payment_detail_exp',payAtLoadDetail);

         fnFillInnerHTML('show_remain_payment_detail_exp',payRemainMsg+noPayRemain); 

         

         if(noPay=='0.00')

         {

			 fnCloseDiv('ccTable');

			 fnCloseDiv('exCheckTable');

			 fnCloseDiv('paymentMethodOption');

             //fnOpenDiv('directReserv');

             fnClearInnerHTML('show_payment_detail_exp'); 

             fnClearInnerHTML('show_remain_payment_detail_exp'); 

			 fnFillInnerHTML('payatloadzero',payAtLoadZeroTable);

         }

         else

         {

            fnSetFieldValue('paymentAmount',noPay);

         }

      }

    

    }

 }  

   

/*

############################################################################################################################

# Function Name : fnExpCheckoutCheck()

# Created By : Manish Sharma

# Created On : 01 August 2008

# Description : Only set the payoption in beetween the exp.checkout form tags and tc check also.

############################################################################################################################

*/ 

function fnExpCheckoutCheck()

{



     //get pay option radio button value

	var intPayOptionCount = 0;

    for(payOptionNo = 0; payOptionNo < document.final_reservation.pay_option.length; payOptionNo++)

    {

       if (document.final_reservation.pay_option[payOptionNo].checked == true)

       {

          var intPayOption = document.final_reservation.pay_option[payOptionNo].value;

          intPayOptionCount++;

          break;

       }

    }

    

        fnSetFieldValue('payoption',intPayOption); 

	   //alert(intPayOption);

     

     if(document.getElementById('tc1').checked==false)

        {



            fnFocusAndAlert(errorArray[99] , 'tc1')

            return false;

        }



}   





/*

############################################################################################################################

# Function Name : fnShowWeatherInfo()

# Created By : Manish Sharma

# Created On : 01 August 2008

# Description : Only redirect to yahoo API weather RSS

############################################################################################################################

*/ 



function fnShowWeatherInfo()

{

  var zipcode = fnGetFieldValue('show_weather'); 

  

  //var url = "weather.php?zipcode="+zipcode; 

  

  var url = "http://www.weather.com/outlook/travel/businesstraveler/local/"+zipcode;

  var weatherPopup = window.open (url ,"CompareLocation","location=0,status=0,scrollbars=1,width=350,height=250,menubar=0,resizable=0,screenX=200,screenY=300"); 

  

  

}   

   

/*

############################################################################################################################

# Function Name : fnOpenReservSignup()

# Created By : Manish Sharma

# Created On : 02 August 2008

# Description : open signup table and vechile info. table in reservation part 3 when customer is new

############################################################################################################################

*/ 

function fnOpenReservSignup(bill_table_id , vechi_table_id,submit_button,reserv_login,signup_link,login_link)

{

   fnCloseDiv(reserv_login);

   fnCloseDiv(signup_link);

   fnOpenDiv(login_link);

   fnOpenDiv(bill_table_id);

   fnOpenDiv(vechi_table_id);

   fnOpenDiv(submit_button);

}



/*

############################################################################################################################

# Function Name : fnCloseReservSignup()

# Created By : Manish Sharma

# Created On : 02 August 2008

# Description :close signup , car info, submit btn, when customer login link click from reservation step 3

############################################################################################################################

*/ 

function fnCloseReservSignup(bill_table_id , vechi_table_id,submit_button,reserv_login,signup_link,login_link)

{

   fnOpenDiv(reserv_login);

   fnOpenDiv(signup_link);

   fnCloseDiv(login_link);

   fnCloseDiv(bill_table_id);

   fnCloseDiv(vechi_table_id);

   fnCloseDiv(submit_button);



}



/*

############################################################################################################################

# Function Name : fnImgOver()

# Created By : Manish Sharma

# Created On : 05 August 2008

# Description :imaqge checked according to img value

############################################################################################################################

*/ 



function fnImgOver(selectVal)

{

     //sel = 2;

     if(selectVal==1)

     {

         MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

          overlib('Poor');

     }

     

     if(selectVal==2)

     {

        MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image2','','../images/star-full-red-h.gif',1);

         overlib('Average');

     }

     

     if(selectVal==3)

     {

        MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image2','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image3','','../images/star-full-red-h.gif',1);

         overlib('Good');

     }

     if(selectVal==4)

     {

       

        MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image2','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image3','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image4','','../images/star-full-red-h.gif',1);

         overlib('Very Good'); 

     }

     

     if(selectVal==5)

     {

        MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image2','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image3','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image4','','../images/star-full-red-h.gif',1);

        MM_swapImage('Image5','','../images/star-full-red-h.gif',1); 

         overlib('Outstanding');

     }

  

     

     

}



/*

############################################################################################################################

# Function Name : fnImgOut()

# Created By : Manish Sharma

# Created On : 05 August 2008

# Description :image unchecked and set the rate value according to img value

############################################################################################################################

*/ 



var intSelectRating=0;



function fnImgOut()

{



         switch(intSelectRating) 

         {

                case 0: MM_swapImage('Image1','','../images/star-full-red.gif',1);

                        MM_swapImage('Image2','','../images/star-full-red.gif',1);

                        MM_swapImage('Image3','','../images/star-full-red.gif',1);

                        MM_swapImage('Image4','','../images/star-full-red.gif',1);

                        MM_swapImage('Image5','','../images/star-full-red.gif',1);  

                        break;

                case 1: MM_swapImage('Image2','','../images/star-full-red.gif',1);

                        MM_swapImage('Image3','','../images/star-full-red.gif',1);

                        MM_swapImage('Image4','','../images/star-full-red.gif',1);

                        MM_swapImage('Image5','','../images/star-full-red.gif',1);

                          break;

                case 2: MM_swapImage('Image3','','../images/star-full-red.gif',1);

                        MM_swapImage('Image4','','../images/star-full-red.gif',1);

                        MM_swapImage('Image5','','../images/star-full-red.gif',1); 

                          break;

                case 3: MM_swapImage('Image4','','../images/star-full-red.gif',1);

                        MM_swapImage('Image5','','../images/star-full-red.gif',1); 

                          break;

                case 4: MM_swapImage('Image5','','../images/star-full-red.gif',1); 

                          break;

                case 5: ''

                        break;                                        

                default: '';

         }



         nd();

         

         }





/*

############################################################################################################################

# Function Name : fnSaveRating()

# Created By : Manish Sharma

# Created On : 04 August 2008

# Description :Save rating according to image click with userid and email

############################################################################################################################

*/ 

function fnSaveRating(rate)

{

  //alert("rate:"+rate+"cust_mail:"+cust_mail+"cust_id:"+cust_id);



  var vendor_id = fnGetFieldValue('Vendor_info');

  var location_id = fnGetFieldValue('Location_info');

  

  if(vendor_id==-1)

  {

    fnFocusAndAlert(errorArray[55] , 'Vendor_info');

    return false;

  }

  

  if(location_id==-1)

  {

    fnFocusAndAlert(errorArray[66] , 'Location_info');

    return false;

  }



  //assign the rate value to out function global value

  intSelectRating = rate;

  

    

  fnSetFieldValue('rating_score',rate);

    

     switch(rate) 

         {

                case 1: MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

                        break;

                case 2: MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image2','','../images/star-full-red-h.gif',1);

                        break;

                case 3: MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image2','','../images/star-full-red-h.gif',1); 

                        MM_swapImage('Image3','','../images/star-full-red-h.gif',1); 

                        break;

                case 4: MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image2','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image3','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image4','','../images/star-full-red-h.gif',1); 

                        break;

                case 5: MM_swapImage('Image1','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image2','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image3','','../images/star-full-red-h.gif',1);

                        MM_swapImage('Image4','','../images/star-full-red-h.gif',1); 

                        MM_swapImage('Image5','','../images/star-full-red-h.gif',1);

                        break;                                

                default:'';        

                

         }        

 

        fnOpenDiv('rating_msg');

        

        var partMsg = '';

          

        switch(rate)

            {

                case 1: partMsg = 'Poor';

                        break;

                case 2: partMsg = 'Average';

                        break;

                case 3: partMsg = 'Good';

                        break;

                case 4: partMsg = 'Very Good';

                        break;

                case 5: partMsg = 'Outstanding';

                        break;

                default: partMsg='';

            }



        

        $msg='Thanks for rating : '+ partMsg;

        

        

        fnFillInnerHTML('rating_msg',$msg)

    

 

  

}





/*

############################################################################################################################

# Function Name : fnCheckRatRevForm()

# Created By : Manish Sharma

# Created On : 05 August 2008

# Description :rating review page validation

############################################################################################################################

*/ 

function fnCheckRatRevForm()

{



  var vendor_id = fnGetFieldValue('Vendor_info');

  var location_id = fnGetFieldValue('Location_info');

  var title = fnGetFieldValue('rev_title');

  var rev_msg = fnGetFieldValue('vendor_review');

  var rat_val = fnGetFieldValue('rating_score');

  

  if(vendor_id==-1)

  {

    fnFocusAndAlert(errorArray[55] , 'Vendor_info');

    return false;

  }

  

  if(location_id==-1)

  {

    fnFocusAndAlert(errorArray[66] , 'Location_info');

    return false;

  }

  

  if(isBlank(title))    //check review title

   {

        fnFocusAndAlert(errorArray[106] , 'rev_title')

        return false;

   }  

  if(isBlank(rev_msg))    //check review msg

   {

        fnFocusAndAlert(errorArray[107] , 'vendor_review')

        return false;

   }

  if(rat_val==0)

  {

        fnFocusAndAlert(errorArray[108] , 'rating_score')

        return false;

  }   

  



}



/*

############################################################################################################################

# Function Name : fnDiaprrovedRating()

# Created By : Manish Sharma

# Created On : 05 August 2008

# Description :disapproved template validation

############################################################################################################################

*/ 

function fnDiaprrovedRating()

{



  var reason = fnGetFieldValue('disapprove_reason');

   if(isBlank(reason))    //check review title

   {

        fnFocusAndAlert(errorArray[109] , 'disapprove_reason')

        return false;

   }  



}



/*

############################################################################################################################

# Function Name : fnReviewSearch()

# Created By : Manish Sharma

# Created On : 06 August 2008

# Description : read review-rating search validation

############################################################################################################################

*/ 



function fnReviewSearch()

{



  var vendor_id = fnGetFieldValue('Vendor_info');

  var location_id = fnGetFieldValue('Location_info');



  if(vendor_id==-1 )

  {

    fnFocusAndAlert(errorArray[55] , 'Vendor_info');

    return false;

  }

  

  if(location_id==-1)

  {

    fnFocusAndAlert(errorArray[66] , 'Location_info');

    return false;

   }

  

  

  if(vendor_id!=-1 && location_id!=-1)

  {

    window.location.href=HTTP_DOMAIN+"/Review/"+vendor_id+'/'+location_id+'/';

  }

}





/*

############################################################################################################################

# Function Name : sortResult()

# Created By : Manish Sharma

# Created On : 12 August 2008

# Description : According to sortby value submit the form and sort the result

############################################################################################################################

*/ 



function sortResult()

{

   var sortBy_Val = fnGetFieldValue('result_sort'); 

   

   //window.location.href = 'user_location_reservation2.php?sortBy='+sortBy_Val;

    

   window.location.href = HTTP_DOMAIN+'/Search-Result/'+sortBy_Val+'/';

}





/*

############################################################################################################################

# Function Name : showGoogleMap()

# Created By : Manish Sharma

# Created On : 12 August 2008

# Description : Show the google map with marker on reservation sub step-3

############################################################################################################################

*/ 



function showGoogleMap(lati , longi)

{

     var map = null;

     var geocoder = null;



   

      if (GBrowserIsCompatible()) 

      {

        map = new GMap2(document.getElementById("map_canvas"));

        var point = new GLatLng(lati, longi);

        

        map.setCenter(point, 7);

        var marker = new GMarker(point);

        map.addOverlay(marker);

        

      }

    



}



/*

############################################################################################################################

# Function Name : fnReservCancel()

# Created By : Manish Sharma

# Created On : 14 August 2008

# Description : ask the confirmation before reservation cancellation

############################################################################################################################

*/ 

function fnReservCancel(reservNo)

{

  if(confirm('Sure , You want to cancel this reservation.'))

  {

	//window.location.href="login_confirm.php?rno="+reservNo;

    window.location.href= HTTP_DOMAIN+"/ReservationCancel/"+reservNo+"/";

  }  



}


function fnReservCancelAdmin(reservNo)

{

  if(confirm('Are you sure, you want to cancel this reservation.'))

  {

	var url = HTTP_DOMAIN+"/admin/cancelReservation.php?rno="+reservNo;

	var reviewPopup = window.open (url,"Review","location=0,status=1,scrollbars=1,width=850,height=300,menubar=1,resizable=1,screenX=10,screenY=10");
   

  }  



}



/*

############################################################################################################################

# Function Name : openPopupReadReview()

# Created By : Manish Sharma

# Created On : 08 September 2008

# Description : open the popup window for review.

############################################################################################################################

*/



function openPopupReadReview(vid,locid)

{

   var url = HTTP_DOMAIN+"/ShowReview/"+vid+"/"+locid+"/";

   var reviewPopup = window.open (url,"Review","location=0,status=1,scrollbars=1,width=850,height=850,menubar=1,resizable=1,screenX=10,screenY=10");

}



/*

############################################################################################################################

# Function Name : fnRandomImageShow()

# Created By : Manish Sharma

# Created On : 08 September 2008

# Description : random image(banner) show.

############################################################################################################################

*/



var imageArray = new Array();



imageArray[0] = "banner.png"; 

imageArray[1] = "banner_replace.jpg";



function fnRandomImageShow()

{

var rand = Math.floor(Math.random()*2); 



var imgPath = "<img src='../images/"+imageArray[rand]+"'  width='423' height='284' border='0' usemap='#MapMap' />";



document.getElementById("banner_img").innerHTML = imgPath;



}



function fnRandomImageShow1()

{

var rand = Math.floor(Math.random()*2); 



var imgPath = "<img src='/images/"+imageArray[rand]+"'  width='423' height='284' border='0' usemap='#MapMap' />";



document.getElementById("banner_img").innerHTML = imgPath;



}



/*

############################################################################################################################

# Function Name : fnRotateAdvImg()

# Created By : Manish Sharma

# Created On : 12 September 2008

# Description : random image show in every 15 second

############################################################################################################################

*/



var imageArray1 = new Array();



imageArray1[0] = "adv_img_1.gif"; 

imageArray1[1] = "adv_img_2.gif";

var timeOutId ;

function fnRotateAdvImg()

{

 

var rand1 = Math.floor(Math.random()*2); 



var imgPath = "<a href='http://www.i-parkntravel.com/VendorRelation/'><img src='../images/"+imageArray1[rand1]+"' border='0' usemap='#MapMap' /></a>";



document.getElementById("adv_image").innerHTML = imgPath;



timeOutId = setTimeout("fnRotateAdvImg()",15000); 



}





function killAdvTimeOut(){

    clearTimeout(timeOutId);

    }

    



 function fnRotateAdvImg1()

{

 

var rand1 = Math.floor(Math.random()*2); 



var imgPath = "<a href='http://www.i-parkntravel.com/VendorRelation/'><img src='/images/"+imageArray1[rand1]+"' border='0' /></a>";



document.getElementById("adv_image").innerHTML = imgPath;



timeOutId = setTimeout("fnRotateAdvImg1()",15000); 



}



/*

############################################################################################################################

# Function Name :fnPopupTermsCondition()

# Created By : Manish Sharma

# Created On : 09 September 2008

# Description : open the popup window for terms and conditions for customer at the time of payment.

############################################################################################################################

*/

function fnPopupTermsCondition()

{

  var tcPopup = window.open (HTTP_DOMAIN+"/Terms-of-Use/","TermsConditions","location=0,status=1,scrollbars=1,width=850,height=750,menubar=0,resizable=0,screenX=10,screenY=10");

}





/*

############################################################################################################################

# Function Name :fnPopupCancellationPolicy()

# Created By : Manish Sharma

# Created On : 27 june 2009

# Description : open the popup window for cancellation ploicy of reservation 

############################################################################################################################

*/

function fnPopupCancellationPolicy()

{

  var tcPopup = window.open (HTTP_DOMAIN+"/CancellationPolicy/","CancellationPolicy","location=0,status=1,scrollbars=1,width=900,height=550,menubar=0,resizable=0,screenX=10,screenY=10");

}





/*

############################################################################################################################

# Function Name : fnPopupGetDirection()

# Created By : Manish Sharma

# Created On : 09 September 2008

# Description : open the get direction popup

############################################################################################################################

*/



function fnPopupGetDirection(addr1,addr2,city,zipcode,state,country)

{

  var url = "http://maps.google.com/maps?f=d&hl=en&saddr=&daddr="+addr1+","+addr2+","+city+","+zipcode+","+state+","+country;

  //var url= "getdirection.php?vid="+vid+"&locid="+locid;

   var getDirectionPopup = window.open (url,"GetDirection","location=0,status=1,scrollbars=1,width=850,height=850,menubar=1,resizable=1,screenX=10,screenY=10");

}



/*

############################################################################################################################

# Function Name :fnPopupPrivacyPolicy()

# Created By : Manish Sharma

# Created On : 11 September 2008

# Description : open the popup window for Privacy policies for customer at the footer

############################################################################################################################

*/

function fnPopupPrivacyPolicy()

{

  var privacyPolicyPopup = window.open (HTTP_DOMAIN+"/PrivacyPolicy/","PrivacyPolicy","location=0,status=1,scrollbars=1,width=850,height=750,menubar=0,resizable=0,screenX=10,screenY=10");

}



/*

############################################################################################################################

# Function Name :fnPrintCustomerReceipt()

# Created By : Manish Sharma

# Created On : 19 September 2008

# Description : open the popup window for print receipt formet

############################################################################################################################

*/

function fnPrintCustomerReceipt(recepit_id)

{

  var url = HTTPS_DOMAIN+"/PrintReceipt/"+recepit_id+"/";

  var receiptPopup = window.open (url,"ReservationReceipt","location=0,status=1,scrollbars=1,width=850,height=750,menubar=1,resizable=1,screenX=10,screenY=10");

  

  //window.print();



 }

 

 function fnPrintMyReservReceipt(recepit_id)

{

  var url = HTTP_DOMAIN+"/PrintReceipt/"+recepit_id+"/";

  var receiptPopup = window.open (url,"ReservationReceipt","location=0,status=1,scrollbars=1,width=850,height=750,menubar=1,resizable=1,screenX=10,screenY=10");

  

  //window.print();



 }



/*

############################################################################################################################

# Function Name :fnViewLargeImage()

# Created By : Manish Sharma

# Created On : 19 September 2008

# Description : open the popup window for large location and lot image

############################################################################################################################

*/

function fnViewLargeImage(image_name)

{

  var url = HTTP_DOMAIN+"/LargeImage/"+image_name+"/"; 

  var receiptPopup = window.open (url,"LargeLocationImage","location=0,status=1,scrollbars=1,width=380,height=260,menubar=0,resizable=1,screenX=100,screenY=100");



}

 

 

 

 /*

############################################################################################################################

# Function Name :fnVendorDiscountAvailable()

# Created By : Manish Sharma

# Created On : 16 December 2008

# Description : open the popup window for vendor availables discount

############################################################################################################################

*/

function fnVendorDiscountAvailable(vendor_id)

{

  var url = HTTP_DOMAIN+"/VendorDiscount/"+vendor_id+"/"; 

  var receiptPopup = window.open (url,"AvailableDiscount","location=0,status=1,scrollbars=1,width=800,height=800,menubar=0,resizable=1,screenX=100,screenY=100");



}

 

 function fnVendorDiscountAvailableadd(vendor_id)

{

 // var url = HTTP_DOMAIN+"/VendorDiscountadd/"+vendor_id+"/"; 

 var url = "/show_vendor_discount_add.php?id="+vendor_id;

  var receiptPopup = window.open (url,"AvailableDiscount","location=0,status=1,scrollbars=1,width=800,height=800,menubar=0,resizable=1,screenX=100,screenY=100");



}



/*

############################################################################################################################

# Function Name :fnSearchDiscount()

# Created By : Manish Sharma

# Created On : 16 December 2008

# Description : open the popup window for vendor availables discount all

############################################################################################################################

*/

function fnSearchDiscount()

{

  var url = HTTP_DOMAIN+"/SearchDiscount/"; 

  var receiptPopup = window.open (url,"SearchDiscount","location=0,status=1,scrollbars=1,width=800,height=800,menubar=0,resizable=1,screenX=100,screenY=100");



} 

 

function updateParentCoupon(formname) { 

//alert(formname.couponname.value);  

	opener.document.final_reservation.coupon_number.value = formname.couponname.value; 

	self.close();  

	return false;

} 



 function openChild(file,window) {

    childWindow=open(file,window,'resizable=no,width=800,height=600');

    if (childWindow.opener == null) childWindow.opener = self;

    }







//stop hiding

-->