function writeBox(aid,prefix) {
	setupMainSettings(aid,prefix);
	
	if(OKToRun(1)) {
		document.write("<form name='quick_booking_tool' action='http://" + agencyPrefix + "/do/flight/ProcessRoundTripSearch?ag=" + agencyID + "' method='POST'>");
		document.write("<table class='bookingtool'><tr><td colspan='2' class='titlebar' id='booking_flight_type'>Flight Type:</td></tr><tr id='booking_flighttypeset'><td colspan='2' class='smalloptions'>");
		document.write("<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>");
		document.write("<label id='booking_oneway_label'>One-Way:<input type='radio' name='flightType' onclick=\"switchType('flights-oneway')\" value='1'></label>");
		document.write("<label id='booking_multi_label'>Multiple Destination:<input type='radio' name='flightType' onclick=\"switchType('flights-multi')\" value='2'></label>");
		document.write("</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'>");
		document.write("<p><label id='booking_field_1_label'>");
		if(typeof customBookingCode1Title != "undefined") {
	        document.write(customBookingCode1Title);
	    } else {
	        document.write("Airport Code:");
	    }
		document.write("<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>");
        document.write("<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> ");
        document.write("<select name='departTime' onfocus='void hideCalendar()' id='booking_timeofday_1'><option value='anytime'>Entire Day</option><option value='06:00'>Morning</option>");
        document.write("<option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p></td></tr><tr id='booking_titleset_2'>");
        document.write("<td colspan='2' class='titlebar' id='booking_title_2'>Returning From:</td></tr><tr id='booking_fieldset_2'><td colspan='2'>");
        document.write("<p><label id='booking_field_2_label'>");
        if(typeof customBookingCode2Title != "undefined") {
	        document.write(customBookingCode2Title);
	    } else {
	        document.write("Airport Code:");
	    }
        document.write("<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>");
        document.write("<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> ");
        document.write("<select name='returnTime' onfocus='void hideCalendar()' id='booking_timeofday_3'><option value='anytime'>Entire Day</option><option value='06:00'>Morning</option>");
        document.write("<option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p>");
        document.write("</td></tr><tr id='booking_titleset_3' style='display: none'><td colspan='2' class='titlebar' id='booking_title_3'>Flight 1:</td>");
        document.write("</tr><tr id='booking_fieldset_3' style='display: none'><td colspan='2'>");
        document.write("<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>");
        document.write("<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>");
        document.write("<p><label id='booking_date_3_label'>Departure Date:<br><input type='text' name='departDates[0]' value='mm/dd/yyyy' class='datebox'></label> ");
        document.write("<select name='departTimes[0]' onfocus='void hideCalendar()' id='booking_timeofday_3'><option value='anytime'>Entire Day</option>");
        document.write("<option value='06:00'>Morning</option><option value='12:00'>Afternoon</option><option value='18:00'>Evening</option>");
        document.write("</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>");
        document.write("</tr><tr id='booking_fieldset_4' style='display: none'><td colspan='2'>");
        document.write("<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>");
        document.write("<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>");
        document.write("<p><label id='booking_date_4_label'>Departure Date:<br><input type='text' name='departDates[1]' value='mm/dd/yyyy' class='datebox'></label> ");
        document.write("<select name='departTimes[1]' onfocus='void hideCalendar()' id='booking_timeofday_4'><option value='anytime'>Entire Day</option>");
        document.write("<option value='06:00'>Morning</option><option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p>");
    	document.write("</td></tr><tr id='booking_titleset_5' style='display: none'><td colspan='2' class='titlebar' id='booking_title_5'>Flight 3 (Optional):</td>");
    	document.write("</tr><tr id='booking_fieldset_5' style='display: none'><td colspan='2'>");
    	document.write("<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>");
        document.write("<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>");
        document.write("<p><label id='booking_date_5_label'>Departure Date:<br><input type='text' name='departDates[2]' value='mm/dd/yyyy' class='datebox'></label> ");
        document.write("<select name='departTimes[2]' onfocus='void hideCalendar()' id='booking_timeofday_5'><option value='anytime'>Entire Day</option><option value='06:00'>Morning</option>");
        document.write("<option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p></td></tr><tr id='booking_titleset_6' style='display: none'>");
        document.write("<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'>");
        document.write("<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>");
        document.write("<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>");
        document.write("<p><label id='booking_date_6_label'>Departure Date:<br><input type='text' name='departDates[3]' value='mm/dd/yyyy' class='datebox'></label> ");
        document.write("<select name='departTimes[3]' onfocus='void hideCalendar()' id='booking_timeofday_6'><option value='anytime'>Entire Day</option>");
        document.write("<option value='06:00'>Morning</option><option value='12:00'>Afternoon</option><option value='18:00'>Evening</option></select></p>");
        document.write("</td></tr><tr id='booking_optiontitle_1'><td colspan='2' class='titlebar' id='booking_options_1_title'>Options:</td>");
		
        document.write("</tr><tr id='booking_optionset_1'><td colspan='2' class='smalloptions'>");
		
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		document.write("<tr id='booking_optionset_1'><td colspan='2' class='regoptions'>");
		
		document.write("<table style='font-size:7pt' cellpadding='0' cellspacing='1' border='0'><tr>");
		document.write("<td align='left'>");
			//ADULTS
			document.write("<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>");
			document.write("<label id='booking_numadults_1'>&nbsp;Adults</label>");
			
		document.write("</td><td align='left'>");
			/*//SENIORS
			document.write("<select name='numberOfSeniors' onfocus='void hideCalendar()' onchange='checkForChildAlone()'>");
        document.write("<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>");
			document.write("<label id='booking_numseniors_1'>&nbsp;Seniors (64+)</label>");*/
			
		document.write("</td><td align='left'>");
			//MILITARY
			document.write("<select name='numberOfMilitary' onfocus='void hideCalendar()' onchange='checkForMilitary();checkForChildAlone()'><option value='0'>0</option selected><option value='1'>1</option><option value='2'>2</option>");
        document.write("<option value='3'>3</option><option value='4'>4</option><option value='5'>5</option></select>");
			document.write("<label id='booking_nummilitary_1'>&nbsp;Military (ID-Req)</label>");
				
		document.write("</td></tr><tr><td align='left'>");
			//CHILDREN
			document.write("<select name='numberOfChildren' onfocus='void hideCalendar()'>");
        document.write("<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>");
        document.write("</select>");
			document.write("<label id='booking_numchildren_1'>&nbsp;Children(2-15)</label>");

		document.write("</td><td align='left'>");
			//INFANT-SEAT
			document.write("<select name='numberOfInfSeat' onfocus='void hideCalendar()'>");
        document.write("<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>");
        document.write("</select>");
			document.write("<label id='booking_numinfseat_1'>&nbsp;Infant-Seat (<2)</label>");
			
		document.write("</td><td align='left'>");
			//INFANT-LAP
			document.write("<select name='numberOfInfLap' onfocus='void hideCalendar()'>");
        document.write("<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>");
        document.write("</select>");
			document.write("<label id='booking_numinflap_1'>&nbsp;Infant-Lap (<2)</label>");
			
		document.write("</td></tr>");
		
		document.write("</table></td></tr><tr>");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		
        document.write("<td class='searchbarl'><a href='http://" + agencyPrefix + "/do/flight/RoundTripSearch?ag=" + agencyID + "' id='booking_adv_link'>");
        if(typeof customBookingAdvLinkTitle != "undefined") {
	        document.write(customBookingAdvLinkTitle);
	    } else {
	        document.write("Advanced Search");
	    }
    	document.write("</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 {
		document.write("<table class='bookingtool'><tr>");
		document.write("<td>To search flights please use the <a href='https://" + agencyPrefix + "/do/flight/RoundTripSearch?ag=" + agencyID + "'>Flight Search Page</a></td>");
		document.write("</tr></table>");
	}
}
