function openScript(url, wname, width, height) {

var Win = window.open(url,wname,'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=yes,status=yes' );

}

var next=new Array("out", "over");
    
next["out"] = "july2005images/sisterprop.gif";
next["over"] = "july2005images/sisterprop-on.gif";
    
    
function vpersons()
{

var persons = document.getElementById('personsval').value;
  
if(persons == 0) {alert('Please select the number of persons.'); document.getElementById('personsval').focus();return false;}  

else {  return true;}
  
}


function calmini(day,month,year,cell,checkwhich)
{



if (checkwhich == 1){
document.getElementById('checkin_day').selectedIndex = day;
document.getElementById('checkin_month').selectedIndex = month;
document.getElementById('checkin_year').selectedIndex = year;
var calendar_letter = "a";

verifydate('iw_nights','checkin_day','checkin_month','checkin_year','checkout_day','checkout_month','checkout_year','0');

}

if (checkwhich == 2){
document.getElementById('checkout_day').selectedIndex = day;
document.getElementById('checkout_month').selectedIndex = month;
document.getElementById('checkout_year').selectedIndex = year;
var calendar_letter = "d";

verifydate('iw_nights','checkin_day','checkin_month','checkin_year','checkout_day','checkout_month','checkout_year','1','1');

}

for (myday=1;myday<=31;myday++){
var myid = 'cm'+myday+calendar_letter+month+year;
if (document.getElementById(myid)){
document.getElementById(myid).style.fontWeight='normal';
document.getElementById(myid).style.color='#ffffff';
}
}


document.getElementById(cell).style.fontWeight='bold';
document.getElementById(cell).style.color='#ffcc00';

}


function open_cal(id) {

if (id == 'acal'){ document.getElementById('dcal').style.display = 'none'; }
if (id == 'dcal'){ document.getElementById('acal').style.display = 'none'; }

toggle(id);

}


function toggle(id)
{

if (document.getElementById(id)){

if (document.getElementById(id).style.display == 'none'){ document.getElementById(id).style.display = 'block';  } else { document.getElementById(id).style.display = 'none';  }

}

}

function verifydate(obj,dayin,monthin,yearin,dayout,monthout,yearout,checkinout,updatecheckout){

		var dayin = $(dayin).value;
		var monthin = $(monthin).value;
		var yearin = $(yearin).value;
		var dayout = $(dayout).value;
		var monthout = $(monthout).value;
		var yearout = $(yearout).value;
		
        var url = 'booking/verifydate.cgi';
        
        var pars = 'dayout='+dayout+'&monthout='+monthout+'&yearout='+yearout+'&dayin='+dayin+'&monthin='+monthin+'&yearin='+yearin+'&checkinout='+checkinout+'&format=1';
        
        
if (checkinout == 0){ // checkin

calchange('calain',monthin,yearin,'a',dayin)     

}

if (checkinout == 1 && updatecheckout == 1){ // checkout

calchange('caldin',monthout,yearout,'d',dayout)     

}
      
var myAjax = new Ajax.Updater(
			obj, 
            url, 
            {
                method: 'post', 
                parameters: pars,
                evalScripts: true
            });
    
}


function calchange(obj,month,year,c,dayin){

		
		
        var url = 'booking/calendar_mini.cgi';
        
        var pars = 'm='+month+'&y='+year+'&c='+c+'&d='+dayin;
        
     
      
var myAjax = new Ajax.Updater(
			obj, 
            url, 
            {
                method: 'post', 
                parameters: pars,
                evalScripts: true
            });
    
}



