// JavaScripts

// Variables for global navigation button mouseovers
var home_not = "images/button-home.png";
var home_hot = "images/button-home-hot.png";
var games_not = "images/button-games.png";  
var games_hot = "images/button-games-hot.png";  
var novels_not = "images/button-novels.png";  
var novels_hot = "images/button-novels-hot.png";  
var shop_not = "images/button-shop.png";  
var shop_hot = "images/button-shop-hot.png"; 
var playpen_not = "images/button-playpen.png";  
var playpen_hot = "images/button-playpen-hot.png"; 
var shows_not = "images/button-shows.png";  
var shows_hot = "images/button-shows-hot.png"; 

// Functions to change global navigation buttons on mouseover/mouseoff
function activate(imgName) {  
document.images[imgName].src = eval( imgName + "_hot" );  
}  
function deactivate(imgName) {  
document.images[imgName].src = eval( imgName + "_not" );  
} 

/***********************************************
* START 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
***********************************************/

//Home
var menu1=new Array()
menu1[0]='<a href="index_news.htm">News and Events</a>'
menu1[1]='<a href="index_info.htm#">Company Info</a>'
menu1[2]='<a href="index_retailers_distr.htm">Retail and Wholesale</a>'

//Games
var menu2=new Array()
menu2[0]='<a href="games_hr.htm">Horror Rules</a>'
menu2[1]='<a href="games_hrmg.htm">Horror Rules Mini-Game</a>'
menu2[2]='<a href="games_hrcharcreator.htm">HR Character Creator</a>'
menu2[3]='<a href="games_hrminicon.htm">HR Mini-Con</a>'
menu2[4]='<a href="games_relentless.htm">Relentless</a>'
menu2[5]='<a href="games_tok.htm">Tales of Kezemeth</a>'
menu2[6]='<a href="games_freedl.htm">Free Downloads</a>'

//Novels
var menu3=new Array()
menu3[0]='<a href="novels_ms.htm">GS Book 1: Midnight Snack</a>'
menu3[1]='<a href="novels_ms_chars.htm">Midnight Snack: Characters</a>'
menu3[2]='<a href="novels_ms_secrets.htm">Midnight Snack: Secrets</a>'
menu3[3]='<a href="novels_arn.htm">GS Book 2: Another Rotten Night</a>'

//Shop
var menu4=new Array()
menu4[0]='<a href="shop_rpg.htm">Roleplaying Games</a>'
menu4[1]='<a href="shop_novels.htm">Novels</a>'
menu4[2]='<a href="shop_ebooks.htm">eBooks & Downloads</a>'
menu4[3]='<a href="shop_gear.htm">Gamer Gear</a>'
menu4[4]='<a href="shop_retailers.htm">Retail Outlets</a>'

//Play Pen
var menu5=new Array()
menu5[0]='<a href="playpen_rogd.htm">Random Obituary Generator</a>'
menu5[1]='<a href="playpen_swrogd.htm">Star Wars Random Obituary Gen.</a>'
menu5[2]='<a href="playpen_ooze.htm">Make Your Own Horror Story</a>'
menu5[3]='<a href="playpen_badbrains.htm">Bad Brains Quiz</a>'
menu5[4]='<a href="playpen_hr_combatsim.htm">Horror Rules Combat Sim</a>'

//Shows
var menu6=new Array()
menu6[0]='<a href="chris_weedin_schools.htm">Schools</a>'
menu6[1]='<a href="chris_weedin_events.htm">Event Speaking</a>'
menu6[2]='<a href="chris_weedin_corptraining.htm">Corporate Training</a>'
menu6[3]='<a href="chris_weedin_appearances.htm">Appearances</a>'
menu6[4]='<a href="chris_weedin_scheduling.htm">Schedule an Event</a>'

var menuwidth='130px' //default menu width
var menubgcolor='#ffff99'  //menu bgcolor
var disappeardelay=0  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

//No further editting needed
//Additional style and color formatting settings for the dropdown menus are in the stylesheet

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.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

/***********************************************
* END AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
***********************************************/

