function submitFormAction(formObj,formAction) {
	if (!formObj)
		return false;
	if (formObj.tagName != "FORM") {
		if (!formObj.form)
			return false;
		formObj = formObj.form;
	}
	if (formObj.action)
		formObj.action.value = formAction;
  
	formObj.submit();
}

function checkProductQty(itemid,obj) {
  var ship_qty = obj.value;
  if(ship_qty <= 0) {
    alert("The shipped quantity for every line must be greater than 0,  please change teh shipped quantity to be able to save the package");
    obj.value = 1;
  }
  var i = itemid;
  var amount_left = items[i][0] - items[i][1];
  if(ship_qty > amount_left) {
    alert("The shipped quantity for every line must be smaller or equal to the quantity that remains to be shipped.  Please update the status of the items in the item status section to reflect that some units remain to be shipped");
    obj.value = 1;
  }
}
