// JavaScript Document
var flightTable = "";
var	isFlightTableBuilt = false;
var hotelTable = "";
var	isHotelTableBuilt = false;
var carTable = "";
var isCarTableBuilt = false;

function writeBox(aid,prefix) {
	setupMainSettings(aid,prefix);
	
	if(!isFlightTableBuilt) {
		flightTable+=("<div id='replace'>");
		
		if(OKToRun(1)) {
			flightTable+=("<form name='quick_booking_tool' action='http://" + agencyPrefix + "/do/flight/ProcessRoundTripSearch?ag=" + agencyID + "' method='POST' target='_blank'>");
			flightTable+=("<table cellpadding='0' cellspacing='0' border='0' class='qbt_top'><tr><td class='new_qbt_txt' colspan='3' align='center'><b>QUICK RESERVATIONS</b> | Book Your Trip Now !</td></tr><tr>");	
			flightTable+=("<td class='links' align='center' valign='bottom'><a class='selected' href='javascript:writeBox(");	
			flightTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			flightTable+=(");'>Flight</a>");
			flightTable+=("<a href='javascript:writeHotelBox(");	
			flightTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			flightTable+=(");'>Hotel</a>");
			flightTable+=("<a href='javascript:writeCarBox(");	
			flightTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			flightTable+=(");'>Car</a></td>");
			flightTable+=("</tr><tr><td class='new_qbt_txt2' colspan='3' align='center'>PERSONAL &amp; BUSINESS TRAVEL</td></tr></table>");
			flightTable+=("<table class='bookingtool'>");
			flightTable+=("<tr><td colspan='2' class='titlebar' id='booking_flight_type'>Flight Type:</td></tr><tr id='booking_flighttypeset'><td colspan='2' class='smalloptions'>");
			flightTable+=("<label id='booking_round_label' class='selected'>Round-Trip:<input type='radio' name='flightType' onclick=\"switchType('flights-roundtrip')\" value='0' id='booking_flights_round' checked></label>");
			flightTable+=("<label id='booking_oneway_label'>One-Way:<input type='radio' name='flightType' onclick=\"switchType('flights-oneway')\" value='1'></label>");
			flightTable+=("<label id='booking_multi_label'>Multiple Destination:<input type='radio' name='flightType' onclick=\"switchType('flights-multi')\" value='2'></label>");
			flightTable+=("</td></tr><tr id='booking_titleset_1'><td colspan='2' class='titlebar' id='booking_title_1'>Departing From:</td></tr><tr id='booking_fieldset_1'><td colspan='2'>");
			flightTable+=("<p><label id='booking_field_1_label'>");
			if(typeof customBookingCode1Title != "undefined") {
		        flightTable+=(customBookingCode1Title);
		    } else {
		        flightTable+=("Airport Code:");
		    }
			flightTable+=("<br><input type='text' name='origin' accesskey='d' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('origin')\" autocomplete='off' value='" + defaultSource + "'></label> <a href=\"javascript:void codeList('origin')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_date_1_label'>Departure Date:<br><input type='text' name='departDate' value='mm/dd/yyyy' class='datebox' onfocus=\"void showCalendar(qElements['departDate'],qElements['departDate'],qElements['returnDate']);\"></label> ");
	        flightTable+=("<select name='departTime' onfocus='void hideCalendar()' id='booking_timeofday_1'><option value='anytime'>Entire Day</option><option value='06:00'>Morning</option>");
	        flightTable+=("<option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p></td></tr><tr id='booking_titleset_2'>");
	        flightTable+=("<td colspan='2' class='titlebar' id='booking_title_2'>Returning From:</td></tr><tr id='booking_fieldset_2'><td colspan='2'>");
	        flightTable+=("<p><label id='booking_field_2_label'>");
	        if(typeof customBookingCode2Title != "undefined") {
		        flightTable+=(customBookingCode2Title);
		    } else {
		        flightTable+=("Airport Code:");
		    }
		
	        flightTable+=("<br><input type='text' name='destination' accesskey='r' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('destination')\" autocomplete='off'></label> <a href=\"javascript:void codeList('destination')\">Airport codes</a></p>");
	        flightTable+=("<p id='booking_return_date'><label id='booking_date_2_label'>Return Date:<br><input type='text' name='returnDate' value='mm/dd/yyyy' class='datebox' onfocus=\"void showCalendar(qElements['returnDate'],qElements['departDate'],qElements['returnDate']);\"></label> ");
	        flightTable+=("<select name='returnTime' onfocus='void hideCalendar()' id='booking_timeofday_3'><option value='anytime'>Entire Day</option><option value='06:00'>Morning</option>");
	        flightTable+=("<option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p>");
	        flightTable+=("</td></tr><tr id='booking_titleset_3' style='display: none'><td colspan='2' class='titlebar' id='booking_title_3'>Flight 1:</td>");
	        flightTable+=("</tr><tr id='booking_fieldset_3' style='display: none'><td colspan='2'>");
	        flightTable+=("<p><label id='booking_field_3_label'>From (Airport Code):<br><input type='text' name='origins[0]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[0]')\" autocomplete='off' value='" + defaultSource + "'></label> <a href=\"javascript:void codeList('origins[0]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_field_3b_label'>To (Airport Code):<br><input type='text' name='dests[0]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[0]')\" autocomplete='off'></label> <a href=\"javascript:void codeList('dests[0]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_date_3_label'>Departure Date:<br><input type='text' name='departDates[0]' value='mm/dd/yyyy' class='datebox'></label> ");
	        flightTable+=("<select name='departTimes[0]' onfocus='void hideCalendar()' id='booking_timeofday_3'><option value='anytime'>Entire Day</option>");
	        flightTable+=("<option value='06:00'>Morning</option><option value='12:00'>Afternoon</option><option value='18:00'>Evening</option>");
	        flightTable+=("</select></p></td></tr><tr id='booking_titleset_4' style='display: none'><td colspan='2' class='titlebar' id='booking_title_4'>Flight 2 (Optional):</td>");
	        flightTable+=("</tr><tr id='booking_fieldset_4' style='display: none'><td colspan='2'>");
	        flightTable+=("<p><label id='booking_field_4_label'>From (Airport Code):<br><input type='text' name='origins[1]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[1]')\" autocomplete='off'></label> <a href=\"javascript:void codeList('origins[1]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_field_4b_label'>To (Airport Code):<br><input type='text' name='dests[1]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[1]')\" autocomplete='off'></label> <a href=\"javascript:void codeList('dests[1]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_date_4_label'>Departure Date:<br><input type='text' name='departDates[1]' value='mm/dd/yyyy' class='datebox'></label> ");
	        flightTable+=("<select name='departTimes[1]' onfocus='void hideCalendar()' id='booking_timeofday_4'><option value='anytime'>Entire Day</option>");
	        flightTable+=("<option value='06:00'>Morning</option><option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p>");
	    	flightTable+=("</td></tr><tr id='booking_titleset_5' style='display: none'><td colspan='2' class='titlebar' id='booking_title_5'>Flight 3 (Optional):</td>");
	    	flightTable+=("</tr><tr id='booking_fieldset_5' style='display: none'><td colspan='2'>");
	    	flightTable+=("<p><label id='booking_field_5_label'>From (Airport Code):<br><input type='text' name='origins[2]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[2]')\" autocomplete='off'></label> <a href=\"javascript:void codeList('origins[2]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_field_5b_label'>To (Airport Code):<br><input type='text' name='dests[2]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[2]')\" autocomplete='off'></label> <a href=\"javascript:void codeList('dests[2]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_date_5_label'>Departure Date:<br><input type='text' name='departDates[2]' value='mm/dd/yyyy' class='datebox'></label> ");
	        flightTable+=("<select name='departTimes[2]' onfocus='void hideCalendar()' id='booking_timeofday_5'><option value='anytime'>Entire Day</option><option value='06:00'>Morning</option>");
	        flightTable+=("<option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p></td></tr><tr id='booking_titleset_6' style='display: none'>");
	        flightTable+=("<td colspan='2' class='titlebar' id='booking_title_6'>Flight 4 (Optional):</td></tr><tr id='booking_fieldset_6' style='display: none'><td colspan='2'>");
	        flightTable+=("<p><label id='booking_field_6_label'>From (Airport Code):<br><input type='text' name='origins[3]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[3]')\" autocomplete='off'></label> <a href=\"javascript:void codeList('origins[3]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_field_6b_label'>To (Airport Code):<br><input type='text' name='dests[3]' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[3]')\" autocomplete='off'></label> <a href=\"javascript:void codeList('dests[3]')\">Airport codes</a></p>");
	        flightTable+=("<p><label id='booking_date_6_label'>Departure Date:<br><input type='text' name='departDates[3]' value='mm/dd/yyyy' class='datebox'></label> ");
	        flightTable+=("<select name='departTimes[3]' onfocus='void hideCalendar()' id='booking_timeofday_6'><option value='anytime'>Entire Day</option>");
	        flightTable+=("<option value='06:00'>Morning</option><option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p>");
	        flightTable+=("</td></tr><tr id='booking_optiontitle_1'><td colspan='2' class='titlebar' id='booking_options_1_title'>Options:</td>");
			
	        flightTable+=("</tr><tr id='booking_optionset_1'><td colspan='2' class='smalloptions'>");
			
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			flightTable+=("<tr id='booking_optionset_1'><td colspan='2' class='regoptions'>");
			
			flightTable+=("<table style='font-size:7pt' cellpadding='0' cellspacing='1' border='0'><tr>");
			flightTable+=("<td align='left'>");
				//ADULTS
				flightTable+=("<select name='numberOfAdults' onfocus='void hideCalendar()' onchange='checkForChildAlone()'><option value='0'>0</option><option value='1' selected>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select>");
				flightTable+=("<label id='booking_numadults_1'>&nbsp;Adults</label>");
				
			flightTable+=("</td><td align='left'>");
				//SENIORS
				flightTable+=("<select name='numberOfSeniors' onfocus='void hideCalendar()' onchange='checkForChildAlone()'>");
	        flightTable+=("<option value='0' selected>0</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select>");
				flightTable+=("<label id='booking_numseniors_1'>&nbsp;Seniors (64+)</label>");
				
			flightTable+=("</td><td align='left'>");
				//CHILDREN
				flightTable+=("<select name='numberOfChildren' onfocus='void hideCalendar()'>");
	        flightTable+=("<option value='0' selected>0</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option>");
	        flightTable+=("</select>");
				flightTable+=("<label id='booking_numchildren_1'>&nbsp;Children(2-15)</label>");
			
				
			flightTable+=("</td></tr>");
			
			flightTable+=("</table></td></tr><tr>");
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			
			
	        flightTable+=("<td class='searchbarl'><a target='_blank' onClick='showPrompt2();return false' href='http://" + agencyPrefix + "/do/flight/RoundTripSearch?ag=" + agencyID + "' id='booking_adv_link'>");
	        if(typeof customBookingAdvLinkTitle != "undefined") {
		        flightTable+=(customBookingAdvLinkTitle);
		    } else {
		        flightTable+=("Advanced Search");
		    }
	    	flightTable+=("</a></td><td class='searchbar'><input type='button' name='submitbutton' onmouseover='checkForChildAlone()' onclick='submitForm()' value='Search Flights' id='booking_button'></td></tr></table></form>");
		} else {
			flightTable+=("<table class='bookingtool'><tr>");
			flightTable+=("<td>To search flights please use the <a target='_blank' href='https://" + agencyPrefix + "/do/flight/RoundTripSearch?ag=" + agencyID + "'>Flight Search Page</a></td>");
			flightTable+=("</tr></table>");
		}
		flightTable+=("</div>");
		document.writeln(flightTable);
		isFlightTableBuilt = true;
	}
		document.getElementById('replace').innerHTML=flightTable;
		
	if(isFlightTableBuilt) {
		startBookingNext();
	}		
}
function writeHotelBox(aid,prefix) {
	setupMainSettings(aid,prefix);
	if(!isHotelTableBuilt) {
		if(OKToRun(1)) {;
			hotelTable+=("<form name='quick_booking_tool' action='http://" + agencyPrefix + "/do/hotel/ProcessHotelSearch?ag=" + agencyID + "' method='POST' target='_blank'>");
			hotelTable+=("<input type='hidden' name='formValue' value='1'>");
  		 	hotelTable+=("<input type='hidden' name='placeId' value='-1'>");
  		 	hotelTable+=("<input type='hidden' name='sid' value=''>");
    		hotelTable+=("<input type='hidden' name='engine' value='-1'>");
      		hotelTable+=("<table cellpadding='0' cellspacing='0' border='0' class='qbt_top'><tr><td class='new_qbt_txt' colspan='3' align='center'><b>QUICK RESERVATIONS</b> | Book Your Trip Now !</td></tr><tr>");	
			hotelTable+=("<td class='links' align='center' valign='bottom'><a href='javascript:writeBox(");	
			hotelTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			hotelTable+=(");'>Flight</a>");
			hotelTable+=("<a class='selected' href='javascript:writeHotelBox(");	
			hotelTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			hotelTable+=(");'>Hotel</a>");
			hotelTable+=("<a href='javascript:writeCarBox(");	
			hotelTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			hotelTable+=(");'>Car</a></td>");
			hotelTable+=("</tr><tr><td class='new_qbt_txt2' colspan='3' align='center'>PERSONAL &amp; BUSINESS TRAVEL</td></tr></table>");
			hotelTable+=("<table class='bookingtool'><tr><td colspan='2' class='titlebar' id='booking_hotel_type'>Place:</td></tr><tr><td colspan='2' class='smalloptions'>");
			hotelTable+=("<label id='booking_city_label' class='selected'>City:<input type='radio' name='searchType' value='0' checked></label>");
			hotelTable+=("<label id='booking_airport_label'>Airport:<input type='radio' name='searchType' value='1'></label>");
			hotelTable+=("<label id='booking_place_label'>Place:<input type='radio' name='searchType' value='2'></label>");
			hotelTable+=("</td></tr>");
			
			hotelTable+=("<tr><td colspan='2'>");
			if(typeof customBookingCode1Title != "undefined") {
		        hotelTable+=(customBookingCode1Title);
		    } else {
		        hotelTable+=("Destination or Airport Code:");
		    }   
		    hotelTable+=("<br><input type='text' name='placeString' accesskey='d' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('placeString')\" autocomplete='off' value='" + defaultSource + "'></label> <a href=\"javascript:void codeList('placeString')\">Airport codes</a></p>");
			hotelTable+=("</td></tr>");
			hotelTable+=("<tr id='booking_titleset_1'><td colspan='2' class='titlebar' id='booking_title_1'>Hotel Travel Dates:</td></tr><tr id='booking_fieldset_1'><td colspan='2'>");
	        hotelTable+=("<p><label id='booking_date_1_label'>Check-in Date:<br><input type='text' name='checkinDate' value='mm/dd/yyyy' class='datebox' onfocus=\"void showCalendar(qElements['checkinDate'],qElements['checkinDate'],qElements['checkoutDate']);\"></label> ");
	        hotelTable+=("</p></td></tr>");
	        hotelTable+=("<tr id='booking_fieldset_2'><td colspan='2'>");
	        hotelTable+=("<p id='booking_return_date'><label id='booking_date_2_label'>Check-out Date:<br><input type='text' name='checkoutDate' value='mm/dd/yyyy' class='datebox' onfocus=\"void showCalendar(qElements['checkoutDate'],qElements['checkinDate'],qElements['checkoutDate']);\"></label> ");
	        hotelTable+=("</p>");
	        hotelTable+=("</td></tr>");
	   
	        hotelTable+=("<tr id='booking_optiontitle_1'><td colspan='2' class='titlebar' id='booking_options_1_title'>Options:</td>");
			
	        hotelTable+=("</tr><tr id='booking_optionset_1'><td colspan='2' class='smalloptions'>");
			
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			hotelTable+=("<tr id='booking_optionset_1'><td colspan='2' class='regoptions'>");
			
			hotelTable+=("<table style='font-size:7pt' cellpadding='0' cellspacing='1' border='0'><tr>");
			
			hotelTable+=("<td align='left'>");
			hotelTable+=("<select name='rooms' onfocus='void hideCalendar()'>");
	        hotelTable+=("<option value='0'>0</option><option value='1' selected>1</option><option value='2'>2</option><option value='3'>3</option>");
	        hotelTable+=("</select>");
			hotelTable+=("<label id='booking_numinflap_1'>&nbsp;Rooms (<4)</label>");
			
			hotelTable+=("</td><td align='left'>");
			
				//ADULTS
				hotelTable+=("<select name='numberOfAdults' onfocus='void hideCalendar()' onchange='checkForChildAloneHotel()'><option value='0'>0</option><option value='1'>1</option><option value='2' selected>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select>");
				hotelTable+=("<label id='booking_numadults_1'>&nbsp;Adults</label>");
				
			hotelTable+=("</td><td align='left'>");
				//CHILDREN
			hotelTable+=("<select name='numberOfChildren' onfocus='void hideCalendar()'>");
	        hotelTable+=("<option value='0' select>0</option><option value='1'>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option><option value='5'>5</option>");
	        hotelTable+=("</select>");
				hotelTable+=("<label id='booking_numchildren_1'>&nbsp;Children(2-15)</label>");
				
			hotelTable+=("</td></tr>");
			
			hotelTable+=("</table></td></tr><tr>");
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			
			
	        hotelTable+=("<td class='searchbarl'><a target='_blank'  onClick='showPrompt3();return false' href='http://" + agencyPrefix + "/do/hotel/HotelSearch?ag=" + agencyID + "' id='booking_adv_link'>");
	        if(typeof customBookingAdvLinkTitle != "undefined") {
		        hotelTable+=(customBookingAdvLinkTitle);
		    } else {
		        hotelTable+=("Advanced Search");
		    }
	    	hotelTable+=("</a></td><td class='searchbar'><input type='button' name='submitbutton' onmouseover='checkForChildAloneHotel()' onclick='submitForm()' value='Search Hotels' id='booking_button'></td></tr></table></form>");
		} else {
			hotelTable+=("<table class='bookingtool'><tr>");
			hotelTable+=("<td>To search hotels please use the <a href='https://" + agencyPrefix + "/do/hotel/HotelSearch?ag=" + agencyID + "'>Hotel Search Page</a></td>");
			hotelTable+=("</tr></table>");
		}
			isHotelTableBuilt = true;
	}
	document.getElementById('replace').innerHTML=hotelTable;
	startHotelBooking();
}

function writeCarBox(aid,prefix) {
	setupMainSettings(aid,prefix);
	if(!isCarTableBuilt) {
		if(OKToRun(1)) {
			carTable+=("<form name='quick_booking_tool' action='http://" + agencyPrefix + "/do/car/ProcessCarSearch?ag=" + agencyID + "' method='POST' target='_blank'>");
			carTable+=("<input type='hidden' name='formValue' value='1'>");
  		 	carTable+=("<input type='hidden' name='sid' value=''>");
    		carTable+=("<input type='hidden' name='engine' value='-1'>");
			carTable+=("<table cellpadding='0' cellspacing='0' border='0' class='qbt_top'><tr><td class='new_qbt_txt' colspan='3' align='center'><b>QUICK RESERVATIONS</b> | Book Your Trip Now !</td></tr><tr>");	
			carTable+=("<td class='links' align='center' valign='bottom'><a href='javascript:writeBox(");	
			carTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			carTable+=(");'>Flight</a>");
			carTable+=("<a href='javascript:writeHotelBox(");	
			carTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			carTable+=(");'>Hotel</a>");
			carTable+=("<a class='selected' href='javascript:writeCarBox(");	
			carTable+=("\"" + agencyID + "\"" + "," +  "\"" +  agencyPrefix +  "\"");
			carTable+=(");'>Car</a></td>");
			carTable+=("</tr><tr><td class='new_qbt_txt2' colspan='3' align='center'>PERSONAL &amp; BUSINESS TRAVEL</td></tr></table>");	
			carTable+=("<table class='bookingtool'><tr><td colspan='2' class='titlebar' id='booking_car_type'>Pick-up:</td></tr><tr><td colspan='2' class='smalloptions'>");
			carTable+=("</td></tr>");
			carTable+=("<tr><td colspan='2'>");
			if(typeof customBookingCode1Title != "undefined") {
		        carTable+=(customBookingCode1Title);
		    } else {
		        carTable+=("Airport Code:");
		    }
		    carTable+=("<br><input type='text' name='pickupLocation' accesskey='d' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('pickupLocation')\" autocomplete='off' value='" + defaultSource + "'></label> <a href=\"javascript:void codeList('pickupLocation')\">Airport codes</a></p>");
			carTable+=("</td></tr>");
			carTable+=("<tr id='booking_fieldset_1'><td colspan='2'>");
			carTable+=("<p><label id='booking_date_1_label'>Pick-up Date:<br><input type='text' name='pickupDate' value='mm/dd/yyyy' class='datebox' onfocus=\"void showCalendar(qElements['pickupDate'],qElements['pickupDate'],qElements['dropOffDate']);\"></label> ");
			carTable+=("</p></td>");
			
			carTable+=("<tr id='booking_titleset_1'><td colspan='2' class='titlebar' id='booking_title_1'>Drop-off:</td></tr>");
	        carTable+=("<tr><td colspan='2'>");
			if(typeof customBookingCode1Title != "undefined") {
		        carTable+=(customBookingCode1Title);
		    } else {
		        carTable+=("Airport Code:");
		    }
		    carTable+=("</td></tr>");
	        
	         carTable+=("<tr><td colspan='2'>");
	         carTable+=("<input type='text' name='dropOffLocation' accesskey='d' class='airportcodebox' onfocus='void hideCalendar()' onblur=\"replaceLocation('dropOffLocation')\" autocomplete='off' value='" + defaultSource + "'><a href=\"javascript:void codeList('dropOffLocation')\">Airport codes</a>");
	        carTable+=("</td></tr>");
	        carTable+=("<tr id='booking_fieldset_2'><td colspan='2'>");
	        carTable+=("<p id='booking_return_date'><label id='booking_date_2_label'>Drop-off Date:<br><input type='text' name='dropOffDate' value='mm/dd/yyyy' class='datebox' onfocus=\"void showCalendar(qElements['dropOffDate'],qElements['pickupDate'],qElements['dropOffDate']);\"></label> ");
	        carTable+=("</p>");
	        carTable+=("</td></tr>");
	   
	      
	        carTable+=("<td class='searchbarl'><a target='_blank' onClick='showPrompt4();return false' href='http://" + agencyPrefix + "/do/car/CarSearch?ag=" + agencyID + "' id='booking_adv_link'>");
	        if(typeof customBookingAdvLinkTitle != "undefined") {
		        carTable+=(customBookingAdvLinkTitle);
		    } else {
		        carTable+=("Advanced Search");
		    }
	    	carTable+=("</a></td><td class='searchbar'><input type='button' name='submitbutton' onclick='submitForm()' value='Search Cars' id='booking_button'></td></tr></table></form>");
		} else {
			carTable+=("<table class='bookingtool'><tr>");
			carTable+=("<td>To search flights please use the <a href='https://" + agencyPrefix + "/do/car/CarSearch?ag=" + agencyID + "'>Car Search Page</a></td>");
			carTable+=("</tr></table>");
		}
		
		isCarTableBuilt = true;
	}	
	document.getElementById('replace').innerHTML=carTable;
	startCarBooking();
}
