/*
 *	All rights reserved
 *
 *	Copyrighted by
 *	ACCITOR 2001-2004
 *
 *	By copying this file you will be prosecuted!
 */

	function makeCss(){
		this.textColor = "#FFFFFF";
		this.textHover = "#FFFFFF";
		this.bgColor = "#FFFFFF";
		this.bgHover = "#FFFFFF";
		this.bgHoverLayer = "#FFFFFF";
		this.menuFont = "Verdana, Geneva, Helvetica, sans-serif";
		this.menuFontSize = '10';
		this.LinkColor = "#FFFFFF";
		this.writeCss = writeCss;
	}

	function writeCss(){}

	function makeMenu(idref,labelText, url, itemZ, linkOption){
		this.idref = idref;
		this.labelText = labelText;
		this.url = url;
		this.itemZ = itemZ;
		this.linkOption = linkOption;
		this.posTop = '0';
		this.posLeft = '0';
		this.itemWidth = '133';
		this.itemHeight = '20';
		this.addMenuItem = addMenuItem;
		this.writeMenu = writeMenu;
		this.showMenu = showMenu;
		this.hideMenu = hideMenu;
		this.items = new Array( );
		this.subUrl = new Array( );
		this.linkOptionVect = new Array();
	}

	function addMenuItem(subLabel,subUrl,linkOption){
		this.items[this.items.length] = subLabel;
		this.subUrl[this.subUrl.length] = subUrl;
		this.linkOptionVect[this.linkOptionVect.length] = linkOption;
	}

	function writeMenu( ){
		var myHtmlRef = "";
		var subHeight = parseInt(this.itemHeight);
		
		if (ns)
		{
			alert("Please, update your browser it is realy old!!!");
		}
		else if( ie || future ){
			myHtmlRef += "<div id=\'"+this.idref;
			myHtmlRef +="\' class=\'menyRubrik\' style=\'position: absolute;";
			myHtmlRef +=" left: "+this.posLeft+";";
			myHtmlRef +=" top: "+this.posTop+";";
			myHtmlRef +=" width: "+this.itemWidth+";";
			myHtmlRef +=" height: "+this.itemHeight+";";
			myHtmlRef +=" z-index: "+this.itemZ+";";
			myHtmlRef +=" background-color: "+myCss.bgColor +";\'";

			myHtmlRef +=" onMouseOver=\'showMenu(\"sub"+this.idref+"\");\'";
			myHtmlRef +=" onMouseOut=\'hideMenu(\"sub"+this.idref+"\");\'>";
			
			myHtmlRef +="<table border='0px' width='" + this.itemWidth + "' bgcolor='white' cellpadding='1px' cellspacing='1px'><tr><td class='mainColor'><a href='JavaScript:' OnMouseOver=\'window.status=\"Klicka p&aring; n&aring;gon av l&auml;nkarna nedan.\"; return true\' style='text-decoration: none;'><font class='mainHeaderFont'>"+this.labelText+"</font></a>";
			
			myHtmlRef +="</td></tr></table></div>";

			myHtmlRef += "<div id=\'sub"+this.idref;
			myHtmlRef +="\' class=\'menyRubrik\' style=\'position: absolute;";
			myHtmlRef +=" left: "+eval(parseInt(this.posLeft)+5)+";";
			myHtmlRef +=" top: "+eval(parseInt(this.posTop)+parseInt(this.itemHeight)-2)+";";
			myHtmlRef +=" width: " + this.itemwidth + ";";
			myHtmlRef +=" height: 0";
			myHtmlRef +=" background-color: "+myCss.bgColor +";";
			myHtmlRef +=" visibility: hidden;";
			myHtmlRef +=" z-index: "+eval(this.itemZ+1)+";\'";

			myHtmlRef +=" onMouseOver=\'showMenu(\"sub"+this.idref+"\")\'";
			myHtmlRef +=" onMouseOut=\'hideMenu(\"sub"+this.idref+"\")\'>";
			
			myHtmlRef +="<table border='0px' bgcolor='white' cellpadding='1px' cellspacing='1px'><tr><td class='mainColor'>";
			
			for (var i=0; i<this.items.length; i++)
			{
	 			myHtmlRef += "&nbsp;<a href=\""+this.subUrl[i]+"\" class='mylink'";
				if(this.linkOptionVect[i] == "extern")
					myHtmlRef +=" target=\"blank\"";

				myHtmlRef += "><font class='mainHeaderFont'>"+this.items[i]+"</font>";
				
				myHtmlRef += "</a>&nbsp;<br>";
			}

			myHtmlRef +="</td></tr></table></div>";
		}
        document.write(myHtmlRef);
	}

	var tmp = null;
	function showMenu(lyr)
	{
		if(tmp != null)
		{
			if (ns) eval("document.layers[tmp].visibility='hide'");
			if (ie)	eval(tmp+".style.visibility='hidden'");
			if (future) eval("document.getElementById(tmp).style.visibility='hidden'");
			tmp = null;
		}

		myClearTimeout();
		if (ns) eval("document.layers['"+lyr+"'].visibility='show'");
		if (ie)	eval(lyr+".style.visibility='visible'");
		if (future) eval("document.getElementById('"+lyr+"').style.visibility='visible'");
	}

	function hideMenu(lyr)
	{
		tmp = lyr;
		myStartTimeout();
	}

	window.myHideMenuTimer = null;
	function myClearTimeout()
	{
		if (myHideMenuTimer) clearTimeout(myHideMenuTimer);
		myHideMenuTimer = null;
		myDHFlag = false;
	}
	function myStartTimeout()
	{
		myStart = new Date();
		myDHFlag = true;
		myHideMenuTimer = setTimeout("myDoHide()", 500);
	}
	
	function myDoHide()
	{
		lyr = tmp;
	
		if (!myDHFlag) return;
		var elapsed = new Date() - myStart;
		if (elapsed < 500) {
			myHideMenuTimer = setTimeout("myDoHide()", 1100-elapsed);
			return;
		}
		myDHFlag = false;

		if (ns) eval("document.layers['"+lyr+"'].visibility='hide'");
		if (ie)	eval(lyr+".style.visibility='hidden'");
		if (future) eval("document.getElementById('"+lyr+"').style.visibility='hidden'");

	}

	
	var reflink = "";
	function setRefLink()
	{
		reflink = "../";
	}
 