/*--------------------------------------------------|
|M%M SRD23 Dropdown menu v2.0                       |
|created by Mohamed @ http://mywoorld.com           |
|Updated by amGed Aka Sacred @ http://ibmafia.com   |
|IPB ver. 2.3.x 2.2   http://invisionpower.com      |
|__________________________________________________*/

var menu1=new Array()
menu1[0]='<table><tr><td><span class="srd23mm-menu-item"><a href="http://www.cybernations.net/login.asp" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Nation Login</b></a></span></td></tr>'
menu1[1]='<tr><td><span class="srd23mm-menu-item"><a href="http://forums.cybernations.net/" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>CN Forum</b></a></span></td></tr>'
menu1[2]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.cybernations.net/allNations_display_alliances.asp?Alliance=MOLON%20LABE" target="_blank"> <img src="style_images/1/menu_item.gif" /> <b>ML Nations</b></a></span></td></tr>'
menu1[3]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.cybernations.net/stats_alliance_stats_custom.asp?Alliance=MOLON%20LABE" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>ML Stats</b></a></span></td></tr>'
menu1[4]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.cybernations.net/game_update_log.asp" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Update Log</b></a></span></td></tr>'
menu1[5]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.cybernations.net/stats_resource_tool.asp" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>CN Resource Tool</b></a></span></td></tr></table>'

var menu2=new Array()
menu2[0]='<div class="popupmenu-category" align="center">Ministers</div><table><tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=16"><img src="style_images/1/menu_item.gif" /> <b>king ost - MoIA</b></a></span></td></tr>'
menu2[1]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=185"><img src="style_images/1/menu_item.gif" /> <b>OzymandiasX - MoFA</b></a></span></td></tr>'
menu2[2]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=60"><img src="style_images/1/menu_item.gif" /> <b>ThePunk - MoTaF</b></a></span></td></tr>'
menu2[3]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=2"><img src="style_images/1/menu_item.gif" /> <b>OD45 - MoWaD</b></a></span></td></tr></table></table>'
menu2[4]='<div class="popupmenu-category" align="center">Congress</div><table><tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=64"><img src="style_images/1/menu_item.gif" /> <b>Atrocities</b></a></span></td></tr>'
menu2[5]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=3"><img src="style_images/1/menu_item.gif" /> <b>Pepper</b></a></span></td></tr>'
menu2[6]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=7"><img src="style_images/1/menu_item.gif" /> <b>Wickica</b></a></span></td></tr>'
menu2[7]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=178"><img src="style_images/1/menu_item.gif" /> <b>SKOAL</b></a></span></td></tr>'
menu2[8]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Msg&CODE=4&MID=14"><img src="style_images/1/menu_item.gif" /> <b>The Corporal</b></a></span></td></tr></table>'

var menu3=new Array()
menu3[0]='<table><tr><td><span class="srd23mm-menu-item"><a href="http://www.cnvalhalla.org/forum/index.php?" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Valhalla</b></a></span></td></tr>'
menu3[1]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.castledoom.com/CN/index.php" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>DOOM</b></a></span></td></tr>'
menu3[2]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.iron-command.com/forum/index.php?act=idx" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>IRON</b></a></span></td></tr>'
menu3[3]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.phoenix-federation.net/forums/index.php" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>TPF</b></a></span></td></tr>'

var menu4=new Array()
menu4[0]='<div class="popupmenu-category" align="center">BLOC</div><table><tr><td><span class="srd23mm-menu-item"><a href="http://forums.cybernations.net/index.php?showtopic=45658" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Duckroll</b></a></span></td></tr></table>'
menu4[1]='<div class="popupmenu-category" align="center">MDoAP</div><table><tr><td><span class="srd23mm-menu-item"><a href="http://forums.cybernations.net/index.php?showtopic=3602" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Valhalla</b></a></span></td></tr>'
menu4[2]='<tr><td><span class="srd23mm-menu-item"><a href="http://forums.cybernations.net/index.php?showtopic=45886" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>TPF</b></a></span></td></tr></table>'
menu4[3]='<div class="popupmenu-category" align="center">Protectorate</div><table><tr><td><span class="srd23mm-menu-item"><a href="http://forums.cybernations.net/index.php?showtopic=33506" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>DOOM</b></a></span></td></tr></table>'
menu4[4]='<tr><td><span class="srd23mm-menu-item"><a href="http://forums.cybernations.net/index.php?showtopic=47870" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>SCORN</b></a></span></td></tr>'


var menu5=new Array()
menu5[0]='<table><tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Search"><img src="style_images/1/menu_item.gif" /> <b>Search</b></a></span></td></tr>'
menu5[1]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=help"><img src="style_images/1/menu_item.gif" /> <b>Help</b></a></span></td></tr>'
menu5[2]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Members"><img src="style_images/1/menu_item.gif" /> <b>Members</b></a></span></td></tr>'
menu5[3]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?act=Calendar"><img src="style_images/1/menu_item.gif" /> <b>Calendar</b></a></span></td></tr></table>'

var menu6=new Array()
menu6[0]='<table><tr><td><span class="srd23mm-menu-item"><a href="http://www.ar15armory.com/" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Armory</b></a></span></td></tr>'
menu6[1]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=arcade"><img src="style_images/1/menu_item.gif" /> <b>Arcade</b></a></span></td></tr></table>'

var menu7=new Array()
menu7[0]='<table><tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=irc" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Public</b></a></span></td></tr>'
menu7[1]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=irc2" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Semi-secure</b></a></span></td></tr>'
menu7[2]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=irc3" target="_blank"><img src="style_images/1/menu_item.gif" /> <b>Private</b></a></span></td></tr></table>'

var menu8=new Array()
menu8[0]='<table><tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=fasttrack"><img src="style_images/1/menu_item.gif" /> <b>Fast Track</b></a></span></td></tr>'
menu8[1]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=soon"><img src="style_images/1/menu_item.gif" /> <b>Others</b></a></span></td></tr>'
menu8[2]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=soon"><img src="style_images/1/menu_item.gif" /> <b>coming</b></a></span></td></tr>'
menu8[3]='<tr><td><span class="srd23mm-menu-item"><a href="http://www.molonlabealliance.com/forums/index.php?autocom=soon"><img src="style_images/1/menu_item.gif" /> <b>soon.</b></a></span></td></tr></table>'
//=============================
//to create new menu add --> var menu5=new Array()
//to add item to menu add --> menu5[0]='<div class="popupmenu-category" align="center">Name of the Menu here</div><table><tr><td><span class="srd23mm-menu-item"><a href="{$this->ipsclass->base_url}act=YOURPAGEHERE"><img src="style_images/YOUR SKIN HERE/menu_item.gif" /> <b>NAME OF THE PAGE HERE</b></a></span></td></tr>'
//=============================

var disappeardelay=0  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" 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=-500
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 windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
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
}
