function fnToday()
	{		
		var strDate = new Date();
		var str_out_Date = new Date();
		str_out_Date.setDate(str_out_Date.getDate()+1);
		var os_today="Win"
		var ie_today=false;
		var op_today=false;
		var bn_today=navigator.platform;
		var bw_today=navigator.userAgent;
		var checkInYear=strDate.getFullYear();
		var checkOutYear=str_out_Date.getFullYear();
		var checkInMonth=strDate.getMonth()+1;
		var checkInDay=strDate.getDate();
		var checkOutMonth=str_out_Date.getMonth()+1;
		var checkOutDay=str_out_Date.getDate();
		window.document.quicksearch.checkInDate1.value=checkInMonth+"/"+checkInDay+"/"+checkInYear
		window.document.quicksearch.checkOutDate1.value=checkOutMonth+"/"+checkOutDay+"/"+checkOutYear
		if(bn_today.indexOf("Win32")==-1)
		{
		 os_today="Mac";		 
 		 if(bw_today.indexOf("MSIE")!=-1)
		 	{				 
				//ie_today=true;
				var checkInMonth=strDate.getMonth()+parseInt(1);
				var checkInDay=strDate.getDate();
				var checkOutMonth=str_out_Date.getMonth()+parseInt(1);
				var checkOutDay=str_out_Date.getDate();
		
				window.document.quicksearch.checkInDate1.value=checkInMonth+"/"+checkInDay+"/"+checkInYear
				window.document.quicksearch.checkOutDate1.value=checkOutMonth+"/"+checkOutDay+"/"+checkOutYear
				window.document.quicksearch.numberOfNights.value=0;
			} 
		 if(bw_today.indexOf("Opera")!=-1)
		 	{
				op_today=true;
			}
		}
		 
		if(op_today)
		{		 
		var checkInMonth=strDate.getMonth()+parseInt(1);
		var checkInDay=strDate.getDate();
		var checkOutMonth=str_out_Date.getMonth()+parseInt(1);
		var checkOutDay=str_out_Date.getDate();
		
		window.document.quicksearch.checkInDate1.value=checkInMonth+"/"+checkInDay+"/"+checkInYear
		window.document.quicksearch.checkOutDate1.value=checkOutMonth+"/"+checkOutDay+"/"+checkOutYear
		window.document.quicksearch.numberOfNights.value=1;
		}
		else if(ie_today)
		{
		var checkInMonth=strDate.getMonth();
		var checkInDay=strDate.getDate()-parseInt(1);
		var checkOutMonth=str_out_Date.getMonth();
		var checkOutDay=str_out_Date.getDate()-parseInt(1);
		window.document.quicksearch.checkInDate1.value=checkInMonth+"/"+checkInDay+"/"+checkInYear
		window.document.quicksearch.checkOutDate1.value=checkOutMonth+"/"+checkOutDay+"/"+checkOutYear
		}
		else
		{
		var checkInMonth=strDate.getMonth()+parseInt(1);
		var checkInDay=strDate.getDate();
		var checkOutMonth=str_out_Date.getMonth()+parseInt(1);
		var checkOutDay=str_out_Date.getDate();
		
		window.document.quicksearch.checkInDate1.value=checkInMonth+"/"+checkInDay+"/"+checkInYear
		window.document.quicksearch.checkOutDate1.value=checkOutMonth+"/"+checkOutDay+"/"+checkOutYear
		}
	
	}


