var date = new Date();
var year = date.getFullYear();

coma="'";
aff_html1  ='<form name="form1" action="/cgi-fbin/HotelReservation/User/find-hotel.pl" method="post" enctype="multipart/form-data"> \n';
aff_html1 +='<INPUT  Type="hidden" name="hname" VALUE="';



aff_html1a ='"><INPUT  Type="hidden" name="htype" VALUE="Any Hotel Type"> \n';
aff_html1a +='<INPUT TYPE="HIDDEN" name="affid" value="';


aff_html1b ='"><INPUT  Type="hidden" name="hlocation" VALUE="Any Location">  \n'; 
aff_html1b +='<table align=center BORDER=1 CELLSPACING=0 CELLPADDING=0 COLS=3 WIDTH="412" style="border - collapse: collapse" bordercolor="#cccccc">  \n';
aff_html1b +='<tr BGCOLOR="#cccccc"><td align=center><font size=2>';

aff_html2 ='</font></td></tr>\n';
aff_html2 +='<tr><td ALIGN=CENTER VALIGN=TOP>\n';
aff_html2 +='<table BORDER=0 BGCOLOR="#ffffff" CELLSPACING=0 CELLPADDING=2 WIDTH="410" id="shit"> \n';
aff_html2 +='<tr > \n';
aff_html2 +='<td WIDTH="130">&nbsp;</td> \n';
aff_html2 +='<td WIDTH="267">&nbsp;</td> \n';
aff_html2 +='<td WIDTH="13">&nbsp;</td> \n';
aff_html2 +='</tr> \n';

aff_html2 +='<tr> \n';
aff_html2 +='<td valign="center" align="right">check in&nbsp;&nbsp;</td> \n';
aff_html2 +='<td valign="top"> \n';
aff_html2 +='<select name="gcid"> \n';
aff_html2 +=' <option  >------ \n';
aff_html2 +=' <option  VALUE="1">1 \n';
aff_html2 +=' <option  VALUE="2">2 \n';
aff_html2 +=' <option  VALUE="3">3 \n';
aff_html2 +=' <option  VALUE="4">4 \n';
aff_html2 +=' <option  VALUE="5">5 \n';
aff_html2 +=' <option  VALUE="6">6 \n';
aff_html2 +=' <option  VALUE="7">7 \n';
aff_html2 +=' <option  VALUE="8">8 \n';
aff_html2 +=' <option  VALUE="9">9 \n';
aff_html2 +=' <option  VALUE="10">10 \n';
aff_html2 +=' <option  VALUE="11">11 \n';
aff_html2 +=' <option  VALUE="12">12 \n';
aff_html2 +=' <option  VALUE="13">13 \n';
aff_html2 +=' <option  VALUE="14">14 \n';
aff_html2 +=' <option  VALUE="15">15 \n';
aff_html2 +=' <option  VALUE="16">16 \n';
aff_html2 +=' <option  VALUE="17">17 \n';
aff_html2 +=' <option  VALUE="18">18 \n';
aff_html2 +=' <option  VALUE="19">19 \n';
aff_html2 +=' <option  VALUE="20">20 \n';
aff_html2 +=' <option  VALUE="21">21 \n';
aff_html2 +=' <option  VALUE="22">22 \n';
aff_html2 +=' <option  VALUE="23">23 \n';
aff_html2 +=' <option  VALUE="24">24 \n';
aff_html2 +=' <option  VALUE="25">25 \n';
aff_html2 +=' <option  VALUE="26">26 \n';
aff_html2 +=' <option  VALUE="27">27 \n';
aff_html2 +=' <option  VALUE="28">28 \n';
aff_html2 +=' <option  VALUE="29">29 \n';
aff_html2 +=' <option  VALUE="30">30 \n';
aff_html2 +=' <option  VALUE="31">31 \n';
aff_html2 +='</select> \n';

aff_html2 +='<select name="gcim"> \n';
aff_html2 +=' <option  >------ \n';
aff_html2 +=' <option  VALUE="1">January \n';
aff_html2 +=' <option  VALUE="2">February \n';
aff_html2 +=' <option  VALUE="3">March \n';
aff_html2 +=' <option  VALUE="4">April \n';
aff_html2 +=' <option  VALUE="5">May \n';
aff_html2 +=' <option  VALUE="6">June \n';
aff_html2 +=' <option  VALUE="7">July \n';
aff_html2 +=' <option  VALUE="8">August \n';
aff_html2 +=' <option  VALUE="9">September \n';
aff_html2 +=' <option  VALUE="10">October \n';
aff_html2 +=' <option  VALUE="11">November \n';
aff_html2 +=' <option  VALUE="12">December \n';
aff_html2 +='</select> \n';
aff_html2 +='&nbsp;<select name="gciy" id="gciy"> \n';

for (i=year; i<=year+4; i++) {
aff_html2 +="<option value=\""+i+"\">"+i+"</option> \n";
}

aff_html2 +='</select> \n';
aff_html2 +='</td><td>&nbsp;</td></tr> \n';





