// WINDOW ALERT ///////////////////////////////////////////////

function TT_Alert()
{
	return confirm('You are about to exit our web site in a new window. To remain at The Tarpon Tale Inn, click cancel. To leave our site for the site you have selected, click OK. When you wish to return to our site, close the window.')
}

// NAVIGATION /////////////////////////////////////////////////

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

if (document.images) {

   	home1 = new Image();   home1.src = Base + "home1.gif";
    home2 = new Image();   home2.src = Base + "home2.gif";
    
    accommodations1 = new Image();   accommodations1.src = Base + "accommodations1.gif";
    accommodations2 = new Image();   accommodations2.src = Base + "accommodations2.gif";
               
    rates1 = new Image();   rates1.src = Base + "rates1.gif";
    rates2 = new Image();   rates2.src = Base + "rates2.gif";
    
    reservations1 = new Image();   reservations1.src = Base + "reservations1.gif";
    reservations2 = new Image();   reservations2.src = Base + "reservations2.gif";

    arrival1 = new Image();   arrival1.src = Base + "arrival1.gif";
    arrival2 = new Image();   arrival2.src = Base + "arrival2.gif";

	about1 = new Image();   about1.src = Base + "about1.gif";
    about2 = new Image();   about2.src = Base + "about2.gif";
    
    area1 = new Image();   area1.src = Base + "area1.gif";
    area2 = new Image();   area2.src = Base + "area2.gif";

    real_estate1 = new Image();   real_estate1.src = Base + "real_estate1.gif";
    real_estate2 = new Image();   real_estate2.src = Base + "real_estate2.gif";

    real_estate1 = new Image();   real_estate1.src = Base + "real_estate1.gif";
    real_estate2 = new Image();   real_estate2.src = Base + "real_estate2.gif";
	
	location1 = new Image();   location1.src = Base + "location1.gif";
    location2 = new Image();   location2.src = Base + "location2.gif";
	
	arrow_back1 = new Image();   arrow_back1.src = Base + "arrow_back1.gif";
    arrow_back2 = new Image();   arrow_back2.src = Base + "arrow_back2.gif";

	arrow_return1 = new Image();   arrow_return1.src = Base + "arrow_return1.gif";
    arrow_return2 = new Image();   arrow_return2.src = Base + "arrow_return2.gif";

    arrow_next1 = new Image();   arrow_next1.src = Base + "arrow_next1.gif";
    arrow_next2 = new Image();   arrow_next2.src = Base + "arrow_next2.gif";
}             
                
function imgOn(imgName,target) {
	if (document.images) {
		document[target].src = eval(imgName + "2.src");       
	}
}
                
function imgOff(imgName,target) {
	if (document.images) {
		document[target].src = eval(imgName + "1.src");       
	}
}


// The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu)
// See:  http://www.msc.cornell.edu/~houle/javascript/randomizer.phpl
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);
  	}


// SELF-SIZE WINDOW OPENER /////////////////////////////////////////////////

function MM_preloa1ages() { //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_preloa1ages.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_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_findObj(n, d) { //v3.0
  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); 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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


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

var myWindow = 'LinkWindow';

function win(fileName) {
        window.open(fileName,myWindow,'scrollbars=yes,resizable=yes,status=yes,toolbar=yes,width=550,height=400,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=520,height=600,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=520,height=320,screenX=0,screenY=0,top=0,left=235')
}


// COIUNTDOWN DATE ///////////////////////////////////////////////////////////
<!-- Hide from old browsers
  now = new Date();
  eventDate = new Date("May 31, 2005");
  msEachDay = 24 * 60 * 60 * 1000 ;
  
  function daysUntilEvent(){
// Step 1:
  daysRemaining = (eventDate.getTime() - now.getTime()) / msEachDay;
// Step 2:
  daysRemaining = Math.round(daysRemaining);
// Step 3:
  document.write("We're Due in less than  " + daysRemaining + " days. Help Us Celebrate!");}
	// stop hiding script from old browsers -->


// DATE ///////////////////////////////////////////////////////////
	var today=new Date();
	
	function nameDay() {
	  var arg1=nameDay.arguments;
	  for (var i=0; i < arg1.length; i++) {
	    this[i]=arg1[i];
	  }
	  this.length=arg1.length;
	}
	
	function nameMonth() {
	  var arg2=nameMonth.arguments;
	  for (var i=0; i < arg2.length; i++) {
	    this[i]=arg2[i];
	  }
	  this.length=arg2.length;
	}

	function getString(date) {
	  var day=new nameDay("Sun","Mon","Tues","Wed","Thur","Fri","Sat");
	  var month=new nameMonth("Jan","Feb","March","April","May","June","July","August","Sep","Oct","Nov","Dec");
	  var yy = date.getYear();
	  var year = (yy < 1000) ? yy + 1900 : yy;
	  
	  return day[date.getDay()] + ". " + month[date.getMonth()] + " " + date.getDate() + ". " + year;
	}
	
	function printDate(){	
		var display=getString(today);
		document.write(display);
	}
    
   function validatePassword() {
    if (document.changepassword.password.value=="") {
    	alert('You must fill in the Password field before submitting');
    	document.changepassword.password.focus();
    	return false;
    }
    if (document.changepassword.password.value.length > 0 && document.changepassword.password.value.length < 8) {
    	alert('Your password must be at least 8 characters long.  Please correct this before submitting');
    	document.changepassword.password.value="";
    	document.changepassword.confirmpassword.value="";
    	document.changepassword.password.focus();
    	return false;
    }
    if (document.changepassword.password.value!=document.changepassword.confirmpassword.value) {
    	alert('Your passwords do not match.  Please correct before submitting');
    	document.changepassword.password.value="";
    	document.changepassword.confirmpassword.value="";
    	document.changepassword.password.focus();
    	return false;
   }
   }    
