/* Detta script får endast användas PRIVAT och i ICKE KOMMERSIELLT syfte i med
   dessa rader intakt OCH i enlighet med >> http://www.jojoxx.net/?legal << */

var mnu=[
	{	text:"Guider", sidebar:true, sidebarImage:"http://www.jojoxx.net/images/icon_html.gif",
		menu:[
		{ text:"JavaScript", link:"/jscript/", width:"100px" },
		{ text:"Perl", link:"/perl/" },
		{ text:"Html", link:"/html/" },
		{ text:"CSS", link:"/css/" }
		]
	},
	{
		text:"Scriptarkiv", sidebar:true, sidebarImage:"http://www.jojoxx.net/images/icon_js.gif",
		menu:[
		{ text:"JavaScript", link:"/jscript/archive/", width:"100px" },
		{ text:"JS-includes", link:"/jscript/libs/" },
		{ text:"DHTML", link:"/dhtml/" },
		{ text:"Perl", link:"/perl/archive/" }
		]
	},
	{
		text:"FAQ",
		menu:[
		{ text:"Apache", link:"/faq/index.pl?cat=10", width:"120px" },
		{ text:"ASP", link:"/faq/index.pl?cat=7" },
		{ text:"CSS", link:"/faq/index.pl?cat=2" },
		{ text:"Domäner", link:"/faq/index.pl?cat=8" },
		{ text:"HTML", link:"/faq/index.pl?cat=1" },
		{ text:"JavaScript", link:"/faq/index.pl?cat=4" },
		{ text:"Operativsystem", menu:[
			{ text:"Unix", link:"/faq/index.pl?cat=14" },
			{ text:"Window 2000 Terminal Server", link:"/faq/index.pl?cat=14" },
			{ text:"Windows 2000, NT 4", link:"/faq/index.pl?cat=15" }
		] },
		{ text:"Perl, CGI", link:"/faq/index.pl?cat=5" },
		{ text:"SQL", link:"/faq/index.pl?cat=13" },
		{ text:"SSI", link:"/faq/index.pl?cat=9" },
		{ text:"Säkerhet", link:"/faq/index.pl?cat=11" },
		{ text:"Sökmotorer", link:"/faq/index.pl?cat=3" }
		]
	},
	{
		text:"Relaterade siter",
		menu:[
		{ text:"WebForum", link:"http://www.webforum.nu/index.php?referrerid=599" },
		{ text:"xhtml.nu", link:"http://xhtml.nu/" },
		{ text:"Backend Media", link:"http://www.backendmedia.se/" },
		{ text:"W3 Schools", link:"http://www.w3schools.com/" }
		]
	},
	{
		text:"Övrigt",
		menu:[
		{ text:"Internetbokmärken", link:"/bookmarks.asp" },
		{ text:"Sponsorer", link:"/services/sponsors.asp" },
		{ text:"Spela Maxi Yatzy", link:"/jscript/archive/dicegames/MaxiYatzy.html" },
		{ text:"Gästboken", link:"/cgi-bin/jxbookpro2.pl" },
		{ text:"Länka till jojoxx.net", link:"/showpage.asp?id=2" },
		{ text:"Kontakta mig", link:"/contact.asp" },
		{ text:"Medlemsarea", link:"/usermanage.asp" },
		{ text:"Hem", link:"/" }
		]
	}

];
var menuProperties={
	timeout:1000,
	subImage:"http://www.jojoxx.net/images/menu_sub_arrow.gif",
	cleanUpLevel:1, cleanUpTimer:null,
	Munique:0, unique:0,
	m_parent:{}, m_opened:[]
}

