// JavaScript Document

	function isPastDate(strDate)
	{
		var check_In=new Date();
		check_In=new Date(strDate); 
		var strCurrentDate = new Date(date());
		if(check_In<strCurrentDate)
			return true;
		else
			return false;
	}

	function frmSubmit()
	{
		var f= window.document.quicksearch;
		var intMon=parseInt(f.checkInMonth.options[f.checkInMonth.selectedIndex].value,10);
		var intDate=parseInt(f.checkInDay.options[f.checkInDay.selectedIndex].value,10);
		var intYear=parseInt(f.checkInYear.options[f.checkInYear.selectedIndex].value,10);
		var checkindate = new Date(intMon+"/"+intDate+"/"+intYear);
		var checkinday = checkindate.getDate();
		f.checkInDate.value=checkinday;
		var checkinmonth = checkindate.getMonth();
		var checkinyear = checkindate.getFullYear();
		checkindate.setDate(checkindate.getDate()+parseInt(f.number_Nights.value));
		MM2=checkindate.getMonth()+parseInt(1);
		YY2=checkindate.getFullYear();
		DD2=checkindate.getDate();
		
		
		f.checkInMonthYear.value = checkinmonth+""+checkinyear;
		
		
		window.document.quicksearch.DateOut.value = window.document.quicksearch.MM2.value+"/"+window.document.quicksearch.DD2.value+"/"+window.document.quicksearch.YY2.value;
		window.document.quicksearch.checkOutFullDate.value=MM2+"/"+DD2+"/"+YY2;
		
		
		if(isPastDate(intMon+"/"+intDate+"/"+intYear))
		{
			alert("Check-IN Date can not be passed date.");
			f.checkInDay.focus();
			return false;
		}
		else{
			strEvent = "event1";		
			strText = "Home Page - " +"Reservation Widget";			 
			var s=s_gi('thayintermiami');s.linkTrackVars='prop1,eVar1,events';s.events="'"+strEvent+"'";s.prop1=""+strText+"";s.eVar1=""+strText+"";s.tl(this,'o', ""+strText+"");
		}
	}

	function fnToday()
	{
		var strDate = new Date();
		window.document.quicksearch.checkInMonth.value=strDate.getMonth()+parseInt(1);
		window.document.quicksearch.checkInDay.value=strDate.getDate();
		window.document.quicksearch.checkInYear.value=strDate.getFullYear();
		
	}
	
	
	function lastday(mon, yr)
	{
		var start_date= new Date(yr, mon, 1);
		var end_date= new Date(yr, mon+1, 1);
		lday =( end_date - start_date);
		lday = lday/(24*60*60000);
		return lday;
	}
	
	function idays(m,d,y)
	{
		lday=lastday(m.options[m.selectedIndex].value-1 ,
	    y.options[y.selectedIndex].value);
		d.length=lday;
	    for(i=0;i<lday;i++)
	    {
			d.options[i].text=i+1;
			d.options[i].value=i+1;
	    }
	}


