var portalName="Travelstay";
var servletUrl="http://www.secure-atlanticcity.com/servlet/";
var logoUrl="http://www.secure-atlanticcity.com/html/" ;
//var servletUrl="http://www.roomsinac.com/servlet/";
//var logoUrl="http://www.roomsinac.com/html/" ;

var afflogoURL = logoUrl+portalName+"/AffiliateImages/en/";
var pageCentered="Y";
var progressBar="Y"
var progressLeft=280;
var progressTop=310;
var nav=navigator.appName;
var myindate = new Date();
var myoutdate = new Date();
myindate = new Date(myindate.setDate(myoutdate.getDate()+7));
myoutdate = new Date(myoutdate.setDate(myoutdate.getDate()+8));
var inmm 	= myindate.getMonth();
var indd 	= myindate.getDate();
var inyy 	= myindate.getFullYear();
var outmm = myoutdate.getMonth();
var outdd = myoutdate.getDate();
var outyy = myoutdate.getFullYear();
var dayimagepath="images";
var nav=navigator.appName;
var uag=navigator.userAgent;
var brow="";
if (uag.indexOf("Netscape/7")>-1){
brow="NS7";
}else if (uag.indexOf("Firefox")>-1){
brow="Firefox";
}else if (uag.indexOf("Opera")>-1){
brow="Opera";
}else{
brow="IE";
}

var top_loc=""+document.location+"";
var top_str=top_loc.substring(top_loc.indexOf(".html?")+6,top_loc.length);
var value_arr = top_str.split("&");

function get_logo(){
		if (top_loc.indexOf(".html?")==-1){
		return;
		}else{
		document.images["RG_afflogo"].src=""+afflogoURL+""+value_arr[0]+"";
		document.bgColor="#"+value_arr[1]+"";
		}
}

function goHome(){
top.location=""+value_arr[4]+"";
}





function LoadCal(DateType,monthField,dayField,yearField,formName){
 dayval  = Number(document.forms[formName].elements[dayField].options[document.forms[formName].elements[dayField].selectedIndex].value);
 monthval= Number(document.forms[formName].elements[monthField].options[document.forms[formName].elements[monthField].selectedIndex].value);
 yearval = Number(document.forms[formName].elements[yearField].options[document.forms[formName].elements[yearField].selectedIndex].value);
 window.open("loadDatesIndex.asp?DateType="+DateType+"&formName="+formName+"&DayField="+dayField+"&day="+dayval+"&MonthField="+monthField+"&month="+(Number(monthval)+1)+"&YearField="+yearField+"&year="+yearval+"","calwin","width=235,height=190,top=280,left=100,location=0,status=0");
}

