function deleteTable(table)
{
 for(var count=(table.rows.length-1);count>0;count--)
	{
    	table.deleteRow(count);
	}
}
function addGuest()
{
	 var table=document.getElementById("guestTable");
	 deleteTable(table);
	 var numrooms=document.getElementById("numrooms").value;
 
	 for (var counter=0;counter<(numrooms-1);counter++)
	 {
		  var row=table.insertRow(counter+1);
		  row.vAlign="top";
		  row.align="left";
		  var cell0 = row.insertCell(0);
		  cell0.width="50px";
		  var cell1=row.insertCell(1);
		  var cell2=row.insertCell(2);
		  if(counter == 0)
		  {
		    cell1.innerHTML="<select id='adults1' name='adults'><option value='1'>1</option><option value='2' selected='selected'>2</option><option value='3'>3</option><option value='4'>4</option></select>";
		    cell2.innerHTML="<select id='noOfChildren1' name='childs'><option value='0'>0</option><option value='1'>1</option><option value='2'>2</option>";
		  }
		  if(counter == 1)
		  {		  
		    cell1.innerHTML="<select id='adults2' name='adults'><option value='1'>1</option><option value='2' selected='selected'>2</option><option value='3'>3</option><option value='4'>4</option></select>";
		    cell2.innerHTML="<select id='noOfChildren1' name='childs'><option value='0'>0</option><option value='1'>1</option><option value='2'>2</option>";
		  }
		    cell1.width="45px";		  
		    cell1.align="left";
		    cell2.width="100px";
		    cell2.align="left";
	 }
}
function formDisplay()
{

    document.write("<style>	.TESTcpYearNavigation, 	.TESTcpMonthNavigation { background-color:#6677DD; text-align:center; vertical-align:center; text-decoration:none; color:#FFFFFF; font-weight:bold; }");
	document.write("	.TESTcpDayColumnHeader, .TESTcpYearNavigation, .TESTcpMonthNavigation, .TESTcpCurrentMonthDate, .TESTcpCurrentMonthDateDisabled, .TESTcpOtherMonthDate, .TESTcpOtherMonthDateDisabled, .TESTcpCurrentDate, .TESTcpCurrentDateDisabled, .TESTcpTodayText, .TESTcpTodayTextDisabled, .TESTcpText { font-family:arial; font-size:8pt; }");
	document.write("	TD.TESTcpDayColumnHeader { text-align:right; border:solid thin #6677DD; border-width:0 0 1 0; }");
	document.write("	.TESTcpCurrentMonthDate, .TESTcpOtherMonthDate, .TESTcpCurrentDate { text-align:right; text-decoration:none; } ");
	document.write("	.TESTcpCurrentMonthDateDisabled, .TESTcpOtherMonthDateDisabled, .TESTcpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }");
	document.write("	.TESTcpCurrentMonthDate { color:#6677DD; font-weight:bold; }");
	document.write("	.TESTcpCurrentDate { color: #FFFFFF; font-weight:bold; }");
	document.write("	.TESTcpOtherMonthDate { color:#808080; }");
	document.write("	TD.TESTcpCurrentDate { color:#FFFFFF; background-color: #6677DD; border-width:1; border:solid thin #000000; }");
	document.write("	TD.TESTcpCurrentDateDisabled { border-width:1; border:solid thin #FFAAAA; }");
	document.write("	TD.TESTcpTodayText, TD.TESTcpTodayTextDisabled { border:solid thin #6677DD; border-width:1 0 0 0; }");
	document.write("	A.TESTcpTodayText, SPAN.TESTcpTodayTextDisabled { height:20px; }");
	document.write("	A.TESTcpTodayText { color:#6677DD; font-weight:bold; }");
	document.write("	SPAN.TESTcpTodayTextDisabled { color:#D0D0D0; }");
	document.write("	.TESTcpBorder { border:solid thin #6677DD; }");
	document.write("	A.datelink { FONT-WEIGHT: normal; TEXT-DECORATION: none }");
	document.write("	A.datelink:hover { FONT-WEIGHT: normal; TEXT-DECORATION: none }");
	document.write("	.search { FONT-SIZE: 14px; FONT-WEIGHT: bold; COLOR: #ffffff; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; }");
    document.write("	.document1 { FONT-SIZE: 11px; FONT-WEIGHT: bold; COLOR: #040000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; }");
    document.write("	.formButton {	BORDER: #fb8232 2px solid; 	FONT-SIZE: 8pt; FONT-WEIGHT: bold; WIDTH: 84px; COLOR: #ff6600;	FONT-FAMILY: arial; BACKGROUND-COLOR: #fdefe5; }");
    document.write("	.ftxt{ font-family: Verdana, arial; font-size: 8pt; color: #ffffff; font-weight: bold }	");
    document.write("	.fldsn{ font-family: Verdana, arial; font-size: 8pt; color: #004164; font-weight: bold; background-color: #EFE7DA; border: 1 solid #613F19 }");
    document.write("	.fldsd{ font-family: Verdana, arial; font-size: 8pt; color: #004164; font-weight: bold; background-color: #F4FAFF; border: 2 dotted #004164 }");
    document.write("    .cityStyle{ font-family: Verdana, arial; font-size: 8pt; color: #ffffff; font-weight: normal;  }  ");
    document.write("    .cityStyleHeader{ font-family: Verdana, arial; font-size: 12pt; color: #ffffff; font-weight: bold;  }");
    document.write("    .form_bg{background:url(http://www.hotelsfair.com/images/form_bg.jpg) repeat;}  .btn {BORDER-RIGHT: #FE0000 0px solid; BORDER-TOP: #FE0000 0px solid; BORDER-LEFT: #FE0000 0px solid; BORDER-BOTTOM: #FE0000 0px solid; background-image:url(http://www.hotelsfair.com/images/search_inner.jpg); width:90px; height:30px; } .btn a{BORDER-RIGHT: #FE0000 0px solid; BORDER-TOP: #FE0000 0px solid; BORDER-LEFT: #FE0000 0px solid; BORDER-BOTTOM: #FE0000 0px solid; background-image:url(http://www.hotelsfair.com/images/search_inner.jpg); width:90px; height:30px; }.btn a:hover {BORDER-RIGHT: #FE0000 0px solid; BORDER-TOP: #FE0000 0px solid; BORDER-LEFT: #FE0000 0px solid; BORDER-BOTTOM: #FE0000 0px solid; background-image:url(http://www.hotelsfair.com/images/search_inner1.jpg); width:91px; height:30px; }");
	document.write("</style>");
	document.write("<script language='JavaScript' src='http://www.hotelsfair.com/box/jscript/calendar/CalendarPopup.js'></script>");
	document.write("<script languag='JavaScript' src='http://www.hotelsfair.com/box/jscript/calendar/AnchorPosition.js'></script>");
	document.write("<script languagE='JavaScript' src='http://www.hotelsfair.com/box/jscript/calendar/date.js'></SCRIPT>");
	document.write("<script languagE='JavaScript' src='http://www.hotelsfair.com/box/jscript/calendar/PopupWindow.js'></script>");
	document.write("<script language='JavaScript' src='http://www.hotelsfair.com/box/jscript/calendar/validate_instant.js'></script>");
	document.write("<iframe id='theframe' style='position:absolute; display: none' ></iframe>");
	document.write("<div id='testdiv1' style='position:absolute; visibility:hidden;background-color:white;layer-background-color:white;'></div>");	
	document.write("<form method='post' name='searchHotel'  action='http://www.hotelsfair.com/worldwidehotelresult.aspx'>");
	document.write("<table valign=top class='form_bg' style='width:225px' cellspacing='0' cellpadding='0' border='0' >");
	document.write("<tr class='cityStyleHeader'><td colspan='3'>Select a Destination</td></tr>");
	document.write("<tr class='cityStyle'><td><input id='city1' checked='checked'  name='city' type='radio' value='Berlin,Germany-BER' />Berlin</td>");
    document.write("<td ><input id='city2'  name='city' type='radio' value='Dubai,United Arab Emirates-DXB' />Dubai</td>");
    document.write("<td><input id='city3'  name='city' type='radio' value='London,United Kingdom-LON' />London </td></tr>");
    document.write("<tr  class='cityStyle'><td><input id='city4'  name='city' type='radio' value='Miami,Usa-MIA' />Miami</td>");
    document.write("<td> <input id='city5'  name='city' type='radio' value='Chicago,Usa-CHI' />Chicago</td>");
    document.write("<td> <input id='city6'  name='city' type='radio' value='Paris,France-PAR' />Paris</td></tr>");
    document.write("<tr  class='cityStyle'><td><input id='city7'  name='city' type='radio' value='Basel,Switzerland-BSL' />Basel</td>");
    document.write("<td> <input id='city8'  name='city' type='radio' value='Madrid,Spain-MAD' />Madrid</td>");
    document.write("<td> <input id='city9'  name='city' type='radio' value='Davos,Switzerland-ZDV' />Davos</td></tr>");
	document.write("<tr  class='cityStyle'><td><input id='city10'  name='city' type='radio' value='Rome,Italy-ROM' />Rome</td>");
    document.write("<td> <input id='city11'  name='city' type='radio' value='Toronto,Canada-YTO' />Toronto</td>");
    document.write("<td> <input id='city12'  name='city' type='radio' value='Zurich,Switzerland-ZRH' />Zurich</td></tr>");
    document.write("<tr class='ftxt'><td colSpan='2' >Select Date</td><td></td></tr>");	
    document.write("<tr class='cityStyle'><td>Check-in </td>");
	document.write("<td colspan='2'><input type='text' name='txtCheck_in' id='txtCheck_in' size='14' maxLength=10 value='dd/mm/yyyy' class='fldsn'>");
    document.write("<A class=datelink HREF='#' onClick=\"calCheck_in.select(document.searchHotel.txtCheck_in,'anchorCheck_in','dd/MM/yyyy'); positionIFrame(); return false;\" NAME='anchorCheck_in' ID='anchorCheck_in'>");
	document.write("&nbsp;<img id='txtCheckIn_img' src='http://www.hotelsfair.com/images/show-calendar.gif' width='16' height='16' style='cursor:pointer' title='Calendar' onMouseOver=\"window.status='Date Picker'; return true;\" onMouseOut=\"window.status=''; return true;\" border=0 ></A>");
	document.write("&nbsp;</td></tr>");	
	document.write("<tr height=7><td colspan=3></td></tr>");
	document.write("<tr class='cityStyle'><td>Check-out</td>");
	document.write("<td colspan='2'><input type='text' name='txtCheck_out' id='txtCheck_out' size='14' maxLength=10 value='dd/mm/yyyy'  class='fldsn'>");
	document.write("<A class=datelink HREF='#' onClick=\"callMe();  calCheck_out.select(document.searchHotel.txtCheck_out,'anchorCheck_out','dd/MM/yyyy'); positionIFrame(); return false;\" NAME='anchorCheck_out' ID='anchorCheck_out'>");
	document.write("&nbsp;<img id='txtCheckout_img' src='http://www.hotelsfair.com/images/show-calendar.gif' width='16' height='16' style='cursor:pointer' title='Calendar' onMouseOver=\"window.status='Date Picker'; return true;\" onMouseOut=\"window.status=''; return true;\" border=0 ></A>");
	document.write("</td></tr>");
	document.write("<tr><td colspan='3' class='fldsn'> Rooms and Guests </td></tr>");
	document.write("<tr><td align='left' colspan='3'>");
	document.write("<table style='width: 200px'>");
    document.write("<tr class='ftxt'><td width='50px'> Rooms</td><td width='50px''>Adults</td><td width='75px'>Children</td></tr>");
	document.write("<tr><td width='53px'><select id='numrooms' name='numrooms' onchange='addGuest();' >");
    document.write("<option value='1'>1</option><option value='2'>2</option><option value='3'>3</option>");
    document.write("</select></td>");
	document.write("<td width='50px'><select id='adults' name='adults'>");
    document.write("<option value='1'>1</option><option value='2' selected='selected'>2</option><option value='3'>3</option><option value='4'>4</option></select></td>");
   document.write("<td width='100px'> <select id='children' name='childs' onchange='addGuest();'>");
   document.write("<option value='0' selected='selected'>0</option><option value='1'>1</option><option value='2'>2</option></select></td></tr></table>");
   document.write("<table id='guestTable'><tr><td width='50px' align='center'></td><td width='50px' align='center'></td><td width='75px' align='center'></td></tr></table>");
   document.write("</td></tr>");
   document.write("<tr class='ftxt'><td colspan='3'><input type='checkbox' id='ChkIndia' name='ChkIndia' value='1'>&nbsp;&nbsp;I am a Resident of India.</td></tr>");   document.write("<tr class='ftxt'><td colspan='3'>&nbsp;</td></tr>");   document.write("<tr> <td>&nbsp;</td><td> <input class='btn' id='Button1' type='Submit' value='.' onClick='return ValidateFormInstant();'    /></td><td> &nbsp;</td>");
   document.write("</tr></table>");
   document.write("</form>");           
}