aff_html2 +='<tr><td valign="center" align="right"> \n';
aff_html2 +='check out&nbsp;&nbsp;</td><td valign="top"> \n';
aff_html2 +='<select name="gcod"> \n';
aff_html2 +=' <option  >------ \n';
aff_html2 +=' <option  VALUE="1">1 \n';
aff_html2 +=' <option  VALUE="2">2 \n';
aff_html2 +=' <option  VALUE="3">3 \n';
aff_html2 +=' <option  VALUE="4">4 \n';
aff_html2 +=' <option  VALUE="5">5 \n';
aff_html2 +=' <option  VALUE="6">6 \n';
aff_html2 +=' <option  VALUE="7">7 \n';
aff_html2 +=' <option  VALUE="8">8 \n';
aff_html2 +=' <option  VALUE="9">9 \n';
aff_html2 +=' <option  VALUE="10">10 \n';
aff_html2 +=' <option  VALUE="11">11 \n';
aff_html2 +=' <option  VALUE="12">12 \n';
aff_html2 +=' <option  VALUE="13">13 \n';
aff_html2 +=' <option  VALUE="14">14 \n';
aff_html2 +=' <option  VALUE="15">15 \n';
aff_html2 +=' <option  VALUE="16">16 \n';
aff_html2 +=' <option  VALUE="17">17 \n';
aff_html2 +=' <option  VALUE="18">18 \n';
aff_html2 +=' <option  VALUE="19">19 \n';
aff_html2 +=' <option  VALUE="20">20 \n';
aff_html2 +=' <option  VALUE="21">21 \n';
aff_html2 +=' <option  VALUE="22">22 \n';
aff_html2 +=' <option  VALUE="23">23 \n';
aff_html2 +=' <option  VALUE="24">24 \n';
aff_html2 +=' <option  VALUE="25">25 \n';
aff_html2 +=' <option  VALUE="26">26 \n';
aff_html2 +=' <option  VALUE="27">27 \n';
aff_html2 +=' <option  VALUE="28">28 \n';
aff_html2 +=' <option  VALUE="29">29 \n';
aff_html2 +=' <option  VALUE="30">30 \n';
aff_html2 +=' <option  VALUE="31">31 \n';
aff_html2 +='</select> \n';
aff_html2 +='<select name="gcom"> \n';
aff_html2 +=' <option  >------ \n';
aff_html2 +=' <option  VALUE="1">January \n';
aff_html2 +=' <option  VALUE="2">February \n';
aff_html2 +=' <option  VALUE="3">March \n';
aff_html2 +=' <option  VALUE="4">April \n';
aff_html2 +=' <option  VALUE="5">May \n';
aff_html2 +=' <option  VALUE="6">June \n';
aff_html2 +=' <option  VALUE="7">July \n';
aff_html2 +=' <option  VALUE="8">August \n';
aff_html2 +=' <option  VALUE="9">September \n';
aff_html2 +=' <option  VALUE="10">October \n';
aff_html2 +=' <option  VALUE="11">November \n';
aff_html2 +=' <option  VALUE="12">December \n';
aff_html2 +='</select> \n';
aff_html2 +='&nbsp;<select name="gcoy" id="gcoy"> \n';

for (i=year; i<=year+4; i++) {
aff_html2 +="<option value=\""+i+"\">"+i+"</option> \n";
}

aff_html2 +='</select></td> \n';
aff_html2 +='<td>&nbsp;</td></tr> \n';






aff_html2 +='<tr><td valign="center" align="right"> \n';
aff_html2 +='jumlah kamar&nbsp;&nbsp;</td><td valign="top"> \n';
aff_html2 +='<input  type="text" name="gqty" value="1" size="3" maxlength="3">&nbsp;<INPUT TYPE="hidden" NAME="mode" VALUE="SEARCH"><input type="submit" name="dummy" VALUE="CARI KAMAR"></td><td>&nbsp;</td></tr> \n';




aff_html3 ='<tr><td colspan="3" height="10">&nbsp;</td></tr></table> \n';
aff_html3 +='</td></tr> \n';
aff_html3 +='</table> \n';
aff_html3 +='</form> \n';




function find_hotel(xx,yy,zz){
  aff_html=aff_html1+xx+aff_html1a+zz+aff_html1b+yy+aff_html2+aff_html3;
  document.write(aff_html);
}

function local_date () {

startoffset = 7;
duration = 1;
servertz = +7;
  
theday = new Date ();
theday2 = new Date ();

theyearfirst = document.form1.gciy.options[0].value;
thetz = theday.getTimezoneOffset ();

epoch = theday.getTime () + (24 * 3600 * startoffset + 60 * thetz + 3600 * servertz) * 1000;

theday.setTime (epoch);
thedate = theday.getDate ();
themonth = theday.getMonth () + 1;
theyear = theday.getFullYear ();

theyearoffset = theyear - theyearfirst;

document.form1.gcid.options[thedate].selected = true;
document.form1.gcim.options[themonth].selected = true;
document.form1.gciy.options[theyearoffset].selected = true;

epoch2 = epoch + 24 * 3600 * duration * 1000;

theday2.setTime (epoch2);
thedate2 = theday2.getDate ();
themonth2 = theday2.getMonth () + 1;
theyear2 = theday2.getFullYear ();

theyearoffset2 = theyear2 - theyearfirst;

document.form1.gcod.options[thedate2].selected = true;
document.form1.gcom.options[themonth2].selected = true;
document.form1.gcoy.options[theyearoffset2].selected = true;

}


