// JavaScript Document

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var information=new Array()
information[0]='<a href="http://www.pointrobertsmarina.com/info/index.html">Information</a>'
information[1]='<a href="http://www.pointrobertsmarina.com/info/services.html">Services & Amenities</a>'
information[2]='<a href="http://www.pointrobertsmarina.com/info/community.html">Community</a>'
information[3]='<a href="http://www.pointrobertsmarina.com/info/faq.html">FAQ</a>'
information[4]='<a href="http://www.pointrobertsmarina.com/info/resources.html">Links</a>'
information[5]='<a href="http://www.pointrobertsmarina.com/info/jobs.html">Employment</a>'
information[6]='<a href="http://www.pointrobertsmarina.com/contact.html">Contact</a>'
//information[7]='<a href="http://www.pointrobertsmarina.com/newsletter.html">Newsletter</a>'
//information[8]='<a href="http://www.pointrobertsmarina.com/anyboard9/forum">Bulletin Board</a>'

//Contents menu 2, and so on
var moorage=new Array()
moorage[0]='<a href="http://www.pointrobertsmarina.com/slips/">Slip Availability Listings</a>'
moorage[1]='<a href="http://www.pointrobertsmarina.com/moorage/map.html">Slip Map</a>'
moorage[2]='<a href="http://www.pointrobertsmarina.com/moorage/electrical_FAQ.html">Electrical FAQ</a>'
moorage[3]='<a href="http://www.pointrobertsmarina.com/moorage/index.html">Rates</a>'
moorage[4]='<a href="http://www.pointrobertsmarina.com/moorage/contract.html">Contracts</a>'
moorage[5]='<a href="http://www.pointrobertsmarina.com/moorage/non-renew.html">Notice of Non-Renewal</a>'
moorage[6]='<a href="http://www.pointrobertsmarina.com/moorage/sublease.html">Sublease Form</a>'
moorage[7]='<a href="http://www.pointrobertsmarina.com/moorage/liveaboard.html">Live Aboard</a>'

var newsletter=new Array()
newsletter[0]='<a href="http://www.pointrobertsmarina.com/boating/cams.html">Web Cam</a>'
newsletter[1]='<a href="http://www.pointrobertsmarina.com/boating/weather.php">Weather Station</a>'

var boating=new Array()
boating[0]='<a href="http://www.pointrobertsmarina.com/boating/maps.html">Maps</a>'
boating[1]='<a href="http://www.pointrobertsmarina.com/boating/cams.html">Web Cam</a>'
boating[2]='<a href="http://www.pointrobertsmarina.com/boating/weather.php">Weather Station</a>'
boating[3]='<a href="http://www.pointrobertsmarina.com/tidechart/chart.pdf" target="_blank">Today\'s Tide</a>'
boating[4]='<a href="http://www.pointrobertsmarina.com/tidechart/charttomorrow.pdf" target="_blank">Tomorrow\'s Tide</a>'
boating[5]='<a href="http://www.pointrobertsmarina.com/boating/fishing.html">Fishing</a>'
boating[6]='<a href="http://www.pointrobertsmarina.com/boating/auction.html">Vessels for Auction</a>'
boating[7]='<a href="http://www.yachtworld.com/pointroberts/pointroberts_1.cgi?company=pointroberts&limit=50&type=&new=&units=Feet&hosturl=pointroberts&page=broker" target="_blank">Vessels for Sale</a>'

var regulatory=new Array()
regulatory[0]='<a href="http://www.pointrobertsmarina.com/regulatory/index.html">Customs at a Glance</a>'
regulatory[1]='<a href="http://www.pointrobertsmarina.com/regulatory/permits.html">WA State Permits</a>'
regulatory[2]='<a href="http://www.pointrobertsmarina.com/regulatory/marpol.html">Marpol Treaty</a>'
regulatory[3]='<a href="http://www.pointrobertsmarina.com/regulatory/gastax.html">Gas Tax Refund</a>'
regulatory[4]='<a href="http://www.pointrobertsmarina.com/regulatory/clearing_form.html">US Customs Clearing Form</a>'
regulatory[5]='<a href="http://www.pointrobertsmarina.com/regulatory/decals.html">Annual Decal Information</a>'
regulatory[6]='<a href="http://www.pointrobertsmarina.com/regulatory/customs_hours.html">Customs & Border Protection Agency – Hours</a>'

var club=new Array()
club[0]='<a href="http://www.pointrobertsmarina.com/marina_club/clubs.html">Reciprocal Clubs</a>'
		
var menuwidth='185px' //default menu width
var menubgcolor='#E1EFFB'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu



function expiration(maxdays, addDate){
var getOldDate = new Date(addDate);
var getNewDate = new Date();
var isItNew = maxdays*24*60*60*1000;
if ((getNewDate.getTime()-getOldDate.getTime()) <=  isItNew) {
document.write("<img name='newImage' src='http://www.pointrobertsmarina.com/images/new.gif' align='absmiddle'>"); } }


/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_f2'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_f2'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;

//end rollover

function PrintThisPage() 
{ 
   var sOption="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; 

   var sWinHTML = document.getElementById('content').innerHTML; 
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><link href=http://www.pointrobertsmarina.com/print.css type=text/css><body><h3>Point Roberts Marina</h3>'); 
       winprint.document.write(sWinHTML);          
       winprint.document.write('<p>http://www.pointrobertsmarina.com</p></body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}