function setCheckOutLodInclud(theval,theday){

 //tmpInDate = new Date(document.frm1.cmbCheckInYear.options[document.frm1.cmbCheckInYear.selectedIndex].value,document.frm1.cmbCheckInMonth.options[document.frm1.cmbCheckInMonth.selectedIndex].value,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
 
  	var tmpInMY=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
	var tmpInMY_vals=tmpInMY.split("-");


	tmpmm	= tmpInMY_vals[1];
	tmpyy	= tmpInMY_vals[0];
	
	//----------------------------------------------------------- //===============
	var tmpInMY_vals3=theval.split("-");
	tmpmm3	= tmpInMY_vals3[1];
	tmpyy3	= tmpInMY_vals3[0];
	//----------------------------------------------------------- //===============
	
	
	document.forms["frm1"].elements["cmbCheckInMonth"].value	=tmpInMY_vals[1];
	document.forms["frm1"].elements["cmbCheckInYear"].value	=tmpInMY_vals[0];
	
	
       
       
	/////st///11111111/////  when u wnt to increase drop dwn length/////////////////////////// 
	// var chk_in_zzz=tmpInDate2.getDate();
	  var chk_in_zzz=theday; //===============
	

	  	var   tmpmm_in = document.frm1.cmbCheckInMonth.value;
                var  tmpyy_in = document.frm1.cmbCheckInYear.value;
	 // maxdays2 = maxdate(tmpmm,tmpyy);
	maxdays2 = maxdate(tmpmm3,tmpyy3);  //===============
	

	document.frm1.elements["cmbCheckInDate"].options.length=0;
		for (a=1; a<=maxdays2; a++){
		document.frm1.elements["cmbCheckInDate"].options[document.frm1.elements["cmbCheckInDate"].options.length] =  (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}	
			
	if (Number(chk_in_zzz)<10){
	document.frm1.cmbCheckInDate.value=  "0"+chk_in_zzz+"";
	 }else{
	 document.frm1.cmbCheckInDate.value=chk_in_zzz; 
	  }
	  ///1111//ed/////////  when u wnt to increase drop dwn length///////////////////////////
	
	//alert('maxdays2 >> '+maxdays2);
	
tmpInDate = new Date(tmpyy,tmpmm,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
       
  	if(document.frm1.language.value != null && document.frm1.language.value != "")
  	{
  		document.images["inday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDate.getDay())+"_"+document.frm1.language.value+".gif";
  	}
  	else
  	{
	 document.images["inday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDate.getDay())+".gif";
	}
// noDays = Number(document.frm1.cmbNoOfNights.options[document.frm1.cmbNoOfNights.selectedIndex].value);

/*

	 tmpOutDate = new Date(tmpInDate.setDate(tmpInDate.getDate()+1));
	document.frm1.cmbCheckOutMonth.value	= tmpOutDate.getMonth();
	document.frm1.cmbCheckOutYear.value		= tmpOutDate.getFullYear();
	
	
	var cmbCheckOutymcombo_value=document.frm1.cmbCheckOutYear.value+"-"+document.frm1.cmbCheckOutMonth.value;
	 document.frm1.cmbCheckOutymcombo.value	= cmbCheckOutymcombo_value;
	 
	
	
	
		
	/////st///2222/////  when u wnt to increase drop dwn length/////////////////////////// 
	 var zzzz=tmpOutDate.getDate();
	  	var   tmpmm = document.frm1.cmbCheckOutMonth.value;
                var  tmpyy = document.frm1.cmbCheckOutYear.value;
	  maxdays = maxdate(tmpmm,tmpyy);
	  
	document.frm1.elements["cmbCheckOutDate"].options.length=0;
		for (a=1; a<=maxdays; a++){
		document.frm1.elements["cmbCheckOutDate"].options[document.frm1.elements["cmbCheckOutDate"].options.length] =  (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}

	if (Number(zzzz)<10){
	document.frm1.cmbCheckOutDate.value=  "0"+zzzz+"";
	 }else{
	 document.frm1.cmbCheckOutDate.value=zzzz; 
	  }
	/////ed/////////  when u wnt to increase drop dwn length/////////////////////////// 
	
	  document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpOutDate.getDay())+".gif";

*/

//-----------------------------------------------------------------//===============
tmpInDate = new Date(tmpyy,tmpmm,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
       var tmpInDate2=tmpInDate;
//-----------------------------------------------------------------//===============




///st##############redooo arival/depat issue#####################
	 tmpOutDate = new Date(tmpInDate.setDate(tmpInDate.getDate()+1));
	document.frm1.cmbCheckOutMonth.value	= tmpOutDate.getMonth();
	document.frm1.cmbCheckOutYear.value		= tmpOutDate.getFullYear();
	
		//alert('tmpOutDate >> '+tmpOutDate);
	var cmbCheckOutymcombo_value=document.frm1.cmbCheckOutYear.value+"-"+document.frm1.cmbCheckOutMonth.value;
	 document.frm1.cmbCheckOutymcombo.value	= cmbCheckOutymcombo_value;
	 //alert('cmbCheckOutymcombo_value >> '+cmbCheckOutymcombo_value);
	
	 
	/////st///2222/////  when u wnt to increase drop dwn length/////////////////////////// 
	 var zzzz=tmpOutDate.getDate();
	  	var   tmpmm = document.frm1.cmbCheckOutMonth.value;
                var  tmpyy = document.frm1.cmbCheckOutYear.value;
	  maxdays = maxdate(tmpmm,tmpyy);
	
	document.frm1.elements["cmbCheckOutDate"].options.length=0;
		for (a=1; a<=maxdays; a++){
		document.frm1.elements["cmbCheckOutDate"].options[document.frm1.elements["cmbCheckOutDate"].options.length] =  (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}

	if (Number(zzzz)<10){
	document.frm1.cmbCheckOutDate.value=  "0"+zzzz+"";
	 }else{
	 document.frm1.cmbCheckOutDate.value=zzzz; 
	  }
	/////ed/////////  when u wnt to increase drop dwn length/////////////////////////// 
	 
	if(document.frm1.language.value != null && document.frm1.language.value != "")
  	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpOutDate.getDay())+"_"+document.frm1.language.value+".gif";}
	else
	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpOutDate.getDay())+".gif";}
	
///ed##############redooo arival/depat issue#####################

	  
	 
	  

//########################################
	var tmpInMY7=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
	var tmpInMY_vals7=tmpInMY7.split("-");
	tmpmm7	= tmpInMY_vals7[1];
	tmpyy7	= tmpInMY_vals7[0];
	var tmpInDate7 = new Date(tmpyy7,tmpmm7,document.forms["frm1"].elements["cmbCheckInDate"].options[document.forms["frm1"].elements["cmbCheckInDate"].selectedIndex].value,0,0,0,0);
//########################################		

	var tmpInMY1=document.forms["frm1"].elements["cmbCheckOutymcombo"].options[document.forms["frm1"].elements["cmbCheckOutymcombo"].options.selectedIndex].value;
	
	var tmpInMY_vals1=tmpInMY1.split("-");
	tmpmm	= tmpInMY_vals1[1];
	tmpyy	= tmpInMY_vals1[0];
	var tmpInDateout = new Date(tmpyy,tmpmm,document.forms["frm1"].elements["cmbCheckOutDate"].options[document.forms["frm1"].elements["cmbCheckOutDate"].selectedIndex].value,0,0,0,0);

	
	
	noDays = (tmpInDateout - tmpInDate7)/one_day;
	noDays = Math.round(noDays);
	document.forms["frm1"].cmbNoOfNights.value = noDays;

}

function setNights(){
		var tmpInMY=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
		var tmpInMY_vals=tmpInMY.split("-");
		tmpmm	= tmpInMY_vals[1];
		tmpyy	= tmpInMY_vals[0];
			
		 tmpInDate = new Date(tmpyy,tmpmm,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
		 tmpOutDate = new Date(document.frm1.cmbCheckOutYear.value,document.frm1.cmbCheckOutMonth.value,document.frm1.cmbCheckOutDate.value,0,0,0,0);
		 dateDifference = get_deference(tmpInDate,tmpOutDate);
		 if (dateDifference<1 || dateDifference>15){
		  return;
		 }
		 if (dateDifference>0){
		 document.frm1.cmbNoOfNights.selectedIndex = dateDifference-1;
		 }
}

function maxdate(mm,yy){
 if (mm==1){
  if(yy%4==0){return 29;}else{return 28;}
   }else if (mm==0 || mm==2 || mm==4 || mm==6 || mm==7 || mm==9 || mm==11){
    return 31;
  }else{
  return 30;
 }
}

function setMonthDays(name){
//alert('1111111111111111');
 /*tmpmm	= document.frm1.elements["cmbCheck"+name+"Month"].options[document.frm1.elements["cmbCheck"+name+"Month"].selectedIndex].value;
 tmpyy	= document.frm1.elements["cmbCheck"+name+"Year"].options[document.frm1.elements["cmbCheck"+name+"Year"].selectedIndex].value;*/
 
//alert('test1gggggggg >> '+name);
 	var tmpInMY=document.forms["frm1"].elements["cmbCheck"+name+"ymcombo"].options[document.forms["frm1"].elements["cmbCheck"+name+"ymcombo"].options.selectedIndex].value;
	//alert('setMonthDays>>>>'+tmpInMY);
	var tmpInMY_vals=tmpInMY.split("-");
	tmpmm	= tmpInMY_vals[1];
	tmpyy	= tmpInMY_vals[0];

/*
	maxdays = maxdate(tmpmm,tmpyy);
	alert('maxdays eeeeeee >>>>>>>>'+maxdays);
	document.frm1.elements["cmbCheckOutDate"].options.length=0;
		for (a=1; a<=maxdays; a++){
		document.frm1.elements["cmbCheck"+name+"Date"].options[document.frm1.elements["cmbCheck"+name+"Date"].options.length] = (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}
	*/
	
	/*
	selectedInd=document.frm1.elements["cmbCheck"+name+"Date"].selectedIndex; 
	document.frm1.elements["cmbCheck"+name+"Date"].options.length=28;
	toAdd=maxdays-28;
	
	for (a=0; a<toAdd; a++){
	document.frm1.elements["cmbCheck"+name+"Date"].options[document.frm1.elements["cmbCheck"+name+"Date"].options.length] = new Option(29+a,29+a); 
	}
	new_lnth=document.frm1.elements["cmbCheck"+name+"Date"].options.length;
	if (new_lnth<selectedInd+1){
	document.frm1.elements["cmbCheck"+name+"Date"].selectedIndex=document.frm1.elements["cmbCheck"+name+"Date"].options.length-1;
	}else{
	document.frm1.elements["cmbCheck"+name+"Date"].selectedIndex=selectedInd; 
	}
	*/
}


function RG_checkValues(){
  

 tmpInDate = new Date(document.frm1.cmbCheckInYear.options[document.frm1.cmbCheckInYear.selectedIndex].value,document.frm1.cmbCheckInMonth.options[document.frm1.cmbCheckInMonth.selectedIndex].value,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
 tmpOutDate = new Date(document.frm1.cmbCheckOutYear.value,document.frm1.cmbCheckOutMonth.value,document.frm1.cmbCheckOutDate.value,0,0,0,0);

 
 
 
 
 

 dateDifference = get_deference(tmpInDate,tmpOutDate);
 
//alert('dateDifference>>>>>>>>'+dateDifference);
 
 
 
 noNights = document.frm1.cmbNoOfNights.options[document.frm1.cmbNoOfNights.selectedIndex].value;
 today = new Date();
  if ((today-tmpInDate)>86400000){
   alert("Check in date can not be less than the system date");
   set_default_date();
  return;
 }

 if (dateDifference>15 || dateDifference<1){
  alert("Number of night(s) can not be greater than "+document.frm1.cmbNoOfNights.options.length+" or less than 1.\r\nPlease select again ...");
  set_default_date();
  return;
 }else{
  document.frm1.cmbNoOfNights.selectedIndex=dateDifference-1;
 }

 noOfRooms = document.frm1.cmbNoOfRooms.selectedIndex+1;
 noOfAdults = document.frm1.cmbNoOfAdults.selectedIndex+1;

if(noOfRooms>noOfAdults){
 alert("Number of adults is greater then the maximum no of adults for the rooms selected!");
 return;
}
document.frm1.action = servletUrl+portalName+".ResevationSearch";
document.frm1.submit();

}

function get_deference(ind,oud){
 ind_d = ind.getDate();
 ind_m = ind.getMonth();
 ind_y = ind.getYear();
 oud_d = oud.getDate();
 oud_m = oud.getMonth();
 oud_y = oud.getYear();
 ret_val=0;
 if (ind_y==oud_y){
  if (ind_m==oud_m){
   ret_val=oud_d-ind_d;
  }else{
   ret_val=(maxdate(ind_m,ind_y)-ind_d)+oud_d 
   }
 }else{  
  if (ind_m==11 && oud_m==0){
   ret_val=(maxdate(ind_m,ind_y)-ind_d)+oud_d
  }
 }
return ret_val;
}

function showCal(img,seltype){
    document.getElementById("calWin").style.zIndex="100";
	document.getElementById("calWin").style.left=getPos("left",img)+30+"px";
	document.getElementById("calWin").style.top=getPos("top",img)-86+"px";
	document.getElementById("calWin").style.width="214px";
	document.getElementById("calWin").style.height="220px";
	document.frm1.Hidseltypesdate.value = seltype;
//	alert('document.frm1.Hidseltypesdate.value >>'+document.frm1.Hidseltypesdate.value);
	var tmpInMY=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
	//alert(tmpInMY);
	var tmpInMY_vals=tmpInMY.split("-");
	tmpmm	= tmpInMY_vals[1];
	tmpyy	= tmpInMY_vals[0];
	
	var tmpInMY1=document.forms["frm1"].elements["cmbCheckOutymcombo"].options[document.forms["frm1"].elements["cmbCheckOutymcombo"].options.selectedIndex].value;
	//alert(tmpInMY);
	var tmpInMY_vals1=tmpInMY1.split("-");
	tmpmm1	= tmpInMY_vals1[1];
	tmpyy1	= tmpInMY_vals1[0];
	
        tmpmonthtocal=tmpmm;
	tmpyeartocal=tmpyy;
	if(seltype == "Out"){
	tmpmonthtocal=tmpmm1;
		tmpyeartocal=tmpyy1;
	}
	window.frames[0].location.href ="http://www.travelstay.com/loadDatesinclude.asp?DateType=Check-"+seltype+" date&FormName=frm1&"+
	"DayField=cmbCheck"+seltype+"Date&day="+document.forms["frm1"].elements["cmbCheck"+seltype+"Date"].options[parent.document.forms["frm1"].elements["cmbCheck"+seltype+"Date"].selectedIndex].value+""+
	"&MonthField=cmbCheck"+seltype+"Month&month="+(Number(tmpmonthtocal)+1)+""+
	"&YearField=cmbCheck"+seltype+"Year&year="+tmpyeartocal+"&yearout="+tmpyy1+"&yearin="+tmpyy+"&fromdayz="+document.forms["frm1"].elements["cmbCheckInDate"].options[parent.document.forms["frm1"].elements["cmbCheckInDate"].selectedIndex].value+""+
	"&todayz="+document.forms["frm1"].elements["cmbCheckOutDate"].options[parent.document.forms["frm1"].elements["cmbCheckOutDate"].selectedIndex].value+""+
	"&frommonthz="+tmpmm+"&tomonthz="+tmpmm1+"&afftCode=RA&langCode="+escape(document.frm1.language.value)+"";/*,"calwin","width=250,height=205,top=280,left=100,toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable=0");*/
	//&langCode=en
	//window.frames[0].location.href="loadDatesinclude.asp";
	document.getElementById("calWin").style.display="block";
	//document.getElementById("calWin").style.visibility="hidden";
}

function getPos(val,img){
posObj=document.images[img];
var temp_pos=0;
if (brow=="NS7"){
		if (val=="top"){			temp_pos=document.images[img].y;
		}
		else{			temp_pos=document.images[img].x;}
	}
	else{			while(posObj.tagName!='BODY' && posObj.tagName!='HTML'){
			
			if(posObj.className != 'tabs-holder' && posObj.className != 'tab')
			{
				if (val=="top"){
					temp_pos+=posObj.offsetTop;
				}
				else{
					temp_pos+=posObj.offsetLeft;
				}
			}
		posObj=posObj.offsetParent;
		}
	}
return temp_pos;
}


function setCheckOutnewLodInclud(theval,theday){

//alert('setCheckOutnew >>  '+setCheckOutnew);
 	var tmpInMY=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
	//alert(tmpInMY);
	var tmpInMY_vals=tmpInMY.split("-");
	tmpmm	= tmpInMY_vals[1];
	tmpyy	= tmpInMY_vals[0];
	
	//----------------------------------------------------------- //===============
	var tmpInMY_vals3=theval.split("-");
	tmpmm3	= tmpInMY_vals3[1];
	tmpyy3	= tmpInMY_vals3[0];
	//----------------------------------------------------------- //===============
	
	

	var tmpInDate = new Date(tmpyy,tmpmm,document.forms["frm1"].elements["cmbCheckInDate"].options[document.forms["frm1"].elements["cmbCheckInDate"].selectedIndex].value,0,0,0,0);
								
						//alert('tmpInDate >> '+tmpInDate);		
	var tmpInMY1=document.forms["frm1"].elements["cmbCheckOutymcombo"].options[document.forms["frm1"].elements["cmbCheckOutymcombo"].options.selectedIndex].value;
	
	//alert(tmpInMY);
	var tmpInMY_vals1=tmpInMY1.split("-");
	tmpmm	= tmpInMY_vals1[1];
	tmpyy	= tmpInMY_vals1[0];
	
//alert('tmpInDate >> '+tmpInDate);

	/////st///11111111/////  when u wnt to increase drop dwn length/////////////////////////// 
	// var chk_in_zzz=tmpInDate2.getDate();
	   var chk_in_zzz=theday; //===============
	 
     //maxdays2 = maxdate(tmpmm,tmpyy);
     maxdays2 = maxdate(tmpmm3,tmpyy3);  //===============
	
	document.frm1.elements["cmbCheckOutDate"].options.length=0;
		for (a=1; a<=maxdays2; a++){
		document.frm1.elements["cmbCheckOutDate"].options[document.frm1.elements["cmbCheckOutDate"].options.length] =  (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}	
			
	if (Number(chk_in_zzz)<10){
	document.frm1.cmbCheckOutDate.value=  "0"+chk_in_zzz+"";
	 }else{
	 document.frm1.cmbCheckOutDate.value=chk_in_zzz; 
	  }
	  ///1111//ed/////////  when u wnt to increase drop dwn length///////////////////////////
	
	
	
	//-----------------------------------------------------------------//===============
	var tmpInDateout = new Date(tmpyy,tmpmm,document.forms["frm1"].elements["cmbCheckOutDate"].options[document.forms["frm1"].elements["cmbCheckOutDate"].selectedIndex].value,0,0,0,0);	
       var tmpInDate2=tmpInDateout;
       //-----------------------------------------------------------------//===============
	
	
	
//alert('tmpInDateout >> '+tmpInDateout);	
	if(document.frm1.language.value != null && document.frm1.language.value != "")
  	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDateout.getDay())+"_"+document.frm1.language.value+".gif";}
		else
	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDateout.getDay())+".gif";}
		
//	document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDateout.getDay())+".gif";
	
	noDays = (tmpInDateout - tmpInDate)/one_day;
	document.frm1.cmbCheckOutMonth.value=tmpmm;
	document.frm1.cmbCheckOutYear.value=tmpyy;

	noDays = Math.round(noDays);
	document.forms["frm1"].cmbNoOfNights.value = noDays;
	//alert('Set checkout');
	//document.getElementById("calWin").style.display="none";
	//document.getElementById("calWin").style.height="0px";
		document.getElementById("inCal").src=document.mapFrm.imagePath.value+"/RG_cal_acexp.gif";
	document.getElementById("outCal").src=document.mapFrm.imagePath.value+"/RG_cal_acexp.gif";
//	window.frames[0].location.href="calendar_achotelrooms.html";
}


function setCheckOut(){

 //tmpInDate = new Date(document.frm1.cmbCheckInYear.options[document.frm1.cmbCheckInYear.selectedIndex].value,document.frm1.cmbCheckInMonth.options[document.frm1.cmbCheckInMonth.selectedIndex].value,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
 //alert('setCheckOut >>');
  	var tmpInMY=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
	var tmpInMY_vals=tmpInMY.split("-");


	tmpmm	= tmpInMY_vals[1];
	tmpyy	= tmpInMY_vals[0];
	
	
	document.forms["frm1"].elements["cmbCheckInMonth"].value	=tmpInMY_vals[1];
	document.forms["frm1"].elements["cmbCheckInYear"].value	=tmpInMY_vals[0];
	
	tmpInDate = new Date(tmpyy,tmpmm,document.frm1.cmbCheckInDate.options[document.frm1.cmbCheckInDate.selectedIndex].value,0,0,0,0);
       var tmpInDate2=tmpInDate;
//alert('tmpInDate >> '+tmpInDate);

	/////st///11111111/////  when u wnt to increase drop dwn length/////////////////////////// 
	 var chk_in_zzz=tmpInDate2.getDate();
	
	  	var   tmpmm_in = document.frm1.cmbCheckInMonth.value;
                var  tmpyy_in = document.frm1.cmbCheckInYear.value;
	  maxdays2 = maxdate(tmpmm,tmpyy);

	document.frm1.elements["cmbCheckInDate"].options.length=0;
		for (a=1; a<=maxdays2; a++){
		document.frm1.elements["cmbCheckInDate"].options[document.frm1.elements["cmbCheckInDate"].options.length] =  (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}	
			
	if (Number(chk_in_zzz)<10){
	document.frm1.cmbCheckInDate.value=  "0"+chk_in_zzz+"";
	 }else{
	 document.frm1.cmbCheckInDate.value=chk_in_zzz; 
	  }
	  ///1111//ed/////////  when u wnt to increase drop dwn length///////////////////////////
	
	//alert('maxdays2 >> '+maxdays2);
	

	if(document.frm1.language.value != null && document.frm1.language.value != "")
  	{
  		document.images["inday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDate.getDay())+"_"+document.frm1.language.value+".gif";
  	}
  	else
  	{
		document.images["inday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDate.getDay())+".gif";
	}




//	 document.images["inday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDate.getDay())+".gif";
// noDays = Number(document.frm1.cmbNoOfNights.options[document.frm1.cmbNoOfNights.selectedIndex].value);




///st##############redooo arival/depat issue#####################
	 tmpOutDate = new Date(tmpInDate.setDate(tmpInDate.getDate()+1));
	document.frm1.cmbCheckOutMonth.value	= tmpOutDate.getMonth();
	document.frm1.cmbCheckOutYear.value		= tmpOutDate.getFullYear();
	
	var cmbCheckOutymcombo_value=document.frm1.cmbCheckOutYear.value+"-"+document.frm1.cmbCheckOutMonth.value;
	 document.frm1.cmbCheckOutymcombo.value	= cmbCheckOutymcombo_value;
	
	
	
	/////st///2222/////  when u wnt to increase drop dwn length/////////////////////////// 
	 var zzzz=tmpOutDate.getDate();
	  	var   tmpmm = document.frm1.cmbCheckOutMonth.value;
                var  tmpyy = document.frm1.cmbCheckOutYear.value;
	  maxdays = maxdate(tmpmm,tmpyy);
	  
	document.frm1.elements["cmbCheckOutDate"].options.length=0;
		for (a=1; a<=maxdays; a++){
		document.frm1.elements["cmbCheckOutDate"].options[document.frm1.elements["cmbCheckOutDate"].options.length] =  (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}

	if (Number(zzzz)<10){
	document.frm1.cmbCheckOutDate.value=  "0"+zzzz+"";
	 }else{
	 document.frm1.cmbCheckOutDate.value=zzzz; 
	  }
	/////ed/////////  when u wnt to increase drop dwn length/////////////////////////// 
	
	if(document.frm1.language.value != null && document.frm1.language.value != "")
  	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpOutDate.getDay())+"_"+document.frm1.language.value+".gif";}
	else
	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpOutDate.getDay())+".gif";}
	
	//  document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpOutDate.getDay())+".gif";
///st##############redooo arival/depat issue#####################
	

	  
//########################################
	var tmpInMY6=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
	var tmpInMY_vals6=tmpInMY6.split("-");
	tmpmm6	= tmpInMY_vals6[1];
	tmpyy6	= tmpInMY_vals6[0];
	var tmpInDate6 = new Date(tmpyy6,tmpmm6,document.forms["frm1"].elements["cmbCheckInDate"].options[document.forms["frm1"].elements["cmbCheckInDate"].selectedIndex].value,0,0,0,0);
//########################################		
	 

	var tmpInMY1=document.forms["frm1"].elements["cmbCheckOutymcombo"].options[document.forms["frm1"].elements["cmbCheckOutymcombo"].options.selectedIndex].value;
	var tmpInMY_vals1=tmpInMY1.split("-");
	tmpmm	= tmpInMY_vals1[1];
	tmpyy	= tmpInMY_vals1[0];
	var tmpInDateout = new Date(tmpyy,tmpmm,document.forms["frm1"].elements["cmbCheckOutDate"].options[document.forms["frm1"].elements["cmbCheckOutDate"].selectedIndex].value,0,0,0,0);
	
	
	
	noDays = (tmpInDateout - tmpInDate6)/one_day;
	noDays = Math.round(noDays);
	document.forms["frm1"].cmbNoOfNights.value = noDays;
	
}



function setCheckOutnew(){


 	var tmpInMY=document.forms["frm1"].elements["cmbCheckInymcombo"].options[document.forms["frm1"].elements["cmbCheckInymcombo"].options.selectedIndex].value;
	//alert(tmpInMY);
	var tmpInMY_vals=tmpInMY.split("-");
	tmpmm	= tmpInMY_vals[1];
	tmpyy	= tmpInMY_vals[0];
	
	var tmpInDate = new Date(tmpyy,tmpmm,document.forms["frm1"].elements["cmbCheckInDate"].options[document.forms["frm1"].elements["cmbCheckInDate"].selectedIndex].value,0,0,0,0);
								
						//alert('tmpInDate >> '+tmpInDate);		
	var tmpInMY1=document.forms["frm1"].elements["cmbCheckOutymcombo"].options[document.forms["frm1"].elements["cmbCheckOutymcombo"].options.selectedIndex].value;
								
	//alert(tmpInMY);
	var tmpInMY_vals1=tmpInMY1.split("-");
	tmpmm	= tmpInMY_vals1[1];
	tmpyy	= tmpInMY_vals1[0];
	var tmpInDateout = new Date(tmpyy,tmpmm,document.forms["frm1"].elements["cmbCheckOutDate"].options[document.forms["frm1"].elements["cmbCheckOutDate"].selectedIndex].value,0,0,0,0);

	
	/***
	* 
	*  
	*
	*/
	
		
       var tmpInDate2=tmpInDateout;
//alert('tmpInDate >> '+tmpInDate);

	/////st///11111111/////  when u wnt to increase drop dwn length/////////////////////////// 
	 var chk_in_zzz=tmpInDate2.getDate();
     maxdays2 = maxdate(tmpmm,tmpyy);

	document.frm1.elements["cmbCheckOutDate"].options.length=0;
		for (a=1; a<=maxdays2; a++){
		document.frm1.elements["cmbCheckOutDate"].options[document.frm1.elements["cmbCheckOutDate"].options.length] =  (a<10)? new Option("0"+a+"","0"+a+"") : new Option(a,a); 
		}	
			
	if (Number(chk_in_zzz)<10){
	document.frm1.cmbCheckOutDate.value=  "0"+chk_in_zzz+"";
	 }else{
	 document.frm1.cmbCheckOutDate.value=chk_in_zzz; 
	  }
	  ///1111//ed/////////  when u wnt to increase drop dwn length///////////////////////////
	
	
	
	
	
	
	
//alert('tmpInDateout >> '+tmpInDateout);	
if(document.frm1.language.value != null && document.frm1.language.value != "")
  	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDateout.getDay())+"_"+document.frm1.language.value+".gif";}
	else
	{document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDateout.getDay())+".gif";}
	
	//document.images["outday"].src=document.mapFrm.imagePath.value+"/RG_dd"+(tmpInDateout.getDay())+".gif";
	
	noDays = (tmpInDateout - tmpInDate)/one_day;
	document.frm1.cmbCheckOutMonth.value=tmpmm;
	document.frm1.cmbCheckOutYear.value=tmpyy;

	noDays = Math.round(noDays);
	document.forms["frm1"].cmbNoOfNights.value = noDays;
	//document.getElementById("calWin").style.display="none";
	//document.getElementById("calWin").style.height="0px";
	document.getElementById("inCal").src=document.mapFrm.imagePath.value+"/RG_cal_acexp.gif";
	document.getElementById("outCal").src=document.mapFrm.imagePath.value+"/RG_cal_acexp.gif";
//	window.frames[0].location.href="calendar_achotelrooms.html";
}

