﻿// NAVIGATION /////////////////////////////////////////////////


function Sanibel_Alert()
{
	return confirm('Sanibel Holiday does not provide, and is not responsible for, the product, service or overall website content available at the linked site. Our privacy policies do not apply to linked websites. Users should consult the privacy disclosures on the linked site for further information. To remain at Sanibel Holiday, click cancel. To leave our site for the site you have selected, click OK. Thank you for visiting Sanibel Holiday web site.')
}

var Base="../images/interface_images/nav/";

if (document.images) {
  
	homesDIM = new Image();  homesDIM.src = Base + "homesDIM.gif";
	homesLIT = new Image();   homesLIT.src = Base + "homesLIT.gif";   

	condosDIM = new Image();  condosDIM.src = Base + "condosDIM.gif";
	condosLIT = new Image();   condosLIT.src = Base + "condosLIT.gif";   

	explorerDIM = new Image();  explorerDIM.src = Base + "explorerDIM.gif";
	explorerLIT = new Image();   explorerLIT.src = Base + "explorerLIT.gif";   

	playDIM = new Image();  playDIM.src = Base + "playDIM.gif";
	playLIT = new Image();   playLIT.src = Base + "playLIT.gif";   

	specialsDIM = new Image();  specialsDIM.src = Base + "specialsDIM.gif";
	specialsLIT = new Image();   specialsLIT.src = Base + "specialsLIT.gif";   

	contactDIM = new Image();   contactDIM.src = Base + "contactDIM.gif";
	contactLIT = new Image();   contactLIT.src = Base + "contactLIT.gif";  
                        
}             
                
function imgOn(imgName,target) {
	if (document.images) {
		document[target].src = eval(imgName + "LIT.src");       
	}
}
                
function imgOff(imgName,target) {
	if (document.images) {
		document[target].src = eval(imgName + "DIM.src");       
	}
}


// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
// See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.html
rnd.today=new Date();
rnd.seed=rnd.today.getTime();
function rnd() {
         rnd.seed = (rnd.seed*9301+49297) % 233280;
         return rnd.seed/(233280.0);
};
function rand(number) {
         return Math.ceil(rnd()*number);
};
// end central randomizer. -->


// WINDOW CLOSE AND LOADER /////////////////////////////////////////////////
function supressError() {
        return true;
    }

    function load(url) {

        window.onerror = supressError;
        opener.location.href = url;
        setTimeout('self.close()',1000);
  	}



// WINDOW OPENER /////////////////////////////////////////////////

var myWindow = 'LinkWindow';

function win(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=750,height=600,screenX=0,screenY=0,top=0,left=235')
}


var myWindow = 'LinkWindow';

function winVER(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=400,height=500,screenX=0,screenY=0,top=0,left=235')
}


var myWindow = 'LinkWindow';

function winSML(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=300,height=250,screenX=0,screenY=0,top=0,left=235')
}

var myWindow = 'LinkWindow';

function homesSlideShow(homeid,imageindex) {
        window.open("homesSlideshow.php?homeid=" + homeid + "&imageindex=" + imageindex,myWindow,'scrollbars=no,resizable=no,status=no,toolbar=no,width=500,height=450,screenX=0,screenY=0,top=0,left=235')
}																									

var myWindow = 'LinkWindow';

function condosSlideShow(unitid,imageindex) {
        window.open("condosSlideshow.php?unitid=" + unitid + "&imageindex=" + imageindex,myWindow,'scrollbars=no,resizable=no,status=no,toolbar=no,width=500,height=450,screenX=0,screenY=0,top=0,left=235')
}

function gotop(url) {
	if (document.Condos.Selector.options[document.Condos.Selector.selectedIndex].value == 0){
  		return false;
    }else{
    	document.location = url;        
    }
}

var myWindow = 'LinkWindow';

