<!--

function Checkout(strDestination, OrderID) {
	//alert(strDestination + "\n" + OrderID + "\n" + Clear);
	//return false;
	
	document.frmForm.action = strDestination;
	
	document.frmForm.OrderID.value = OrderID;
	document.frmForm.Clear.value = 0;
	
	document.frmForm.submit();
}

function EmptyBasket(strDestination, OrderID) {
	//alert(strDestination + "\n" + OrderID + "\n" + Clear);
	//return false;
	
	document.frmForm.action = strDestination;
	
	document.frmForm.OrderID.value = OrderID;
	document.frmForm.PPU.value = 0;
	document.frmForm.ThisQuantity.value = 0;
	document.frmForm.Clear.value = 1;
	
	document.frmForm.submit();
}

function AddSOToBasket(strDestination, strSource, dblPrice, Chosen_ProductID, ThisQuantity, Add) {
	/*   
    alert("strDestination: " + strDestination + "\n" +
			"strSource: " + strSource + "\n" +
			"dblPrice: " + dblPrice + "\n" +
			"Chosen_ProductID: " + Chosen_ProductID + "\n" +
			"ThisQuantity: " + ThisQuantity + "\n" +
			"Add: " + Add);
    */
    //return false;
    
    document.frmForm.action = strDestination;

	document.frmForm.Chosen_ProductID.value = Chosen_ProductID;
	document.frmForm.PPU.value = dblPrice;
	document.frmForm.ThisQuantity.value = ThisQuantity;
	//name="mainQuantity"
    document.frmForm.source.value = strSource;
	//name="Section_Name"
	document.frmForm.Add.value = Add;
	document.frmForm.Clear.value = 0;

    document.frmForm.submit();
}

function checkFormUnload() {
    
    var strOrderID = document.frmForm.OrderID.value;    

    //alert(strOrderID.length);

    if (strOrderID.length) {
        return false;
    } else {
        return true;
    }
}

function checkForm() {
    
    var strOrderID = document.frmForm.OrderID.value;    

    //alert(strOrderID);

    if (IsNumeric(strOrderID)) {
        return false;
    } else {
        return true;
    }    
}
    
function section(intSectionID, strSource) {
    document.frmForm.action = 'addorder.asp';
    document.frmForm.Chosen_SectionID.value = intSectionID;
    document.frmForm.source.value = strSource;
    //document.frmForm.Clear.value = 0
    
    document.frmForm.submit();
}
    
//function submitForm(strDestination, strSource, [dblPrice]) {
function header(strDestination, strSource) {

    document.frmForm.action = strDestination;
    
    document.frmForm.Chosen_SectionID.value = 0;
	document.frmForm.Chosen_ProductID.value = 0;
    document.frmForm.source.value = strSource;
    document.frmForm.PPU.value = 0;
    document.frmForm.ThisQuantity.value = 0;   
    //document.frmForm.Clear.value = 0

    document.frmForm.submit();
}

function AddToBasket(strDestination, strSource, dblPrice, Chosen_SectionID, Chosen_ProductID, ThisQuantity, Add) {
    /*
    alert("strDestination: " + strDestination + "\n" +
			"strSource: " + strSource + "\n" +
			"dblPrice: " + dblPrice + "\n" +
			"Chosen_SectionID: " + Chosen_SectionID + "\n" +
			"Chosen_ProductID: " + Chosen_ProductID + "\n" +
			"ThisQuantity: " + ThisQuantity + "\n" +
			"Add: " + Add);
    */
    //return false;
    
    document.frmForm.action = strDestination;

    document.frmForm.Chosen_SectionID.value = Chosen_SectionID;
	document.frmForm.Chosen_ProductID.value = Chosen_ProductID;
	document.frmForm.PPU.value = dblPrice;
	document.frmForm.ThisQuantity.value = ThisQuantity;
	//name="mainQuantity"
    document.frmForm.source.value = strSource;
	//name="Section_Name"
	document.frmForm.Add.value = Add;
	document.frmForm.Clear.value = 0;

    document.frmForm.submit();
}

function addAnother(strDestination, strSource, dblPrice, Chosen_SectionID, Chosen_ProductID, OrderID, ThisQuantity, Add) {
/*
    alert("strDestination: " + strDestination + "\n" +
			"strSource: " + strSource + "\n" +
			"dblPrice: " + dblPrice + "\n" +
			"Chosen_SectionID: " + Chosen_SectionID + "\n" +
			"Chosen_ProductID: " + Chosen_ProductID + "\n" +
			"OrderID: " + OrderID + "\n" +
			"ThisQuantity: " + ThisQuantity + "\n" +
			"Add: " + Add);
  */  
    //return false;
    
    document.frmForm.action = strDestination;
    
    document.frmForm.OrderID.value = OrderID;
    document.frmForm.Chosen_SectionID.value = Chosen_SectionID;
	document.frmForm.Chosen_ProductID.value = Chosen_ProductID;
	document.frmForm.PPU.value = dblPrice;
	document.frmForm.ThisQuantity.value = ThisQuantity;
	//name="mainQuantity"
    document.frmForm.source.value = strSource;
	//name="Section_Name"
	document.frmForm.Add.value = Add;
	document.frmForm.Clear.value = 0;

    document.frmForm.submit();
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

	function CheckEntries() {
		if( document.frmForm.First_Name.value=="" ) {
			alert("Please enter your First Name");
			return false;
		}
		if( document.frmForm.Last_Name.value=="" ) {
			alert("Please enter your Last Name");
			return false;
		}
		if( document.frmForm.Title.value=="" ) {
			alert("Please enter your Title");
			return false;
		}
		if( document.frmForm.Street_Address.value=="" ) {
			alert("Please enter your Street Address");
			return false;
		}
		if( document.frmForm.Town.value=="" ) {
			alert("Please enter your Town");
			return false;
		}
		if( document.frmForm.County.value=="" ) {
			alert("Please enter your County");
			return false;
		}
		if( document.frmForm.Postcode.value=="" ) {
			alert("Please enter your Postcode");
			return false;
		}
		if( document.frmForm.Email.value=="" ) {
			alert("Please enter your Email Address");
			return false;
		}
		if( document.frmForm.Email.value!=document.frmForm.confirm_Email.value) {
			alert("Your Email addresses do not match");
			return false;
		}
	}
-->