// JavaScript Document
/*****
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
******/

//WHO WE ARE
var menu1=new Array()
menu1[0]='<a href="http://www.gns.cri.nz/who/index.html">Who we are</a>'
menu1[1]='<a href="http://www.gns.cri.nz/who/globe/annual.html">Annual Report</a>'
menu1[2]='<a href="http://www.gns.cri.nz/who/intent.html">Statement of Intent</a>'
menu1[3]='<a href="http://www.gns.cri.nz/who/structure.html">Structure</a>'
menu1[4]='<a href="http://www.gns.cri.nz/who/directors.html">Board of Directors</a>'
menu1[5]='<a href="http://www.gns.cri.nz/who/management.html">Management</a>'
menu1[6]='<a href="http://www.gns.cri.nz/who/office.html">Office Locations</a>'
menu1[7]='<a href="http://www.gns.cri.nz/who/staff_search.html">Staff Search</a>'
menu1[8]='<a href="http://www.gns.cri.nz/who/globe/index.html">Globe Magazine</a>'
menu1[9]='<a href="http://www.gns.cri.nz/who/links.html">Links</a>'

//LEARN
var menu2=new Array()
menu2[0]='<a href="http://www.gns.cri.nz/kids/index.html">Learning Zone</a>'
menu2[1]='<a href="http://www.gns.cri.nz/what/index.html"><b>What we do</b></a>'
menu2[2]='<a href="http://www.gns.cri.nz/what/earthact/index.html">&nbsp;The Active Earth</a>'
menu2[3]='<a href="http://www.gns.cri.nz/wellingtonfault/index.html">&nbsp;The Wellington Fault</a>'
menu2[4]='<a href="http://www.gns.cri.nz/iceandsnow/index.html">&nbsp;Ice and Snow</a>'
menu2[5]='<a href="http://www.gns.cri.nz/what/earthres/index.html">&nbsp;Earth\'s Resources</a>'
menu2[6]='<a href="http://www.gns.cri.nz/what/atom/index.html">&nbsp;Using the Atom</a>'
menu2[7]='<a href="http://www.gns.cri.nz/what/earthhist/index.html">&nbsp;Earth History</a>'
menu2[8]='<a href="http://www.gns.cri.nz/what/earthhist/fossils/index.html">&nbsp;About NZ Fossils</a>'
menu2[9]='<a href="http://www.gns.cri.nz/research/marine/index.html">&nbsp;Under the Ocean floor</a>'
menu2[10]='<div class="nl">More learning</div>'
menu2[11]='<a href="http://www.geonet.org.nz/latest.html" target="_blank">&nbsp;Latest Quake</a>'
menu2[12]='<a href="http://www.gns.cri.nz/what/earthact/earthquakes/index.html">&nbsp;About Quakes</a>'
menu2[13]='<a href="http://www.gns.cri.nz/kids/volcanoes/index.html">&nbsp;Volcanoes</a>'
menu2[16]='<a href="http://www.careers.govt.nz/default.aspx?id0=103&id1=J26141" target="_blank">&nbsp;Want to be a Geologist?</a>'
menu2[17]='<a href="http://www.gns.cri.nz/store/publications/topsell.html">&nbsp;Educational Publications</a>'
menu2[18]='<a href="http://www.gns.cri.nz/store/download/">&nbsp;Free Downloads</a>'
menu2[19]='<a href="http://images.gns.cri.nz/shop/photolib/" target="_blank">&nbsp;Photo Library</a>'
menu2[20]='<a href="http://www.gns.cri.nz/who/globe/index.html">&nbsp;Globe Magazine</a>'

//RESEARCH
var menu3=new Array()
menu3[0]='<a href="http://www.gns.cri.nz/research/index.html">Research Index</a>'
menu3[2]='<a href="http://www.gns.cri.nz/research/themes.html">Themes</a>'
menu3[3]='<a href="http://www.gns.cri.nz/research/energy.html">Energy & Resources</a>'
menu3[4]='<a href="http://www.gns.cri.nz/research/environment.html">Environment & Land Use</a>'
menu3[5]='<a href="http://www.gns.cri.nz/research/global_climate.html">Global & Climate Change</a>'
menu3[6]='<a href="http://www.gns.cri.nz/research/Hazards.html">Hazards & Tectonics</a>'
menu3[7]='<a href="http://www.gns.cri.nz/research/innovative.html">Innovative Technologies</a>'
menu3[8]='<a href="http://www.gns.cri.nz/research/collaboration.html">Collaboration & Consortia</a>'
menu3[9]='<a href="http://www.gns.cri.nz/research/expertise.html">Areas of Expertise</a>'
menu3[10]='<a href="http://www.gns.cri.nz/research/publications/index.html">Research publications</a>'
menu3[11]='<a href="http://www.gns.cri.nz/store/databases/index.html">Databases</a>'
menu3[12]='<a href="http://data.gns.cri.nz/paperdata/index.jsp">Data Repository</a>'

