// 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 WHO WE ARE
var menu1=new Array()
menu1[0]='<a href="http://www.gns.cri.nz/who/globe/annual.html">Annual Report</a>'
menu1[1]='<a href="http://www.gns.cri.nz/who/intent.html">Statement of Intent</a>'
menu1[2]='<a href="http://www.gns.cri.nz/who/structure.html">GNS Structure</a>'
menu1[3]='<a href="http://www.gns.cri.nz/who/directors.html">Board of Directors</a>'
menu1[4]='<a href="http://www.gns.cri.nz/who/management.html">Management</a>'
menu1[5]='<a href="http://www.gns.cri.nz/who/office.html">Office Locations</a>'
menu1[6]='<a href="http://www.gns.cri.nz/who/staff_search.html">Staff Search</a>'
menu1[7]='<a href="http://www.gns.cri.nz/who/globe/index.html">Globe Magazine</a>'
menu1[8]='<a href="http://www.gns.cri.nz/who/links.html">Links</a>'


//Contents for menu 2
var menu2=new Array()
menu2[0]='<a href="http://www.gns.cri.nz/what/index.html"><b>What we do</b></a>'
menu2[1]='<a href="http://www.gns.cri.nz/what/earthact/index.html">&nbsp;The Active Earth</a>'
menu2[2]='<a href="http://www.gns.cri.nz/what/earthres/index.html">&nbsp;Earth\'s Resources</a>'
menu2[3]='<a href="http://www.gns.cri.nz/what/atom/index.html">&nbsp;Using the Atom</a>'
menu2[4]='<a href="http://www.gns.cri.nz/what/earthhist/index.html">&nbsp;Earth History</a>'
menu2[5]='<a href="http://www.gns.cri.nz/what/earthhist/fossils/index.html">&nbsp;About NZ Fossils</a>'
menu2[6]='<a href="http://www.gns.cri.nz/research/marine/index.html">&nbsp;Under the Ocean floor</a>'
menu2[7]='<div class="nl">More learning</div>'
menu2[8]='<a href="http://www.geonet.org.nz/latest.html" target="_blank">&nbsp;Latest Quake</a>'
menu2[9]='<a href="http://www.gns.cri.nz/what/earthact/earthquakes/index.html">&nbsp;About Quakes</a>'
menu2[10]='<a href="http://www.gns.cri.nz/what/earthact/volcanoes/index.html">&nbsp;Volcanoes</a>'
menu2[11]='<a href="http://www.hazardwatch.co.nz" target="_blank">&nbsp;HazardWatch</a>'
menu2[12]='<a href="http://www.quaketrackers.org.nz" target="_blank">&nbsp;Quake Trackers</a>'
menu2[13]='<a href="http://www.careers.govt.nz/default.aspx?id0=103&id1=J26141" target="_blank">&nbsp;Want to be a Geologist?</a>'
menu2[14]='<a href="http://www.gns.cri.nz/store/publications/topsell.html">&nbsp;Educational Publications</a>'
menu2[15]='<a href="http://www.gns.cri.nz/store/download/">&nbsp;Free Downloads</a>'
menu2[16]='<a href="http://images.gns.cri.nz/shop/photolib/" target="_blank">&nbsp;Photo Library</a>'
menu2[17]='<a href="http://www.gns.cri.nz/who/globe/index.html">&nbsp;Globe Magazine</a>'

//Contents for menu 3 RESEARCH
var menu3=new Array()
menu3[0]='<a href="http://www.gns.cri.nz/research/index.html">Research Index</a>'
menu3[1]='<a href="http://www.gns.cri.nz/research/programmes.html">Programmes</a>'
menu3[2]='<a href="http://www.gns.cri.nz/research/themes.html">Themes</a>'
menu3[4]='<a href="http://www.gns.cri.nz/research/funding_descrip.html">Funding Sources</a>'
menu3[5]='<a href="http://www.gns.cri.nz/research/publications/index.html">Research publications</a>'
menu3[6]='<a href="http://www.gns.cri.nz/store/databases/index.html">Databases</a>'
menu3[7]='<a href="http://data.gns.cri.nz/paperdata/index.jsp">Data Repository</a>'
menu3[8]='<a href="http://www.gns.cri.nz/research/publications/recent/index.html">Recent Staff Papers</a>' 

