
//GAMES ASSISTANCE panels

//Developed by Mike Sibley from ~ Pop-it menu- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com

var link=new Array(2)

//	HANGMAN Playing Hints - GENERAL START HINTS
link[0]='<div class=\"defttl\">About Hangman</div>'
link[0]+='<div class=\"defbox\" style="text-align:left;">Click <b>New Game</b> to play on your own and then select a subject in the <b>Word Lists</b> box.<hr size=1 >'
link[0]+='Click <b>New Match</b> to compete with a friend and enter your own words or phrases, and then follow the instructions in the box below.<hr size=1 >'
link[0]+='When you have chosen to play a Game or Match, point to this link again for more help.</div>'

//	HANGMAN Playing Hints - SINGLE PLAYER
link[1]='<div class=\"defttl\">Single Player Hints</div>'
link[1]+='<div class=\"defbox\" style="text-align:left;">Choose a subject in the "<b>Word Lists</b>" box and begin playing.<hr size=1 >'
link[1]+='A count is displayed of your games won and lost during the session.<hr size=1 >'
link[1]+='You can change the Level at any time during play - up or down.<br>Level 1 = 9 lives through to Level 6 = 4 lives. You don\'t score more by choosing a higher level but it\'s more fun!<hr size=1>'
link[1]+='Click <b>New Game</b> to play again.</div>'

//	HANGMAN Playing Hints - TWO PLAYERS
link[2]='<div class=\"defttl\">Two Player Hints</div>'
link[2]+='<div class=\"defbox\" style="">For "<b>Word</b>" you may use:<div style="text-align:left;margin-left:6px;">&#149; Words<br>&#149; Short phrases<br>&#149; Punctuation<br>&#149; Numbers in the text<br><br> The limit is 22 characters for a phrase or 13 letters for a single word.<hr size=1 >'
link[2]+='<b>Two Player</b> scores are based on the length of the word or phrase, the number of lives lost before solving the puzzle, and the Level you set - the higher the level you more you score!<hr size=1 >'
link[2]+='You can change the Level up or down at any time during play.<br>Level 1 = 9 lives through to Level 6 = 4 lives.<hr size=1>'
link[2]+='Follow the instructions below.</div>'


////No need to edit beyond here

var ie4=document.all
var ns6=document.getElementById&&!document.all
var ns4=document.layers

function menuOn(e,links){

if (!document.all&&!document.getElementById&&!document.layers)
return

clearhide()

menuobj=ie4? document.all.convert : ns6? document.getElementById("convert") : ns4? document.convert : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

if (links == 'general'){menuobj.innerHTML= link[0]}
if (links == 'single'){menuobj.innerHTML= link[1]}
if (links == 'double'){menuobj.innerHTML= link[2]}

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

//Find out how close the mouse is to the corner of the window
var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie4? document.body.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.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX

//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.thestyle.top=ie4? document.body.scrollTop+eventY-menuobj.contentheight : ns6? window.pageYOffset+eventY-menuobj.contentheight : eventY-menuobj.contentheight
else
menuobj.thestyle.top=ie4? document.body.scrollTop+event.clientY : ns6? window.pageYOffset+eventY : eventY
menuobj.thestyle.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 hideIt(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynahide(e){
if (ie4&&!menuobj.contains(e.toElement))
hideIt()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hideIt()
}

function dlayhide(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hideIt()",250)
}

function clearhide(){
if (window.delayhide)
clearTimeout(delayhide)
}



