var clicked=""
var gtype=".jpg"
var selstate="_over"
if (typeof(loc)=="undefined" || loc==""){
	var loc=""
	if (document.body&&document.body.innerHTML){
		var tt = document.body.innerHTML.toLowerCase();
		var last = tt.indexOf("wotgames.js\"");
		if (last>0){
			var first = tt.lastIndexOf("\"", last);
			if (first>0 && first<last) loc = document.body.innerHTML.substr(first+1,last-first-1);
		}
	}
}

document.write("<table border=\"0\" cellspacing=\"5\" cellpadding=\"0\"><tr>");
tr(false);
writeButton(loc+"","air_hockey.htm","wotgames_b1",158,20,"Air Hockey Tables","",0);
writeButton(loc+"","bbq.htm","wotgames_b12",158,20,"BBQs and Firepits","",0);
writeButton(loc+"","casino_tables.htm","wotgames_b2",158,20,"Casino Tables","",0);
writeButton(loc+"","table_football.htm","wotgames_b3",158,20,"Table Football Tables","",0);
writeButton(loc+"","pool_tables.htm","wotgames_b4",158,20,"Pool Tables","",0);
writeButton(loc+"","snooker_tables.htm","wotgames_b5",158,20,"Snooker Tables","",0);
writeButton(loc+"","table_multi.htm","wotgames_b6",158,20,"Multi Games Tables","",0);
writeButton(loc+"","table_tennis.htm","wotgames_b7",158,20,"Table Tennis Tables","",0);
writeButton(loc+"","pokertables.htm","wotgames_b8",158,20,"Poker Tables","",0);
writeButton(loc+"","poker_accessories.htm","wotgames_b9",158,20,"Poker Chips","",0);
writeButton(loc+"","swim.htm","wotgames_b13",158,20,"Swimming & Paddling Pools","",0);
writeButton(loc+"","trampolines.htm","wotgames_b10",158,20,"Trampolines","",0);
writeButton(loc+"","outdoor_games.htm","wotgames_b11",158,20,"Garden Games","",0);
writeButton(loc+"","swings.htm","wotgames_b14",158,20,"Wooden & Metal Swings","",0);
writeButton(loc+"","playcentres.htm","wotgames_b15",158,20,"Playcentres & Climbing Frames","",0);
writeButton(loc+"","fitness.htm","wotgames_b16",184,20,"Fitness & Leisure","",0);
writeButton(loc+"","darts.htm","wotgames_b17",158,20,"Darts","",0);
writeButton(loc+"","bigmo.htm","wotgames_b18",158,20,"Chopper Bikes","",0);
writeButton("","http://www.wotever.co.uk","wotgames_b19",158,20,"Wotever Retro Products","_blank",0);
writeButton("","http://www.pedalcar.org.uk","wotgames_b20",172,20,"Pedal Cars","_blank",0);
tr(true);
document.write("</tr></table>")
loc="";

function tr(b){if (b) document.write("<tr>");else document.write("</tr>");}

function turn_over(name) {
	if (document.images != null && clicked != name) {
		document[name].src = document[name+"_over"].src;
	}
}

function turn_off(name) {
	if (document.images != null && clicked != name) {
		document[name].src = document[name+"_off"].src;
	}
}

function reg(gname,name)
{
if (document.images)
	{
	document[name+"_off"] = new Image();
	document[name+"_off"].src = loc+gname+gtype;
	document[name+"_over"] = new Image();
	document[name+"_over"].src = loc+gname+"_over"+gtype;
	}
}

function evs(name){ return " onmouseover=\"turn_over('"+ name + "')\" onmouseout=\"turn_off('"+ name + "')\""}

function writeButton(urld, url, name, w, h, alt, target, hsp)
{
	gname = name;
	while(typeof(document[name])!="undefined") name += "x";
	reg(gname, name);
	tr(true);
	document.write("<td>");
	if (alt != "") alt = " alt=\"" + alt + "\"";
	if (target != "") target = " target=\"" + target + "\"";
	if (w > 0) w = " width=\""+w+"\""; else w = "";
	if (h > 0) h = " height=\""+h+"\""; else h = "";	
	if (url != "") url = " href=\"" + urld + url + "\"";
	
	document.write("<a " + url + evs(name) + target + ">");	
	
	if (hsp == -1) hsp =" align=\"right\"";
	else if (hsp > 0) hsp = " hspace=\""+hsp+"\"";
	else hsp = "";
	
	document.write("<img src=\""+loc+gname+gtype+"\" name=\"" + name + "\"" + w + h + alt + hsp + " border=\"0\" /></a></td>");
	tr(false);
}
