	function onOver(currImg){

		var retObj;
		if (typeof currImg == "string"){
			retObj = eval("document." + currImg + ".src=" + currImg + "on.src;");
		}else{
			retObj = currImg;
		}

		return retObj;
	}

	function onOut(currImg){

		var retObj;
		if (typeof currImg == "string"){
			retObj = eval("document." + currImg + ".src=" + currImg + "off.src;");
		}else{
			retObj = currImg;
		}

		return retObj;
	}

function edit(item,theQty,minOrderQty){
	if(minOrderQty < 1){
		minOrderQty = 1;
	}
	if(theQty < 1){
		theQty = 1;
	}
	minOrderQty = minOrderQty/1;
	theQty = theQty/1;
//	quan=prompt("Please enter the quantity you wish to order", theQty);
//		quan=parseInt(quan);
		quan = parseInt(theQty);
		valid=true;
		if(quan==0){
			confDel('delete.asp?btype=remove&item='+item);
			valid=false;
//		} else if(quan<minOrderQty){
//			alert("You cannot order less than " + minOrderQty + " of this product.");
		}else{	
			if(quan>0){
				document.location="edit.asp?item="+item+"&quantity="+quan;
				valid=false;
			}else{
				if(valid){
					alert("Please make sure that the value entered is a number greater than or equal to zero, and is greater than the minimum order quantity.");
				}
			}
		}
	var divQty;
	if(document.getElementById){
			divQty = document.getElementById('qtyDiv');
	}else{
			divQty = document.all['qtyDiv'];	
	}
	if(divQty != null)
	{
		divQty.style.visibility = 'hidden';
	}
}

function editQty(item,theQty,minOrderQty)
{
	var itemQtyBox;
	var itemCodeBox;
	var itemMinQtyBox;
	var divQty;
	if(document.getElementById){
		itemQtyBox = document.getElementById('prodQty');
		itemCodeBox = document.getElementById('prodItem');
		itemMinQtyBox = document.getElementById('prodMinQty');
		divQty = document.getElementById('qtyDiv');
	}else{
		itemQtyBox = document.all['prodQty'];
		itemCodeBox = document.all['prodItem'];
		itemMinQtyBox = document.all['prodMinQty'];
		divQty = document.all['qtyDiv'];
	}

	if(itemQtyBox != null)
	{
		itemQtyBox.value = theQty;
	}
	if(itemCodeBox != null)
	{
		itemCodeBox.value = item;
	}
	if(itemMinQtyBox != null)
	{
		itemMinQtyBox.value = minOrderQty;
	}
	
	if(divQty != null)
	{
		divQty.style.visibility = 'visible';
	}
	if(itemQtyBox != null)
	{
		itemQtyBox.focus();
	}
}

function hideQty()
{
	var divQty = document.getElementById('qtyDiv');
	if(divQty != null)
	{
		divQty.style.visibility = 'hidden';
	}

}

function hideDel()
{
	var divDel = document.getElementById('delDiv');
	if(divDel != null)
	{
		divDel.style.visibility = 'hidden';
	}

}

function hideEmpty()
{
	var divEmpty = document.getElementById('emptyDiv');
	if(divEmpty != null)
	{
		divEmpty.style.visibility = 'hidden';
	}

}

function showEmpty()
{
	var divEmpty = document.getElementById('emptyDiv');
	if(divEmpty != null)
	{
		divEmpty.style.visibility = 'visible';
	}
}

function confShowDel(dest)
{
	var destBox = document.getElementById('prodDest');
	var divDel = document.getElementById('delDiv');
	if(destBox != null)
	{
		destBox.value = dest;
	}
	if(divDel != null)
	{
		divDel.style.visibility = 'visible';
	}
}

function confDel(dest)
{	//if(confirm("Are you sure that you want to remove this item from your shopping basket"))
		document.location=dest;
}

function confEmpty()
{	//if(confirm("Are you sure that you want to empty your shopping basket?"))
		document.location="delete.asp?btype=empty";
}

function checkout(url)
{	
	theWin = parent.window.opener;
	theWin.parent.master.location = url;
	window.close();
}

function verifyDetails(){
//	cardLength = document.checkout.cardno.value.length;
	if(document.checkout.clientname.value==""){
		alert('Please Enter Your Name');
		document.checkout.clientname.focus();
	}else if(document.checkout.clientaddress.value==""){
		alert('Please Enter Your Address');
		document.checkout.clientaddress.focus();
	}else if((document.checkout.clientemail.value.indexOf('@',0)==-1) || (document.checkout.clientemail.value.indexOf('.',0)==-1)){
		alert('Please Enter a Valid Email Address');
		document.checkout.clientemail.focus();
//	}else if(document.checkout.cardname.value==""){
//		alert('Please Enter the Name As It Appears On Your Credit Card');
//		document.checkout.cardname.focus();
//	}else if(document.checkout.cardno.value==""){
//		alert('Please Enter The Card Number');
//		document.checkout.cardno.focus();
//	}else if(cardLength < 13 || cardLength > 25){
//		alert('Please Enter a Valid Card Number');
//		document.checkout.cardno.focus();
	}else{
		document.checkout.submit();
	}
}

function editDetails(){
	document.checkout.submit();
}

function placeOrder(){
	document.checkout.checkoutpage.value = 'place';
	document.checkout.submit();
}

	function sendEmail(){
		if((document.sendmail.mailemail.value.indexOf('@',0)==-1) || (document.sendmail.mailemail.value.indexOf('.',0)==-1)){
			alert('Please enter a valid email address, so we can contact you.');
			if(document.all){
				document.sendmail.mailemail.focus();
			}
		}else if(document.sendmail.mailenquiry.value == ""){
			if(confirm('You haven\'t entered a message.\n\nWould you like to continue without sending a message?')){
				document.sendmail.submit();
			}else{
				if(document.all){
					document.sendmail.mailenquiry.focus();
				}
			}
		}else{
			document.sendmail.submit();
		}
	}
