function submitTheData() {
	document.ViewCart.submit();
}

function removeProduct(id){
	document.ViewCart.productId.value = id;
	document.ViewCart.cartAction.value = "DEL";
	submitTheData();
}

function updateQuantity(elNumber){
	var elQty = eval("document.ViewCart.txtQty_"+elNumber+".value");
	if (!isNaturalNumber(elQty)){	
		alert('Please enter a valid positive number');
		return(false);	
	}else if (elQty.value <= 0 || elQty.value > 99){
		alert('Please enter a value that is greater than 0 and less than 100.');
		return(false);
	}else{
		document.ViewCart.cartAction.value = "UPD";
		document.ViewCart.productId.value = elNumber;
		submitTheData();		
	}

}

function getOrderInfo1(){
	window.location.href='http://localhost/umipub.publicsite/ourbooks/GetAddressInfo.aspx';
}

// <summary>
// Test for Positive Integers. 
// </summary>
// <param name="strNumber">String to Test</param>
// <returns>bool</returns>
function isNaturalNumber(val) {
	pattern = /^0*[1-9][0-9]*$/;
	var matchArray = val.match(pattern); // is the format ok?
	
  if (matchArray == null) {
    return false;
  }	else { 
		return true;
	}
}