function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.01

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && d.getElementById) x=d.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}



function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}



// Use for PopUp Windows

function popUp(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}



// Used in OLE to close PopUps and return to opening window

function goBack(object){



 if (window.opener && !window.opener.closed){

  window.opener.location = "/book/"+object;

  window.close();

 }	

}

// FOR FUZZY LOGIC ON RESULTS PAGE
function popUpFixed(theURL,winName,features) {

	winName = window.open(theURL,winName,features);
    winName.focus();

}




function shipshape() {

		open("/shipshape.htm","ship","width=450,height=450,toolbar=no,scrollbars=yes,resizable=yes")

}


// Use for PopUp Windows
function popUp(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// For Image Viewer
function show(name,src) {
    if (document.images)
        document.images[name].src = src;
}

// OLE Delete Confirmation
function verify(inID, inName, Type){
	if(Type == "category"){
		if(confirm("Are you sure you want to delete the " + inName + " category?")){
			window.location="ol-delcat.pl?ID="+inID
		}
	}

	if(Type == "amenity"){
		if(confirm("Are you sure you want to delete the " + inName + " amenity?\nThis amenity will be removed from all properties that currently have it.")){
			window.location="ol-delamen.pl?ID="+inID
		}
	}

	if(Type == "manual"){
		if(confirm("Are you sure you want to delete the manually entered property data for unit "+ inName +"?")){
			window.location="ol-delmanual.pl?ID="+inID+"&PMSID="+inName
		}
	}
}


// FOR COMPARISON PAGE

function deleteProp(){
	document.compare.submit();
}

function printProp(controller, prop){
		if(controller == "house"){
			var url = "/book/house.html?print=Y&PMSUnitID="+prop+"&Instruct=Y";
			newWindow = window.open(url,"printpropcompare", "resizable=yes,toolbar=yes,menubar=yes,scrollbars=yes,height=600 width=620");
		
		}
		else{
			var url = "propprint.html?propList=" + document.compare.propList.value +"&Instruct=Y";
			newWindow = window.open(url,"printpropcompare", "resizable=yes,toolbar=yes,menubar=yes,scrollbars=yes,height=600 width=620");
		}
}

function back()
{
	var Mainform = document.forms[0];
	if (Mainform.Previous.value == "")
	{	
		alert("These are the first properties in the list.");
	}
	else
	{
		Mainform.Instruct.value = "N";
		Mainform.Next.value = Mainform.Current.value;
		Mainform.CurrentIndex.value = parseInt(Mainform.CurrentIndex.value) - 3 + ''
		Mainform.submit();
	}
}
	
function next()
{
	var Mainform = document.forms[0];
	if (Mainform.Next.value == "")
	{	
		alert("There are no more properties.");
	}
	else
	{
		Mainform.Instruct.value = "N";
		Mainform.Previous.value = Mainform.Current.value;
		Mainform.CurrentIndex.value = parseInt(Mainform.CurrentIndex.value) + 3 + ''
		Mainform.submit();
	}
}

function closeWindow(){
	window.close()
}

function update_calendar_form(DDval,MMval,YYval)
{
        document.frmRes.day.selectedIndex = DDval;
        document.frmRes.month.selectedIndex = MMval;
        document.frmRes.year.selectedIndex = YYval;
}

function printInstr(controller){
	if(controller == "house"){
		var Mainform = document.forms[0];
		if (window.print){
    		document.write('<a href="javascript:onClick=window.print()"><img src="/images/comp_but_printb.gif" width="135" height="18" border="0" alt="Print This Page"></a>');
			if (Mainform.Instruct.value == "Y"){
				popUp('/book/printinstruct2.html?Button=Y','PropCompare', 'resizable=yes,toolbar=no,menubar=no,scrollbars=yes,height=250,width=425');
			}
		}else{
			if (Mainform.Instruct.value == "Y"){
				popUp('/book/printinstruct2.html?Button=N','PropCompare', 'resizable=yes,toolbar=no,menubar=no,scrollbars=yes,height=250,width=425');
			}
		}

	}else{
		var Mainform = document.forms[0];
		if (window.print){
    		document.write('<a href="javascript:onClick=window.print()"><img src="/images/comp_but_printb.gif" width="135" height="18" border="0" alt="Print This Page"></a>');
			if (Mainform.Instruct.value == "Y"){
				popUp('/book/printinstruct.html?Button=Y','PropCompare', 'resizable=yes,toolbar=no,menubar=no,scrollbars=yes,height=250,width=425');
			}
		}else{
			if (Mainform.Instruct.value == "Y"){
				popUp('/book/printinstruct.html?Button=N','PropCompare', 'resizable=yes,toolbar=no,menubar=no,scrollbars=yes,height=250,width=425');
			}
		}
	}
}


// For amenity OLE to check that user entered last updated by

function updatebyCheck(object){
	var lastUpdateBy = object.LastUpdateBy.value;
	if (lastUpdateBy == ""){
		alert("Please enter either your name or initials in the Last Updated By field.")
		return false;
	}

}

// EMAIL A FRIEND

function MM_openBrWindow(theURL,winName,features) { //v3.0
  var myLocation = location.href;
  //alert("Location" + myLocation);
  var newLoc;

  newLoc = theURL + "?REFERER=" + escape(myLocation);
 
  //alert("newLoc" + newLoc);
  window.open(newLoc,winName,features);
}

// JavaScript Functions for use with new online booking
// chrisr - 07/26/01

function checkAgreement(object){
//	for (var i=0;i<object.elements.length;i++) {

//		alert("value: "+object.elements[i].value+" Name:"+object.elements[i].name);

		if (object.elements[0].checked != true ){
			alert("In order to continue the reservation process you must agree with the terms of this lease agreement.\nPlease check that you have checked the box on this page.")
			return false;
		}else{
			return true;
		}
    

//	}

}


function isEmail(str) {
  // are regular expressions supported?
  var supported = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported)
    return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
  return (!r1.test(str) && r2.test(str));
}


