/***********************************************
* Pop-it menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var defaultMenuWidth="135px" //set default menu width.

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT

linkset[0]='<a href="/beaconnews/">Beacon News</a>'
linkset[0]+='<a href="/couriernews/">Courier News</a>'
linkset[0]+='<a href="/heraldnews/">Herald News</a>'
linkset[0]+='<a href="/newssun/">News Sun</a>'
linkset[0]+='<a href="/sunpub/naper/">Naperville Sun</a>'
linkset[0]+='<a href="/sunpub/">Sun Publications</a>'

linkset[1]='<a href="/beaconnews/business/">Beacon News Business</a>'
linkset[1]+='<a href="/couriernews/business/">Courier News Business</a>'
linkset[1]+='<a href="/heraldnews/business/">Herald News Business</a>'
linkset[1]+='<a href="/newssun/business/">News Sun Business</a>'
linkset[1]+='<a href="/sunpub/naper/business/">Naper Sun Business</a>'

linkset[2]='<a href="/beaconnews/entertainment/">Beacon News (Go)</a>'
linkset[2]+='<a href="/couriernews/entertainment/">Courier News (Go)</a>' 
linkset[2]+='<a href="/heraldnews/entertainment/">Herald News (Going)</a>' 
linkset[2]+='<a href="/newssun/entertainment/">News Sun (Go)</a>' 
linkset[2]+='<a href="/sunpub/outandabout/">Suns (Out &amp; About)</a>' 

linkset[3]='<a href="/entertainment/books/">Books</a>'
linkset[3]+='<a href="/features/chicagodateline/">Chicago Dateline</a>' 
linkset[3]+='<a href="/entertainment/dining/">Dining</a>'
linkset[3]+='<a href="http://www.suburbanchicagonews.com/ap/entertainment/">Hollywood Update</a>' 
linkset[3]+='<a href="/entertainment/justforfun/">Just for Fun</a>' 
linkset[3]+='<a href="/entertainment/tv/">Television</a>'
linkset[3]+='<a href="/entertainment/travel/">Travel</a>'
linkset[3]+='<a href="/entertainment/videogames/">Video Games</a>'

linkset[4]='<a href="/beaconnews/features/">BN (Voice)</a>'
linkset[4]+='<a href="/couriernews/features/">CN (Fox Valley Living)</a>' 
linkset[4]+='<a href="/heraldnews/features/">HN (Your Life)</a>'
linkset[4]+='<a href="/newssun/features/">News Sun (Your Life)</a>' 
linkset[4]+='<a href="/sunpub/naper/everyday/">Naper Sun (Everyday)</a>'

linkset[5]='<a href="/features/food/">Food</a>' 
linkset[5]+='<a href="/features/health/">Health</a>' 
linkset[5]+='<a href="/features/homeandgarden/">Home & Garden</a>' 
linkset[5]+='<a href="/features/religion/">Religion</a>' 
linkset[5]+='<a href="/features/technology/">Technology</a>'

linkset[6]='<a href="/beaconnews/opinions/">Beacon News Opinions</a>'
linkset[6]+='<a href="/couriernews/opinions/">Courier News Opinions</a>'
linkset[6]+='<a href="/heraldnews/opinions/">Herald News Opinions</a>'
linkset[6]+='<a href="/newssun/opinions/">News Sun Opinions</a>'
linkset[6]+='<a href="/sunpub/naper/opinions/">Naper Sun Opinions</a>'

linkset[7]='<a href="/beaconnews/sports/">Beacon News Sports</a>'
linkset[7]+='<a href="/couriernews/sports/">Courier News Sports</a>'
linkset[7]+='<a href="/heraldnews/sports/">Herald News Sports</a>'
linkset[7]+='<a href="/newssun/sports/">News Sun Sports</a>'
linkset[7]+='<a href="/sunpub/naper/sports/">Naperville Sun Sports</a>'

linkset[8]='<a href="/search/">30-Day Search</a>'
linkset[8]+='<a href="/search/archive.asp">Archives</a>'
  
linkset[9]='<a href="/beaconnews/features/food/">Food</a>' 
linkset[9]+='<a href="/beaconnews/features/health/">Health</a>' 
linkset[9]+='<a href="/features/homeandgarden/">Home & Garden</a>' 
linkset[9]+='<a href="/beaconnews/features/religion/">Religion</a>' 
linkset[9]+='<a href="/features/technology/">Technology</a>'

linkset[10]='<a href="/couriernews/features/food/">Food</a>' 
linkset[10]+='<a href="/couriernews/features/health/">Health</a>' 
linkset[10]+='<a href="/features/homeandgarden/">Home & Garden</a>' 
linkset[10]+='<a href="/couriernews/features/religion/">Religion</a>' 
linkset[10]+='<a href="/features/technology/">Technology</a>'

linkset[11]='<a href="/heraldnews/features/food/">Food</a>' 
linkset[11]+='<a href="/heraldnews/features/health/">Health</a>' 
linkset[11]+='<a href="/features/homeandgarden/">Home & Garden</a>' 
linkset[11]+='<a href="/heraldnews/features/religion/">Religion</a>' 
linkset[11]+='<a href="/features/technology/">Technology</a>'

linkset[12]='<a href="/newssun/features/food/">Food</a>' 
linkset[12]+='<a href="/newssun/features/health/">Health</a>' 
linkset[12]+='<a href="/features/homeandgarden/">Home & Garden</a>' 
linkset[12]+='<a href="/newssun/features/religion/">Religion</a>' 
linkset[12]+='<a href="/features/technology/">Technology</a>'

////No need to edit beyond here

var ie5=document.all && !window.opera
var ns6=document.getElementById
if(navigator.appVersion.indexOf("Mac") != -1) var ie5=0

if (ie5||ns6) 
document.write('<div id="popitmenu" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=which
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
menuobj.style.left=ie5? iecompattest().scrollLeft+136+"px" : window.pageXOffset+131+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY-10+"px" : window.pageYOffset+eventY-10+"px"
menuobj.style.visibility="visible"
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.visibility="hidden"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu
