function winOpen() {
	var a = arguments;
	var n,f,s,w,h,t,l;
	n = (a[1]) ? a[1] : 'child';
	f = (a[6]) ? a[6].toString() : null;
	s = (f && f.search(/scrollbars=(1|true)/) != -1);
	w = a[2];
	h = a[3];
	t = (a[4]) ? a[4] : 0;
	l = (a[5]) ? a[5] : 0;
	child = window.open(a[0],n,'width='+w+',height='+h+',top='+t+',left='+l+',directories=0,'+f);
	setTimeout('child.focus()',100);
	if(f && f.search(/temp=(1|true)/) != -1) window.onfocus = function(){ if(window.child) child.close(); child = null };
}


function WriteToday() {
    var now = new Date();
    var days = new Array(
      'Sun','Mon','Tues',
      'Wed','Thurs','Fri','Sat');
    var months = new Array(
      'January','February','March','April','May',
      'June','July','August','September','October',
      'November','December');
    var year = now.getYear();
    year = (year < 1000) ? year + 1900 : year;
    var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
    today =  days[now.getDay()] + ", " +
       months[now.getMonth()] + " " +
       date + ", " +
       year;
     document.write(today);
}

//build booking engine string and add Google analytics variables to the end of it 

function bookingString(theBookString){

	var nights= document.resform.Length[document.resform.Length.selectedIndex].text;
	var Adults= document.resform.Adults[document.resform.Adults.selectedIndex].text;
	var Children= document.resform.Children[document.resform.Children.selectedIndex].text;
	var rooms= "1";
	var DateIn = document.resform.DateIn.value;
	var hotelID = document.resform.HotelID.value;

	var cutToGoogleVariables = theBookString.substring(45);
	var NewBookString = "https://reservations.ihotelier.com/istay.cfm?&HotelID="+hotelID+"&LanguageID=1&Rooms=1&DateIn="+ DateIn +"&Length= "+nights+"&Adults="+Adults+"&Children="+Children+"&";
	NewBookString +=  cutToGoogleVariables;
	document.resform.action = NewBookString;
}