
/***********************************************
* 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 menu1=new Array()
menu1[0]='<a href="about_us.htm">About CURRA</a>'
menu1[1]='<a href="funders.htm">Funders</a>'
menu1[2]='<a href="community_partners.htm">Community Partners</a>'
menu1[3]='<a href="researchers.htm">Researchers</a>'
menu1[4]='<a href="students_and_interns.htm">Students & Interns</a>'
menu1[5]='<a href="advisory_board.htm">Advisory Board</a>'
menu1[6]='<a href="contact_us.htm">Contact Us</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="research_overview.htm">Overview</a>'
menu2[1]='<a href="globalization_and_recovery.htm">Globalization  &  Recovery</a>'
menu2[2]='<a href="rural_youth.htm">Rural Youth   &  Recovery</a>'
menu2[3]='<a href="critical_habitat.htm" data-sub="1">Critical Habitat</a>'
menu2[4]='<a href="governing_future.htm" data-sub="2">Governing for the Future</a>'
menu2[5]='<a href="new_initiatives.htm" data-sub="3">New Initiatives</a>'

//Contents for menu 3, and so on
var menu3=new Array()

menu3[0]='<a href="community_radio.htm">Community Radio</a>'
menu3[1]='<a href="community_topics.htm">Community Topics</a>'
menu3[2]='<a href="curriculum_for_recovery.htm">Curriculum for Recovery</a>'
menu3[3]='<a href="fishery_MOU.htm">Fishery MOU Report</a>'
menu3[4]='<a href="gros_morne_beach_watch.htm">Gros Morne Beach Watch</a>'
menu3[5]='<a href="in_the_news.htm">In the News</a>'
menu3[6]='<a href="past_events.htm">Past Events</a>'

//Contents for menu 4, and so on
var menu4=new Array()

menu4[0]='<a href="fishplants.htm">Fishplants Today Photo Exhibit</a>'
menu4[1]='<a href="heritage.htm">Heritage</a>'
menu4[2]='<a href="local_knowledge.htm">Local Knowledge Encyclopaedia</a>'
menu4[3]='<a href="theatre.htm">Theatre</a>'

//Contents for menu 5
var menu5=new Array()
menu5[0]='<a href="newsletter.htm">Newsletter</a>'
menu5[1]='<a href="plain_language_summaries.htm">Plain Language Summaries</a>'
menu5[2]='<a href="presentations.htm">Presentations & Posters</a>'
menu5[3]='<a href="reports.htm">Reports</a>'
menu5[4]='<a href="interviews.htm">Audio Interviews</a>'
menu5[5]='<a href="videos.htm">Videos</a>'
menu5[6]='<a href="other_resources.htm">Other Resources</a>'

//Contents for menu 6
var menu6=new Array()
menu6[0]='<a href="links_affiliated_projects.htm">Affiliated Projects</a>'
menu6[1]='<a href="links_projects_of_interest.htm">Projects of Interest</a>'

// add new submenus here
subMenus = jQuery("<div id='curra_submenu_1' class='submenudiv'>"
         + "<a href='critical_cod_eelgrass.html'>Cod & Eelgrass</a>"
         + "<a href='critical_deep_sea_corals.html'>Deep Sea Corals</a>"
         + "<a href='critical_lobster_and_crab.html'>Lobster & Crab</a>"
         + "<a href='critical_plankton_and_nearshore_fish.html'>Plankton & Nearshore Fish&nbsp;&nbsp;</a>"
         + "<a href='critical_salmonid_fishes.html'>Salmonid Fishes</a>"
         + "</div>"
         + "<div id='curra_submenu_2' class='submenudiv'>"
         + "<a href='governance_cod.html'>Governance - Cod</a>"
         + "<a href='governance_st_pauls_inlet.html'>Governance - St. Paul's&nbsp;&nbsp;</a>"         
         + "<a href='governance_scallop_dragging.html'>Scallop Dragging</a>"         
         + "<a href='governance_wolffish.html'>Wolffish at Risk</a>"         
         + "</div>"
         + "<div id='curra_submenu_3' class='submenudiv'>"
         + "<a href='new_initiatives_food_security.html'>Community Food Security</a>"
         + "<a href='new_initiatives_forests_of_newfoundland.html'>Forests of Newfoundland</a>"         
         + "<a href='new_initiatives_lobster.html'>Lobster Reproductive Value</a>"         
         + "<a href='new_initiatives_membranipora.html'>Membranipora membranacea&nbsp;&nbsp;</a>"         
         + "<a href='new_initiatives_parkers_brook.html'>Parker's Brook Arctic Char</a>"         
         + "<a href='new_initiatives_other.html'>Other New Initiatives</a>"        
         + "</div>").hide();

var menuwidth='165px' //default menu width
var menubgcolor='lightyellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
var delayhide='';
/////No further editing 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"

jQuery('*[data-sub]').each(function(){
  var e = jQuery(this)
    , a = e.attr('data-sub');
    e.mouseover(function(){
      jQuery('#curra_submenu_'+a)
        .css('position','absolute')
        .css('top',dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+e.position().top+'px')
        .css('left',(jQuery('#dropmenudiv').position().left+jQuery('#dropmenudiv').width())+'px')
        .css('z-index','1000')
        .show()
        .mouseout(function(event){
          if((typeof jQuery(event.relatedTarget).attr('data-sub') === 'undefined' || jQuery(event.relatedTarget).attr('data-sub') === false) && jQuery(event.relatedTarget).parent()[0] !== jQuery(this)[0]){
            jQuery('#curra_submenu_'+a).hide();
            delayhidemenu();            
          }
          event.stopImmediatePropagation();
          event.preventDefault();
          return false;
        });
    }).mouseout(function(event){
      if(!jQuery(event.relatedTarget).parent().hasClass('submenudiv')){
        jQuery('#curra_submenu_'+a).hide();
      }
      else {
        clearTimeout(delayhide);
        setTimeout(function(){ clearTimeout(delayhide); },disappeardelay*0.5);
      }
    });
});

}

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

jQuery(document).ready(function(){
  jQuery('body').append(subMenus);
});