function menu(obj){
	var str="<table cellspacing='0' class=\"menu_bar\"><tr>";
	menuProperties.Munique++; var mid="jm"+menuProperties.Munique+"_";
	var style="";
	for(var i in obj){
		style=(obj[i].width)?"width:"+obj[i].width+"px;":"";
		str+="<td class=\"menu_item\" style=\""+style+"\" onmouseover=\"openmenu('"+mid+i+"'); mover(this);\" onmouseout=\"mout(this);\">"+obj[i].text.replace(/\s/g,"&nbsp;")+"</td>";
	}
	str+="</tr><tr>";
	for(var i in obj){
		str+="<td>"+submenu(obj[i],0,mid+i)+"</td>";
	}
	str+="</tr></table>"
	return str;
}
function vertical_menu(obj){
	var str="<table cellspacing='0' class=\"menu_bar\">";
	menuProperties.Munique++; var mid="jm"+menuProperties.Munique+"_";
	var style="";
	for(var i in obj){
		style=(obj[i].width)?"width:"+obj[i].width+"px;":"";
		str+="<tr><td class=\"menu_item\" style=\""+style+"\" onmouseover=\"openmenu('"+mid+i+"'); mover(this);\" onmouseout=\"mout(this);\">"+obj[i].text.replace(/\s/g,"&nbsp;")+"</td><td style=\"vertical-align:top;\">"+submenu(obj[i],0,mid+i)+"</td></tr>";
	}
	str+="</table>"
	return str;
}
function submenu(obj,level,id){
	if(obj.menu){ var rootobj=obj; obj=obj.menu; }
	var str=""; var style=""; var width;
	if(rootobj && rootobj.sidebar){
		str+="<tr onmouseover=\"mover();\" onmouseout=\"mout();\"><td rowspan=\""+(obj.length+1)+"\" class=\"menu_sidebar\">";
		str+=(rootobj.sidebarImage)?"<img src='"+rootobj.sidebarImage+"'>":"";
		str+="</td><td></td><td></td><td></td></tr>";
	}
	for(var i in obj){
		var onclick=""; var itemstyle=(obj[i].style)?obj[i].style:"";
		if(obj[i].width){ width=obj[i].width; itemstyle+="width:"+width+";"; }
		if(obj[i].menu){
			menuProperties.unique++; var mid="jsm"+menuProperties.unique;
			if(id){ menuProperties.m_parent[mid]=id; }
			str+="<tr onmouseover=\"mover(this);\" onmouseout=\"mout(this);\"><td class=\"menu_sub_item\" style=\""+itemstyle+"\" onmouseover=\"openmenu('"+mid+"');\">"+obj[i].text+"</td><td class=\"menu_sub_item\" style='vertical-align:middle;'><img src=\""+menuProperties.subImage+"\"></td><td class=\"menu_sub_item\">"+submenu(obj[i].menu,level+1,mid)+"</td></tr>";
		} else {
			onclick=(obj[i].onclick)?obj[i].onclick:"";
			if(obj[i].link){ onclick+=(obj[i].target)?"window.open('"+obj[i].link+"','"+obj[i].target+"');":"window.open('"+obj[i].link+"','_self');"; }
			str+="<tr onmouseover=\"mover(this);\" onmouseout=\"mout(this);\" onclick=\""+onclick+"\"><td class=\"menu_sub_item\" style=\""+itemstyle+"\" "+((obj[i].disabled)?"disabled='disabled' ":"")+">"+obj[i].text+"</td><td class=\"menu_sub_item\"><td class=\"menu_sub_item\"></td></tr>";
		}
	}
	style+=(width)?"width:"+width+";":"";
	str="<div id=\""+id+"\" style=\"position:absolute;visibility:hidden;"+style+"\"><table class=\"menu_background\" cellspacing='0'>"+str+"</table></div>";
	return str;
}
function openmenu(id){
	for(var i in menuProperties.m_opened){ menuProperties.m_opened[i].style.visibility="hidden"; }
	var obj=document.getElementById(id);
	obj.style.visibility="visible";
	menuProperties.m_opened[menuProperties.m_opened.length]=obj;
	while(menuProperties.m_parent[id]){
		id=menuProperties.m_parent[id];
		obj=document.getElementById(id);
		menuProperties.m_opened[menuProperties.m_opened.length]=obj;
		obj.style.visibility="visible";
	}
}
function mover(obj){
	if(obj){
		obj.className=(obj.tagName.toUpperCase()=="TR")?"menu_sub_item menu_sub_item_hover":"menu_item menu_item_hover";
	}
	if(menuProperties.cleanUpTimer){ menuProperties.cleanUpLevel++; clearTimeout(menuProperties.cleanUpTimer) }
}
function mout(obj){
	if(obj){
		obj.className=(obj.tagName.toUpperCase()=="TR")?"menu_sub_item":"menu_item";
	}
	menuProperties.cleanUpLevel--; menuProperties.cleanUpTimer=setTimeout("cleanUp()",menuProperties.timeout);
}
function cleanUp(){
	if(menuProperties.cleanUpLevel!=0) return;
	for(var i in menuProperties.m_opened){ menuProperties.m_opened[i].style.visibility="hidden"; }
}
function addEvent(event,action){
var e=eval(event)+""; var c=""; if(eval(event)){ c=e.match(/^function\s*\(\)\s*\{([\s\S]+)\}/mi)[1]; } eval(event+"=function(){"+c+action+"\n}");
}
addEvent("document.onclick","cleanUp();");

document.write("<style type=\"text/css\">@import url(\"/indexmenu3.css\");</style>");
document.write("<div style=\"position:absolute;top:59px;left:300px;z-index:300;width:0px;\">"+menu(mnu)+"</div>");
