/*********************************************
<Author>
L. Williams

<Description>
HTML document can call this file using meathod showSearch() to display the Search Module on a site. The Module can be confiured to unique specifications. Please reference the documentation provided by ICHotelsGroup.

<Dependenceies>
This file includes and requires for use two files.
  -- Main site Style Sheet: "http://images1.ichotelsgroup.com/css/6c_styles.css"
  -- Motified Static Site Calendar (Typically named cal2.js): "JSSearchCalendar.js"

<Other>
Much of this code is reproduced from ICHotelsGroup main website, in addition to other JS code.
*********************************************/
var redirectVars=[["brandCode","6c"],["regionCode","1"],["localeCode","en"],["city",""],["state",""],["country",""],["hotelCode",""],["rateCode",""],["hide_rateCode",""],["IATAno",""],["hide_IATAno",""],["corpNum",""],["hide_corpNum",""],["GPC",""],["hide_GPC",""],["searchHI",""],["searchEX",""],["searchCP",""],["searchIC",""],["searchSB",""],["searchCW",""],["searchIN",""]]
for (var i=0; i<redirectVars.length ;i++ )
{
	var evalString='var '+redirectVars[i][0]+'="'+redirectVars[i][1]+'";';
	eval(evalString);
}

var st=["","AB","AK","AL","AR","AZ","BC","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MB","MD","ME","MI","MN","MO","MS","MT","NB","NC","ND","NE","NF","NH","NJ","NM","NS","NV","NY","OH","OK","ON","OR","PA","PE","QC","RI","SC","SD","SK","TN","TX","UT","VA","VT","WA","WI","WV","WY"];

var b=[["0001","United States"],["0140","Andorra"],["0150","Argentina"],["0100","Aruba"],["0160","Australia"],["0165","Austria"],["0180","Bahamas"],["0181","Bahrain"],["0190","Belgium"],["0185","Bosnia & Herzegovina"],["0220","Brazil"],["0255","Cambodia"],["0260","Canada"],["0107","Caribbean"],["0268","Cayman Islands"],["0275","Chile"],["0280","China-Peoples Rep"],["0285","Colombia"],["0295","Costa Rica"],["0305","Cyprus"],["0311","Czech Republic"],["0320","Dominican Republic"],["0325","Ecuador"],["0922","Egypt"],["0330","El Salvador"],["0926","England"],["0327","Eritrea"],["0338","Fiji Islands"],["0340","Finland"],["0350","France"],["0367","French Polynesia"],["0388","Gabon"],["0394","Germany"],["0400","Greece"],["0066","Guam"],["0415","Guatemala"],["0430","Honduras"],["0435","Hong Kong"],["0445","Hungary"],["0455","India"],["0458","Indonesia"],["0470","Ireland"],["0475","Israel"],["0480","Italy"],["0487","Jamaica"],["0490","Japan"],["0500","Jordan"],["0525","Kazakhstan"],["0505","Kenya"],["0515","Korea-Republic Of"],["0520","Kuwait"],["0540","Lebanon"],["0532","Lithuania"],["0573","Macau"],["0574","Macedonia"],["0580","Malaysia"],["0590","Malta"],["0595","Mexico"],["0610","Morocco"],["0615","Mozambique"],["0625","Nepal"],["0630","Netherlands"],["0660","New Zealand"],["0665","Nicaragua"],["0616","Oman"],["0700","Pakistan"],["0710","Panama"],["0712","Papua New Guinea"],["0720","Peru"],["0725","Philippines"],["0730","Poland"],["0735","Portugal"],["0072","Puerto Rico"],["0747","Qatar"],["0755","Romania"],["0825","Russia"],["0785","Saudi Arabia"],["0760","Scotland"],["0795","Singapore"],["0796","Slovakia"],["0801","South Africa"],["0830","Spain"],["0272","Sri Lanka"],["0855","Switzerland"],["0281","Taiwan"],["0865","Tanzania"],["0875","Thailand"],["0887","Trinidad & Tobago"],["0890","Tunisia"],["0905","Turkey"],["0888","United Arab Emirates"],["0925","United Kingdom"],["0930","Uruguay"],["0001","United States"],["0078","US Virgin Islands"],["0931","Uzbekistan"],["0548","Vanuatu"],["0940","Venezuela"],["0950","Wales"],["0968","Yemen"],["0990","Zambia"],["0818","Zimbabwe"]];

