/***********************************************
* 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
***********************************************/
// var menuwidth='165px' //default menu width
var menuwidth=165 //default menu width
var menubgcolor='#C8D4E4'  //menu bgcolor  #D1E9E9 CCFFFF 99CCFF
var disappeardelay=200  //250 menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

//Contents for menu: CIRCULATION
var menu1=new Array()
menu1[0]='<a href="/circ/loans.htm">Renew an Item</a>'
menu1[1]='<a href="/circ/placinghold.htm">Place a Hold</a>'
menu1[2]='<a href="/circ/request_it.htm">Can’t Find It? Request It!</a>'
menu1[3]='<a href="/circ/index.htm">Library Cards</a>'
menu1[4]='<a href="/circ/askus_circ.htm">Ask Circulation Services!</a>'

//Contents for menu: REFERENCE & RESEARCH
var menu4=new Array()
menu4[0]='<a href="/research/index.htm">All Research Services</a>'
menu4[1]='<a href="/research/subject_guide/index.htm">Online Research</a>'
menu4[2]='<a href="/rs/audio/downloadable.htm">Digital & Downloadable Collections</a>'
menu4[3]='<a href="/research/timely.htm">Hot Topics</a>'
// menu4[4]='<a href="/research/link/link.htm">Internet Sites</a>'
menu4[4]='<a href="/research/local_info.htm">Local Information and History </a>'
menu4[5]='<a href="http://ezproxy.st-charles.lib.il.us/login?url=http://la6mf3gn7p.cs.serialssolutions.com/">Super Search (Databases)</a>'
menu4[6]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: BOOKS
var menu2=new Array()

menu2[0]='<a href="/rs/index.htm">What to Read</a>'
menu2[1]='<a href="/arl/arl_new.htm">New Titles & Purchases</a>'
menu2[2]='<a href="/rs/authors.htm">Authors</a>'
menu2[3]='<a href="/rs/bookdiscussion.htm">Discuss Books</a>'
menu2[4]='<a href="/arl/arl_audio.htm">Audiobooks</a>'
menu2[5]='<a href="/rs/audio/downloadable.htm">Digital & Downloadable Collections</a>'
menu2[6]='<a href="/blog/readers">Blog - Read@SCPL</a>'
menu2[7]='<a href="/rs/findbooks.htm">Catalog Search Tips</a>'
menu2[8]='<a href="/rs/askus_rs.htm">Ask Readers Services!</a>'

//Contents for menu: MOVIES
var menu12=new Array()

menu12[0]='<a href="/rs/what_to_watch.htm">What to Watch</a>'
menu12[1]='<a href="http://www.linc.lib.il.us/web2/tramp2.exe/log_in?setting_key=stcharles&screen=QuickList.html&*list=New Entertainment DVDs&*listfile=SCNewDVD">New Entertainment DVDs</a>'
menu12[2]='<a href="/research/subject_guide/entertainment.htm">Subject Guide, Entertainment</a>'
menu12[3]='<a href="/blog/movies/">Blog - Movies@SCPL</a>'
menu12[4]='<a href="/rs/findmovies.htm">Catalog Search Tips</a>'
menu12[5]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: MUSIC
var menu13=new Array()

menu13[0]='<a href="http://www.linc.lib.il.us/web2/tramp2.exe/log_in?setting_key=stcharles&screen=QuickList.html&*list=New Music CDs&*listfile=SCNewCD">New Music CDs</a>'
menu13[1]='<a href="/research/subject_guide/music.htm">Subject Guide, Music</a>'
menu13[2]='<a href="/blog/music/">Blog - inTune@SCPL</a>'
menu13[3]='<a href="/rs/findmusic.htm">Catalog Search Tips</a>'
menu13[4]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: COMPUTERS
var menu5=new Array()
menu5[0]='<a href="/tech/computers.htm">Computers and Internet</a>'
menu5[1]='<a href="/tech/classes.htm">Computer Classes</a>'
menu5[2]='<a href="http://www.st-charles.il.us/stc_calendar/default.asp?CategoryID=72&TypeID=2&submit1=Go">Calendar - Computer Classes</a>'
menu5[3]='<a href="/tech/index.htm">Technology Center</a>'
menu5[4]='<a href="/contact/wireless/wireless.htm">Wireless Internet Access</a>'
menu5[5]='<a href="/contact/policy/internet.htm">Library Policy</a>'
menu5[6]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: LIBRARY INFO
var menu8=new Array()
menu8[0]='<a href="/contact/index.htm">A to Z index</a>'
menu8[1]='<a href="/contact/general.htm">General Info</a>'
menu8[2]='<a href="/contact/location.htm">Hours and Location</a>'
menu8[3]='<a href="/blog/jobs/">Jobs Available</a>'
menu8[4]='<a href="/contact/policy/index.htm">Library Policies</a>'
menu8[5]='<a href="/contact/publications.htm">Publications and Events</a>'
menu8[6]='<a href="/contact/support.htm">Support the Library</a>'
menu8[7]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: ADULTS
var menu10=new Array()
menu10[0]='<a href="/at_lib/index.htm">Events for Adults</a>'
menu10[1]='<a href="http://www.st-charles.il.us/stc_calendar/default.asp?CategoryID=70&TypeID=2&submit1=Go">Calendar</a>'
menu10[2]='<a href="/rs/libbkdis.htm">Book Discussion Groups</a>'
menu10[3]='<a href="/at_lib/itg.htm">Discover Your Library!</a>'
menu10[4]='<a href="/blog/jobs/">Jobs Available</a>'
menu10[5]='<a href="/contact/volunteering.htm">Volunteering</a>'
menu10[6]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: TEENS
var menu7=new Array()
menu7[0]='<a href="/teens/index.htm">Teen Services</a>'
menu7[1]='<a href="/teens/events.htm">Events</a>'
menu7[2]='<a href="/tech/computers.htm">Computers & Internet</a>'
menu7[3]='<a href="/rs/audio/downloadable.htm">Digital & Downloadable Collections</a>'
//menu7[4]='<a href="http://www.st-charles.il.us/stc_calendar/default.asp?CategoryID=71&TypeID=2&submit1=Go">Calendar</a>'
menu7[4]='<a href="/teens/ygadread.htm">Good Reads</a>'
menu7[5]='<a href="/teens/homework_help.htm">Homework Help</a>'
menu7[6]='<a href="/teens/teenques.htm">How do I...?</a>'
menu7[7]='<a href="/teens/tap.htm">TAP - Teen Advisory Panel</a>'
menu7[8]='<a href="/research/subject_guide/teen_issues.htm">Teen Issues</a>'
menu7[9]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: YOUTH
var menu6=new Array()
menu6[0]='<a href="/ys/index.htm">Youth Services: Infant - Grade 8</a>'
menu6[1]='<a href="/ys/ythprogramguide.htm">Youth Events</a>'
menu6[2]='<a href="/evanced/lib/eventcalendar.asp">Calendar & Registration</a>'
menu6[3]='<a href="/ys/ys_hw_help.htm">Reference, Homework Help &  Internet Links</a>'
menu6[4]='<a href="/ys/good_reads.htm">Good Reads</a>'
menu6[5]='<a href="/ys/ys_parents.htm">Parents, Teachers & Scout Leaders</a>'
menu6[6]='<a href="/ys/bwnews/pdf/bwn_archive.htm">Bookworm News</a>'
menu6[7]='<a href="/ys/buzz/MSB.pdf">Middle School Buzz</a>'
menu6[8]='<a href="/contact/ystaff.htm">Ask Youth Services!</a>'

