<!--

// filename: image_map_functions.js
// mouse over-out functions

/***********************************************
* 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="100px" //set default menu width.

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

// linkset[0]='<a href="http://dynamicdrive.com">Dynamic Drive</a>'
// linkset[1]='<a href="http://msnbc.com">MSNBC</a>'

linkset[0]='<a href="state_name.php?state=AL">Alabama</a>'
linkset[1]='<a href="state_name.php?state=AK">Alaska</a>'
linkset[2]='<a href="state_name.php?state=AR">Arizona</a>'
linkset[3]='<a href="state_name.php?state=AR">Arkansas</a>'
linkset[4]='<a href="state_name.php?state=CA">California</a>'
linkset[5]='<a href="state_name.php?state=CO">Colorado</a>'
linkset[6]='<a href="state_name.php?state=CN">Connecticut</a>'
linkset[7]='<a href="state_name.php?state=DE">Delaware</a>'
linkset[8]='<a href="state_name.php?state=DC">District of Columbia</a>'
linkset[9]='<a href="state_name.php?state=FL">Florida</a>'
linkset[10]='<a href="state_name.php?state=GE">Georgia</a>'
linkset[11]='<a href="state_name.php?state=GU">Guam</a>'
linkset[12]='<a href="state_name.php?state=HI">Hawaii</a>'
linkset[13]='<a href="state_name.php?state=ID">Idaho</a>'
linkset[14]='<a href="state_name.php?state=IL">Illinois</a>'
linkset[15]='<a href="state_name.php?state=IN">Indiana</a>'
linkset[16]='<a href="state_name.php?state=IA">Iowa</a>'
linkset[17]='<a href="state_name.php?state=KS">Kansas</a>'
linkset[18]='<a href="state_name.php?state=KY">Kentucky</a>'
linkset[19]='<a href="state_name.php?state=LA">Louisiana</a>'
linkset[20]='<a href="state_name.php?state=ME">Maine</a>'
linkset[21]='<a href="state_name.php?state=MD">Maryland</a>'
linkset[22]='<a href="state_name.php?state=MA">Massachusetts</a>'
linkset[23]='<a href="state_name.php?state=MI">Michigan</a>'
linkset[24]='<a href="state_name.php?state=MN">Minnesota</a>'
linkset[25]='<a href="state_name.php?state=MS">Mississippi</a>'
linkset[26]='<a href="state_name.php?state=MO">Missouri</a>'
linkset[27]='<a href="state_name.php?state=MA">Montana</a>'
linkset[28]='<a href="state_name.php?state=NE">Nebraska</a>'
linkset[29]='<a href="state_name.php?state=NV">Nevada</a>'
linkset[30]='<a href="state_name.php?state=NH">New Hampshire</a>'
linkset[31]='<a href="state_name.php?state=NJ">New Jersey</a>'
linkset[32]='<a href="state_name.php?state=NM">New Mexico</a>'
linkset[33]='<a href="state_name.php?state=NY">New York</a>'
linkset[34]='<a href="state_name.php?state=NC">North Carolina</a>'
linkset[35]='<a href="state_name.php?state=ND">North Dakota</a>'
linkset[36]='<a href="state_name.php?state=OH">Ohio</a>'
linkset[37]='<a href="state_name.php?state=OK">Oklahoma</a>'
linkset[38]='<a href="state_name.php?state=OR">Oregon</a>'
linkset[39]='<a href="state_name.php?state=PA">Pennsylvania</a>'
linkset[40]='<a href="state_name.php?state=PR">Puerto Rico</a>'
linkset[41]='<a href="state_name.php?state=RI">Rhode Island</a>'
linkset[42]='<a href="state_name.php?state=SC">South Carolina</a>'
linkset[43]='<a href="state_name.php?state=SD">South Dakota</a>'
linkset[44]='<a href="state_name.php?state=TN">Tennessee</a>'
linkset[45]='<a href="state_name.php?state=TX">Texas</a>'
linkset[46]='<a href="state_name.php?state=UT">Utah</a>'
linkset[47]='<a href="state_name.php?state=VT">Vermont</a>'
linkset[48]='<a href="state_name.php?state=VI">Virgin Islands</a>'
linkset[49]='<a href="state_name.php?state=VA">Virginia</a>'
linkset[50]='<a href="state_name.php?state=WA">Washington</a>'
linkset[51]='<a href="state_name.php?state=WV">West Virginia</a>'
linkset[52]='<a href="state_name.php?state=WI">Wisconsin</a>'
linkset[53]='<a href="state_name.php?state=WY">Wyoming</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){
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+eventX+"px" : window.pageXOffset+eventX+"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+"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()",500)
}

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

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

// -->
