function ProdDetail(pid){
	var url="product_detail.php?pid="+pid;
	window.open(url,'prodWin','scrollbars,resizable,width=420,height=380');
}
function adminProdDetail(pid){
	var url="../product_detail.php?pid="+pid;
	window.open(url,'prodWin','scrollbars,resizable,width=420,height=380');
}
// shopping cart command functions
function DetailAddToCart(pid){
	var url="cart.php?pd=1&action=add&pid="+pid+"&qty=1";
	opener.location.href=url;
	alert("Item added to cart");
	self.close();
}
function AddToCart(pid,qty){
	var url="cart.php?action=add&pid="+pid+"&qty="+qty;
	window.location.href=url;
}
function UpdateCart(menu){
	var key = menu.name;
	var qty = menu.options[menu.selectedIndex].value;
	var url="cart.php?action=update&key="+key+"&qty="+qty;
	window.location.href=url;
}
function RemoveFromCart(pid){
	if(confirm("Are you sure you wish to remove this item from your Shopping Cart?")){
		var url="cart.php?action=remove&pid="+pid;
		window.location.href=url;
	}
}

//==========================================================
// admin command functions
function prodDelete(pid){
	var url="prod_admin.php?pid="+pid+"&action=del";
	if(confirm("This action cannot be undone.\n\nAre you SURE you wish to delete this product?\n")){
		window.open(url,'delW','width=10,height=10');
	}
}
function prodEdit(pid){
	var url="prod_admin.php?pid="+pid+"&action=edit";
	window.open(url,'editW','width=525,height=450,resizable,scrollbars=auto');
}
function logOutAdmin(){
	if(confirm("Are you sure you wish to log out of the admin system?")){
		top.location.href = 'logout.php';
	}
}
function orderDetail(oid){
	if(oid>0){
		var url="order_detail.php?oid="+oid;
		window.open(url,'detailWin','width=500,height=400,scrollbars,resizable');
	}
}
//=====================================================================