function addItemToQuickList( item, qty ) {
  var url='/quicklistAdd.php?productID=' + item + '&qty=' + qty;
  var x = window.open( url, 'QuickWindow', 'width=400,height=400,scrollbars=no');
}

function validateUSNumber( item ) { 
 var CleanedString=""; 
 var index = 0; 
 var LimitCheck; 
 var InitialString = item.value

 if (item.value == '') return true;
 //Get the length of the inputted string, to know how many characters to check
 LimitCheck = InitialString.length;

 //Walk through the inputted string and collect only number characters, appending them to CleanedString
 while (index != LimitCheck) { 
  if (isNaN(parseInt(InitialString.charAt(index)))) { } 
  else { CleanedString = CleanedString + InitialString.charAt(index); } 
  index = index + 1; 
 }

 //If CleanedString is exactly 10 digits long, then format it and allow form submission
 if (CleanedString.length == 10) { 
  item.value = CleanedString.substring(0,3) + "-" + CleanedString.substring(3,6) + "-" + CleanedString.substring(6,10); 
 }
 //If CleanedString is not 10 digits longs, show an alert and cancel form submission
 else { 
  CleanedString = InitialString; 
  alert("Please enter only your ten digit phone number.");
  if (document.all) { 
    item.focus();
    item.select();
  }
 return false
 } 
} 
function viewOrder( type, options, orderid ) {
  var url='/viewOrder.php?type=' + type + '&options=' + options + '&orderid=' + orderid;
  var x = window.open( url, 'orderWindow', 'width=600,height=550,scrollbars=yes');
}
function viewAvailability( getstring ) {
  var url='/viewAvailability.php' + getstring;
  var x = window.open( url, 'availWindow', 'width=450,height=275,scrollbars=yes');
}
function removeItem( id ) {
  if (confirm('Really remove this category from the database?')) {
     document.rmItemForm.remove.value = "Remove";
     document.rmItemForm.submit(); 
  } else {
   return false;
  }   
}
function enableEmpSecurity( isEmp ) {
	//O for no, 1 for yes
	if (isEmp == 0) {
	    document.userMaintForm.mod_security.disabled = true;
	} else {
		document.userMaintForm.mod_security.disabled = false;
	}
}
function setHiddenAction(id, val) {
  document.getElementById(id).value = val;
  return true;
}