//var w = document;
//w.r = w.write; 

function writeSelectNumbers(i){
	for(var x=1;x<i;x++)document.write("<option value="+x+">"+x+"</option>");
	document.close();
}

function monthName(month_value){
	switch (month_value){
		case 0: return "January"
		case 1: return "Feburary"
		case 2: return "March"
		case 3: return "April"
		case 4: return "May"
		case 5: return "June"
		case 6: return "July"
		case 7: return "August"
		case 8: return "September"
		case 9: return "October"
		case 10: return "November"
		case 11: return "December"
	}
	document.close();
}

function writeMonthYear(){
	var date_now = new Date()
	var month_now = date_now.getMonth()
	var year_now = date_now.getFullYear()
	var temp_year
	for(var i=month_now;i<month_now+12;i++){
		temp_year = year_now
		if(i>11)
		  temp_year = temp_year + 1
		document.write("<option value="+(i%12)+temp_year+">"+monthName(i%12)+" "+temp_year+"</option>");
		}
	document.close();
}

function writeStateId(stateName){
	for(var i=0;i<61;i++){
		if ((st[i]==stateName)&&(stateName!=""))
			document.write("<option selected value=\""+st[i]+"\">"+st[i]+"</option>");
		else 
			document.write("<option value=\""+st[i]+"\">"+st[i]+"</option>");
	}
	document.close();
}

function writeCountryId(countryName){
	document.write("<select name=countryId class=f12quickres>");
	for(var i=0;i<102;i++){
		if ((b[i][0]==countryName)||(b[i][1]==countryName))
			document.write("<option selected value="+b[i][0]+">"+b[i][1]+"</option>");
		else
			document.write("<option value="+b[i][0]+">"+b[i][1]+"</option>");
	}
	document.write("</select>");
	document.close();
}


function populateCheckOut()
{
    var theForm = document.searchForm;
    if ((theForm.checkOutMonthYear.selectedIndex == 0)    ||
        (theForm.checkOutMonthYear.selectedIndex < theForm.checkInMonthYear.selectedIndex) ||
        ((theForm.checkOutMonthYear.selectedIndex == theForm.checkInMonthYear.selectedIndex) &&
         (theForm.checkOutDate.selectedIndex <= theForm.checkInDate.selectedIndex))) {
           if(theForm.checkInMonthYear.selectedIndex != 0) {
               if (theForm.checkInDate.selectedIndex > 29 ) {
                    theForm.checkOutDate.selectedIndex = 1;
                    theForm.checkOutMonthYear.selectedIndex = theForm.checkInMonthYear.selectedIndex + 1;
                }
                else if ((theForm.checkInDate.selectedIndex == 29 ) &&
                     ((theForm.checkInMonthYear.selectedIndex == 4) ||
                      (theForm.checkInMonthYear.selectedIndex == 6)  ||
                      (theForm.checkInMonthYear.selectedIndex == 9) ||
                      (theForm.checkInMonthYear.selectedIndex == 11))) {
                          theForm.checkOutDate.selectedIndex = 1;
                          theForm.checkOutMonthYear.selectedIndex = theForm.checkInMonthYear.selectedIndex + 1;
                }
                else {
                      theForm.checkOutDate.selectedIndex = theForm.checkInDate.selectedIndex + 1;
                      theForm.checkOutMonthYear.selectedIndex = theForm.checkInMonthYear.selectedIndex;
                }
            }
    }
}

                                                                           
var calendarSwap = 0; //set to 0 for checkIn, 1 for checkOut;');                                              
                                                                                                           
