/*

eshox.com javascripts
copyright (c) 2004, secure.cc, inc.

*/

var wsmenu = false;
window.onload = wsload;

function wsload() {
	var dt = document.getElementById('wsnav').getElementsByTagName("*");
	for (i=0; i<dt.length; i++) if (dt[i].className == 'wsmenu') {
		dt[i].onmouseover = wsmenu_open;
		dt[i].onmouseout = wsmenu_unstick;
	}
	if (dp = document.getElementById('wspage')) dp.onmouseover = function() { wsmenu_unstick(); }
	window.onunload = wsmenu_unstick;
}

function wsmenu_open() {
	wsmenu_unstick();
	window.wsmenu = this.firstChild;
	if (wsmenu.nextSibling) {
		wsmenu.nextSibling.className = 'hover';
	} else {
		wsmenu.className = 'hover';
	}
}

function wsmenu_unstick() {
	if (wsmenu) {
		if (window.wsmenu.nextSibling) {
			window.wsmenu.nextSibling.className = '';
		} else {
			wsmenu.className = '';
		}
		wsmenu = false;
	}
}

function popup_window(popURL, popWidth, popHeight) {
	if (!popWidth || !popHeight) { popWidth = 758; popHeight = 585; }
	centerx = Math.round((window.screen.width/2) - (popWidth/2));
	centery = Math.round((window.screen.height/2) - (popHeight/2));
	popWidth = parseInt(popWidth);
	popHeight = parseInt(popHeight);
	
	realwidth = (self.outerWidth - self.innerWidth);
	realheight = (self.outerHeight - self.innerHeight);
	if (realwidth > 0) popWidth = parseInt(popWidth) + parseInt(realwidth);
	if (realheight > 0) popHeight = parseInt(popHeight) + parseInt(realheight) - 96;

	theMethod = 'width='+popWidth+',height='+popHeight+',left=' + centerx + ',top=' + centery + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes';
	var popupWindow = window.open(popURL,'eshoxpopup',theMethod);
	popupWindow.focus();
	popupWindow.document.style.border="0px";
	popupWindow.document.style.margin="0px";
	popupWindow.document.style.padding="0px";
}

function go_direct(url) { document.location.href = url; return true; }
function go_url(webcode) { return go_direct(webcode+'.php'); }
function go_shop(pid) { return go_direct('http://www.eshox.com/shop/product_info.php?products_id='+pid); }
function go_dir(dir) { return go_direct('http://www.eshox.com/'+dir+'/'); }
function go_redirect(url) { return xhtml_check=window.open(url); }

var agt = navigator.userAgent.toLowerCase();
if (agt.indexOf("msie 5.2") !=-1 || agt.indexOf("msie 5.1") !=-1) {
	//alert("Please use a web browser that supports HTML 4 standards (Opera, Safari or Firefox).");
}
