var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=0 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

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 blank(obj, objheader, e, visible, hidden) {
	if (ie5||ns6)
		dropmenuobj.style.left=dropmenuobj.style.top=-500
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
		obj.visibility=hidden
	} else if (e.type=="click") {
		obj.visibility=hidden
	}
	
	if (e.type=="click" && objheader.backgroundColor==w || e.type=="mouseover") {
		//objheader.color='#666666'
	} else if (e.type=="click") {
		objheader.border="none"
	}
}

function showhide(obj, objheader, e, visible, hidden) {
	if (ie5||ns6)
		dropmenuobj.style.left=dropmenuobj.style.top=-500
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") {
		obj.visibility=visible
	} else if (e.type=="click") {
		obj.visibility=hidden
	}
	
	if (e.type=="click" && objheader.backgroundColor==w || e.type=="mouseover") {
		//objheader.color='#666666'
	} else if (e.type=="click") {
		objheader.border="none"
	}
}

function iecompattest() {
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge) {
	var edgeoffset=0
	if (whichedge=="rightedge") {
		var windowedge=ie5 && !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=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
		var windowedge=ie5 && !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 blankdownmenu(obj, e, dropmenuID, dropheadermenuID) {
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	if (typeof dropmenuobj!="undefined") //hide previous menu
	dropmenuobj.style.visibility="hidden"
	clearhidemenu()
	if (typeof dropheadermenuobj!="undefined") //hide previous menu
	{
		dropheadermenuobj.style.border="none"
		dropheadermenuobj.style.color="#333333"
		clearhidemenu()
	}
	if (ie5||ns6) {
		obj.onmouseout=delayhidemenu
		dropmenuobj=document.getElementById(dropmenuID)
		dropheadermenuobj=document.getElementById(dropheadermenuID)
		if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
		dropmenuobj.onmouseover=clearhidemenu
		dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
		dropheadermenuobj.onmouseout=ie5? function(){ dynamichide2(event)} : function(event){ dynamichide2(event)}
		blank(dropmenuobj.style, dropheadermenuobj.style, e, "visible", "hidden")
		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 dropdownmenu(obj, e, dropmenuID, dropheadermenuID) {
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	if (typeof dropmenuobj!="undefined") //hide previous menu
	dropmenuobj.style.visibility="hidden"
	clearhidemenu()
	if (typeof dropheadermenuobj!="undefined") //hide previous menu
	{
		dropheadermenuobj.style.border="none"
		dropheadermenuobj.style.color="#eee"
		clearhidemenu()
	}
	if (ie5||ns6) {
		obj.onmouseout=delayhidemenu
		dropmenuobj=document.getElementById(dropmenuID)
		dropheadermenuobj=document.getElementById(dropheadermenuID)
		if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
		dropmenuobj.onmouseover=clearhidemenu
		dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
		dropheadermenuobj.onmouseout=ie5? function(){ dynamichide2(event)} : function(event){ dynamichide2(event)}
		showhide(dropmenuobj.style, dropheadermenuobj.style, e, "visible", "hidden")
		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 ((ie5||ns6) && !enableanchorlink) 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 (ie5&&!dropmenuobj.contains(e.toElement))
		delayhidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		delayhidemenu()
}

function dynamichide2(e) {
	if (ie5&&!dropheadermenuobj.contains(e.toElement)) {
		delayhidemenu()
		dropheadermenuobj.style.border="none"
	} else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) {
		dropheadermenuobj.style.border="none"
		delayhidemenu()
	}
}

function delayhidemenu() {
	delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu() {
	if (typeof delayhide!="undefined")
		clearTimeout(delayhide)
}

document.write('<a href="http://www.kapanlagi.com/game/characters_games.html" title="Characters" onMouseover="dropdownmenu(this, event, \'naruto\', \'menuheader_naruto\')" id="menuheader_naruto">CHARACTERS <img src="http://img.kapanlagi.com/i/v3/woman/icon/mnIcon.jpg" border="0" /></a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/tournaments/" title="TOURNAMENT" >TOURNAMENT</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/action_games.html" title="action" >ACTION</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/adventure_games.html" title="adventure" >ADVENTURE</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/arcade_games.html" title="arcade" >ARCADE</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/dress-up_games.html" title="dress-up" >DRESS-UP</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/love_and_hate_celeb.html" title="love & hate" >LOVE & HATE</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/other_games.html" title="other" >OTHER</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/puzzle_games.html" title="puzzle" >PUZZLE</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/racing_games.html" title="racing" >RACING</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/rpg_games.html" title="rpg" >RPG</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/shooting_games.html" title="shooting" >SHOOTING</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/skill_games.html" title="skill" >SKILL</a><span class="vLine">&nbsp;</span><a href="http://www.kapanlagi.com/game/strategy_games.html" title="strategy" >STRATEGY</a>');

document.write('<div id="naruto" class="mainmenuitem2"><div class="mainmenuitemborder2"><a class="slide2" href="http://www.kapanlagi.com/game/naruto_games.html" title="Naruto" >Naruto</a><a class="slide2" href="http://www.kapanlagi.com/game/dragon_ball_games.html" title="Dragon Ball" >Dragon Ball</a><a class="slide2" href="http://www.kapanlagi.com/game/avatar_games.html" title="Avatar" >Avatar</a><a class="slide2" href="http://www.kapanlagi.com/game/ben_10_games.html" title="Ben 10" >Ben 10</a><a class="slide2" href="http://www.kapanlagi.com/game/mario_games.html" title="Mario" >Mario</a><a class="slide2" href="http://www.kapanlagi.com/game/celebrities_games.html" title="Celebrities" >Celebrities</a><a class="slide2" href="http://www.kapanlagi.com/game/sonic_games.html" title="Sonic" >Sonic</a><a class="slide2" href="http://www.kapanlagi.com/game/spongebob_games.html" title="Spongebob" >Spongebob</a><a class="slide2" href="http://www.kapanlagi.com/game/superman_games.html" title="Superman" >Superman</a></div><div class="mainmenuitemborder3"><a class="slide2" href="http://www.kapanlagi.com/game/spiderman_games.html" title="Spiderman" >Spiderman</a><a class="slide2" href="http://www.kapanlagi.com/game/batman_games.html" title="Batman" >Batman</a><a class="slide2" href="http://www.kapanlagi.com/game/harry_potter_games.html" title="Harry Potter" >Harry Potter</a><a class="slide2" href="http://www.kapanlagi.com/game/stickman_games.html" title="Stickman" >Stickman</a><a class="slide2" href="http://www.kapanlagi.com/game/michael_jackson_games.html" title="Michael Jackson" >Michael Jackson</a><a class="slide2" href="http://www.kapanlagi.com/game/tom_and_jerry_games.html" title="Tom and Jerry" >Tom and Jerry</a><a class="slide2" href="http://www.kapanlagi.com/game/transformers__games.html" title="Transformers" >Transformers</a><a class="slide2" href="http://www.kapanlagi.com/game/scooby_doo_games.html" title="Scooby doo" >Scooby doo</a><a class="slide2" href="http://www.kapanlagi.com/game/doraemon_games.html" title="Doraemon" >Doraemon</a></div></div>');