//Contents for menu 4, SERVICES
var menu4=new Array()
menu4[0]='<div class="nl">Consultancy</div>'
/*menu4[0]='<a href="#" title="Heading for Consultancy"><b>Consultancy</b></a>' */
menu4[1]='<a href="http://www.gns.cri.nz/services/index.html">&nbsp;Commercial Services</a>'
menu4[2]='<a href="http://www.gns.cri.nz/who/globe/index.html">&nbsp;Globe Magazine</a>'
menu4[5]='<div class="nl">Analytic Services</div>'
menu4[6]='<a href="http://www.gns.cri.nz/services/labservices.html">&nbsp;Laboratory Services</a>'
menu4[7]='<a href="http://www.rafterradiocarbon.co.nz/">&nbsp;Radiocarbon</a>'
menu4[8]='<a href="http://www.rafterisotopes.co.nz/">&nbsp;Isotope Analysis</a>'
menu4[9]='<a href="http://www.gns.cri.nz/services/ionbeam/index.html">&nbsp;Ion beam Analysis</a>'
menu4[10]='<a href="http://www.isoscan.com/">&nbsp;Isoscan</a>'
menu4[11]='<a href="http://www.gns.cri.nz/store/databases/index.html">&nbsp;Databases</a>'
menu4[12]='<a href="http://data.gns.cri.nz/paperdata/index.jsp">&nbsp;Data repository</a>'


//Contents for menu 5 PRODUCTS
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">Data</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[5]='<a href="http://www.gns.cri.nz/services/index.html">Services</a>'
menu5[6]='<a href="http://www.gns.cri.nz/services/labservices.html">Lab Services </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>'
menu5[9]='<a href="http://www.gns.cri.nz/store/publications/mapdata.html">Digital Map Data</a>'

//Contents for menu 6
var menu6=new Array()
menu6[0]='<a href="http://www.gns.cri.nz/news/vacancies/index.html">Vacancies</a>'
menu6[1]='<a href="http://www.gns.cri.nz/news/vacancies/overview.htm">Introduction to GNS Science</a>'
menu6[2]='<a href="http://www.gns.cri.nz/news/vacancies/geninfo.html">About NZ</a>'
menu6[3]='<a href="http://www.gns.cri.nz/who/globe/index.html">Globe Magazine</a>'
menu6[4]='<a href="http://www.gns.cri.nz/news/vacancies/applicindex.html">Vacancy application form</a>'



//Contents for menu 7 WHATS NEW
var menu7=new Array()
menu7[0]='<a href="http://www.gns.cri.nz/news/newcontent/index.html">New Content</a>'
menu7[1]='<a href="http://www.gns.cri.nz/news/release/index.html">Media Releases</a>'
menu7[2]='<a href="http://www.geonet.org.nz/">Latest Quake</a>'
menu7[3]='<a href="http://www.gns.cri.nz/news/conferences/index.html">Conferences</a>'
menu7[4]='<a href="http://www.gns.cri.nz/news/vacancies/index.html">Vacancies</a>'
menu7[5]='<a href="http://www.geonet.org.nz/volcanocam.html">Volcanoes</a>'
menu7[6]='<a href="http://www.gns.cri.nz/store/publications/latestpubs.html">Latest Publications</a>'
menu7[7]='<a href="http://www.gns.cri.nz/news/fellowships/index.html">Fellowships</a>'
menu7[8]='<a href="http://www.gns.cri.nz/research/publications/recent/index.html">Recent Staff Papers</a>' 
menu7[9]='<a href="http://images.gns.cri.nz/">New Images in Library</a>' 


//Contents for menu 8 Side nav for SIL
var menu8=new Array()
menu8[0]='<a href="deuterium.html">Deuterium</a>'
menu8[1]='<a href="oxygen.html">Oxygen</a>'
menu8[2]='<a href="nitrogen.html">Nitrogen</a>'
menu8[3]='<a href="carbon.html">Carbon</a>'
menu8[4]='<a href="sulphur.html">Sulphur</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