//SERV
var menu4=new Array()
//menu4[0]='<div class="nl">Consultancy</div>'
menu4[1]='<a href="http://www.gns.cri.nz/services/index.html">&nbsp;Commercial Services</a>'
menu4[4]='<a href="http://www.gns.cri.nz/services/consultancy_services.html">&nbsp;Consultancy Services</a>'
menu4[6]='<a href="http://www.gns.cri.nz/services/laboratory_services.html">&nbsp;Laboratory Services</a>'


//PROD
var menu5=new Array()
menu5[0]='<a href="http://www.gns.cri.nz/store/publications/index.html">Publications</a>'
menu5[1]='<a href="http://www.gns.cri.nz/store/databases/index.html">Databases</a>'
menu5[2]='<a href="http://www.gns.cri.nz/store/software/index.html">Software</a>'
menu5[3]='<a href="http://www.gns.cri.nz/store/publications/maps.html">Maps</a>'
menu5[4]='<a href="http://images.gns.cri.nz/">Photo Library</a>'
menu5[7]='<a href="http://www.gns.cri.nz/store/download/index.html">Downloads</a>'
menu5[8]='<a href="http://www.gns.cri.nz/store/probe/index.html">Stephenson\'s Probe</a>'

//VACANT
var menu6=new Array()
menu6[0]='<a href="http://www.gns.cri.nz/news/vacancies/index.html">Vacancies</a>'

//NEW
var menu7=new Array()
menu7[1]='<a href="http://www.gns.cri.nz/news/newcontent/index.html">New Content</a>'
menu7[2]='<a href="http://www.gns.cri.nz/news/release/index.html">Media Releases</a>'
menu7[3]='<a href="http://www.gns.cri.nz/news/audio.html">Audio/podcasts</a>'
menu7[4]='<a href="http://www.geonet.org.nz/">Latest Quake</a>'
menu7[5]='<a href="http://www.gns.cri.nz/news/conferences/index.html">Conferences</a>'
menu7[6]='<a href="http://www.gns.cri.nz/news/vacancies/index.html">Vacancies</a>'
menu7[7]='<a href="http://www.geonet.org.nz/volcanocam.html">Volcanoes</a>'
menu7[8]='<a href="http://www.gns.cri.nz/store/publications/latestpubs.html">Latest Publications</a>'
menu7[9]='<a href="http://www.gns.cri.nz/news/fellowships/index.html">Scholarships</a>'
menu7[10]='<a href="http://www.gns.cri.nz/research/publications/recent/index.html">Recent Staff Papers</a>' 
menu7[11]='<a href="http://images.gns.cri.nz/">New Images in Library</a>' 

//Side nav TODAY
var menu9=new Array()
menu9[0]='<a href="http://www.geonet.org.nz/">GeoNet</a>'
menu9[1]='<a href="http://www.geonet.org.nz/earthquake/quakes/latest.html">Latest Quake</a>'
menu9[2]='<a href="http://www.geonet.org.nz/volcano/volcams.html">Volcano Watch</a>'
menu9[4]='<a href="http://www.gns.cri.nz/what/earthact/earthquakes/bulletin.html">Quake alerts</a>'

//Side nav OTHER
var menu10=new Array()
menu10[0]='<a href="http://www.geonet.org.nz">GeoNet</a>'
menu10[1]='<a href="nic/index.html">National Isotope Centre</a>'
menu10[2]='<a href="services/ionbeam/index.html">&nbsp;&nbsp;Ion beam Lab</a>'
menu10[3]='<a href="http://www.gns.cri.nz/nic/rafterradiocarbon/">&nbsp;&nbsp;Rafter Radiocarbon Lab</a>'
menu10[4]='<a href="http://www.gns.cri.nz/nic/stableisotopes/">&nbsp;&nbsp;Stable Isotope Lab</a>'
menu10[5]='<a href="http://www.isoscan.com/">&nbsp;&nbsp;IsoScan</a>'
menu10[6]='<a href="http://www.globeclaritas.com/">Globe Claritas</a>'
menu10[8]='<a href="store/databases/index.html">Databases and web maps</a>'
menu10[9]='<a href="store/databases/seismic/pdq/index.html">PDQMap</a>'
menu10[10]='<a href="http://data.gns.cri.nz/minerals">MinMap</a>'

//Side nav RELATED
var menu11=new Array()
menu11[0]='<a href="research/marine/deep_sea_research.html">Deep sea research</a>'
menu11[1]='<a href="http://www.unclosnz.org.nz/">UNCLOS Article 76</a>'
menu11[2]='<a href="http://www.gns.cri.nz/nzpaleoclimate/">Paleoclimate</a>'
menu11[3]='<a href="http://www.naturalhazards.net.nz/">Natural Hazards.net</a>'
menu11[4]='<a href="who/friends.html">Friends of GNS</a>'


var menuwidth='165px' //default menu width
/* var menubgcolor='#adadad'  //menu bgcolor */
var menubgcolor='#F2F2F2'  //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="-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-topedge
}
}
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