	var arrNYMpuSecondaryOptions =		new Array();
	arrNYMpuSecondaryOptions[0] =			"NYC Address|NYA";
	arrNYMpuSecondaryOptions[1] =			"NYC Hotels|NYH";
	arrNYMpuSecondaryOptions[2] =			"NYC Landmarks|NYL";

	var arrNYMdsSecondaryOptions =		new Array();
	arrNYMdsSecondaryOptions[0] =			"NYC Address|NYA";
	arrNYMdsSecondaryOptions[1] =			"NYC Hotels|NYH";
	arrNYMdsSecondaryOptions[2] =			"NYC Landmarks|NYL";
	arrNYMdsSecondaryOptions[3] =			"As Directed|ASD";
	
	var arrAirportSecondaryOptions =	new Array();
	arrAirportSecondaryOptions[0] =		"JFK Airport|JFK";
	arrAirportSecondaryOptions[1] =		"LaGuardia Airport|LAG";
	arrAirportSecondaryOptions[2] =		"Newark Airport|NWK";

	var arrLISecondaryOptions = new Array();
	var arrNJSecondaryOptions = new Array();
	var arrNYSecondaryOptions = new Array();
	var arrWESecondaryOptions = new Array();
	var arrCTSecondaryOptions = new Array();
	var arrPASecondaryOptions = new Array();
	
	var arrJFKAirLinesOptions = new Array();
	var arrNWKAirLinesOptions = new Array();
	var arrLAGAirLinesOptions = new Array();
	var arrCarType			  = new Array();
	
	var arrJFKMeeting = new Array();
	var arrNWKMeeting = new Array();
	var arrLAGMeeting = new Array();
	
	var arrNoError = new Array();
	arrNoError[0] =	"NoError|NoError";
	
	var arrCarImages = new Array();
	arrCarImages[0] = "";
	arrCarImages[1] = "img/sedan.jpg";
	arrCarImages[2] = "img/laxsedan.gif";
	arrCarImages[3] = "";
	arrCarImages[4] = "img/van_henry.gif";
	arrCarImages[5] = "img/strech.jpg";
	arrCarImages[6] = "img/strech.jpg";
	arrCarImages[7] = "img/minivan.jpg";
	
	arrCarImages[8] = "img/strech.jpg";
	arrCarImages[9] = "img/suv_9.jpg";
	arrCarImages[10] = "img/vanterra_henry.JPG";
	arrCarImages[11] = "img/van_henry.gif";
	arrCarImages[12] = "img/strech.jpg";
	arrCarImages[13] = "img/strech.jpg";
	arrCarImages[14] = "img/hummer.gif";
        arrCarImages[15] = "img/partybus.jpg";
	/* */
	
	var flgTogglePrimary = true;
	
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	 

	//initializing
	var puPrimaryInfoControl;
	var puSecondaryInfoControl;
	var puDispatchZoneControl;
	var puBuildingControl;
	var puStreetControl;
	var puZipCodeControl
	var puPricingTableCounterControl;
	var puFlightControl;
	var puFromControl;
	
	var dsPrimaryInfoControl;
	var dsSecondaryInfoControl;
	var dsDispatchZoneControl;
	var dsBuildingControl;
	var dsStreetControl;
	var dsZipCodeControl;
	var dsPricingTableCounterControl;
	
	var puAirLineControl;
	
	var dsAirLineControl;
	
	var numPassengerControl;
	var numPackageControl;
	
	var carTypeControl;
	
	var HaveCouponControl;
	var HaveCouponEditValue;
	
	var isEditValue;

	function initForm()
	{
	
		thisForm = document.form1;
		puPrimaryInfoControl = thisForm.puPrimaryInfo;
		puSecondaryInfoControl = thisForm.puSecondaryInfo;
		puDispatchZoneControl = thisForm.puDispatchZone;
		puBuildingControl = thisForm.puBuilding;
		puStreetControl = thisForm.puStreet;
		puZipCodeControl = thisForm.puZipCode;
		puPricingTableCounterControl = thisForm.puPricingTableCounter;
		puFlightControl = thisForm.puFlight;
		puFromControl = thisForm.puFrom;
		puAptControl = thisForm.puApt;
		
		dsPrimaryInfoControl = thisForm.dsPrimaryInfo;
		dsSecondaryInfoControl = thisForm.dsSecondaryInfo;
		dsDispatchZoneControl = thisForm.dsDispatchZone;
		dsBuildingControl = thisForm.dsBuilding;
		dsStreetControl = thisForm.dsStreet;
		dsZipCodeControl = thisForm.dsZipCode;
		dsPricingTableCounterControl = thisForm.dsPricingTableCounter;
		dsAptControl = thisForm.dsApt;
		
		puAirLineControl = thisForm.puAirLine;
		dsAirLineControl = thisForm.dsAirLine;
		numPassengerControl = thisForm.numPassenger;
		numPackageControl = thisForm.numPackage;
		carTypeControl = thisForm.CarType;
		
		//edit values when returnig to edit
		isEditValue = thisForm.IsEdit.value;
		puPrimaryInfoEditValue = thisForm.puPrimaryInfoEdit.value;
		dsPrimaryInfoEditValue = thisForm.dsPrimaryInfoEdit.value;
		//pMonthEditValue = thisForm.pMonthEdit.value;
		//pDayEditValue = thisForm.pDayEdit.value;
		//pYearEditValue = thisForm.pYearEdit.value;
		//pHourEditValue = thisForm.pHourEdit.value;
		//pMinuteEditValue = thisForm.pMinuteEdit.value;
		carTypeEditValue = thisForm.CarTypeEdit.value;
		puSecondaryInfoEditValue = thisForm.puSecondaryInfoEdit.value;
		dsSecondaryInfoEditValue = thisForm.dsSecondaryInfoEdit.value;
		puAirLineEditValue = thisForm.puAirLineEdit.value;
		dsAirLineEditValue = thisForm.dsAirLineEdit.value;
		HaveCouponEditValue = thisForm.HaveCouponEdit.value;
		HaveCouponControl = thisForm.HaveCoupon;
		
		
	
		MM_preloadImages('img/2_r4_c1_f2.gif','img/2_r4_c2_f2.gif','img/2_r4_c3_f2.gif','img/2_r4_c4_f2.gif','img/2_r4_c5_f2.gif','img/2_r4_c7_f2.gif','img/2_r4_c9_f2.gif','img/2_r4_c12_f2.gif','img/2_r4_c13_f2.gif'); 
		
		
		if ( isEditValue == "1" )
		{
		
			populateCarType(numPassengerControl.options[numPassengerControl.selectedIndex].value, numPackageControl.options[numPackageControl.selectedIndex].value);
			selectOption( document.form1.CarType, carTypeEditValue);

			selectOption( puPrimaryInfoControl, puPrimaryInfoEditValue)
			selectOption( dsPrimaryInfoControl, dsPrimaryInfoEditValue)
					
			populateSecondaryInfo( puPrimaryInfoControl );
			selectOption( puSecondaryInfoControl, puSecondaryInfoEditValue);
			secondaryInfoChanged( puSecondaryInfoControl );
			
			populateSecondaryInfo( dsPrimaryInfoControl );
			selectOption( dsSecondaryInfoControl, dsSecondaryInfoEditValue);
			secondaryInfoChanged( dsSecondaryInfoControl );
			
			selectOption( puAirLineControl, puAirLineEditValue);
			selectOption( dsAirLineControl, dsAirLineEditValue);
			selectOption( HaveCouponControl, HaveCouponEditValue);
			toggleCoupon(HaveCouponControl);
		
		}
		else
		{
			setDate(); 			
			populateCarType(numPassengerControl.options[numPassengerControl.selectedIndex].value, numPackageControl.options[numPackageControl.selectedIndex].value);
			populateSecondaryInfo( puPrimaryInfoControl );
			populateSecondaryInfo( dsPrimaryInfoControl );
		}
	}
	
	
	
	
	//set 3 date dropdowns to current date + 1day
	function setDate()
	{
		var today = new Date();
		var month = 1 + today.getMonth();
		var day =  today.getDate();
		var year = today.getFullYear();
		
		var hr =1 + today.getHours();
		if ( hr>12 ) 
		{
			hr-=12
			document.form1.pAMPM[1].checked = true;
		}
		
		var minute = today.getMinutes();
		
		
		if ( minute > 0 && minute <= 7 )
		{
			minute = "0";
		}
		else if( minute >7 && minute <= 23 )
		{
			minute = "15";
		}
		else if( minute > 23 && minute <= 37 )
		{
			minute = "30";
		}
		else if( minute > 37 && minute <= 52 )
		{
			minute = "45";
		}
		else
		{
			hr++;
			minute = "0";
		}

		selectOption( document.form1.pMonth, month.toString() );
		selectOption( document.form1.pDay, day.toString() );
		selectOption( document.form1.pYear, year.toString() );
		
		selectOption(document.form1.pHour, hr.toString() );
		selectOption(document.form1.pMinute, minute.toString() );
		
		removeDaysIfRequired(document.form1.pMonth, document.form1.pDay);
	}
	
	
	function removeDaysIfRequired( monthControl, dayControl)
	{
		if ( dayControl.options.length == 28 )
		{
			dayControl.options[dayControl.options.length] = new Option( "29", "29" );
			dayControl.options[dayControl.options.length] = new Option( "30", "30" );
			dayControl.options[dayControl.options.length] = new Option( "31", "31" );
		}

		if ( dayControl.options.length == 29 )
		{
			dayControl.options[dayControl.options.length] = new Option( "30", "30" );
			dayControl.options[dayControl.options.length] = new Option( "31", "31" );
		}
		
		if ( dayControl.options.length == 30 )
		{
			dayControl.options[dayControl.options.length] = new Option( "31", "31" );
		}

		
		switch( monthControl.options[monthControl.selectedIndex].value )
		{
			case "4":
				removeOptionFromSelect(dayControl, "31");
				break;
			case "6":
				removeOptionFromSelect(dayControl, "31");
				break;
			case "9":
				removeOptionFromSelect(dayControl, "31");
				break;
			case "11":
				removeOptionFromSelect(dayControl, "31");
				break;
			
			case "2":
				if ( document.form1.pYear[document.form1.pYear.selectedIndex].value == "2004" || document.form1.pYear[document.form1.pYear.selectedIndex].value == "2008" )
				{
					removeOptionFromSelect(dayControl, "30");
					removeOptionFromSelect(dayControl, "31");
				}
				else
				{
					removeOptionFromSelect(dayControl, "29");
					removeOptionFromSelect(dayControl, "30");
					removeOptionFromSelect(dayControl, "31");
				}
				break;
			
			default:
				break;
		}
	}
	
	
	function findStreet( type, county, buildingNo )
	{
		if ( !isWhitespace(buildingNo))
		{
			if ( !isNaN(buildingNo) )
			{
				var newwin = window.open("street_lookup.asp?stype=" + type+"&County="+county+"&BuildingNo="+buildingNo,'newWin','resizable=no,width=290,height=350,top=50,left=100,status=no,scrollbars=no')
				newwin.focus();
			}
		}
	}
	
	function findStreetWithMsg( type, county, buildingNo )
	{
		if ( county == "M" || county == "BK" || county == "BX" || county == "QU" || county == "SI" )
		{
			if ( isWhitespace(buildingNo) || isNaN( buildingNo ) )
			{
				alert("Please enter numeric Building Number to search available Streets.");
			}
			else if ( !isInteger (buildingNo) )
			{
				alert("Please enter numeric Building Number Without DECIMAL to search available Streets.");
			}
			else
			{
				findStreet( type, county, buildingNo );
			}
		}
	}
	
		function findBLDGNumberWithABC( type, county, buildingNo )
	{
		if ( county == "M" || county == "BK" || county == "BX" || county == "QU" || county == "SI" )
		{
			if ( isWhitespace(buildingNo) || isNaN( buildingNo ) )
			{
				alert("Please enter numeric Building Number Without ABC.");
			}
			else if ( !isInteger (buildingNo) )
			{
				alert("Please enter numeric Building Number Without DECIMAL.");
			}
		}
	}
	
	
	
	
	
	function findLandmark (type, flag, placeName)
	{
		var newwin = window.open("landm_hotel_lookup.asp?stype=" + type+"&Flag="+flag+"&PlaceName="+placeName,'newWin','resizable=no,width=290,height=300,top=50,left=100,status=no,scrollbars=no')
		newwin.focus();
	}
	
	function findHotel (type, flag, placeName)
	{
		var newwin = window.open("landm_hotel_lookup.asp?stype=" + type+"&Flag="+flag+"&PlaceName="+placeName,'newWin','resizable=no,width=290,height=300,top=50,left=100,status=no,scrollbars=no')
		newwin.focus();
	}
	
	function retobj(obj,type)
	{
		if (type =='PUA')  
		{
			document.form1.puStreet.value = obj.st_name;
			document.form1.puXStreet.value = obj.x_st;
			document.form1.puDispatchZone.value = obj.dispatch_zone;
			document.form1.puZipCode.value = obj.zip_code;
			document.form1.puPricingTableCounter.value = obj.pricing_table_counter;
		}
		if (type == 'DSA')  
		{
			document.form1.dsStreet.value = obj.st_name;
			document.form1.dsXStreet.value = obj.x_st;
			document.form1.dsDispatchZone.value = obj.dispatch_zone;
			document.form1.dsZipCode.value = obj.zip_code;
			document.form1.dsPricingTableCounter.value = obj.pricing_table_counter;
		}
		
		if (type =='PUL')  
		{
			document.form1.puLandmarkName.value = obj.name;
			document.form1.puLandmarkStreet.value = obj.st_name;
			document.form1.puLandmarkStreetNo.value = obj.st_no;
			document.form1.puLandmarkXStreet.value = obj.x_st;
			document.form1.puDispatchZone.value = obj.dispatch_zone;
			document.form1.puZipCode.value = obj.zip_code;
		}
		if (type == 'DSL')  
		{
			document.form1.dsLandmarkName.value = obj.name;
			document.form1.dsLandmarkStreet.value = obj.st_name;
			document.form1.dsLandmarkStreetNo.value = obj.st_no;
			document.form1.dsLandmarkXStreet.value = obj.x_st;
			document.form1.dsDispatchZone.value = obj.dispatch_zone;
			document.form1.dsZipCode.value = obj.zip_code;
		}
		if (type =='PUH')  
		{
			document.form1.puHotelName.value = obj.name;
			document.form1.puHotelStreet.value = obj.st_name;
			document.form1.puHotelStreetNo.value = obj.st_no;
			document.form1.puHotelXStreet.value = obj.x_st;
			document.form1.puDispatchZone.value = obj.dispatch_zone;
			document.form1.puZipCode.value = obj.zip_code;
		}
		if (type == 'DSH')  
		{
			document.form1.dsHotelName.value = obj.name;
			document.form1.dsHotelStreet.value = obj.st_name;
			document.form1.dsHotelStreetNo.value = obj.st_no;
			document.form1.dsHotelXStreet.value = obj.x_st;
			document.form1.dsDispatchZone.value = obj.dispatch_zone;
			document.form1.dsZipCode.value = obj.zip_code;
		}
		
	}
	
	function populateSecondaryInfo( primaryInfoControl )
	{
		var primaryInfo = primaryInfoControl.options[primaryInfoControl.selectedIndex].value;
		var secondaryInfoControl = (primaryInfoControl == puPrimaryInfoControl)? puSecondaryInfoControl: dsSecondaryInfoControl;
		
		if ( primaryInfo == "AIR" )
		{
			populateSelectWithArray(secondaryInfoControl, arrAirportSecondaryOptions);
			
			//first time when pu changed from M TO AIR toggle ds to M
			if ( flgTogglePrimary && primaryInfoControl == puPrimaryInfoControl &&  isEditValue != 1 )
			{
				selectOption( dsPrimaryInfoControl, "M")
				populateSelectWithArray(dsSecondaryInfoControl, arrNYMdsSecondaryOptions);
				secondaryInfoChanged(dsSecondaryInfoControl )
				flgTogglePrimary = false;
			}
		}
		else if( primaryInfo == "M" )
		{
			var arrNYM = ( secondaryInfoControl == puSecondaryInfoControl )? arrNYMpuSecondaryOptions : arrNYMdsSecondaryOptions
			populateSelectWithArray(secondaryInfoControl, arrNYM );
			
		}
		else if( primaryInfo == "LI" )
		{
			populateSelectWithArray( secondaryInfoControl, arrLISecondaryOptions );
		}
		else if( primaryInfo == "NJ" )
		{
			populateSelectWithArray( secondaryInfoControl, arrNJSecondaryOptions );
		}
		else if( primaryInfo == "NY" )
		{
			populateSelectWithArray( secondaryInfoControl, arrNYSecondaryOptions );
		}
		else if( primaryInfo == "WE" )
		{
			populateSelectWithArray( secondaryInfoControl, arrWESecondaryOptions );
		}
		else if( primaryInfo == "CT" )
		{
			populateSelectWithArray( secondaryInfoControl, arrCTSecondaryOptions );
		}
		else if( primaryInfo == "PA" )
		{
			populateSelectWithArray( secondaryInfoControl, arrPASecondaryOptions);
		}
		else
		{
			populateSelectWithArray( secondaryInfoControl, arrNoError);
			//secondaryInfoControl.style.visibility = "hidden";
		}
		
		secondaryInfoChanged( secondaryInfoControl );
	}

	function secondaryInfoChanged(secondaryInfoControl )
	{
		secValue = secondaryInfoControl.options[secondaryInfoControl.selectedIndex].value;
		airLinesListControl = (secondaryInfoControl == puSecondaryInfoControl)? puAirLineControl : dsAirLineControl;
		dispatchZoneControl = (secondaryInfoControl == puSecondaryInfoControl)? puDispatchZoneControl : dsDispatchZoneControl;
		zipCodeControl		= (secondaryInfoControl == puSecondaryInfoControl)? puZipCodeControl : dsZipCodeControl;
		if ( secValue == "JFK")
		{
			populateSelectWithArray(airLinesListControl, arrJFKAirLinesOptions, true);
			dispatchZoneControl.value = "380"; //JFK
			zipCodeControl.value = "11430";
			
		}
		else if ( secValue == "LAG" )
		{
			populateSelectWithArray(airLinesListControl, arrLAGAirLinesOptions, true);
			dispatchZoneControl.value = "300"; //LAG
			zipCodeControl.value = "11371";
		}
		else if ( secValue == "NWK" )
		{
			populateSelectWithArray(airLinesListControl, arrNWKAirLinesOptions, true);
			dispatchZoneControl.value = "700"; //NWK
			zipCodeControl.value = "90340"
		}
		togglePanels(secondaryInfoControl);
	}
	
	//selects <option> in <select>
	function selectOption( selectControl, selectedValue)
	{
		for ( var i = 0; i < selectControl.options.length; i++ )
			if ( selectControl.options[i].value == selectedValue )
				selectControl.options[i].selected = true;
	}
	
	
	function populateCarType(numPass, numPack)
	{
		carTypeControl.options.length = 0;
		for ( var i = 0; i < arrCarType.length; i++ )
		{
			if ( parseInt(numPass) <= parseInt(arrCarType[i].maxPassenger) && parseInt(numPack) <= parseInt(arrCarType[i].maxPackage))
			{
				carTypeControl.options[carTypeControl.options.length] = new Option( arrCarType[i].carTypeDesc, arrCarType[i].carTypeID );
			}
		}
		setCarPicture(carTypeControl);
	}
	
	function setCarPicture(carTypeControl)
	{
		document.form1.carPicture.src = arrCarImages[parseInt(carTypeControl.options[carTypeControl.selectedIndex].value)]
    }

	
	function populateSelectWithArray(control, optionArray, insertEmpty)
	{
		var textValuePair;
		control.options.length = 0;
		
		if ( insertEmpty )
			control.options[control.options.length] = new Option("", "");
		
		for ( var i = 0; i < optionArray.length; i++ )
		{
			textValuePair = optionArray[i].split("|");
			control.options[control.options.length] = new Option(textValuePair[0], textValuePair[1]);
		}
	}
	
	
	function removeOptionFromSelect(control, optionValue)
	{
		for ( var i = 0; i < control.options.length; i++ )
		{
			if ( control.options[i].value == optionValue )
				control.options[i] = null;
		}
	}
	
	function petWarning(obj)
	{
		if ( obj.checked )
		{
			if ( obj.value == "1" )
			{
				alert("All cats must be in carriers. All dogs must be leashed.  All dogs over 25 pounds must ride in a Mini Van.");
				document.form1.PetWeight.readOnly = false;
				document.form1.PetWeight.disabled = false;
				document.form1.PetWeight.focus();
			}
			else
			{
				document.form1.PetWeight.readOnly = true;
				document.form1.PetWeight.disabled = true;
				document.form1.PetWeight.value = "";
			}
		}
		
	}
	
	
	function selectMinivan(val)
	{
		if ( !isNaN(val) )
		{
			if ( parseInt( val ) >= 25 )
			{
				selectOption( carTypeControl, "7");
			}
		}
	}
	
	function limoWarning(obj)
	{
		switch ( obj.options[obj.selectedIndex].value ) 
		{
		    case "925":
				alert("Please call 212-777-7777 to make Limo reservation.");
				return false;			
		    case "996":
				alert("Please call 212-777-7777 to make Limo reservation.");
				return false;			
		    case "9913":
				alert("Please call 212-777-7777 to make Limo reservation.");
				return false;			
		    case "9915":
				alert("Please call 212-777-7777 to make Limo reservation.");
				return false;			
			default :
			   return true;
		} 
	}
	
	function clearControls(area)
	{
		if (area == 'PU')
		{
			thisForm.puDispatchZone.value = "";
			thisForm.puZipCode.value = "";
			thisForm.puPricingTableCounter.value = "";

			thisForm.puFlight.value = "";
			thisForm.puFrom.value = "";
			
			thisForm.puBuilding.value = "";
			thisForm.puStreet.value = "";
			thisForm.puApt.value = "";
			thisForm.puXStreet.value = "";

			thisForm.puLandmarkName.value = "";
			thisForm.puLandmarkStreet.value = "";
			thisForm.puLandmarkStreetNo.value = "";
			thisForm.puLandmarkXStreet.value = "";

			thisForm.puHotelName.value = "";
			thisForm.puHotelStreet.value = "";
			thisForm.puHotelStreetNo.value = "";
			thisForm.puHotelXStreet.value = "";
		}
		else
		{	
			thisForm.dsDispatchZone.value = "";
			thisForm.dsZipCode.value = "";
			thisForm.dsPricingTableCounter.value = "";
		
			thisForm.dsBuilding.value = "";
			thisForm.dsStreet.value = "";
			thisForm.dsApt.value = "";
			thisForm.dsXStreet.value = "";
			

			thisForm.dsLandmarkName.value = "";
			thisForm.dsLandmarkStreet.value = "";
			thisForm.dsLandmarkStreetNo.value = "";
			thisForm.dsLandmarkXStreet.value = "";

			thisForm.dsHotelName.value = "";
			thisForm.dsHotelStreet.value = "";
			thisForm.dsHotelStreetNo.value = "";
			thisForm.dsHotelXStreet.value = "";
		}
	}
	
	
	function togglePanels( secondaryInfoControl )
	{
		var primaryInfoControl = ( secondaryInfoControl == puSecondaryInfoControl)? puPrimaryInfoControl: dsPrimaryInfoControl;
		var primaryInfo = primaryInfoControl.options[primaryInfoControl.selectedIndex].value;
		var secondaryInfo = secondaryInfoControl.options[secondaryInfoControl.selectedIndex].value;
		
		var elmAir;
		var elmAddr;
				
		if ( secondaryInfoControl == puSecondaryInfoControl )
		{
			elmAir = document.getElementById("puAir");
			elmAddr = document.getElementById("puAddr");
			elmHot = document.getElementById("puHotel");
			elmLan = document.getElementById("puLandmark");
			elmStreet = document.getElementById("puStreet");
			elmXStreet = document.getElementById("puXStreet");
			elmFindStreet = document.getElementById("puFindStreet");
			//elmFindStreetL = document.getElementById("puFindStreetL");
			//clearControls('PU');
		}
		else
		{
			elmAir = document.getElementById("dsAir");
			elmAddr = document.getElementById("dsAddr");
			elmHot = document.getElementById("dsHotel");
			elmLan = document.getElementById("dsLandmark");
			elmStreet = document.getElementById("dsStreet");
			elmXStreet = document.getElementById("dsXStreet");
			elmFindStreet = document.getElementById("dsFindStreet");
			//elmFindStreetL = document.getElementById("dsFindStreetL");
			//clearControls('DS');
		}
			
		
		if ( primaryInfo == "AIR" )
		{
			secondaryInfoControl.style.visibility = "visible";
			elmAir.style.visibility = "visible";
			elmAddr.style.visibility = "hidden";
			elmFindStreet.style.visibility = "hidden";
			//elmFindStreetL.disabled = true;
			//elmAddr.disabled = true;
			elmHot.style.visibility = "hidden";
			elmLan.style.visibility = "hidden";
			
		}
		else if( primaryInfo == "M")
		{
			secondaryInfoControl.style.visibility = "visible";
			
			if ( secondaryInfo == "NYA")
			{
				elmAir.style.visibility = "hidden";
				elmAddr.style.visibility = "visible";
				//elmAddr.disabled = false;
				elmStreet.readOnly = true;
				elmXStreet.readOnly = true;
				elmFindStreet.style.visibility = "visible";
				//elmFindStreetL.disabled = false;
				
				elmHot.style.visibility = "hidden";
				elmLan.style.visibility = "hidden";
				
			}
			else if(secondaryInfo == "NYH")
			{
				elmAir.style.visibility = "hidden";
				elmAddr.style.visibility = "hidden";
				elmFindStreet.style.visibility = "hidden";
				//elmAddr.disabled = true;
				elmHot.style.visibility = "visible";
				elmLan.style.visibility = "hidden";
			}
			else if(secondaryInfo == "NYL")
			{
				elmAir.style.visibility = "hidden";
				elmAddr.style.visibility = "hidden";
				elmFindStreet.style.visibility = "hidden";
				//elmAddr.disabled = true;
				elmHot.style.visibility = "hidden";
				elmLan.style.visibility = "visible";
			}
			else if(secondaryInfo == "ASD")
			{
				elmAir.style.visibility = "hidden";
				elmAddr.style.visibility = "hidden";
				//elmAddr.disabled = true;
				elmFindStreet.style.visibility = "hidden";
				elmHot.style.visibility = "hidden";
				elmLan.style.visibility = "hidden";
			}
		}
		else if( primaryInfo == "BK" || primaryInfo == "BX" || primaryInfo == "QU" || primaryInfo == "SI")
		{	
			elmAir.style.visibility = "hidden";
			elmAddr.style.visibility = "visible";
			//elmAddr.disabled = false;
			
			elmStreet.readOnly = true;
			elmXStreet.readOnly = true;
			elmFindStreet.style.visibility = "visible";
			//elmFindStreetL.disabled = false;
				
			elmHot.style.visibility = "hidden";
			elmLan.style.visibility = "hidden";
			secondaryInfoControl.style.visibility = "hidden";
		}
		else if( ( primaryInfo == "LI" || primaryInfo == "NJ" || primaryInfo == "PA" || primaryInfo == "NY" || primaryInfo == "WE" ||primaryInfo == "CT" ) && secondaryInfoControl == puSecondaryInfoControl)
		{
			elmAir.style.visibility = "hidden";
			elmAddr.style.visibility = "visible";
			//elmAddr.disabled = false;
			
			elmStreet.readOnly = false;
			elmXStreet.readOnly = false;
			elmFindStreet.style.visibility = "hidden";
			//elmFindStreetL.disabled = true;
			
			elmHot.style.visibility = "hidden";
			elmLan.style.visibility = "hidden";
			secondaryInfoControl.style.visibility = "visible";
		}
		else if( ( primaryInfo == "LI" || primaryInfo == "NJ" || primaryInfo == "PA" || primaryInfo == "NY" || primaryInfo == "WE" ||primaryInfo == "CT" ) && secondaryInfoControl == dsSecondaryInfoControl)
		{
			elmAir.style.visibility = "hidden";
			elmAddr.style.visibility = "hidden";
			//elmAddr.disabled = true;
			
			elmStreet.readOnly = false;
			elmXStreet.readOnly = false;
			elmFindStreet.style.visibility = "hidden";
			//elmFindStreetL.disabled = true;
			
			
			elmHot.style.visibility = "hidden";
			elmLan.style.visibility = "hidden";
			secondaryInfoControl.style.visibility = "visible";
		}
		else
		{
			elmAir.style.visibility = "hidden";
			elmAddr.style.visibility = "hidden";
			//elmAddr.disabled = true;
			elmHot.style.visibility = "hidden";
			elmLan.style.visibility = "hidden";
			elmFindStreet.style.visibility = "hidden";
			secondaryInfoControl.style.visibility = "hidden";
		}
	}
	
	function chkDate()
	{
		var todayDate = new Date();
		var h = (thisForm.pAMPM[1].checked)? parseInt(thisForm.pHour.value) + 12 : thisForm.pHour.value;
		var pDate = new Date( thisForm.pYear.value, thisForm.pMonth.value - 1, thisForm.pDay.value, h, thisForm.pMinute.value ) ;
		
		if ( (pDate-todayDate)/(1000*60*60 ) < 1 )
		{
			alert("For today only, you should make a reservation at least 1 hour in advance.\n\nFor reservations less than 1 hour in advance, \nplease call 212-777-7777 or our toll free number 1-800-222-9888.");
			return false;
		}
		else 
		{
			return true;
		}
	}
	
	function toggleCoupon(cnt)
	{
		if ( cnt.options[cnt.selectedIndex].value == "0" )
		{
			document.form1.AdvCode.readOnly = true;
			//document.form1.AdvCode.disabled = true;
			document.form1.AdvCode.value = "";
		}
		else
		{
			document.form1.AdvCode.readOnly = false;
			//document.form1.AdvCode.disabled = false;
		}
	
	}
	
	function submitForm()
	{
		//check for Number of Pass
		if ( numPassengerControl.options[numPassengerControl.selectedIndex].value == "-1" )
		{
			alert("Please select #Passengers.");
			numPassengerControl.focus();
			return false;
			//selectOption( numPassengerControl, "1");
		}
		
		//check for Number of lugg
		if ( numPackageControl.options[numPackageControl.selectedIndex].value == "-1" )
		{
			alert("Please select #Luggage.");
			numPackageControl.focus();
			return false;
			//selectOption( numPackageControl, "0");
		}
        
        //check for Number of Pass and luggage  if ( parseInt(numPass) <= parseInt(arrCarType[i].maxPassenger) && parseInt(numPack) <= parseInt(arrCarType[i].maxPackage))

		if ( numPassengerControl.options[numPassengerControl.selectedIndex].value == "10"  &&  parseInt(numPackageControl.options[numPackageControl.selectedIndex].value) >10 )
		{
			alert("The amount of Passengers and luggage you selected require 2 vehicles please reduce the amount of Passengers or luggage to fit the vehicle.");
			numPackageControl.focus();
			return false;
			//selectOption( numPassengerControl, "1");
		}
		if ( numPassengerControl.options[numPassengerControl.selectedIndex].value == "11"  &&  parseInt(numPackageControl.options[numPackageControl.selectedIndex].value) >10 )
		{
			alert("The amount of Passengers and luggage you selected require 2 vehicles please reduce the amount of Passengers or luggage to fit the vehicle.");
			numPackageControl.focus();
			return false;
			//selectOption( numPassengerControl, "1");
		}
        if ( numPassengerControl.options[numPassengerControl.selectedIndex].value == "12"  &&  parseInt(numPackageControl.options[numPackageControl.selectedIndex].value) >10 )
		{
			alert("The amount of Passengers and luggage you selected require 2 vehicles please reduce the amount of Passengers or luggage to fit the vehicle.");
			numPackageControl.focus();
			return false;
			//selectOption( numPassengerControl, "1");
		}

       if ( numPassengerControl.options[numPassengerControl.selectedIndex].value == "12"  &&  parseInt(numPackageControl.options[numPackageControl.selectedIndex].value) >10 )
		{
			alert("The amount of Passengers and luggage you selected require 2 vehicles please reduce the amount of Passengers or luggage to fit the vehicle.");
			numPackageControl.focus();
			return false;
			//selectOption( numPassengerControl, "1");
		}

     if ( numPassengerControl.options[numPassengerControl.selectedIndex].value == "14" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "15" ||   numPassengerControl.options[numPassengerControl.selectedIndex].value == "16" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "17" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "18" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "19" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "20" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "21"  ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "22"  ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "23" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "24" ||  numPassengerControl.options[numPassengerControl.selectedIndex].value == "25" )
		{
			if ( numPackageControl.options[numPackageControl.selectedIndex].value != "0"  )
			{
				alert("The amount of Passengers and luggage you selected require 2 vehicles please reduce the amount of Passengers or luggage to fit the vehicle.");
				numPackageControl.focus();
			    return false;
			}
		}

		//check for Limo
		var x = limoWarning(carTypeControl);
		if (!x)
			return false;
		
		//check for valid date
		var y = chkDate();
		if ( !y )
			return false;
		
		
		var puPrimary = puPrimaryInfoControl.options[puPrimaryInfoControl.selectedIndex].value;
		var puSecondary = puSecondaryInfoControl.options[puSecondaryInfoControl.selectedIndex].value;
		var puDispatchZ = puDispatchZoneControl.value;
		var puBuild = puBuildingControl.value;
		var puStr = puStreetControl.value;
		var puZip = puZipCodeControl.value;
		var puPricingTableCount = puPricingTableCounterControl.value;
		var puALine = puAirLineControl.options[puAirLineControl.selectedIndex].value;
		var puFlt = puFlightControl.value;
		var puFrm = puFromControl.value;
		var puApt = puAptControl.value;
				
		var dsPrimary = dsPrimaryInfoControl.options[dsPrimaryInfoControl.selectedIndex].value;
		var dsSecondary = dsSecondaryInfoControl.options[dsSecondaryInfoControl.selectedIndex].value;
		var dsDispatchZ = dsDispatchZoneControl.value;
		var dsBuild = dsBuildingControl.value;
		var dsStr = dsStreetControl.value;
		var dsZip = dsZipCodeControl.value;
		var dsPricingTableCount = dsPricingTableCounterControl.value;
		var dsALine = dsAirLineControl.options[dsAirLineControl.selectedIndex].value;
		var dsApt = dsAptControl.value;
		
		//Pickup validation
		if ( puPrimary == "AIR" && puALine == "" )
		{
			alert( "Please select pickup Airline." );
			puAirLineControl.focus();
			return false;
		}
		else if ( puPrimary == "AIR" && puFlt == "" )
		{
			alert( "Please enter Flight #." );
			puFlightControl.focus();
			return false;
		}
		else if ( puPrimary == "AIR" && puFrm == "" )
		{
			alert("Please enter Flight From.");
			puFromControl.focus();
			return false;
		}
		else if ( ( puPrimary == "BK" || puPrimary == "BX" || puPrimary == "QU" || puPrimary =="SI" ) && puZip == "" )
		{
			alert("Please select pickup location Street and Building No.");
			return false;
		}
		else if ( ( puPrimary == "BK" || puPrimary == "BX" || puPrimary == "QU" || puPrimary =="SI" ) && puApt == "" )
		{
			alert("Please enter pickup Apt#/Floor.");
			return false;
		}
		else if ( puPrimary == "M" && puSecondary == "NYA" && puZip == "" )
		{
			alert("Please select pickup location Street and Building No.");
			thisForm.puBuilding.focus();
			return false;
		}
		else if ( puPrimary == "M" && puSecondary == "NYA" && puApt == "" )
		{
			alert("Please enter pickup Apt#/Floor.");
			thisForm.puApt.focus();
			return false;
		}
		else if ( puPrimary == "M" && puSecondary == "NYH" && puDispatchZ == "" )
		{
			alert("Please select pickup Hotel Name and Address.");
			return false;
		}
		else if ( puPrimary == "M" && puSecondary == "NYL" && puDispatchZ == "" )
		{
			alert("Please select pickup location Landmark Name and Address.");
			return false;
		}
		else if( ( puPrimary == "M" || puPrimary == "BK" || puPrimary == "BX" || puPrimary == "QU" || puPrimary == "SI" ||   puPrimary == "LI" || puPrimary == "NJ" || puPrimary == "NY" || puPrimary == "WE" || puPrimary == "CT" || puPrimary == "PA" ) && ( isWhitespace(puBuild) || isWhitespace(puStr) ))	
		{
			alert("Please select pickup location Street and Building No.");
			thisForm.puBuilding.focus();
			return false;
		}
      //Validate numeric bldg #		
		 if( ( puPrimary == "M" || puPrimary == "BK" || puPrimary == "BX" || puPrimary == "QU" || puPrimary == "SI" ||  puPrimary == "LI" || puPrimary == "NJ" || puPrimary == "NY" || puPrimary == "WE" || puPrimary == "CT" || puPrimary == "PA" ) && ( ! isInteger(puBuild)))	
		{
			alert("Please enter numeric Building Number to continue.");
			thisForm.puBuilding.focus();
			return false;
		}
					
		//Destination Validation
		if ( dsPrimary == "AIR" && dsALine == "" )
		{
			alert("Please select destination Airline.");
			dsAirLineControl.focus();
			return false;
		}
		else if ( ( dsPrimary == "BK" || dsPrimary == "BX" || dsPrimary == "QU" || dsPrimary =="SI" ) && dsZip == "" )
		{
			alert("Please select destination location Street and Building No.");
			return false;
		}
		else if ( ( dsPrimary == "BK" || dsPrimary == "BX" || dsPrimary == "QU" || dsPrimary =="SI" ) && dsApt == "" )
		{
			//alert("Please enter destination Apt#/Floor.");
			//return false;
		}
		else if ( dsPrimary == "M" && dsSecondary == "NYA" && dsZip == "" )
		{
			alert("Please select destination location Street and Building No.");
			return false;
		}
		else if ( dsPrimary == "M" && dsSecondary == "NYA" && dsApt == "" )
		{
			//alert("Please enter destination Apt#/Floor.");
			//return false;
		}
		else if ( dsPrimary == "M" && dsSecondary == "NYH" && dsDispatchZ == "" )
		{
			alert("Please select destination Hotel Name and Address.");
			return false;
		}
		
		else if ( dsPrimary == "M" && dsSecondary == "NYL" && dsDispatchZ == "" )
		{
			alert("Please select destination location Landmark Name and Address.");
			return false;
		}
		 //Validate numeric dest bldg #		
		 if( ( dsPrimary == "M" || dsPrimary == "BK" || dsPrimary == "BX" || dsPrimary == "QU" || dsPrimary == "SI" ||  dsPrimary == "LI" || dsPrimary == "NJ" || dsPrimary == "NY" || dsPrimary == "WE" || dsPrimary == "CT" || dsPrimary == "PA" ) && ( ! isInteger(dsBuild)))	
		{
			alert("Please enter numeric Building Number to continue.");
			thisForm.dsBuilding.focus();
			return false;
		}
		
		//Pet check
		if ( document.form1.PetYesNo[0].checked )
		{
			if ( isWhitespace( document.form1.PetWeight.value ) )
			{
				alert("Please enter Pet Weight in pounds.");
				document.form1.PetWeight.focus();
				return false;
			}
			if ( !isPositiveInteger( document.form1.PetWeight.value ))
			{
				alert("Please enter valid Pet Weight in pounds.");
				document.form1.PetWeight.focus();
				return false;
			}
			
			if ( parseInt( document.form1.PetWeight.value ) >= 25 && carTypeControl.options[carTypeControl.selectedIndex].value != "7" )
			{
				alert("All pets over 25 pounds must ride in a Mini Van. Please select Mini Van.");
				document.form1.CarType.focus();
				return false;
			}
		}
	}