var items=new Array()

items[0]='<div class="items"><a href="index.html" class="medium"><strong>Home</strong></a></div>'
items[0]+='<div class="items"><a href="action_games.html" class="medium">Action Games</a></div>'
items[0]+='<div class="items"><a href="arcade_games.html" class="medium">Arcade Games</a></div>'
items[0]+='<div class="items"><a href="funny_games.html" class="medium">Funny Games</a></div>'
items[0]+='<div class="items"><a href="girl_games.html" class="medium">Girl Games</a></div>'
items[0]+='<div class="items"><a href="sport_games.html" class="medium">Sport Games</a></div>'
items[0]+='<div class="items"><a href="race_games.html" class="medium">Race Games</a></div>'
items[0]+='<div class="items"><a href="board_games.html" class="medium">Board Games</a></div>'
items[0]+='<div class="items"><a href="shooting_games.html" class="medium">Shooting Games</a></div>'
items[0]+='<div class="items"><a href="puzzle_games.html" class="medium">Puzzle Games</a></div>'
items[0]+='<div class="items"><a href="multiplayer_games.html" class="medium">Multiplayer Games</a></div>'
items[0]+='<div class="items"><a href="games_for_my_websites.html" class="medium">Free site content</a></div>'

var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1

var ns4=document.layers
var ns6=document.getElementById&&!document.all

function showmenu(e,which){

if (!document.all&&!document.getElementById&&!document.layers)
return

clearhidemenu()

menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

if (ie4||ns6)
menuobj.innerHTML=which
else{
menuobj.document.write('<layer name=gui bgColor=#FFFFFF width=175 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
menuobj.document.close()
}

menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
eventX=ie4? event.clientX : ns6? e.clientX : e.x
eventY=ie4? event.clientY : ns6? e.clientY : e.y

var fixed_right=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
var fixed_down=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY

if (fixed_right <menuobj.contentwidth)
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
else
menuobj.thestyle.left=ie4? document.body.scrollLeft+eventX : ns6? window.pageXOffset+eventX : eventX


menuobj.thestyle.top=320
menuobj.thestyle.visibility="visible"
return false
}

function hidemenu(){
if (window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

function delayhidemenu(){
if (ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",1500)
}

function dynamichide(e){
if (ie4&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function highlightmenu(e,state){
if (document.all)
source_el=event.srcElement
else if (document.getElementById)
source_el=e.target
if (source_el.className=="items"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}else{
while(source_el.id!="popmenu"){
source_el=document.getElementById? source_el.parentNode : source_el.parentElement
if (source_el.className=="items"){
source_el.id=(state=="on")? "mouseoverstyle" : ""
}}}}

if (ie4||ns6)
document.onclick=hidemenu

function BannerArea1(){
urls    = new Array(2);
urls[0] = "3";
urls[1] = "3";

pics    = new Array(2);
pics[0] = "show";
pics[1] = "show2";

index = Math.floor(Math.random() * urls.length);
url = "<a href='http://www.freegamesjungle.com/out.php?id=" + urls[index] + "' onMouseOver='window.status='Open'; return true;' target='_blank'><img src='http://images.freegamesjungle.com/" + pics[index] + ".gif' alt='more games' width='100' height='100' border='0'></a>";
return(url);
}

function BannerArea2(){
urls    = new Array(5);
urls[0] = "5";
urls[1] = "5";
urls[2] = "4";
urls[3] = "4";
urls[4] = "4";

pics    = new Array(5);
pics[0] = "show3";
pics[1] = "show4";
pics[2] = "show5";
pics[3] = "show6";
pics[4] = "show6";

index = Math.floor(Math.random() * urls.length);
url = "<a href='http://www.freegamesjungle.com/out.php?id=" + urls[index] + "' onMouseOver='window.status='Open'; return true;' target='_blank'><img src='http://images.freegamesjungle.com/" + pics[index] + ".gif' alt='more games' width='100' height='100' border='0'></a>";
return(url);
}

function BannerArea3(){
urls    = new Array(4);
urls[0] = "1";
urls[1] = "1";
urls[2] = "1";
urls[3] = "6";

pics    = new Array(4);
pics[0] = "show7";
pics[1] = "show8";
pics[2] = "show9";
pics[3] = "show10";

index = Math.floor(Math.random() * urls.length);
url = "<a href='http://www.freegamesjungle.com/out.php?id=" + urls[index] + "' onMouseOver='window.status='Open'; return true;' target='_blank'><img src='http://images.freegamesjungle.com/" + pics[index] + ".gif' alt='more games' width='100' height='100' border='0'></a>";
return(url);
}

function BannerArea4(){
urls    = new Array(3);
urls[0] = "8";
urls[1] = "8";
urls[2] = "8";

pics    = new Array(3);
pics[0] = "show11";
pics[1] = "show12";
pics[2] = "show13";

index = Math.floor(Math.random() * urls.length);
url = "<a href='http://www.freegamesjungle.com/out.php?id=" + urls[index] + "' onMouseOver='window.status='Open'; return true;' target='_blank'><img src='http://images.freegamesjungle.com/" + pics[index] + ".gif' alt='more games' width='100' height='100' border='0'></a>";
return(url);
}

function rate(rating) {
    var obj = document.getElementById('rating');
    if(rating == 1) obj.innerHTML = '<img src="http://images.freegamesjungle.com/voted_bad.gif">';
    if(rating == 2) obj.innerHTML = '<img src="http://images.freegamesjungle.com/voted_ok.gif">';
    if(rating == 3) obj.innerHTML = '<img src="http://images.freegamesjungle.com/voted_good.gif">';
}


function addBookmark()
{
	var bookmarkurl      = "http://www.freegamesjungle.com/";
	var bookmarktitle    = "Free Games Jungle, you monkeys want games?";
	var nonie            = 'Sorry, only Mozilla Firefox and Internet Explorer support this method to add a bookmark/favourite\n But please feel free to visit the site\'s home page to add a bookmark manually';

	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(bookmarktitle, bookmarkurl,"");
	} else if(document.all){ // IE Favourites
		window.external.AddFavorite(bookmarkurl,bookmarktitle);
	} else {
		alert(nonie);
	}
}