// 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 futureStudents=new Array()
    futureStudents[0]='<a href="/cos/admissions.asp">Admissions</a>'
    futureStudents[1]='<a href="/cos/calendar/netcal.asp">Calendar</a>'
    futureStudents[2]='<a href="/cos/catalogs.asp">Catalogs</a>'
    futureStudents[3]='<a href="/cos/degrees.asp">Degrees &amp; Requirements</a>'
    futureStudents[4]='<a href="/cos/faqs.asp">FAQs</a>'
    futureStudents[5]='<a href="/cos/scholarships.asp">Scholarships</a>'
    futureStudents[6]='<a href="/cos/studentresources.asp">Student Resources</a>'
    futureStudents[7]='<a href="http://www.marshall.edu/cosstudentservices/">Student Services</a>'
    futureStudents[8]='<a href="/cos/contact.asp">Request Information</a>'
    futureStudents[9]='<a href="/cos/tours.asp">Tours</a>'
    futureStudents[10]='<a href="/cos/ambassadors/">Research Ambassadors</a>'

var currentStudents=new Array()
    currentStudents[0]='<a href="/cos/calendar/netcal.asp">Calendar</a>'
    currentStudents[1]='<a href="/cos/catalogs.asp">Catalogs</a>'
    currentStudents[2]='<a href="/cos/directory.asp">COS Directory</a>'
    currentStudents[3]='<a href="/cos/degrees.asp">Degrees &amp; Requirements</a>'
    currentStudents[4]='<a href="/cos/faqs.asp">FAQs</a>'
    currentStudents[5]='<a href="/cos/scholarships.asp">Scholarships</a>'
    currentStudents[6]='<a href="/cos/studentresources.asp">Student Resources</a>'
    currentStudents[7]='<a href="http://www.marshall.edu/cosstudentservices/">Student Services</a>'
    currentStudents[8]='<a href="/cos/syllabi.asp">Syllabi</a>'
    currentStudents[9]='<a href="/cos/tours.asp">Tours</a>'
    currentStudents[10]='<a href="/cos/ambassadors/">Research Ambassadors</a>'

var alumniFriends=new Array()
    alumniFriends[0]='<a href="/cos/alumlist.asp">Alumni Listing</a>'
    alumniFriends[2]='<a href="/cos/alumnews.asp">Alumni Newsletter</a>'
    alumniFriends[1]='<a href="/cos/alumnifriends/alumprofile.asp">Alumni Profile</a>'
    alumniFriends[3]='<a href="/cos/alumresources.asp">Alumni Resources</a>'
    alumniFriends[4]='<a href="/cos/alumnifriends/alumsearch.asp">Alumni Search</a>'
    alumniFriends[5]='<a href="/cos/calendar/netcal.asp">Calendar</a>'
    alumniFriends[6]='<a href="/cos/directory.asp">COS Directory</a>'
    alumniFriends[7]='<a href="/cos/contact.asp">Contact</a>'
    alumniFriends[8]='<a href="/cos/tours.asp">Tours</a>'

var facStaff=new Array()
    facStaff[0]='<a href="http://www.marshall.edu/academic-affairs/">Academic Affairs</a>'
    facStaff[1]='<a href="/cos/calendar/netcal.asp">Calendar</a>'
    facStaff[2]='<a href="/cos/catalogs.asp">Catalogs</a>'
    facStaff[3]='<a href="/cos/committees.asp">Committees</a>'
    facStaff[4]='<a href="/cos/directory.asp">COS Directory</a>'
    facStaff[5]='<a href="http://www.marshall.edu/academic-affairs/duedates.asp">Due Dates</a>'
    facStaff[6]='<a href="/cos/facprofile.asp">Faculty Profile</a>'
    facStaff[7]='<a href="http://www.marshall.edu/cositc/">COS IT Center</a>'
    facStaff[8]='<a href="/cos/managesyllabi.asp">Manage COS Syllabus</a>'
    /*facStaff[8]='<a href="/cos/FECRAHC.asp">Merit Pay Blog</a>'*/
    facStaff[9]='<a href="https://outlookweb.marshall.edu/exchange">Outlook Web Access</a>'
    facStaff[10]='<a href="/cos/policies.asp">Policies &amp; Guidelines</a>'
    facStaff[11]='<a href="/cos/training.asp">Training</a>'

var departments=new Array()
    departments[0]='<a href="http://www.marshall.edu/biology/">Biology</a>'
    departments[1]='<a href="http://www.marshall.edu/chemistry/">Chemistry</a>'
    departments[2]='<a href="/cos/Office.asp">Dean\'s Office</a>'
    departments[3]='<a href="http://www.marshall.edu/es/">Environmental Science</a>'
    departments[4]='<a href="http://www.marshall.edu/geology/">Geology</a>'
    /*departments[5]='<a href="">Integrated Science</a>'*/
    departments[6]='<a href="http://www.marshall.edu/ISAT/">Integrated Science &amp; Technology</a>'
    departments[7]='<a href="http://www.marshall.edu/math/">Mathematics</a>'
    departments[8]='<a href="http://www.marshall.edu/Physics/">Physics</a>'

var research=new Array()
    /*research[0]='<a href="/cos/researchentre.asp">Featured Projects</a>'*/
    research[1]='<a href="http://www.marshall.edu/biology/research.asp">Biology</a>'
    research[2]='<a href="http://www.marshall.edu/chemistry/researchops.asp">Chemistry</a>'
	research[3]='<a href="http://www.marshall.edu/geology/research.asp">Geology</a>'
    research[4]='<a href="http://www.marshall.edu/math/research.asp">Mathematics</a>'
    research[5]='<a href="http://www.marshall.edu/Physics/labs.asp">Physics</a>'
    research[6]='<a href="/cos/ambassadors/">Research Ambassadors</a>'

var resources=new Array()
    resources[0]='<a href="/cos/calendar/netcal.asp">Calendar</a>'
    resources[1]='<a href="/cos/directory.asp">COS Directory</a>'
    resources[2]='<a href="http://www.marshall.edu/mbic/">Imaging Center</a>'
    resources[3]='<a href="http://www.marshall.edu/cositc/">COS IT Center</a>'
    resources[4]='<a href="http://www.marshall.edu/preprof/">Pre-Professionals</a>'
    resources[5]='<a href="/cos/sitemap.asp">Site Map</a>'
    resources[6]='<a href="/cos/files/CoSStrInitAug04.pdf">Strategic Plan</a>'
    resources[7]='<a href="/cos/studentresources.asp">Student Resources</a>'
    resources[8]='<a href="http://www.marshall.edu/cosstudentservices/">Student Services</a>'
    resources[9]='<a href="/cos/tours.asp">Tours</a>'

var menuwidth='225px' //default menu width
var menubgcolor='#FFFFFF'  //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

// change value of hidden field in search so we know JS is enabled
$(document).ready(function(){
    window.document.getElementById('SearchJavaScript').value = '1';
});