function ChkCC( pCard ) {



	var nCheckSum = 0,

		nCardNum = "",

		nDigit,

		RefString = "0246813579";

	

	// remove all extra characters from card number

	for ( var i = 0; i < pCard.length; i++) {

		nDigit = pCard.charAt( i );				// don't optimize

        if ( RefString.indexOf( nDigit ) != -1 )  

			 nCardNum += nDigit;

	}



	for ( i = 2; i <= nCardNum.length; i++ ) {			// dont count last digit

		nDigit = parseInt( nCardNum.charAt( nCardNum.length - i ));		// count backwards

		if ( i % 2 != 1 )			// odd digits get converted

			nDigit = parseInt( RefString.charAt( nDigit ));

		nCheckSum += parseInt( nDigit );

	}

	

	nDigit = nCheckSum % 10;

	if ( nDigit > 0 )

		nDigit = 10 - nDigit;

		

	return ( nDigit == nCardNum.charAt( nCardNum.length-1 ));

}



function empty( xtxt ) {

    for (var i=0; i < xtxt.length; i++) {

        if (xtxt.charAt(i) != " ")

			return false;

    }

    return true;

}



function isNum( pstr ) {

    if( pstr.length == 0) return false;

	if( empty( pstr )) return false;

    var RefString="1234567890.";

    for ( var ctr=0; ctr < pstr.length; ctr++) {

        if (RefString.indexOf( pstr.substring(ctr, ctr+1)) == -1 )  

        	return false;

    }

	return true;

}



// END From checkout.js





