// Dropdown menu script (c) 2003 by Gleb Erty
//
// based on ScriptBreaker source
//  

var counter = 0
var container = new Array()

var dom = (document.getElementById) ? true : false;
var nn4 = (document.layers) ? true : false;
var ie4 = (!dom && document.all) ? true : false;
var opera = (window.opera) ? true : false;
var show_style = (nn4) ? 'show' : 'visible';
var hide_style = (nn4) ? 'hide' : 'hidden';

function getlayer(id) 
{	return (dom) ? document.getElementById(id).style : ((ie4) ? document.all[id].style : ((nn4) ? document.layers[id] : null));
}

function header(nr,al,ap)
{
 id = "mb_"+counter+"_" + nr;
 this.id = id;
 this.counter = counter;
 this.menunum = nr;
 this.onmouseover = doopen;
 this.onmouseout = doclose;
 this.ap = ap;
 str = "<td><a class='link' href=\""+al[1]+"\" style='text-decoration:none;position:relative;' onmouseover='container["+counter+"].container["+nr+"].onmouseover()' onmouseout='container["+counter+"].hide_all()'><div class='menu' id="+this.id+" style='height:"+ap[1]+";'><img src='/images/1x1.gif' height=5 border=0><br><NOBR>&nbsp;&nbsp;&nbsp;"+al[0]+"&nbsp;&nbsp;&nbsp;</NOBR></div></a>"
 document.write(str)
 this.element = document.getElementById(this.id)
 var itemsa = new Array()
 
 document.write("<div id='dd"+nr+"' style='visibility:"+hide_style+"'>")
 for (j=0;j<al[2].length;j++)
 {      if (al[2][j][1] != "") itemsa[j] = new item(nr,j,al[2][j],ap,this.bottom,this.left)
 }
 document.write("</td>")

 this.container = itemsa
}

function doopen()
{
 container[this.counter].fast_hide();
 clearTimeout(container[this.counter].timer);
 this.element.style.backgroundColor = this.ap[6];
 this.element.style.color = this.ap[4];
 for(k=0;k<this.container.length;k++)
 {	this.container[k].onshow();
 }
 getlayer('dd'+this.menunum).visibility = show_style;
}

function doclose()
{
 this.element.style.backgroundColor = this.ap[5];
 this.element.style.color = this.ap[3];
 for(k=0;k<this.container.length;k++)
 {	this.container[k].onhide();
 }
 getlayer('dd'+this.menunum).visibility = hide_style;
}

function item(nr,nri,ali,api,b,l)
{
 this.id = "i"+nr+"_"+ nri +"_"+counter;
 this.left = l;
 this.counter = counter;
 this.onshow = doshow;
 this.onhide = dohide;
 this.onmouseover = doover;
 this.onmouseout = doout;
 this.api = api;
 document.write("<a href=\""+ali[1]+"\" style='text-decoration:none;position:absolute;top:"+(((1+nri)*api[1])+1+api[2])+"' onmouseover='container["+counter+"].container["+nr+"].container["+nri+"].onmouseover();' onmouseout='container["+counter+"].container["+nr+"].container["+nri+"].onmouseout();'><div class='menu2' id='"+this.id+"' style='width:"+api[0]+";height:"+api[1]+";'><img src='/images/1x1.gif' height=5 border=0><br>&nbsp;&nbsp;&nbsp;"+ali[0]+"</div></a>");
 this.element = document.getElementById(this.id);
 this.element.style.visibility = hide_style;
}

function doover()
{	this.element.style.color = this.api[8];
	this.element.style.backgroundColor = this.api[10];
	clearTimeout(container[this.counter].timer);
}

function doout()
{	this.element.style.color = this.api[7];
	this.element.style.backgroundColor= this.api[9];
	container[this.counter].timer = setTimeout("container["+this.counter+"].fast_hide();",1000);
}

function Menu(al,ap)
{
 var headers = new Array()
 document.write("<table cellspacing=0 cellpadding=0 border=0><tr>");
 for(i=0;i<al.length;i++)
 {	if (al[i][1].length != 0) headers[i] = new header(i,al[i],ap)
 }
 document.write("</tr></table>");
 this.container = headers;
 this.hide_all = dohide_all
 this.fast_hide = catcht
 this.timer = null
 this.counter = counter
 container[counter] = this
 counter++;
}

function doshow(){getlayer(this.id).visibility = show_style;}
function dohide(){getlayer(this.id).visibility = hide_style;}

function dohide_all(){this.visibility = hide_style; this.timer = setTimeout("container["+this.counter+"].fast_hide();",1000);}
function catcht(){ for(i=0;i<this.container.length;i++) this.container[i].onmouseout();}
  