// JavaScript Document 

// Build Date selection controls
	function dateSelection(theUnitName,theUnitNumber,theUnitWebPage)
	 	{
			var monthname = new Array("January","Feburary","March","April","May","June","July","August","September","October","November","December");
			var monthdays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);			
			
			today = new Date()
									
			outstr = "<table border='1' cellspacing='0' cellpadding='1'>";
			outstr = outstr + "<tr bgcolor='ffffff'>";
			outstr = outstr + "<td>";
			outstr = outstr +  "<table cellspacing='0' cellpadding='3' border='1' width='100%'>";
			outstr = outstr +  "<tr bgcolor='FFF6F7'>";															 
			outstr = outstr +  "<td colspan='4' align='center'><b>Select Your Arrival Date and # of Nights</td></tr>";
			outstr = outstr +  "<tr bgcolor='FFF6F7'>";
			outstr = outstr +  "<td align='center'>Month<br>";
			outstr = outstr +  "<Select name='zmonth' style='font-size: 9.5pt'>";
			for (x=0; x<=11; x++)
				{
						if (today.getMonth() == x)  
						 	{outstr = outstr +   "<option value='" + (x+1) + "' selected>" + monthname[x] + "</option>"};
							else
							{outstr = outstr +  "<option value='" + (x+1) + "'>" + monthname[x] +"</option>"};
				}
		 outstr = outstr +  "</select";	
		 outstr = outstr +  "</td>";
		 outstr = outstr +  "<td align='center'>Day<br>";
		 outstr = outstr +  "<Select name='zday' style='font-size: 9.5pt'>";
		 numofdays = monthdays[today.getMonth()];
		 for (x=0;x <= numofdays-1; x++)
		 		{
					if (today.getDate()-1 == x)
						{	outstr = outstr +  "<option selected>" + (x+1) + "</option>"; }
						else
						{	outstr = outstr +  "<option>" + (x+1) + "</option>"; }
				}
		 outstr = outstr +  "</select";
		 outstr = outstr +  "</td>";
		 outstr = outstr +  "<td align='center'>Year<br>";
		 outstr = outstr +  "<Select name='zyear' style='font-size: 9.5pt'>";
		 thisyear = today.getFullYear();	
		 outstr = outstr +  "<option>" + thisyear + "</option>";
		 outstr = outstr +  "<option>" + (thisyear + 1) + "</option>";
		 outstr = outstr +  "</select";
		 outstr = outstr +  "</td>";
		 outstr = outstr +  "<td align='center'># of Nights<br>";
		 outstr = outstr +  "<select name='zlength' style='font-size: 9.5pt'>";
		 outstr = outstr +  "<option value='1' selected>1 Night</option>";
		 for (x = 2; x <= 14; x++)
		 		{	outstr = outstr +  "<option value='" + x + "'>" + x + " Night</option>"; }		 
		 outstr = outstr +  "</select";
		 outstr = outstr +  "</td>";
		 outstr = outstr +  "</tr></table>";
		 outstr = outstr +  "<input type='hidden' name='roomid' value='" + theUnitNumber + "'>";
		 outstr = outstr +  "<input type='hidden' name='memberid' value='6848'>";
		 outstr = outstr +  "<input type='hidden' name='zcaller' value='http://www.gocedarcreek.com/cabins/" + theUnitWebPage + "?sid=113'>";
		 outstr = outstr +  "<input type='hidden' name='cbp' value=''>";
		 outstr = outstr +  "<input type='hidden' name='showit' value='Y'>";
		 outstr = outstr +  "<input type='hidden' name='time' value='now()'>";
		 outstr = outstr +  "</td><tr><td bgcolor='FFF6F7' align='center'>";
		 outstr = outstr +  "<input type='hidden' name='javaon' value='Y'>";
		 outstr = outstr +  "<input type='submit' value='Reserve - \"" + theUnitName + "\"'>";
		 outstr = outstr +  "</td></tr></table>";
		 return outstr;
		}