//This function will be called from cal2.js to set the defualt fields on this page.');                        
function setDateFields(){ 
	    var today = new Date();
        if (calendarSwap == 0){  //Check IN Date                                                                          
			var date = document.searchForm.firstinput.value ;                                              
			dateArray = date.split("/");                                                                 
			document.searchForm.checkInDate.selectedIndex = dateArray[1];                                 
                                                                                                           
   			index = 0;                                                                                     
   			for (i=2003;i<=dateArray[2];i++){ index = index + 1;}                                         
			if((dateArray[0]-1)<today.getMonth())
				document.searchForm.checkInMonthYear.selectedIndex = (12-today.getMonth()+1)+(dateArray[0]-1);
			else	 
				document.searchForm.checkInMonthYear.selectedIndex = (dateArray[0])-(today.getMonth());// + "" + (index +2002);
			if (document.searchForm.checkOutMonthYear.selectedIndex == 0)  {
				populateCheckOut();
			}
		}                                                                                                  
		else {        //Check OUT Date                                                                           
			var date = document.searchForm.firstinput.value ;                                       
			dateArray = date.split("/");                                                               
			document.searchForm.checkOutDate.selectedIndex = dateArray[1];                                 
                                                                                                        
   			index = 0;                                                                                 
   			for (i=2003;i<=dateArray[2];i++){ index = index + 1;}                                          
			if((dateArray[0]-1)<today.getMonth())
				document.searchForm.checkOutMonthYear.selectedIndex = (12-today.getMonth()+1)+(dateArray[0]-1);
			else
				document.searchForm.checkOutMonthYear.selectedIndex = (dateArray[0])-(today.getMonth());// + "" + (index +2002);
		}                                                                                                  
  	}                                                                                                  
                                                                                               






