function writeBox(aid,prefix) {
	setupMainSettings(aid,prefix);
	
	if(OKToRun(1)) {
	    document.write("<form name='quick_booking_tool' action='http://secure.skyharbors.com/" + agencyPrefix + "/do/flight/ProcessRoundTripSearch?ag=" + agencyID + "' method='POST'>");
	    document.write("<table class='bookingtool'><tr><td colspan='2' class='mtitlebar'>");
	    if(typeof customBookingTitle != "undefined") {
	        document.write(customBookingTitle);
	    } else {
	        document.write("Quick Flight Search");
	    }
	    document.write("</td></tr><tr><td colspan='2' id='booking_flight_type'>Flight Type: ");
        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' id='booking_title_1' class='titlebar'>Departing From:</td></tr><tr id='booking_fieldset_1'>");
        document.write("<td><label>");
        if(typeof customBookingCode1Title != "undefined") {
	        document.write(customBookingCode1Title);
	    } else {
	        document.write("City/Airport Code:");
	    }
        document.write("<br><input type='text' class='airportcodebox' name='origin' accesskey='d' onfocus='void hideCalendar()' onblur=\"replaceLocation('origin')\" autocomplete='off' value='" + defaultSource + "'></label></td>");
        document.write("<td class='date'><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></td></tr>");
        document.write("<tr id='booking_titleset_2'><td colspan='2' id='booking_title_2' class='titlebar'>Returning From:</td></tr><tr id='booking_fieldset_2'>");
        document.write("<td><label>");
        if(typeof customBookingCode2Title != "undefined") {
	        document.write(customBookingCode2Title);
	    } else {
	        document.write("City/Airport Code:");
	    }
        document.write("<br><input type='text' class='airportcodebox' name='destination' onfocus='void hideCalendar()' onblur=\"replaceLocation('destination')\" autocomplete='off'></label></td>");
        document.write("<td class='date'><span id='booking_return_date'><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='departTime' onfocus='void hideCalendar()'><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></span></td></tr>");
        document.write("<tr id='booking_titleset_3' style='display: none'><td colspan='2' id='booking_title_3' class='titlebar'>Flight 1:</td></tr><tr id='booking_fieldset_3' style='display: none'><td>");
        document.write("<label>From:<br><input type='text' class='airportcodebox' name='origins[0]' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[0]')\" autocomplete='off'></label><br>");
        document.write("<label>To:<br><input type='text' class='airportcodebox' name='dests[0]' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[0]')\" autocomplete='off'></label></td>");
        document.write("<td class='date'><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()'><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></td></tr>");
        document.write("<tr id='booking_titleset_4' style='display: none'><td colspan='2' id='booking_title_4' class='titlebar'>Flight 2:</td></tr><tr id='booking_fieldset_4' style='display: none'>");
        document.write("<td><label>From:<br><input type='text' class='airportcodebox' name='origins[1]' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[1]')\" autocomplete='off'></label><br>");
        document.write("<label>To:<br><input type='text' class='airportcodebox' name='dests[1]' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[1]')\" autocomplete='off'></label></td>");
        document.write("<td class='date'><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()'><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></td></tr><tr id='booking_titleset_5' style='display: none'>");
        document.write("<td colspan='2' id='booking_title_5' class='titlebar'>Flight 3:</td></tr><tr id='booking_fieldset_5' style='display: none'><td>");
        document.write("<label>From:<br><input type='text' class='airportcodebox' name='origins[2]' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[2]')\" autocomplete='off'></label><br>");
        document.write("<label>To:<br><input type='text' class='airportcodebox' name='dests[2]' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[2]')\" autocomplete='off'></label>");
        document.write("</td><td class='date'><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()'><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></td></tr><tr id='booking_titleset_6' style='display: none'>");
        document.write("<td colspan='2' id='booking_title_6' class='titlebar'>Flight 4:</td></tr><tr id='booking_fieldset_6' style='display: none'><td>");
        document.write("<label>From:<br><input type='text' class='airportcodebox' name='origins[3]' onfocus='void hideCalendar()' onblur=\"replaceLocation('origins[3]')\" autocomplete='off'></label><br>");
        document.write("<label>To:<br><input type='text' class='airportcodebox' name='dests[3]' onfocus='void hideCalendar()' onblur=\"replaceLocation('dests[3]')\" autocomplete='off'></label></td>");
        document.write("<td class='date'><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()'><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></td></tr><tr id='booking_optiontitle_1'>");
        document.write("<td colspan='2' class='titlebar' id='booking_options_1_title'>Options:</td></tr>");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		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;<font color='#FF0000'>Military (ID-Req)</font></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()' onChange='checkForInfantLap()' >");
        document.write("<option value='0' selected>0</option><option value='1'>1</option>");
		document.write("<option value='2'>2</option><option value='3'>3</option>");
        document.write("</select>");
			document.write("<label id='booking_numinfseat_1'>&nbsp;Infant (<2)</label>");
			
		document.write("</td><td align='left'>");
			//MILITARY DEPENDENTS
			document.write("<select name='numberOfMilitaryDependents' 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_nummilitarydep_1'>&nbsp;<font color='#FF0000'>Military Dependents</font></label>");
			
		document.write("</td></tr>");
		
		document.write("</table></td></tr><tr>");
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
		
        document.write("<td class='searchbarl'><a href='http://secure.skyharbors.com/" + 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'></td></tr></table></form>");
    } else {
		document.write("<table class='bookingtool'><tr>");
		document.write("<td>To search flights please use the <a href='https://secure.skyharbors.com/" + agencyPrefix + "/do/flight/RoundTripSearch?ag=" + agencyID + "'>Flight Search Page</a></td>");
		document.write("</tr></table>");
	}
}