function checkContactInfo(object){
	controller = 0
	warning = "The following corrections are required:\n"
	if (object.FIRST.value==""){
		controller ++
		warning += controller+". Please enter your FIRST NAME.\n"
	}
	if (object.LAST.value==""){
		controller ++
		warning += controller+". Please enter your LAST NAME.\n"
		
	}
	if (object.EMAIL.value==""){
		controller ++
		warning += controller+". Please enter your EMAIL ADDRESS.\n"
		
	}else if(object.EMAIL.value!=""){
		var address = object.EMAIL.value;
		var verify = isEmail(address);
	//	alert("verify:"+verify)
		if(verify == 0){
			controller ++
			warning += controller+". You have entered an incorrect EMAIL ADDRESS.\n    Please check the address you have entered.\n"

		}
	}
	if (object.HOMEPHONE.value==""){
		controller ++
		warning += controller+". Please enter your HOME PHONE NUMBER.\n"
	}
	if (object.ADDRESS1.value==""){
		controller ++
		warning += controller+". Please enter your STREET ADDRESS.\n"
	}
	if (object.CITY.value==""){
		controller ++
		warning += controller+". Please enter your CITY.\n"
	}
	if (object.STATE.value==""){
		controller ++
		warning += controller+". Please enter your STATE.\n"
	}
	if (object.ZIP.value==""){
		controller ++
		warning += controller+". Please enter your ZIP/POSTAL CODE.\n"
	}
	if (object.ADULTS.value=="" || object.ADULTS.value < 0){
		controller ++
		warning += controller+". Please enter a valid number of ADULTS.\n"
	}
	if (object.CHILDREN.value=="" || object.CHILDREN.value < 0){
		controller ++
		warning += controller+". Please enter a valid number of CHILDREN.\n"
	}



	//Credit card section

	// Now deal with Credit Card


	//First see if they want to pay via check
	//Checkbox for paying via check needs to be last
	//var checkPay = eval(object.elements.length)-1;
	//alert ("Element:" + object.elements[checkPay].checked);

	// works 5/2/07 CR
	if(document.getElementById('yescc').checked){

		if ( empty( object.CCNUMBER.value )) {
			controller ++
			warning += "\n"+controller+". Please provide a Credit Card #";
		} else {
			if ( !ChkCC( object.CCNUMBER.value )){
				controller ++
				warning += "\n"+controller+". Credit Card Number has missing or wrong digits, please check";
			}
		}

		if ( object.CCMONTH.selectedIndex == -1 || object.CCYEAR.selectedIndex == -1 ) {
			controller ++
			warning += "\n"+controller+". Please provide a Credit Card Expiration Date";
		} else {
			// check format of exp date
			var mn = parseInt( object.CCMONTH.options[object.CCMONTH.selectedIndex ].value, 10 );
			var yr = parseInt( object.CCYEAR.options[object.CCYEAR.selectedIndex].value, 10 );
			//                 Ja, Fe, Ma, Ap, Ma, Ju, Ju, Au, Se, Oc, No, De
			//alert("mm "+mn+":yr "+yr);
			if ( mn < 1 || mn > 12 ) {
				controller ++
				warning += "\n"+controller+". Please provide a Credit Card Expiration Date";
			} else {
				var mdays = new Object();
				mdays[1] = 31;
				mdays[2] = 28;
				mdays[3] = 31;
				mdays[4] = 30;
				mdays[5] = 31;
				mdays[6] = 30;
				mdays[7] = 31;
				mdays[8] = 31;
				mdays[9] = 30;
				mdays[10] = 31;
				mdays[11] = 30;
				mdays[12] = 31;
			
				today = new Date();
				xdate = new Date( yr, mn-1, mdays[mn] );
				if ( today.getTime() > xdate.getTime()){
					controller ++
					warning += "\n"+controller+". Credit Card has Expired, please check and re-enter month/year";
				}
			}
		}

		if ( empty( object.CCNAME.value )){
			controller ++
			warning += "\n"+controller+". Please provide a Credit Card Name";
		}
	}
	// End CC Section

	//for (var i=0;i<object.elements.length;i++) {
		//alert("value: "+object.elements[i].value+" Name:"+object.elements[i].name);
	//	if (object.elements[i].name == "SECTION13"){
	//		if (object.elements[i].checked != true ){
	//			controller ++
	//			warning += "\n"+controller+". This property has access to a hottub and/or pool.\nYou must acknowledge that you have carefully read and understand section 13 of the preceding lease."
	//		}
    //	}
	//}

	if (controller > 0){
		alert(warning)
		return false;
	}
}


//----- All of below for query page
var accumulate    = new makeArray(  0, 31, 59, 90,120,151,181,212,243,273,304,334);
var accumulateLY  = new makeArray(  0, 31, 60, 91,121,152,182,213,244,274,305,335);

