/***********************************************
* 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="180px" //set default menu width.

var linkset=new Array()
//SPECIFY MENU SETS AND THEIR LINKS. FOLLOW SYNTAX LAID OUT
linkset[1]='<b>&nbsp;Be An Athlete</b>'
linkset[1]+='<hr>' //Optional Separator
linkset[1]+='<a href="athlete.html">Be An Athlete</a>'
linkset[1]+='<a href="faqs.html#athlete">FAQs</a>'
linkset[1]+='<a href="athlete.html#jrmaccabi">Jr. Maccabi</a>'
linkset[1]+='<a href="athlete.html#tryout">Tryout Schedule</a>'

linkset[3]='<b>&nbsp;Be A Host Family</b>'
linkset[3]+='<hr>' //Optional Separator
linkset[3]+='<a href="family.html">Be A Host Family</a>'
linkset[3]+='<a href="arrivals.html">Delegation Arrivals</a>'

linkset[5]='<b>&nbsp;Be A Sponsor</b>'
linkset[5]+='<hr>' //Optional Separator
linkset[5]+='<a href="sponsor.html">Be A Sponsor</a>'
linkset[5]+='<a href="honorroll.htm" target="new">Honor Roll</a>'
linkset[5]+='<a href="donate.asp">Donate Now</a>'

linkset[7]='<b>&nbsp;News & Photos</b>'
linkset[7]+='<hr>' //Optional Separator
linkset[7]+='<a href="newsboard.html">News Board</a>'
linkset[7]+='<a href="photogalleries.html">Photo Galleries</a>'

linkset[8]='<b>&nbsp;SCOREBOARD</b>'
linkset[8]+='<hr>' //Optional Separator
linkset[8]+='<a href="scoreboard.html#team">Team Sports</a>'
linkset[8]+='<a href="scoreboard.html#individual">Individual Sports</a>'

linkset[9]='<b>&nbsp;About the Games</b>'
linkset[9]+='<hr>' //Optional Separator
linkset[9]+='<a href="aboutgames.html">About the Games</a>'
linkset[9]+='<a href="histgames.html">History of the Games</a>'
linkset[9]+='<a href="alumni.html">Maccabi Alumni</a>'
linkset[9]+='<a href="links.html">Related Links</a>'

linkset[10]='<b>&nbsp;Visitor Information</b>'
linkset[10]+='<hr>' //Optional Separator
linkset[10]+='<a href="visitorinfo.html">Stamford Visitor Guide</a>'
linkset[10]+='<a href="mapquest.html">Let Us Help You Find It</a>'

linkset[12]='<b>&nbsp;FAQs</b>'
linkset[12]+='<hr>' //Optional Separator
linkset[12]+='<b>&nbsp;How do I become ...</b>'
linkset[12]+='<a href="faqs.html#athlete">An Athlete</a>'
linkset[12]+='<a href="faqs.html#family">A Host Family</a>'
linkset[12]+='<a href="faqs.html#volunteer">A Volunteer</a>'

linkset[13]='<b>&nbsp;Register For The Games</b>'
linkset[13]+='<hr>' //Optional Separator
linkset[13]+='<a href="https://www.jccmacreg.org/Contentpages/Login/Register.aspx">Register For The Games</a>'
linkset[13]+='<a href="register_form.html">Information Request Form</a>'
////No need to edit beyond here


var ie5=document.all && !window.opera
var ns6=document.getElementById

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){
var xpos=175; //origianl = 177
var ypos=15;
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
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+xpos+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY+ypos-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop-ypos+event.clientY+"px" : window.pageYOffset+eventY+"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()",1)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu


