/************************************************************************
* RedanMenu by Redan Online Design - www.redanonline.com
* (creates vertical and horizontal sub-menus - use with style.css and samplepage.htm)
*
* v1.2 revised 17 May 2006 to improve alignment of sub-menus
*
* Based on AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for original source code
*************************************************************************/

//Modify contents of sub-menus as appropriate - if link wraps to second line, add a non-breaking space to maintain appearance

var menu1=new Array()

menu1[0]='<a href="http://www.fnhl.co.nz/about.htm">About Far North Holdings Ltd</a>'
menu1[1]='<a href="http://www.fnhl.co.nz/facilities.htm">Facilities and services:</a>'
menu1[2]='<a href="http://www.fnhl.co.nz/property.htm">&nbsp;&#8226; Property</a>'
menu1[3]='<a href="http://www.fnhl.co.nz/maritime.htm">&nbsp;&#8226; Maritime</a>'
menu1[4]='<a href="http://www.fnhl.co.nz/airports.htm">&nbsp;&#8226; Airports</a>'
menu1[5]='<a href="http://www.fnhl.co.nz/bylaws.htm">Bylaws and regulations</a>'
menu1[6]='<a href="http://www.fnhl.co.nz/mmp.htm">Moorings Management Plans</a>'
menu1[7]='<a href="http://www.fnhl.co.nz/fees.htm">Facility fees</a>'
menu1[8]='<a href="http://www.fnhl.co.nz/forms.htm">Downloadable forms</a>'
menu1[9]='<a href="http://www.fnhl.co.nz/media.htm">Media releases</a>'
menu1[10]='<a href="http://www.fnhl.co.nz/surveys.htm">User surveys</a>'
menu1[11]='<a href="http://www.fnhl.co.nz/newsletter.htm">Newsletter</a>'
menu1[12]='<a href="http://www.fnhl.co.nz/calendar.htm">Events calendar</a>'
menu1[13]='<a href="http://www.fnhl.co.nz/propertyads.htm">Property advertisements</a>'
menu1[14]='<a href="http://www.fnhl.co.nz/vacancies.htm">Job vacancies</a>'


var menu2=new Array()

menu2[0]='<a href="http://www.opuamarina.co.nz/index.htm">About Opua Marina</a>'
menu2[1]='<a href="http://www.opuamarina.co.nz/cruisers.htm">Information for Cruisers</a>'
menu2[2]='<a href="http://www.opuamarina.co.nz/berthinfo.htm">Berth Information</a>'
menu2[3]='<a href="http://www.opuamarina.co.nz/facilities.htm">Facilities</a>'
menu2[4]='<a href="http://www.opuamarina.co.nz/portofentry.htm">Port of Entry</a>'
menu2[5]='<a href="http://www.opuamarina.co.nz/opuawharf.htm">Opua Wharf</a>'
menu2[6]='<a href="http://www.opuamarina.co.nz/insurance.htm">Insurance</a>'
menu2[7]='<a href="http://www.opuamarina.co.nz/otherservices.htm">Office Services</a>'


var menu3=new Array()

menu3[0]='<a href="http://www.ashbyboats.co.nz/index.htm">About Ashby\'s Boatyard</a>'
menu3[1]='<a href="http://www.ashbyboats.co.nz/facilities.htm">Facilities:</a>'
menu3[2]='<a href="http://www.ashbyboats.co.nz/facilities.htm#haulout">&nbsp;&#8226; Haul Out</a>'
menu3[3]='<a href="http://www.ashbyboats.co.nz/facilities.htm#hardstand">&nbsp;&#8226; Hardstand</a>'
menu3[4]='<a href="http://www.ashbyboats.co.nz/facilities.htm#jetty">&nbsp;&#8226; Jetty</a>'
menu3[5]='<a href="http://www.ashbyboats.co.nz/facilities.htm#location">&nbsp;&#8226; Our location</a>'
menu3[6]='<a href="http://www.ashbyboats.co.nz/services.htm">Services:</a>'
menu3[7]='<a href="http://www.ashbyboats.co.nz/services.htm#examples">&nbsp;&#8226; Examples of our work</a>'
menu3[8]='<a href="http://www.ashbyboats.co.nz/services.htm#survey">&nbsp;&#8226; Customer Satisfaction Survey</a>'
menu3[9]='<a href="http://www.ashbyboats.co.nz/legal.htm">Legal and fees</a>'
menu3[10]='<a href="http://www.ashbyboats.co.nz/insurance.htm">Insurance</a>'
menu3[11]='<a href="http://www.ashbyboats.co.nz/facilities.htm#vacancies">Job vacancies</a>'

var menu4=new Array()

menu4[0]='<a href="http://www.bayofislandsairport.co.nz/about.htm">About the Airports</a>'
menu4[1]='<a href="http://www.bayofislandsairport.co.nz/passengerinfo.htm">Information for passengers:</a>'
menu4[2]='<a href="http://www.bayofislandsairport.co.nz/passengerinfo.htm#schedulesBOI">&nbsp;&#8226; BOI (Kerikeri) - Flight schedules</a>'
menu4[3]='<a href="http://www.bayofislandsairport.co.nz/passengerinfo.htm#locationBOI">&nbsp;&#8226; BOI (Kerikeri) - Location</a>'
menu4[4]='<a href="http://www.bayofislandsairport.co.nz/passengerinfo.htm#facilitiesBOI">&nbsp;&#8226; BOI (Kerikeri) - Facilities</a>'
menu4[5]='<a href="http://www.bayofislandsairport.co.nz/passengerinfo.htm#scheduleskaitaia">&nbsp;&#8226; Kaitaia - Flight schedules</a>'
menu4[6]='<a href="http://www.bayofislandsairport.co.nz/passengerinfo.htm#locationkaitaia">&nbsp;&#8226; Kaitaia - Location</a>'
menu4[7]='<a href="http://www.bayofislandsairport.co.nz/passengerinfo.htm#facilitieskaitaia">&nbsp;&#8226; Kaitaia - Facilities</a>'
menu4[8]='<a href="http://www.bayofislandsairport.co.nz/aviatorinfo.htm">Information for aviators:</a>'
menu4[9]='<a href="http://www.bayofislandsairport.co.nz/aviatorinfo.htm#dataBOI">&nbsp;&#8226; BOI (Kerikeri) - Airport data</a>'
menu4[10]='<a href="http://www.bayofislandsairport.co.nz/aviatorinfo.htm#datakaitaia">&nbsp;&#8226; Kaitaia - Airport data</a>'
menu4[11]='<a href="http://www.bayofislandsairport.co.nz/aviatorinfo.htm#datakaikohe">&nbsp;&#8226; Kaikohe - Airport data</a>'
menu4[12]='<a href="http://www.bayofislandsairport.co.nz/aviatorinfo.htm#landing_fees">Landing fees</a>'

var menu5=new Array()

menu5[0]='<a href="http://www.fnhl.co.nz/history.htm">History of completed projects</a>'
menu5[1]='<a href="http://www.fnhl.co.nz/currentprojects.htm">Current projects:</a>'
menu5[2]='<a href="http://www.fnhl.co.nz/currentprojects.htm#opuavillagegreen">&nbsp;&#8226; Opua Village Green</a>'
menu5[3]='<a href="http://www.fnhl.co.nz/currentprojects.htm#opuawharf">&nbsp;&#8226; Opua Wharf</a>'
menu5[4]='<a href="http://www.fnhl.co.nz/futureprojects.htm">Future projects:</a>'
menu5[5]='<a href="http://www.fnhl.co.nz/futureprojects.htm#waterfront">&nbsp;&#8226; Paihia Waterfront</a>'
menu5[6]='<a href="http://www.fnhl.co.nz/futureprojects.htm#runway">&nbsp;&#8226; BOI Airport runway</a>'
menu5[7]='<a href="http://www.fnhl.co.nz/futureprojects.htm#opua2">&nbsp;&#8226; Opua Stage Two</a>'
menu5[8]='<a href="http://www.fnhl.co.nz/futureprojects.htm#ashby">&nbsp;&#8226; Ashby\'s Boatyard Development</a>'
menu5[9]='<a href="http://www.fnhl.co.nz/developments.htm#tender">Calls for Tender</a>'

var menuwidth='200px' //default sub-menu width
var menubgcolor=''  //sub-menu bgcolor
var disappeardelay=250  //sub-menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide sub-menu when user clicks within sub-menu?

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="-500px"
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 topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
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){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-1-topedge  // adjust the value to suit the vertical position of the sub-menu (see below)
}
}
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")+0+"px"  //adjust the value to suit the horiz. position of the sub-menu
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"  //adjust the value to suit the vertical position of the sub-menu
}

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