function LeapYear(intYear) {

	if ((intYear % 4) == 0) {
        	if (intYear % 100 == 0) {
            		if (intYear % 400 == 0) { 
                		return true; 
			}
			else{
		   		return false;
			}
        	}
        	else{ return true; }
    	}
    	else {
         	return false; 
    	}
	return false;

}

function makeArray() {

    this[0] = makeArray.arguments.length;

    for (i = 0; i<makeArray.arguments.length; i++)

        this[i+1] = makeArray.arguments[i];

}



function getJulian(day,month,year) {

    if (LeapYear(year))

        return (day + accumulateLY[month]);

    else

        return (day + accumulate[month]);

}


function numberOfDays(month,year) {

	var numDays=new Array(0,31,28,31,30,31,30,31,31,30,31,30,31)

	n = numDays[month]

	//alert ("N ="+n+" Month="+month+" year="+year);
	if(month == 02){
		 if(year % 4 == 0){
			if(year % 100 == 0){
				if(year % 400 == 0){
					++n;
				}
				else{ 
					return n; 
				}
			}
			else{ 
				++n; 
			}
		}
		else{
			return n
		}
	}

	return n;

}


function onChangeDep(object,inYear) {
    var Current = object.DepMonth.selectedIndex
    var currentID = object.DepMonth.options[Current].text
    var currentValue = object.DepMonth.options[Current].value
	
	totalDays = numberOfDays(currentValue,inYear)
	dcount = 1

	while (dcount <= totalDays){
		object.DepDay.options[dcount] = new Option()
    		object.DepDay.options[dcount].text = dcount
	    	object.DepDay.options[dcount].value = dcount
		++dcount
	}
	var stopDay = totalDays + 1
	while( object.DepDay.options[stopDay] ){  
           		object.DepDay.options[stopDay] = null;
		}



}

function onChangeArrDay(object,inYear) {
	//object.DepDay.selectedIndex = object.ArrDay.selectedIndex + 1;
	
	//client wants it to default to 7 days after - 05/11/2005 - Meghna	
	var Current = object.ArrMonth.selectedIndex
        var currentID = object.ArrMonth.options[Current].text
        var currentValue = object.ArrMonth.options[Current].value
        lastDay = numberOfDays(currentValue,inYear)

        if(lastDay < (object.ArrDay.selectedIndex + 7)){
                object.DepMonth.selectedIndex = object.ArrMonth.selectedIndex +1;
                object.DepDay.selectedIndex = ((object.ArrDay.selectedIndex + 7) - lastDay);
        }else{
                object.DepDay.selectedIndex = object.ArrDay.selectedIndex + 7;
        }
}



function onChangeArr(object,inYear,inMonth,currentArrIndex,currentDepIndex) {
    var Current = object.ArrMonth.selectedIndex
    var currentID = object.ArrMonth.options[Current].text
    var currentValue = object.ArrMonth.options[Current].value

	//alert(currentArrIndex + " \ ");

	if(inMonth >= 03){
		inYear = inYear+1;
	}
	totalDays = numberOfDays(currentValue,inYear)
	dcount = 1

	while (dcount <= totalDays){
		object.ArrDay.options[dcount] = new Option()
		object.ArrDay.options[dcount].text = dcount
    		object.ArrDay.options[dcount].value = dcount
		++dcount
	}
	var stopDay = totalDays + 1
	while( object.ArrDay.options[stopDay] ){  
           	object.ArrDay.options[stopDay] = null;
	}

	//alert(Current);
	object.DepMonth.selectedIndex = Current
	
	totalDays = numberOfDays(currentValue,inYear)
	dcount = 1

	while (dcount <= totalDays){
		object.DepDay.options[dcount] = new Option()
    		object.DepDay.options[dcount].text = dcount
    		object.DepDay.options[dcount].value = dcount
		++dcount
	}
	var stopDay = totalDays + 1
	while( object.DepDay.options[stopDay] ){  
        	object.DepDay.options[stopDay] = null;
	}

	// For year changes so day does not change
	object.ArrDay.selectedIndex = currentArrIndex
	object.DepDay.selectedIndex = currentDepIndex
}


