var n;
var NS6;
var menu_x;
var current;	
var currentb;
var onColor;
var offColor;
	
onColor = '#31287B';
offColor = '#63619C';
current = -1;
currentb = -1;
n = (document.layers) ? 1:0;
NS6 = (!document.all && document.getElementById) ? true : false;

document.captureEvents(Event.MOUSEMOVE)

function initIt()
{
	if (n==1)
	{
	    for (i=firstInd+1; i<document.layers.length; i++)
	    {
	        whichEl = document.layers[i];
	        if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
	    }
	    arrange();
	}
}

function delCookie(key) {
	var expireDate = new Date();
	expireDate.setDate(expireDate.getDate() - 1);
	document.cookie = key + '=; expires=' + expireDate.toGMTString();
}

function setup()
{
	var width = window.innerWidth;
	menu_x = ((width - 770)/2) + 129
	var l = window.location.href;
	var h = top.location.hostname;
	if (l.indexOf('/order_details.aspx') == 0 && l.indexOf('/order_complete.aspx') == 0 && h.indexOf('football-shirts.co.uk') == 0) {
		// Check we've not been opened in a frame... if so open a new window
		if (window.location != top.location)
		{
			window.open(window.location,"Kitbag");
			window.location = '/redir/kitbagframe.htm';
		}
	}
}

var sliding = setTimeout('null',1);
var ns6 = document.getElementById && !document.all;

function showMenuDrop(menu)
{
	b = 'boundary';
	document.getElementById(menu).style.visibility = "visible";
	w = document.getElementById(menu).style.width;
	w = Number(w.substring(0,w.length-2));
	y = document.getElementById(menu).style.top;
	y = Number(y.substring(0,y.length-2));
	x = document.getElementById(menu).style.left;
	x = Number(x.substring(0,x.length-2));
	document.getElementById(b).style.left = x - 20;
	document.getElementById(b).style.top = y - 40;
	document.getElementById(b).style.width = w + 40;
	document.getElementById(b).style.visibility = "visible";
}
function hideMenuDrop(menu)
{
	document.getElementById("currency").style.visibility = "hidden";
	document.getElementById("boundary").style.visibility = "hidden";
}

function show_Menu(item,e,n,nn,x) {
	clearTimeout(sliding);
	if (x < 2)
	{
		hideall_sub_b();
	}
	else {
		l = document.body.innerHTML;
		if (l.indexOf('panel_Puma') == -1) {
			hideall_sub_c();
		}
	}
	if (item != 'null') {
		h = document.getElementById(item).style.scrollHeight;
		w = document.getElementById(item).style.scrollWidth;
		document.getElementById(item).style.left = ns6 ? (menu_x + (150 * x)) + 'px'  : (menu_x + (150 * x)) + 'px';
		//document.getElementById(item).style.top = ns6 ? (82 + (17 * n)) + (20 * nn) + offSet : (97 + (17 * n)) + (20 * nn) + offSet;
		document.getElementById(item).style.top = e.pageY + 'px';
		document.getElementById(item).style.visibility = "visible";
	}	
}

function HideMenu() {
	clearTimeout(sliding);
	sliding = setTimeout('hideall_sub_b()',500);
}

function halt() {
	clearTimeout(sliding);
}

function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
else return null;
}
function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
else return null;
}