function showSearch(cityPass, statePass, countryPass, IATAnoPass){
//alert(brandCode);
//backwards compatible support
if(cityPass!=null){city=cityPass;}
if(statePass!=null){state=statePass;}
if(countryPass!=null){country=countryPass;}
if(IATAnoPass!=null){IATAno=IATAnoPass;}
//end



document.write('<script language="JavaScript" type="text/javascript" src="http://images.ichotelsgroup.com/jsquickres/JSSearchCalendar.js"></script>');
document.write('<link rel="stylesheet" type="text/css" href="http://images1.ichotelsgroup.com/css/6c_styles.css">');

document.write('<form action="http://www.ichotelsgroup.com/redirect" name="searchForm" method="POST">');
document.write('<INPUT type=hidden name=firstinput>'); 

document.write('<INPUT type="hidden" name="path" value="asearch">');
document.write('<INPUT type="hidden" name="regionCode" value="'+regionCode+'">');
document.write('<INPUT type="hidden" name="localeCode" value="'+localeCode+'">');
document.write('<INPUT type="hidden" name="brandCode" value="'+brandCode+'">');

if ((searchHI!="")||(searchEX!="")||(searchCP!="")||(searchIC!="")||(searchSB!="")||(searchCW!="")||(searchIN!=""))
{//User has set at least one individual brand to search..
	if (searchHI!="")document.write('<INPUT type="hidden" name="searchGroupCodes" value="HI">');
	if (searchEX!="")document.write('<INPUT type="hidden" name="searchGroupCodes" value="EX">');
	if (searchCP!="")document.write('<INPUT type="hidden" name="searchGroupCodes" value="CP">');
	if (searchIC!="")document.write('<INPUT type="hidden" name="searchGroupCodes" value="IC">');
	if (searchSB!="")document.write('<INPUT type="hidden" name="searchGroupCodes" value="SB">');
	if (searchCW!="")document.write('<INPUT type="hidden" name="searchGroupCodes" value="CW">');
	if (searchIN!="")document.write('<INPUT type="hidden" name="searchGroupCodes" value="IN">');
}
else //user wants to search all brands
{
	document.write('<INPUT type="hidden" name="searchGroupCodes" value="all">');
}


                                                                                           


document.write('<table width="258" border="0" cellpadding="0" cellspacing="0">'); 
document.write('	<tr>'); 
if(hotelCode=="")
	{
		document.write('		<td><a href="http://www.ichotelsgroup.com/h/d/6c/1/en/hotelsearch"><img  src="http://images1.ichotelsgroup.com/cq/etc/media_library/common/1/en/qres.Par.0001.Image.gif" height="28" width="258" border="0"></a></td>'); 
	}
else
	{
		document.write('		<td width="252" height="28" class="qresHeader" nowrap>&nbsp;&nbsp;&nbsp;RESERVE THIS HOTEL</td>');
	}
document.write('	</tr>'); 
document.write('	<tr>'); 
document.write('		<td colspan="1"><img  src="http://images1.ichotelsgroup.com/cq/etc/media_library/common.Par.0001.Image.gif" height="1" width="258"></td>'); 
document.write('	</tr>'); 
document.write('</table>'); 

document.write('<table width="258" border="0" cellspacing="0" cellpadding="0" class=qresHome>');
document.write('	<tr>');
document.write('	<td height=1 bgcolor="ffffff"></td>');
document.write('	</tr>');
document.write('	<tr>');
document.write('	<td>');
document.write('	<table width="100%" border="0" cellspacing="3" cellpadding="0">');
document.write('	<tr>');
document.write('	<td>');
document.write('	<table width="100%" border="0" cellspacing="0" cellpadding="0" class=qresHome>');
document.write('	');
if(hotelCode=="")
	{
		document.write('	<tr> ');
		document.write('     <td> ');
		document.write('        <table width="100%" border="0" cellspacing="0" cellpadding="0" class=qresHome>');
		document.write('          <tr class=qresHome> ');
		document.write('            <td colspan="2" >');
		document.write('              <table width="100%" border="0" cellspacing="0" cellpadding="0" class=qresHome>');
		document.write('                 <tr class=qresHome> ');
		document.write('                  <td align="left">City:</td>');
		document.write('                  <td align="right">State/Prov. (US/Canada)</td>');
		document.write('                 </tr>');
		document.write('              </table>');
		document.write('            </td>');
		document.write('          </tr>');
		document.write('          <tr> ');
		document.write('           <td width="50%">');
		document.write('              <input type="text" name="city" width="115" size="18" maxlength="35" class="f12quickres" value="'+city+'">');
		document.write('            </td>');
		document.write('            <td width="50%" align="left">&nbsp;&nbsp;');
		document.write('              <select name=stateId class="f12quickres">');
		writeStateId(state);
		document.write('        </select>');
		document.write('            </td>');
		document.write('          </tr>');
		document.write('          <tr>');
		document.write('            <td width="50%">Country:</td>');
		document.write('            <td width="50%"></td>');
		document.write('          </tr>');
		document.write('          <tr>');
		document.write('            <td width="50%">');
		writeCountryId(country);
		document.write('            </td>');
		document.write('            <td width="50%"></td>');
		document.write('          </tr>');
								
		document.write('        </table>');
		document.write('      </td>');
		document.write('    </tr>');
	
		document.write('    <tr> ');
		document.write('      <td>&nbsp;</td>');
		document.write('    </tr>');
	}//end hotelCode if statement
else //hotelCode!=null
	{
		city=null;state=null;country=null;
		document.write('<INPUT type="hidden" name="hotelCode" value="'+hotelCode+'">');
	}
document.write('	<tr>');
document.write('	<td>');
document.write('	<table width="100%" border="0" cellspacing="2" cellpadding="0" bgcolor="#000000">');
document.write('	<tr>');
document.write('	<td class=qresHomeOption>');
document.write('	<table width="100%" border="0" cellspacing="3" cellpadding="0" class=qresHomeOption>');
document.write('	<tr class=qresHomeOption>');
document.write('	<td>');
document.write('	<table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('');
document.write('    <tr> ');
document.write('      <td>');
document.write('        <table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('          <tr>');
document.write('           <td>');
document.write('             <table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('               <tr>');
document.write('                 <td class="qresHomeOptionBold">Optional Travel Information</td>');
document.write('               </tr>');
document.write('               <tr>');
document.write('                 <td class="f11">Check-In Date:</td>');
document.write('               </tr>');
document.write('               <tr>');
document.write('                 <td>');
document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('                    <tr> ');
document.write('                       <td class="qresHomeOption" width="12%"> ');
document.write('                         <select name="checkInDate" class="f11" onchange=\'javascript:populateCheckOut()\'>');
document.write('							<option value="-1" ></option>');
writeSelectNumbers(32);
document.write('						  </select>');
document.write('                        </td>');
document.write('                        <td class="qresHomeOption" width="44%"> ');
document.write('                          <select name="checkInMonthYear" class="f11" onchange=\'javascript:populateCheckOut()\'>');
document.write('							<option value="-1" ></option>');
writeMonthYear();
document.write('						  </select>');
document.write('                        </td>');
document.write('                        <td class="qresHomeOption" valign="bottom" align="right" width="40%">');
document.write('							<a onclick="javascript:calendarSwap=0; javascript:showCal(\'Calendar1\')" href="#"><img  src="http://images1.ichotelsgroup.com/cq/etc/media_library/common/1/en/calendar.Par.0002.Image.gif" alt="Calendar" name="Calendar"  align="top" border="0"></a>');
document.write('						</td>');
document.write('                        <td class="qresHomeOption" valign="bottom" align="left" width="4%">');
document.write('						</td>');
document.write('                      </tr>');
document.write('                    </table>');
document.write('                  </td>');
document.write('                </tr>');
document.write('                <tr>');
document.write('                  <td class="f11">Check-Out Date:</td>');
document.write('                </tr>');
document.write('                <tr>');
document.write('                  <td>');
document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class=qresHomeOption>');
document.write('                      <tr> ');
document.write('                        <td width="12%"> ');
document.write('                          <select name="checkOutDate" class="f11" onchange=\'javascript:populateCheckOut()\'>');
document.write('							 <option value="-1" ></option>');
writeSelectNumbers(32);
document.write('						  </select>');
document.write('                        </td>');
document.write('                        <td width="44%"> ');
document.write('                          <select name="checkOutMonthYear" class="f11" onchange=\'javascript:populateCheckOut()\'>');
document.write('                          	<option value="-1" ></option>');
writeMonthYear();
document.write('						  </select>');
document.write('                        </td>');
document.write('                        <td class="qresHomeOption" valign="bottom" align="right" width="40%">');
document.write('							<a href="javascript:calendarSwap=1; javascript:showCal(\'Calendar1\')"><img  src="http://images1.ichotelsgroup.com/cq/etc/media_library/common/1/en/calendar.Par.0002.Image.gif" alt="Calendar" name="Calendar" align="top" border="0"></a>');
document.write('						</td>');
document.write('                        <td class="qresHomeOption" valign="bottom" align="left" width="4%">');
document.write('						</td>');

document.write('                      </tr>');
document.write('                    </table>');
document.write('                  </td>');
document.write('                </tr>');
document.write('              </table>');
document.write('            </td>');
document.write(' </tr><tr>');
document.write('            <td>');
document.write('              <table width="100%" border="0" cellspacing="0" cellpadding="0" >');
document.write('                <tr> ');
document.write('                  <td height="8"></td>');
document.write('                </tr>');
document.write('                <tr> ');
document.write('                  <td> ');
document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
document.write('                      <tr class="f11"> ');
document.write('                        <td>Adult(s):</td>');
document.write('                        <td>&nbsp;</td>');
document.write('                        <td>Child(ren)</td>');
document.write('                        <td>&nbsp;</td>');
document.write('                        <td>Room(s):</td>');
document.write('                      </tr>');
document.write('                      <tr> ');
document.write('                        <td> ');
document.write('                          <select name="numberOfAdults" class="f11">');
writeSelectNumbers(21);
document.write('						  </select>');
document.write('                        </td>');
document.write('                        <td>&nbsp;</td>');
document.write('                       <td> ');
document.write('                          <select name= "numberOfChildren" class="f11">');
document.write('							<option value=0>0</option>');
writeSelectNumbers(21);
document.write('						  </select>');
document.write('                        </td>');
document.write('                        <td>&nbsp;</td>');
document.write('                        <td> ');
document.write('                          <select name="numberOfRooms" class="f11">');
writeSelectNumbers(10);
document.write('						  </select>');
document.write('                        </td>');
document.write('                      </tr>');
document.write('                    </table>');
document.write('                  </td>');
document.write('                </tr>');
document.write('                <tr> ');
document.write('                  <td height="9"></td>');
document.write('                </tr>');
if (hide_rateCode=="")  //use the rate code
{
	if(rateCode=="")
		{
		document.write('                <tr> ');
		document.write('                  <td>');
		document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
		document.write('                      <tr>');
		document.write('                        <td class="f11">Rate Preference:</td>');
		document.write('                        <td>&nbsp;</td>');
		document.write('                      </tr>');
		document.write('                      <tr>');
		document.write('                        <td>');
		document.write('                         <select name="rateTypeCodes" class="f11">');
		document.write('							<option value="6CBARC">&#34;Best Available.** &#34;');
		document.write('							<OPTION VALUE="IDAAA" >AAA-CAA*</OPTION><BR><OPTION VALUE="IDARP" >AARP*</OPTION><BR><OPTION VALUE="IMCGV" >Canadian Govt*</OPTION><BR><OPTION VALUE="IDADC" >German Automobile Club*</OPTION><BR><OPTION VALUE="IMGOV" >Gov\'t-Military*</OPTION><BR><OPTION VALUE="IVANI" >Reward Nights*</OPTION><BR><OPTION VALUE="IMSTI" >State-Gov\'t Rate*</OPTION><BR>');
		document.write('						  </select>');
		document.write('                        </td>');
		document.write('                        <td>&nbsp;</td>');
		document.write('                      </tr>');
		document.write('                    </table>');
		document.write('                  </td>');
		document.write('                </tr>');
	}
	else
	{
		document.write('<INPUT type="hidden" name="rateTypeCodes" value="'+rateCode+'">');
	}
}
else
{
	if(rateCode=="") //default rate code to best available.
		rateCode="6CBARC";
	document.write('<INPUT type="hidden" name="rateTypeCodes" value="'+rateCode+'">');
}
if(hotelCode!="")
{
	document.write('                <tr> ');
	document.write('                  <td height="9"></td>');
	document.write('                </tr>');
	document.write('                <tr> ');
	document.write('                  <td>');
	document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('                      <tr>');
	if (hide_corpNum=="")  //show corpNum field, either programmed or entry field
	{ 
		document.write('                        <td class="f11">Corporate ID:</td>');
	}
	if (hide_IATAno=="")  //show corpNum field, either programmed or entry field
	{
		document.write('                        <td class="f11">IATA #:</td>');
	}
	document.write('                      </tr>');
	document.write('                      <tr>');
	if (hide_corpNum=="")  //show corpNum field, either programmed or entry field
	{
		document.write('                        <td class="f12quickres">');
		if (corpNum!="")
		{
			document.write('							'+corpNum);
			document.write('<INPUT type="hidden" name="corpNum" value="'+corpNum+'">');
		}
		else
		{
			document.write('							<input type="text" name="corpNum" width="115" size="16" maxlength="35" class="f12quickres" value="'+corpNum+'">');
		}
		document.write('                        </td>');
	}
	else  //hide corpNum field.
	{
		document.write('<td><INPUT type="hidden" name="corpNum" value="'+corpNum+'"></td>');
	}
	if (hide_IATAno=="")  //show IATAno field, either programmed or entry field
	{
		document.write('                        <td class="f12quickres">');
		if (IATAno!="")
		{
			document.write('							'+IATAno);
			document.write('<INPUT type="hidden" name="_IATAno" value="'+IATAno+'">');
		}
		else
		{
			document.write('							 <input type="text" name="_IATAno" width="115" size="16" maxlength="35" class="f12quickres" value="'+IATAno+'">');
		}
		document.write('                        </td>');
	}
	else  //hide IATAno field.
	{
		document.write('<td><INPUT type="hidden" name="_IATAno" value="'+IATAno+'"></td>');
	}
	document.write('                      </tr>');
	document.write('                    </table>');
	document.write('                  </td>');
	document.write('                </tr>');

	document.write('                <tr> ');
	document.write('                  <td height="9"></td>');
	document.write('                </tr>');
	if (hide_GPC=="")  //show GPC field, either programmed or entry field (we can removed the entire row since this is the only object present on that row)
	{
		document.write('                <tr> ');
		document.write('                  <td>');
		document.write('                    <table width="100%" border="0" cellspacing="0" cellpadding="0">');
		document.write('                      <tr>');
		document.write('                        <td class="f11">Group Booking Code:</td>');
		document.write('                        <td class="f11">&nbsp;</td>');
		document.write('                      </tr>');
		document.write('                      <tr>');
		document.write('                        <td class="f12quickres">');
		if (GPC!="")
		{
			document.write('							'+GPC);
			document.write('<INPUT type="hidden" name="GPC" value="'+GPC+'">');
		}
		else
		{
			document.write('							 <input type="text" name="GPC" width="115" size="16" maxlength="35" class="f12quickres" value="'+GPC+'">');
		}
		document.write('                        </td>');
		document.write('                        <td>&nbsp;</td>');
		document.write('                      </tr>');
		document.write('                    </table>');
		document.write('                  </td>');
		document.write('                </tr>');
	}
	else  //hide GPC field.
	{
		document.write('<INPUT type="hidden" name="GPC" value="'+GPC+'">');
	}
	
}
else  //not a hotel code module, hide IATAno field.
	{
	if (IATAno!="")
		{
			document.write('<td><INPUT type="hidden" name="_IATAno" value="'+IATAno+'"></td>');
		}
	if (corpNum!="")
		{	
			document.write('<INPUT type="hidden" name="corpNum" value="'+corpNum+'">');
		}
	if (GPC!="")
		{	
			document.write('<INPUT type="hidden" name="GPC" value="'+GPC+'">');
		}
	}
document.write('              </table>');
document.write('            </td>');
document.write('          </tr>');
document.write('        </table>');
document.write('      </td>');
document.write('    </tr>');
document.write('	</table>');
document.write('	</td></tr></table></td></tr></table></td></tr>');
document.write('    <tr> ');
document.write('      <td>');
document.write('        <table width="100%" border="0" cellspacing="0" cellpadding="0" class=qresHome>');
document.write('          <tr>');
document.write('            <td>&nbsp;</td>');
document.write('            <td align=center><font size="2" face="Arial, Helvetica, sans-serif">');
if(hotelCode=="")
	{
		document.write('        <input type="image" src="http://images1.ichotelsgroup.com/cq/etc/media_library/cn/0/en/reservation/qres.Par.0002.Image.gif" name="smartQuickSearch">');
	}
else
	{
		document.write('        <input type="image" src="http://images1.ichotelsgroup.com/cq/etc/media_library/cn/0/en/reservation/qres.Par.0004.Image.gif" name="hotelDetailAvailabilitySearch">');
	}
document.write('        </font></td>');
document.write('          </tr>');
document.write('        </table>');
document.write('      </td>');
document.write('    </tr>');
document.write('  </table>');
document.write('  </td>');
document.write('  </tr>');
document.write(' </table>');
document.write('  </td>');
document.write('  </tr>');
document.write('  </table>');

document.write('  </form>');
document.close();


	
}