function onChangeArrYear(object) {

	object.DepYear.selectedIndex = object.ArrYear.selectedIndex
	var currentYear = object.ArrYear.options[object.ArrYear.selectedIndex].value
	var currentArrIndex = object.ArrDay.selectedIndex
	var currentDepIndex = object.DepDay.selectedIndex
	onChangeArr(object,currentYear,'',currentArrIndex,currentDepIndex)
	

}


// Following is for checking if Sat or Sun in Summer Seasons

var daysofweek = new makeArray('Sunday',
                               'Monday',
                               'Tuesday',
                               'Wednesday',
                               'Thursday',
                               'Friday',
                               'Saturday')

function DayOfWeek(day,month,year) {
	var a = Math.floor((14 - month)/12);
    	var y = year - a;
    	var m = month + 12*a - 2;
    	var d = (day + y + Math.floor(y/4) - Math.floor(y/100) + Math.floor(y/400) + Math.floor((31*m)/12)) % 7;
    	return d+1;
}


//####################################################
// Checks the information on the query page.
function dateCheck(object,inYear,inMonth,inDay,inEndRange) {
	//alert(inYear + ' '+inMonth+ ' ' + inDay + ' ' + inEndRange);
	
	var separator = '/';
	var arrivalDate = object.Arrival.value;
	var arrivalArray = arrivalDate.split(separator);
	var arrMonth = eval(arrivalArray[0]);
	var arrDay = eval(arrivalArray[1]);
	var arrYear = arrivalArray[2];

	var departureDate = object.Departure.value;
	var departArray = departureDate.split(separator);
	var depMonth = eval(departArray[0]);
	var depDay = eval(departArray[1]);
	var depYear = departArray[2];



	// Check that 4 digit year
	if(arrYear.length < 4){
		arrYear = '20'+ arrYear;
	}
	if(depYear.length < 4){
		depYear = '20'+ depYear;
	}

//alert(arrYear+" - "+depYear);

	//var arrMonth = object.ArrMonth.selectedIndex
	//var arrDay = object.ArrDay.selectedIndex
	//var arrYearSelect = object.ArrYear.selectedIndex
	var separator = '-';
	var EndRangeArray = inEndRange.split(separator);

	//alert(arrMonth+"/"+arrDay+"/"+arrYear+" - "+depMonth+"/"+depDay+"/"+depYear);

	// if arr items are valid...
	if (arrYear != 0 || arrMonth != 0 || arrDay != 0) {
		
		var arrToJulian = getJulian(arrDay,arrMonth,arrYear)
		var todaysDate = getJulian(inDay,inMonth,inYear)

		
		//alert("Arrival: "+arrYear+" "+arrMonth+" "+arrDay+"\nDepart: "+depYear+" "+depMonth+" "+depDay );
		
		// Check that all fields have a value
		if (arrYear <= 0 || arrMonth <= 0 || arrDay <= 0){
			alert ("You have entered an incorrect ARRIVAL DATE!\nPlease check that you have entered a correct month, day and year.")
			return false;
		}
		
	 	if (inYear == arrYear && arrToJulian < todaysDate){
			alert ("You have entered an incorrect Arrival Date! The arrival date chosen is before today's date.")
				return false
		}
			
		if (depMonth <= 0 || depDay <= 0 || depYear <= 0 ){
			alert ("You have entered an incorrect departure date.\nPlease check that you have entered a correct month, day and year.");
			return false
		}

		var depToJulian = getJulian(depDay,depMonth,depYear)
	
		if(depYear < eval(EndRangeArray[0])){
			//alert("depYear is less "+depYear+" END: "+EndRangeArray[0]+"\n")
			var addToCal = 365;
		}
		else{
			addToCal = 0;
		}

		var endRangeToJulian = getJulian(eval(EndRangeArray[2]),eval(EndRangeArray[1]),eval(EndRangeArray[0]));
		endRangeToJulian += addToCal;

		//alert("DEP: "+depToJulian+" END: "+endRangeToJulian+"\n")
		if(depToJulian > endRangeToJulian){
			alert("We are sorry but we can not take any reservations past the date of "+EndRangeArray[1]+"/"+EndRangeArray[2]+"/"+EndRangeArray[0]+".")
			return false;
		}

		if (arrYear > depYear){
				alert ("You must select a departure date that is after your arrival date!")
				return false
		}

		if (arrYear == depYear){
			if(arrToJulian > depToJulian){
				alert ("You must select a departure date that is after your arrival date!")
				return false
			}
			//if ( (depToJulian-arrToJulian) > 7){
			//	alert ("For stays longer then 7 days please contact our office by phone")
			//	return false
			//}
			if ( (depToJulian-arrToJulian) < 3){
				alert ("A Minimum of 3 nights stay is required!")
				return false
			}


			// TO STOP BOOKINGS THAT ARE WITHIN 48 HRS OF CURRENT DATE
			if(inMonth == arrMonth && (arrDay - inDay <= 2) && (arrYear == inYear)){

				alert("We do not allow online bookings within 2 days of the current date.\nPlease contact our office for help.");
				return false;
			}
			
			// To stop bookings great than 30 days out and less than 7 nights
			// 7/27/06 if(arrToJulian - todaysDate >= 30 && (depToJulian-arrToJulian < 7)){
			//	alert("We do not allow partial online bookings after 30 days of the current date.\nPlease contact our office for help.");
			//	return false;
			//}
			
		}
		if (arrYear < depYear){
			depToJulian = depToJulian + 365

			if(arrToJulian > depToJulian){
				alert ("You must select a departure date that is after your arrival date!")
				return false
			}

			if ( (depToJulian-arrToJulian) > 7){
				alert ("For stays longer then 7 days please contact our office by phone")
				return false
			}
			if ( (depToJulian-arrToJulian) < 3){
				alert ("A Minimum of 3 nights stay is required!")
				return false
			}
			
			// To stop bookings great than 30 days out and less than 7 nights
			//7/27/06 if(arrToJulian - todaysDate >= 30 && (depToJulian-arrToJulian < 7)){
			//	alert("We do not allow partial online bookings after 30 days of the current date.\nPlease contact our office for help.");
			//	return false;
			//}

		}	

	 	// alert ("Month:" + arrMonth + "Day:" + arrDay + "Year:" + arrYear + "ArrJulian:" + arrToJulian + "\nMonth:" + depMonth + "Day:" + depDay + "Year:" + depYear + "DepJulian:" + depToJulian);
	 	
	}else{
		

		if (depYear > 0 || depMonth > 0 || depDay > 0) {
			alert ("You have entered a departure date but have not entered a correct arrival date.\nPlease reenter your arrival date.")
			return false
		}


	}


	// If length of stay is 7 must start on Sat or Sun
	// added 7/27/06 CR
	if((depToJulian-arrToJulian) == 7){
		var errMessage = "";
		dayNum = DayOfWeek(arrDay,arrMonth,arrYear)
		dayReal = daysofweek[dayNum]
		//alert(dayReal)

		if(dayReal != "Saturday" && dayReal != "Sunday"){
			errMessage += "\nYou must select a Saturday or Sunday arrival day.\nYou selected an arrival day of "+dayReal+". Please select a Saturday or Sunday date."
			//return false;
		}
		if(errMessage != ""){
			alert(errMessage);
			return false;
		}
	}
	


	// Now validated the dates, so check the data.
	
	// Partial stays only allowed within 30 days from now. All other
	// dates must be either a Saturday or a Sunday.
	// 07/27/06 if(arrToJulian - todaysDate >= 30){
	//	var errMessage = "";
	//	if ( (depToJulian-arrToJulian) % 7 != 0){
	//		errMessage += "A weekly stay is required during this time!\n"
	//		//return false
	//	}

	//	// Check that they have chosen a Sat date
	//	dayNum = DayOfWeek(arrDay,arrMonth,arrYear)
	//	dayReal = daysofweek[dayNum]
	//	//alert(dayReal)

	//	if(dayReal != "Saturday" && dayReal != "Sunday"){
	//		errMessage += "\nYou must select a Saturday or Sunday arrival day.\nYou selected an arrival day of "+dayReal+". Please select a Saturday or Sunday date."
	//		//return false;
	//	}

	//	if(errMessage != ""){
	//		alert(errMessage);
	//		return false;
	//	}
			
	//}

	return true;
	

}