function homesThumbsEdit(homeid) {
        window.open("homesThumbsEdit.php?homeid=" + homeid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=450,height=550,screenX=100,screenY=100,top=0,left=0')
}

var myWindow = 'LinkWindow';

function homesImageEdit(homeid) {
        window.open("homesImageAddForm.php?homeid=" + homeid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=450,height=550,screenX=100,screenY=100,top=0,left=0')
}

var myWindow = 'LinkWindow';

function homesThumbImageEdit(homeid) {
        window.open("homesThumbImageAddForm.php?homeid=" + homeid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=450,height=550,screenX=100,screenY=100,top=0,left=0')
}

var myWindow = 'LinkWindow';

function condosUnitsThumbsEdit(unitid) {
        window.open("condosUnitsThumbsEdit.php?unitid=" + unitid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=450,height=550,screenX=100,screenY=100,top=0,left=0')
}

var myWindow = 'LinkWindow';

function condosImageEdit(condoid) {
        window.open("condosImageAddForm.php?condoid=" + condoid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=450,height=550,screenX=100,screenY=100,top=0,left=0')
}

var myWindow = 'LinkWindow';

function condosThumbImageEdit(condoid) {
        window.open("condosThumbImageAddForm.php?condoid=" + condoid,myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=450,height=550,screenX=100,screenY=100,top=0,left=0')
}

function openHomePageView() {
        window.open("http://www.sanibelholiday.com",myWindow,'scrollbars=yes,resizable=yes,status=no,toolbar=no,width=640,height=480,screenX=100,screenY=100,top=0,left=0')
}

function openCMToolsEnlargementWindow(imageSrc,imageTitle) { 
    fileName = 'enlargementPopup.php?' + escape(imageSrc) + '&' + escape(imageTitle);
    myWindowHandle = window.open(fileName,'windowName','directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,width=450,height=450');
}

function validateUnitRequest() {
    if (document.UnitRequest.rname.value=="") {
    	alert('You must fill in the Name field before submitting');
    	document.UnitRequest.rname.focus();
    	return false;
    }
    if (document.UnitRequest.address.value=="") {
    	alert('You must fill in the Address field before submitting');
    	document.UnitRequest.address.focus();
    	return false;
    }
    if (document.UnitRequest.city.value=="") {
    	alert('You must fill in the City field before submitting');
    	document.UnitRequest.city.focus();
    	return false;
    }
    if (document.UnitRequest.state.value=="") {
    	alert('You must fill in the State field before submitting');
    	document.UnitRequest.state.focus();
    	return false;
    }
    if (document.UnitRequest.zipcode.value=="") {
    	alert('You must fill in the Zip field before submitting');
    	document.UnitRequest.zipcode.focus();
    	return false;
    }
    if (document.UnitRequest.country.value=="") {
    	alert('You must fill in the Country field before submitting');
    	document.UnitRequest.country.focus();
    	return false;
    }
    if (document.UnitRequest.phone.value=="") {
    	alert('You must fill in the Phone field before submitting');
    	document.UnitRequest.phone.focus();
    	return false;
    }
    if (document.UnitRequest.email.value=="") {
    	alert('You must fill in the Email field before submitting');
    	document.UnitRequest.email.focus();
    	return false;
    }
    if (document.UnitRequest.numberOfGuests.value=="") {
    	alert('You must fill in the Number in Party field before submitting');
    	document.UnitRequest.numberOfGuests.focus();
    	return false;
    }
    if (document.UnitRequest.fromDate.value=="") {
    	alert('You must fill in the Date From field before submitting');
    	document.UnitRequest.fromDate.focus();
    	return false;
    }
    if (document.UnitRequest.toDate.value=="") {
    	alert('You must fill in the Date To field before submitting');
    	document.UnitRequest.toDate.focus();
    	return false;
    }
    if (document.UnitRequest.fromDate.value==document.UnitRequest.toDate.value) {
    	alert('Your Date From and Date To fields must be different dates.');
    	document.UnitRequest.fromDate.focus();
    	return false;
    }
    if (document.UnitRequest.priceRange.value=="$") {
    	alert('You must fill in the Price Range field before submitting');
    	document.UnitRequest.priceRange.focus();
    	return false;
    }
}    

function validateRequest() {
    if (document.UnitRequest.rname.value=="") {
    	alert('You must fill in the Name field before submitting');
    	document.UnitRequest.rname.focus();
    	return false;
    }
    if (document.UnitRequest.address.value=="") {
    	alert('You must fill in the Address field before submitting');
    	document.UnitRequest.address.focus();
    	return false;
    }
    if (document.UnitRequest.city.value=="") {
    	alert('You must fill in the City field before submitting');
    	document.UnitRequest.city.focus();
    	return false;
    }
    if (document.UnitRequest.state.value=="") {
    	alert('You must fill in the State field before submitting');
    	document.UnitRequest.state.focus();
    	return false;
    }
    if (document.UnitRequest.zipcode.value=="") {
    	alert('You must fill in the Zip field before submitting');
    	document.UnitRequest.zipcode.focus();
    	return false;
    }
    if (document.UnitRequest.country.value=="") {
    	alert('You must fill in the Country field before submitting');
    	document.UnitRequest.country.focus();
    	return false;
    }
    if (document.UnitRequest.phone.value=="") {
    	alert('You must fill in the Phone field before submitting');
    	document.UnitRequest.phone.focus();
    	return false;
    }
    if (document.UnitRequest.email.value=="") {
    	alert('You must fill in the Email field before submitting');
    	document.UnitRequest.email.focus();
    	return false;
    }
    if (document.UnitRequest.numberOfGuests.value=="") {
    	alert('You must fill in the Number in Party field before submitting');
    	document.UnitRequest.numberOfGuests.focus();
    	return false;
    }
    if (document.UnitRequest.rentalType.value=="") {
    	alert('You must choose a rental type before submitting');
    	document.UnitRequest.rentalType.focus();
    	return false;
    }
    if (document.UnitRequest.toDate.value=="") {
    	alert('You must fill in the Date To field before submitting');
    	document.UnitRequest.toDate.focus();
    	return false;
    }
    if (document.UnitRequest.fromDate.value==document.UnitRequest.toDate.value) {
    	alert('Your Date From and Date To fields must be different dates.');
    	document.UnitRequest.fromDate.focus();
    	return false;
    }
    if (document.UnitRequest.priceRange.value=="$") {
    	alert('You must fill in the Price Range field before submitting');
    	document.UnitRequest.priceRange.focus();
    	return false;
    }
}    

function addSpecialsRefresh(){
	document.location='specialsAddForm.php?homeorcondo=' + document.addspecials.homeorcondoselector.options[document.addspecials.homeorcondoselector.selectedIndex].value;
}

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];}}
}







   