/* $Id: general.js,v 1.1 2005/05/18 03:28:35 chris Exp $ */

function clearItem(item, defaultText) {
	obj = MM_findObj(item);
	if (!obj) return;
	if (obj.value == defaultText)
		obj.value = "";
}
function restoreItem(item, defaultText) {
	obj = MM_findObj(item);
	if (!obj) return;
	if (obj.value == "")
		obj.value = defaultText;
}
function setStatus(text) {
	window.status = text;
}

function clearStatus() {
	window.status = '';
}

function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function OpenWin( slFile, nlWidth, nlHeight ) {
	window.open( slFile, "", "width=" + nlWidth + ",height=" + nlHeight + ",scrollbars=yes,menubar=no" );
}

function UpdateQuantity(olCombo) {
	var qty = olCombo.options[ olCombo.selectedIndex ].text;
	if(qty == 0) {
		document.location.href = 'view_cart.php?del_prod=' + olCombo.name + '&qty=' + qty;
	}
	else {
		document.location.href = 'view_cart.php?up_prod=' + olCombo.name + '&qty=' + qty;
	}
}


