var ie=(document.all) ? true:false;
var ns=(document.layers) ? true:false;

var mouseX;
var mouseY;

if (window.Event) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMousePosition;

function getMousePosition(e) {
	if(ie) {
		mouseX = (event.clientX + document.body.scrollLeft);
		mouseY = (event.clientY + document.body.scrollTop);
	} else if(ns) {
		mouseX = (e.pageX);
		mouseY = (e.pageY);	
	}
}
function changeText(id,text) {
	var obj;
	if(ns) {
		obj = document.layers[id].document;
		obj.open();
		obj.write(text);
		obj.close();
	} else if(ie) {
		document.all[id].innerHTML = text;
	}	
}

function gShowCategory() {
	var args = gShowCategory.arguments;
	var id = args[0];
	
	if(ie) {
		document.gCategoryForm.categoryID.value = id;
		document.gCategoryForm.submit();
	} else if(ns) {
		self.location.href = '/category.asp?categoryid=' + id;
	}
}

function gShowProduct() {
	var args = gShowProduct.arguments;
	var prodid = args[0];
	var catid;
	
	if(args.length > 1) catid = args[1];
	
	if(ie) {
		document.gProductForm.productID.value = prodid;
		if(args.length > 1) document.gProductForm.categoryID.value = catid;
		document.gProductForm.submit();
	} else if(ns) {
		var strLocation
		strLocation = '/product.asp?productid='+ prodid;
		if(args.length > 1) strLocation += '&categoryid=' + catid;
		self.location.href = strLocation;
	}
}

function gNavigate(href) {
	document.MainForm.action = href;
	document.MainForm.submit();
}


