		var PPObackgroundcolor;
		var PPOtitlebarcolor;
		var PPOborderwidth;
		var PPObordercolor;
		var PPOtitlefontcolor;
		var PPObodyfontcolor;

	function PPOFormatSearchBox(formatstyle) {
		if (formatstyle == 'standard'){
			PPObackgroundcolor = '#D5E8BB';
			PPOtitlebarcolor = '#88BE3F';
			PPOborderwidth = '0';
			PPObordercolor = '#FFFFFF';
			PPOtitlefontcolor = '#000000';
			PPObodyfontcolor = '#000000';
		}
		else if (formatstyle == 'steel') {
			PPObackgroundcolor = '#d3d3d3';
			PPOtitlebarcolor = '#3f6194';
			PPOborderwidth = '0';
			PPObordercolor = '#FFFFFF';
			PPOtitlefontcolor = '#FFFFFF';
			PPObodyfontcolor = '#000000';
		}
		else if (formatstyle == 'simple') {
			PPObackgroundcolor = '#FFFFFF';
			PPOtitlebarcolor = '#FFFFFF';
			PPOborderwidth = '1';
			PPObordercolor = '';
			PPOtitlefontcolor = '#000000';
			PPObodyfontcolor = '#000000';
		}
		else if (formatstyle == 'santafe') {
			PPObackgroundcolor = '#f9eacd';
			PPOtitlebarcolor = '#8d2031';
			PPOborderwidth = '0';
			PPObordercolor = '#666666';
			PPOtitlefontcolor = '#FFFFFF';
			PPObodyfontcolor = '#000000';
		}
		else if (formatstyle == 'tta') {
			PPObackgroundcolor = '#424c6b';
 	 	    PPOtitlebarcolor = '#000033';
		    PPOborderwidth = '0';
		    PPObordercolor = '#666666';
		    PPOtitlefontcolor = '#FFFFFF';
		    PPObodyfontcolor = '#FFFFFF';
		} else {
			PPObackgroundcolor = '#D5E8BB';
			PPOtitlebarcolor = '#88BE3F';
			PPOborderwidth = '0';
			PPObordercolor = '#FFFFFF';
			PPOtitlefontcolor = '#000000';
			PPObodyfontcolor = '#000000';
		}
	}

	function PPOSearchBoxHeader(searchboxcaption, distributorcode, distributoraccount, targetframe){
		document.write('<form style=\'width:170px;\' name=\'PPOSearchForm\' width=\'150\' method=\'get\' action=\'http://www.latesttraveloffers.com/lton/ltonclct.asp\' target=\'' + targetframe + '\'>');
		document.write('<input type=\'hidden\' name=\'distributorcode\' value=\'' + distributorcode + '\'>');
		document.write('<input type=\'hidden\' name=\'distributoraccount\' value=\'' + distributoraccount + '\'>');
		document.write('<input type=\'hidden\' name=\'UseSearchAPI\' value=\'true\'>');	
		document.write('<table width=\'150\' border=\'' + PPOborderwidth + '\' bordercolor=\'' + PPObordercolor + '\' bgcolor=\'' + PPObackgroundcolor + '\'>');
		document.write('	<tr>');
		document.write('		<td align=\'center\' bgcolor=\'' + PPOtitlebarcolor + '\'><font face=\'arial\' size=\'2\' color=\'' + PPOtitlefontcolor + '\'><strong>' + searchboxcaption + '</strong></font></td>');
		document.write('	</tr>');
		document.write('	<tr>');
		document.write('		<td>');
		document.write('			<table width=\'50\' border=\'0\' cellspacing=\'0\' cellpadding=\'2\'>');
	}
	function PPOSearchBoxFooter(){
		document.write('			</table>');
		document.write('		</td>');
		document.write('	</tr>');
		document.write('</table>');
		document.write('</form>');		
	}
	function PPOSearchBoxSubmit(){
		document.write('<tr>');
		document.write('	<td align=\'center\'><a href=\'#\' onclick=\'document.PPOSearchForm.submit();\'><img src=\'/structure/images/search-button.jpg\' border=\'0\'></a></td>');
		document.write('</tr>');
	}
	function PPOSearchBoxSubmitPlain(){
		document.write('<tr>');
		document.write('	<td><font size=\'1\' face=\'Arial\' color=\'' + PPObodyfontcolor + '\'>Powered by <em>VacationPORT</em></font></td>');
		document.write('	<td align=\'right\'><input type=\'Submit\' value=\'Go\'></td>');
		document.write('</tr>');
	}
	function PPOsrchDestText(){
		document.write('<tr>');
		document.write('	<td colspan=\'2\'><font face=\'Arial\' size=\'1\' color=\'' + PPObodyfontcolor + '\'>Destination: <br></font><input type=\'text\' name=\'srchDestText\'></td>');
		document.write('</tr>');
	}

	function PPOsrchTravType(){
		document.write('<tr>');
		document.write('	<td width=\'150\' align=\'center\' colspan=\'2\'><font face=\'Arial\' size=\'1\' color=\'' + PPObodyfontcolor + '\'>Travel Type: <br></font></td></tr><tr><td width=\'150\' align=\'center\'><select name=\'srchTravType\'>');
		document.write('	<option value=\'CRVA\'>Cruises & Vacations</option>');
		document.write('	<option value=\'CRUZ\'>Cruises</option>');
		document.write('	<option value=\'PKG\'>Vacations</option>');
		document.write('	<option value=\'TOUR\'>Tours</option>');
		document.write('	<option value=\'AUTO\'>International Auto</option>');
		document.write('	<option value=\'LODG\'>Lodging</option>');
		document.write('	<option value=\'AIR\'>Air</option>');
		document.write('</select></td></tr>');
	}
	
	function PPOsrchDestId() {
		document.write('<tr>');
		document.write('	<td align=\'center\' colspan=\'2\'><font face=\'Arial\' size=\'1\' color=\'' + PPObodyfontcolor + '\'>Destination: <br></font></td></tr><tr>');
		document.write('		<td width=\'150\' align=\'center\'><select name=\'srchDestId\'>');
		document.write('			<option value=\'\'>Any Destination</option>');
		document.write('			<option value=\'62221*\'>Africa</option>');
		document.write('			<option value=\'62468*\'>Alaska</option>');
		document.write('			<option value=\'62222*\'>Antarctica</option>');
		document.write('			<option value=\'107508,62226,62228*\'>Asia & Middle East</option>');
		document.write('			<option value=\'62321*\'>Bahamas</option>');
		document.write('			<option value=\'62493*\'>Bermuda</option>');
		document.write('			<option value=\'106355,106357,106365,106374,62482,62483,62484,65788,62486*\'>Canada/New E</option>');
		document.write('			<option value=\'62319,62442,62320,106434*\'>Western Caribbean</option>');
		document.write('			<option value=\'62327,62325,62329,62326,62321,62322,62328*\'>Eastern Caribbean</option>');
		document.write('			<option value=\'62331,62338,62336,62340,62330,62341,62342,62339,62333,62334*\'>Southern Caribbean</option>');
		document.write('			<option value=\'62234,62232,62235,62236,62233,62400,62408,62399,62392,62410,62396*\'>Mediterranean</option>');
		document.write('			<option value=\'62386,62373,62413,62414,62371,62372,60175,62379,62403*\'>Northern Europe</option>');
		document.write('			<option value=\'62380,62375,62385,62378,62379,62391*\'>Western Europe</option>');
		document.write('			<option value=\'62469*\'>Hawaii</option>');
		document.write('			<option value=\'62231,106338*\'>Latin America</option>');
		document.write('			<option value=\'106337*\'>Mexico</option>');
		document.write('			<option value=\'62520*\'>Panama Canal</option>');
		document.write('			<option value=\'62231*\'>South America</option>');
		document.write('			<option value=\'106339,62223*\'>South Pacific</option>');
		document.write('			<option value=\'62471,106372,106386*\'>Western US</option>');
		document.write('			<option value=\'106356,62491,106368,106375*\'>Eastern US</option>');
		document.write('		</select>');
		document.write('	</td></tr>');
	}
	
	function PPOsrchStartTravDate(){
		var arrMonthName = new Array();
		arrMonthName = ["January","February","March","April","May","June","July","August","September","October","November","December"];
		var ThisDate = new Date();
		var ThisMonth = ThisDate.getMonth();
		var ThisYear = ThisDate.getFullYear();
		var tmpMonthYear;
		var tmpMonthYearName;
		document.write("<tr><td align=\'center\' height='15'><font face=\'Arial\' size=\'1\' color=\'" + PPObodyfontcolor + "\'>Travel When:</font></td>");
		document.write("</tr><tr><td align=\'center\' height='23'><select name=\"srchStartTravDate\">");
		document.write("		<option value=\"\">Any Date</option>");
		for ( i = 0; i < 24; i++) {
			if ( ThisMonth == 12 ) {
				ThisMonth = ThisMonth - 12;
				ThisYear = ThisYear + 1;
			}
			if ( (ThisMonth + 1) < 10 ) {
				tmpMonthYear = '0' + (ThisMonth + 1) + '*' + ThisYear + '*';
			}
			else {
				tmpMonthYear = (ThisMonth + 1) + '*' + ThisYear + '*';
			}
			tmpMonthYearName = arrMonthName[ThisMonth] + ' ' + ThisYear;
			document.write("		<option value=\"" + tmpMonthYear + "\">" + tmpMonthYearName + "</option>");
			ThisMonth = ThisMonth + 1;
		}

		document.write("	</select></td>");
		document.write("</tr>");
	}

	function PPOsrchTravBudgetHigh() {
		document.write('<tr><td colspan=\'2\'>');
		document.write('<font face=\'Arial\' size=\'1\' color=\'' + PPObodyfontcolor + '\'>Travel Budget</font><br>');
		document.write('<select name=\'srchTravBudget\'>');
		document.write('<option value=\'\'>Any Price</option>');
		document.write('<option value=\'0*250*\'>$250 or less</option>');
		document.write('<option value=\'251*500*\'>$251 - $500</option>');
		document.write('<option value=\'501*1000*\'>$501 - $1,000</option>');
		document.write('<option value=\'1001*1500*\'>$1,001 - $1,500</option>');
		document.write('<option value=\'1501*2000*\'>$1,501 - $2,000</option>');
		document.write('<option value=\'2001*3000*\'>$2,001 - $3,000</option>');
		document.write('<option value=\'3000**\'>$3,000 or more</option>');
		document.write('</select>');
		document.write('</td></tr>');
	}

	function PPOsrchTravBudgetLow() {
		document.write('<tr><td colspan=\'2\'>');
		document.write('<font face=\'Arial\' size=\'1\' color=\'' + PPObodyfontcolor + '\'>Travel Budget</font><br>');
		document.write('<select name=\'srchTravBudget\'>');
		document.write('<option value=\'\'>Any Price</option>');
		document.write('<option value=\'0*100*\'>$100 or less</option>');
		document.write('<option value=\'101*200*\'>$101 - $200</option>');
		document.write('<option value=\'201*400*\'>$201 - $400</option>');
		document.write('<option value=\'400**\'>$400 or more</option>');
		document.write('</select>');
		document.write('</td></tr>');
	}

	function PPOsrchTravLength() {
		document.write('<tr><td colspan=\'2\'>');
		document.write('<font face=\'Arial\' size=\'1\' color=\'' + PPObodyfontcolor + '\'>Travel Length</font><br>');
		document.write('<select name=\'srchTravLength\'>');
		document.write('<option value=\'\'>Any Length</option>');
		document.write('<option value=\'0*2*\'>0-2 nights</option>');
		document.write('<option value=\'3*6*\'>3-6 nights</option>');
		document.write('<option value=\'7*9*\'>7-9 nights</option>');
		document.write('<option value=\'10*14*\'>10-14 nights</option>');
		document.write('<option value=\'14**\'>over 14 nights</option>');
		document.write('</select>');
		document.write('</td></tr>');
	}

	function PPOsrchTravSupp(){
		document.write('				<tr>');
		document.write('					<td colspan=\'2\'><font face=\'Arial\' size=\'1\' color=\'' + PPObodyfontcolor + '\'>Travel Company: <br></font><input type=\'text\' name=\'srchTravSupp\'></td>');
		document.write('				</tr>');
	}

	function PPOSearchBox(searchboxsize, searchboxstyle, searchboxcaption, distributorcode, distributoraccount, targetframe) {
		//set the colors and styling
		PPOFormatSearchBox(searchboxstyle);
		//print the header
		searchboxcaption = unescape(searchboxcaption);
		PPOSearchBoxHeader(searchboxcaption, distributorcode, distributoraccount, targetframe);
		
		//print the appropriately sized body
		if (searchboxsize == 'simple'){
			PPOsrchTravType();
			PPOsrchDestText();
		}
		else if (searchboxsize == 'moderate'){
			PPOsrchTravType();
			PPOsrchDestId();
			PPOsrchStartTravDate();
		}
		else if (searchboxsize == 'detailed'){
			PPOsrchTravType();
			PPOsrchDestId();
			PPOsrchStartTravDate();
			PPOsrchTravBudgetHigh();
			PPOsrchTravLength();
			PPOsrchTravSupp();
		}
		else {
			PPOsrchTravType();
			PPOsrchDestText();
		}
		//print the submit button and footer
		PPOSearchBoxSubmit();
		PPOSearchBoxFooter();
	}

