now= new Date();
								tomorrow1 = new Date();
								tomorrow1.setDate(now.getDate());
								var calendar1 = new CalendarPopup();
								calendar1.showNavigationDropdowns();
								calendar1.setDayHeaders("Su","Mo","Tu","We","Th","Fr","Sa");
								calendar1.setReturnFunction("setMultipleValues1");
								calendar1.addDisabledDates(null,formatDate(tomorrow1,"yyyy-MM-dd"));
						
								function setMultipleValues1(y,m,d) {
									 	document.searchEngine.inYear.value=y;
										document.searchEngine.inMonth.selectedIndex=m;
										for (var i=0; i<document.searchEngine.inDay.options.length; i++) {
											if (document.searchEngine.inDay.options[i].value==d) {
												document.searchEngine.inDay.selectedIndex=i;
	var defInDate = new Date(y, m, i+2);
	//var defInDate = new Date(y, m, i+1);
	document.getElementById("outDay").value=defInDate.getDate();
	document.getElementById("outMonth").value=defInDate.getMonth();
	document.getElementById("outYear").value=defInDate.getFullYear();
	countday(document.getElementById("inMonth").value+'/'+document.getElementById("inDay").value+'/'+document.getElementById("inYear").value+','+document.getElementById("outMonth").value+'/'+document.getElementById("outDay").value+'/'+document.getElementById("outYear").value,'<?=$BaseUrl?>includes/ajax/countday.php?inDay=')


												}
										}	

								}
								
								dayAfterTomorrow = new Date();
								dayAfterTomorrow.setDate(tomorrow1.getDate()+1);

								var calendar2 = new CalendarPopup();
								calendar2.showNavigationDropdowns();
								calendar2.setDayHeaders("Su","Mo","Tu","We","Th","Fr","Sa");
								calendar2.setReturnFunction("setMultipleValues2");
								calendar2.addDisabledDates(null,formatDate(dayAfterTomorrow,"yyyy-MM-dd"));
						
								function setMultipleValues2(y,m,d) {
										document.searchEngine.outYear.value=y;
										document.searchEngine.outMonth.selectedIndex=m;
										for (var i=0; i<document.searchEngine.outDay.options.length; i++) {
											if (document.searchEngine.outDay.options[i].value==d) {
												document.searchEngine.outDay.selectedIndex=i;
	countday(document.getElementById("inMonth").value+'/'+document.getElementById("inDay").value+'/'+document.getElementById("inYear").value+','+document.getElementById("outMonth").value+'/'+document.getElementById("outDay").value+'/'+document.getElementById("outYear").value,'<?=$BaseUrl?>includes/ajax/countday.php?inDay=')

												}
										}
									

								}
								
								function getDateString(y_obj,m_obj,d_obj) {
										var y = y_obj;
										var m = m_obj;
										var d = d_obj;
										if (y==""|| m==""){ return null;}
										if (d==""){ d=1; } 
										return str= y+'-'+m+'-'+d;
								}
								
								
								<!--Calendar PopUp end-->
								
	function updateCalendarReturn(){
   	           						 						
				var toSet=new Date();
				now= new Date();
				dayAfterTomorrow1 = new Date();
				dayAfterTomorrow1.setDate(now.getDate()+3);
				
                toSet.setDate(document.getElementById("inDay").value);
	            toSet.setMonth(document.getElementById("inMonth").value -1);
	            toSet.setYear(document.getElementById("inYear").value); 
				
				var calendar3 = new CalendarPopup();
				calendar3.showNavigationDropdowns();
				calendar3.setDayHeaders("Su","Mo","Tu","We","Th","Fr","Sa");
				calendar3.setReturnFunction("setMultipleValues2");
			  	if(toSet<=dayAfterTomorrow1){
						toSet = dayAfterTomorrow1;
						
					}
					
				calendar3.addDisabledDates(null,formatDate(toSet,"yyyy-MM-dd"));
				if(calendar2!=null){
				calendar2 = calendar3;
				}


   }
function countday(str,path)
{
	document.getElementById("lenstay").style.display = "none";
	var xmlreload = initxmlhttp() ;
	var url = path+str;
	xmlreload.open( "GET", url, true ) ;
	xmlreload.onreadystatechange=function()
	{
		if (xmlreload.readyState==4)
		{
			totdays = xmlreload.responseText;

			if(totdays>=0)
			{
				document.getElementById("lenstay").innerHTML = "Length of Stay : "+totdays+" night(s)" ;
				document.getElementById("lenstay").style.display = "inline";
			}
		}
	}
	xmlreload.send(null) ;
}
function fillcombo(inDay,inMonth,inYear)
{
	var defInDate = new Date(inYear, inMonth, document.getElementById("inDay").selectedIndex+2);
	document.getElementById("outDay").value=defInDate.getDate();
	document.getElementById("outMonth").value=defInDate.getMonth();
	document.getElementById("outYear").value=defInDate.getFullYear();
	countday(inMonth+'/'+document.getElementById("inDay").selectedIndex+'/'+inYear+','+document.getElementById("outMonth").value+'/'+document.getElementById("outDay").value+'/'+document.getElementById("outYear").value,'<?=$BaseUrl?>includes/ajax/countday.php?inDay=')
}