//Contents for menu: OUTREACH
var menu9=new Array()
menu9[0]='<a href="/outreach/index.htm">About Outreach Services</a>'
menu9[1]='<a href="/outreach/outreach_faq.htm">Frequently Asked Questions</a>'
menu9[2]='<a href="/outreach/outreach_deliv.htm">Delivery options</a>'
menu9[3]='<a href="/outreach/outreach_large.htm">Large Print Materials & Magnification Tools</a>'
menu9[4]='<a href="/outreach/outreach_resources.htm">Resources & links</a>'
menu9[5]='<a href="/outreach/askus_outreach.htm">Ask Outreach Services!</a>'

//Contents for menu: EVENTS, CLASSES
var menu3=new Array()
menu3[0]='<a href="/at_lib/index.htm">Adult Events</a>'
menu3[1]='<a href="/ys/ythprogramguide.htm">Youth Events</a>'
menu3[2]='<a href="/at_lib/programpages/app.pdf">Program Pages (PDF)</a>'
menu3[3]='<a href="http://www.st-charles.il.us/stc_calendar/default.asp?CategoryID=&TypeID=2&submit1=Go">Calendars - All</a>'
menu3[4]='<a href="http://www.st-charles.il.us/stc_calendar/default.asp?CategoryID=70&TypeID=2&submit1=Go">Calendar - Adults </a>'
menu3[5]='<a href="http://www.st-charles.il.us/stc_calendar/default.asp?CategoryID=71&TypeID=2&submit1=Go">Calendar - Teens </a>'
menu3[6]='<a href="/evanced/lib/eventcalendar.asp">Calendar - Youth</a>'
menu3[7]='<a href="http://www.st-charles.il.us/stc_calendar/default.asp?CategoryID=72&TypeID=2&submit1=Go">Calendar - Computer Classes</a>'
menu3[8]='<a href="/research/helpindex.htm">Ask Us!</a>'

//Contents for menu: En Espanol
var menu11=new Array()
menu11[0]='<a href="/espanol/index.htm">Información en español</a>'
menu11[1]='<a href="http://www.linc.lib.il.us/html/spanish/welcome_sc.html">Catálogo</a>'
menu11[2]='<a href="http://www.linc.lib.il.us/web2/tramp2.exe/log_in?setting_key=SCSPANISH&screen=MyAccount.html">Mi cuenta</a>'
menu11[3]='<a href="/espanol/card.htm">Su Tarjeta de la Biblioteca</a>'
menu11[4]='<a href="/espanol/hours.htm">Horas del Servicio/Direcciones</a>'
menu11[5]='<a href="/espanol/policy/index.htm">Políticas Y Procedimientos</a>'
menu11[6]='<a href="/espanol/loan.htm">Información sobre préstamo de materiales</a>'
menu11[7]='<a href="/espanol/hold.htm">Pedir un Libro o Otro Articulo</a>'
menu11[8]='<a href="/espanol/sub_alpha.htm">Recursos Electrónicos</a>'
menu11[9]='<a href="/espanol/links.htm">Sitios en Español</a>'
menu11[10]='<a href="/research/helpindex.htm">Ask Us!</a>'



/////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.y=dropmenuobj.y + 4
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

