function showShippingInfo()
{
var winshipping = 'ShippingInfoWindow';
var feat = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=667,height=350,left=50,screenx=35,top=0,screenY=50';
var page='shippinginfo.asp';
OpenWin = this.open(page, winshipping, feat);
OpenWin.focus();
}

function changeDimension(prodcode,prodcatcode,prodname,prodprice,ph,pw,pu,pq)
{
var windimension = 'ChangeDimensions';
var feat = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=660,height=350,left=50,screenx=35,top=0,screenY=50';
var page='changedimension.aspx?prodcode='+prodcode+'&prodcatcode='+prodcatcode+'&prodname='+prodname+'&unitprice='+prodprice+'&ph='+ph+'&pw='+pw+'&pu='+pu+'&pq='+pq;
OpenWin = this.open(page, windimension, feat);
OpenWin.focus();
}
function productDetail(prodcode,groupcode)
{

var strProdCode = prodcode;
var strGroupCode = groupcode;

document.location.href ="productdetails.aspx?hdnGroupCode="+strGroupCode+'&hdnProdCode='+strProdCode+"&fromcart=Y";

}
function reCalculate()
{
    var blnValidate = true;
   
 if (document.getElementById("hdnProd").value != 1) {
     
     for (var j = 0; j < document.getElementById("hdnProd").value; j++) {
         //alert(document.getElementById("hdnProd").value);
         qtybox = document.getElementById("Qty" + j);
         if (qtybox.value == '' || qtybox.value == 0 || qtybox.value < 0) {
             alert("Please specify the quantity to be calculate");
             qtybox.focus();
             blnValidate = false;
             break;
         }
         else if (isNaN(qtybox.value)) {
             alert("Invalid quantity value. Please enter a proper quantity.");
             qtybox.focus();
             blnValidate = false;
             break;
         }
         else if (qtybox.value.indexOf(".") != -1) {
             alert("Please do not enter decimal values.");
             qtybox.focus();
             blnValidate = false;
             break;
         }
     }
 }
 else {
     //alert(document.getElementById("hdnProd").value);
  qtybox = document.getElementById("Qty0");
  if (qtybox.value == '' || qtybox.value == 0 || qtybox.value < 0) {
             alert("Please specify the quantity to be calculate");
             qtybox.focus();
             blnValidate = false;
         }
         else if (isNaN(qtybox.value)) {
             alert("Invalid quantity value. Please enter a proper quantity.");
            qtybox.focus();
            blnValidate = false;
         }
         else if (qtybox.value.indexOf(".") != -1) {
             alert("Please do not enter decimal values.");
             qtybox.focus();
             blnValidate = false;
         }
 }
 if (blnValidate == true)
  {
     document.getElementById("hdnrecalculate").value = "Y";
     document.form1.submit();
 }
 
}

function emptyCart()
{
	document.frmShowCart.hdnCart.value ="emptyCart"
	document.frmShowCart.submit();	
}

function removeFromCart(removeprodcode,removeheight,removewidth,removeunit) {
	document.getElementById("hdnCart").value = "removeFromCart";
	document.getElementById("hdnRemoveProduct").value = removeprodcode;
	document.getElementById("hdnRemoveHeight").value = removeheight;
	document.getElementById("hdnRemoveWidth").value = removewidth;
	document.getElementById("hdnRemoveUnit").value = removeunit;
	document.forms[0].submit();

}

function checkout(mem) {
	if (document.getElementById("topbar_hdnminorderqty").value != 0)
	{
	    alert("Your order value must be greater than " + "\u00A3" + document.getElementById("topbar_hdnminorderqty").value + " (exc. VAT & Shipping) to checkout and place your order.\nThis minimum order policy helps keep our prices low.");
	}
	else if (mem =='0')
	{
		if (confirm("Please login using the top bar to access this page.\n\nAre you a new customer?\nClick OK to be taken to the Register Page Or Cancel to stay on the same page.\n\nRegistration is instant and is part of the Checkout process.")){
			document.location.href="register.aspx?ssnpage=checkout";
			}		
	}
	else {
		document.location.href="checkout.aspx";
	}

}



function redeem(){

	if(document.frmRedemption.txtVoucherNo.value == ''){
		alert("Please Enter The Voucher No.");
		document.frmRedemption.txtVoucherNo.focus();
	}
	else{
		document.frmRedemption.submit();
	}
	
	
}