 NAV = 0;
 version = navigator.appVersion;
 
 if (navigator.appName == "Netscape" || navigator.appName == "Opera") {
  if (version.substring(0,3) >= "4.0"){NAV = 1;} else
  if (version.substring(0,3) >= "3.0"){NAV = 1;}
 }
 else if  (navigator.appName == "Microsoft Internet Explorer") {
  if (version.substring(0,3) >= "4.0"){NAV = 1;}
 }
 else {NAV=0;}
 
 function moveToFront() {
	if (NAV==1) {
		focus();
		return;
	}
 }
 function closeMe () {
 	if (NAV==1) {
		self.close();
		return;
	}
 }



function donavhighlights(){
window.defaultStatus='Welcome To Deltaville Marina';
   if(!document.layers){

      var atags=document.getElementsByTagName("a");

      for(var i=0;i<atags.length;i++){

         if(atags[i].className=="nav1"){

            if(document.location.href.indexOf(atags[i].href)!=-1){

               atags[i].className="active1";

            }

         }

      }

      var atags=document.getElementsByTagName("a");

      for(var i=0;i<atags.length;i++){

         if(atags[i].className=="info1"){

            if(document.location.href.indexOf(atags[i].href)!=-1){

               atags[i].className="active1";

            }

         }

      }

   }

}  

function reset_donavhighlights(){

   if(!document.layers){

      var atags=document.getElementsByTagName("a");

      for(var i=0;i<atags.length;i++){

         if(atags[i].className=="nav1"){

            if(document.location.href.indexOf(atags[i].href)!=-1){

               atags[i].className="active1";

            }

         }

      }

      var atags=document.getElementsByTagName("a");

      for(var i=0;i<atags.length;i++){

         if(atags[i].className=="active1"){

            if(document.location.href.indexOf(atags[i].href)!=-1){

               atags[i].className="info1";

            }

         }

      }

   }

}  


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var agt=navigator.userAgent.toLowerCase();
var is_opera = (agt.indexOf("opera") != -1);

function ShowHelp(obj,field,hide)
{
	//Get help object
	var helpObj;
	if (document.all){
	helpObj = document.all[field+"_help"];}
	else if (document.getElementById){
		helpObj = document.getElementById(field+"_help");}
	if (helpObj) {
		//if help object is shown, hide it ; if object hidden, show it
		if (hide){
		  helpObj.style.display = "none";}
		else{
		  helpObj.style.display = "";}

		//Get location of mouseover object, move help object to the left if will display off-screen
		var divWidth = helpObj.offsetWidth;
		var offsetLeft = getOffsetLeft(obj);
		var screenWidth = (window.innerWidth) ? window.innerWidth - 25 : document.body.clientWidth;
		if ((offsetLeft + divWidth) > screenWidth) offsetLeft = screenWidth - divWidth;
		newX = offsetLeft;
	
		//Get location of mouseover object, move help object on top if will display off-screen
		var divHeight = helpObj.offsetHeight;
		var offsetTop = getOffsetTop(obj) + obj.offsetHeight;
		var screenHeight = (window.innerHeight) ? window.innerHeight - 25 : document.body.clientHeight;
		if ((offsetTop + divHeight) > screenHeight + getScrollY()) offsetTop = getOffsetTop(obj) - divHeight;
		newY = offsetTop+3;	
	
		helpObj.style.top = newY;
		helpObj.style.left = newX;

		if (!hide){
		  qh_hideElement("select",helpObj);  
		  qh_hideElement("object",helpObj);  
		  qh_hideElement("embed",helpObj);  }
		else{
		  qh_showElement("select");  
		  qh_showElement("object");  
		  qh_showElement("embed");}
	}
}

function getOffsetTop (elm) {
	var mOffsetTop = elm.offsetTop;
	var mOffsetParent = elm.offsetParent;
	while (mOffsetParent) {
		mOffsetTop += mOffsetParent.offsetTop;
		mOffsetParent = mOffsetParent.offsetParent;}
	return mOffsetTop;
}

function getOffsetLeft (elm) {
	var mOffsetLeft = elm.offsetLeft;
	var mOffsetParent = elm.offsetParent;
	while (mOffsetParent) {
		mOffsetLeft += mOffsetParent.offsetLeft;
		mOffsetParent = mOffsetParent.offsetParent;}
	return mOffsetLeft;
}

function getScrollY() {
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape
    scrOfY = window.pageYOffset;}
  else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM
    scrOfY = document.body.scrollTop;}
  else if( document.documentElement &&
      ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6
    scrOfY = document.documentElement.scrollTop;}
  return scrOfY;
}