function isBlank(s)
		{
			var len,k,flg;
			flg=true;
			if(s!=null)
			{
				len=s.length;
				for(k=0;k<len;k++)
				{
					if(s.substring(k,k+1) != " ")
					flg=false;
				}
			}
			return flg;
		}
		
		var dtCh= "/";
		var minYear=1900;
		var maxYear=2100;
		
		function isInteger(s){
			var i;
		    for (i = 0; i < s.length; i++){   
		        var c = s.charAt(i);
		        if (((c < "0") || (c > "9"))) return false;
		    }
		    return true;
		}
		
		function stripCharsInBag(s, bag){
			var i;
		    var returnString = "";
		    for (i = 0; i < s.length; i++){   
		        var c = s.charAt(i);
		        if (bag.indexOf(c) == -1) returnString += c;
		    }
		    return returnString;
		}
		
		function daysInFebruary (year){
		    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
		}
		function DaysArray(n) {
			for (var i = 1; i <= n; i++) {
				this[i] = 31
				if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
				if (i==2) {this[i] = 29}
		   } 
		   return this
		}
		
		function isDate(dtStr){
			var daysInMonth = DaysArray(12)
			var pos1=dtStr.indexOf(dtCh)
			var pos2=dtStr.indexOf(dtCh,pos1+1)
			var strMonth=dtStr.substring(0,pos1)
			var strDay=dtStr.substring(pos1+1,pos2)
			var strYear=dtStr.substring(pos2+1)
			strYr=strYear
			if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
			if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
			for (var i = 1; i <= 3; i++) {
				if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
			}
			inmonth1=parseInt(strMonth)
			inday1=parseInt(strDay)
			inyear1=parseInt(strYr)
			if (pos1==-1 || pos2==-1){
				alert("The date format should be : MM/DD/YYYY")
				return false
			}
			if (strMonth.length<1 || inmonth1<1 || inmonth1>12){
				alert("Please enter a valid month")
				return false
			}
			if (strDay.length<1 || inday1<1 || inday1>31 || (inmonth1==2 && inday1>daysInFebruary(inyear1)) || inday1 > daysInMonth[inmonth1]){
				alert("Please enter a valid day")
				return false
			}
			if (strYear.length != 4 || inyear1==0 || inyear1<minYear || inyear1>maxYear){
				alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
				return false
			}
			if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
				alert("Please enter a valid date")
				return false
			}
		return true
		}
		function isDate1(dtStr){
			var daysInMonth = DaysArray(12)
			var pos1=dtStr.indexOf(dtCh)
			var pos2=dtStr.indexOf(dtCh,pos1+1)
			var strMonth=dtStr.substring(0,pos1)
			var strDay=dtStr.substring(pos1+1,pos2)
			var strYear=dtStr.substring(pos2+1)
			strYr=strYear
			if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
			if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
			for (var i = 1; i <= 3; i++) {
				if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
			}
			outmonth1=parseInt(strMonth)
			outday1=parseInt(strDay)
			outyear1=parseInt(strYr)
		return true
		}
	function fnSubmit()
	{
		
		var f = window.document.quicksearch;
		if(isBlank(f.checkInDate1.value))
		{
			alert("Please enter checkIn Date .")
			f.checkInDate1.value="";
			f.checkInDate1.focus();
			return false;
		}
		if(isBlank(f.checkOutDate1.value))
		{
			alert("Please enter checkOut Date .")
			f.checkOutDate1.value="";
			f.checkOutDate1.focus();
			return false;
		}
		if(!isDate(f.checkInDate1.value))
		{
			//alert("Please enter Date in 'MM/DD/YYYY'.")
			f.checkInDate1.value="";
			f.checkInDate1.focus();
			return false;
		}
		if(!isDate(f.checkOutDate1.value))
		{
			//alert("Please enter Date in 'MM/DD/YYYY'.")
			f.checkOutDate1.value="";
			f.checkOutDate1.focus();
			return false;
		}
		
		var arrive =window.document.quicksearch.checkInDate1.value
		var depart =window.document.quicksearch.checkOutDate1.value
		//window.document.quicksearch.arrive.value=window.document.quicksearch.checkInDate1.value
		isDate(arrive);
		var inmonth;
		if(inmonth1==1)
		{
			inmonth="January";
		}
		if(inmonth1==2)
		{
			inmonth="February";
		}
		if(inmonth1==3)
		{
			inmonth="March";
		}
		if(inmonth1==4)
		{
			inmonth="April";
		}
		if(inmonth1==5)
		{
			inmonth="May";
		}
		if(inmonth1==6)
		{
			inmonth="June";
		}
		if(inmonth1==7)
		{
			inmonth="July";
		}
		if(inmonth1==8)
		{
			inmonth="August";
		}
		if(inmonth1==9)
		{
			inmonth="September";
		}
		if(inmonth1==10)
		{
			inmonth="October";
		}
		if(inmonth1==11)
		{
			inmonth="November";
		} 
		if(inmonth1==12)
		{
			inmonth="December";
		} 
		
		isDate1(depart);
		var outmonth;
		if(outmonth1==1)
		{
			outmonth="January";
		}
		if(outmonth1==2)
		{
			outmonth="February";
		}
		if(outmonth1==3)
		{
			outmonth="March";
		}
		if(outmonth1==4)
		{
			outmonth="April";
		}
		if(outmonth1==5)
		{
			outmonth="May";
		}
		if(outmonth1==6)
		{
			outmonth="June";
		}
		if(outmonth1==7)
		{
			outmonth="July";
		}
		if(outmonth1==8)
		{
			outmonth="August";
		}
		if(outmonth1==9)
		{
			outmonth="September";
		}
		if(outmonth1==10)
		{
			outmonth="October";
		}
		if(outmonth1==11)
		{
			outmonth="November";
		} 
		if(outmonth1==12)
		{
			outmonth="December";
		} 
			
		window.document.quicksearch.inmonth.value=inmonth;
		window.document.quicksearch.inday.value=inday1;
		window.document.quicksearch.inyear.value=inyear1;
		
		window.document.quicksearch.outmonth.value=outmonth;
		window.document.quicksearch.outday.value=outday1;
		window.document.quicksearch.outyear.value=outyear1;
		
		
		
		//window.document.quicksearch.depart.value=window.document.quicksearch.checkOutDate1.value
		
		var check_In=new Date();
		check_In=new Date(arrive);

		var strCurrentDate = new Date('06/03/2009');
		if(check_In<strCurrentDate)
		{
			alert("Check-IN Date can not be passed date.");
			window.document.quicksearch.checkInDate1.focus();
			return false;
		}

		var check_Out=new Date();
		check_Out = new Date(depart);
		new_night =( check_Out - check_In);
		new_night = new_night/(24*60*60000);
		if( new_night <= 0 ) 
		{
			alert("Check-OUT Date must be greater than Check-IN Date.");
			window.document.quicksearch.checkOutDate1.focus();
			return false;
		}
	}
	//-->
	
		//calCheckIn.offsetX = 0;
	//calCheckIn.offsetY = 35;
	function changeDate(varSelectedDate)
	{		 
		var takeDay = parseInt(varSelectedDate.value);
		var SelectedcheckInDate = window.document.quicksearch.checkInDate1.value;
		var SelectedDate = new Date(SelectedcheckInDate);
		var dispDate=new Date(parseInt(SelectedDate.getMonth()+1,10) + "/" + (parseInt(SelectedDate.getDate()+takeDay)) + "/" + SelectedDate.getFullYear());
		var dispDay = dispDate.getDate();		
		var dispMonth = parseInt(dispDate.getMonth()+1,10);
		var dispYear = dispDate.getFullYear();
		
		// display check out date
		window.document.quicksearch.checkOutDate1.value=dispMonth+"/"+dispDay+"/"+dispYear;
	}
	