function qh_hideElement( elmID, overDiv ) {
  if(document.all) {
    for(i = 0; i < document.all.tags( elmID ).length; i++) {
      obj = document.all.tags( elmID )[i];
      if(!obj || !obj.offsetParent) continue;

      // Find the element's offsetTop and offsetLeft relative to the BODY tag.
      objLeft   = obj.offsetLeft;
      objTop    = obj.offsetTop;
      objParent = obj.offsetParent;

      while(objParent.tagName.toUpperCase() != 'BODY') {
        objLeft  += objParent.offsetLeft;
        objTop   += objParent.offsetTop;
        objParent = objParent.offsetParent;
      }

      objHeight = obj.offsetHeight;
      objWidth  = obj.offsetWidth;

      if((overDiv.offsetLeft + overDiv.offsetWidth) <= objLeft);
      else if((overDiv.offsetTop + overDiv.offsetHeight) <= objTop);
      else if(overDiv.offsetTop >= (objTop + objHeight));
      else if(overDiv.offsetLeft >= (objLeft + objWidth));
      else {
        obj.style.visibility = 'hidden';
      }
    }
  }
}
function qh_showElement(elmID) {
  if(document.all) {
    for(i = 0; i < document.all.tags( elmID ).length; i++) {
      obj = document.all.tags(elmID)[i];
      if(!obj || !obj.offsetParent) continue;
      obj.style.visibility = '';
    }
  }
}

//onerror = report;


function report(message,url,line) {
    alert('Error : ' + message + ' at line ' + line + ' in ' + url);

	}




function jkpopwinclose(){
  if (typeof(jkpopwin)!="undefined"){
  //} else {
  jkpopwin.close();
  }
}




var popbackground="#ffffff"; //specify backcolor or background image for pop window
var windowtitle="Click Image To Close Window" ; //pop window title

function detectexist(obj){
return (typeof obj !="undefined");
}


function jkpopimage(imgpath, popwidth, popheight, textdescription){
	function getpos(){
		leftpos=(detectexist(window.screenLeft))? screenLeft+document.body.clientWidth/2-popwidth/2 : detectexist(window.screenX)? screenX+innerWidth/2-popwidth/2 : 0
		toppos=(detectexist(window.screenTop))? screenTop+document.body.clientHeight/2-popheight/1 : detectexist(window.screenY)? screenY+innerHeight/2-popheight/1 : 0
		if (window.opera){
			leftpos-=screenLeft;
			toppos-=screenTop;
		}
	}
	getpos()
	var  winattributes = 'width='+popwidth+', height='+popheight+', resizable=yes, scrollbars=no, statusbar=no, status=no, left='+leftpos+', top='+toppos;
	var bodyattribute = 'bottommargin=0 rightmargin=0 topmargin=0 leftmargin=0 bgcolor='+popbackground;
	if (typeof jkpopwin=="undefined" || jkpopwin.closed){
		jkpopwin = window.open("","",winattributes);
	} else {
		//getpos() //uncomment these 2 lines if you wish subsequent popups to be centered too
		//jkpopwin.moveTo(leftpos, toppos)
		jkpopwin.resizeTo(popwidth, popheight+60);
	}
	jkpopwin.document.open();
	
	//*********************************************************
	//note need to change when new directories are created.
	if (imgpath.search("include")>0 || imgpath.search("/")<0){js_loc="../deltavillemarina.js"} else {js_loc="../deltavillemarina.js"}
	//************************************************************
	
	jkpopwin.document.write('<html><title>'+windowtitle+'</title><script src="'+js_loc+'" type="text/javascript"></script>	<body '+bodyattribute+' ><A title="Click Image To Close Window" HREF="javascript:closeMe();"><img border="0" src="'+imgpath+'" style="margin-bottom: 0.5em"><a><br><center><table border="0" width="100%" id="table1" cellpadding="3"><tr><td width=50%><hr></td><td nowrap>'+textdescription+'</td><td width=50%><hr></td></tr></table></body></html>');
	jkpopwin.document.close();
	jkpopwin.focus();
}

//if (top.frames.length == 0) {top.location = "index.php"};
browserVer = parseInt(navigator.appVersion);
if( document.Images && browserVer >=3 ) browser = "true"; 


function newwindow(page,width,height) {
var newwin = window.open( page ,'','resizable=yes,width=' + width + ',height=' + height + ', status=no,location=no,toolbar=no,menubar=no,scrollbars=no');
//newwin.document.write('<html><head><title>Deltaville Boatyard</title></head><body bgcolor="E8E8E8"><FONT size=2></FONT><div align="center"><img src="' + page + '" alt="" border="0"><br><a href="javascript:window.close()" ><B>Close Window</B></a> </div></body></html>');
}


