isIE = document.all ? true:false;
function newOption() {
   opt = isIE ? document.createElement("OPTION") : new Option();
   return opt;
}
function addOption(objSelect, objOption) {
   if(isIE)
      objSelect.add(objOption, objSelect.length);
   else {
      objSelect.length++;
      objSelect.options[objSelect.length-1] = objOption;
   }
}
function trim(strText) { 
    if(!strText) return "";
    while (strText.substring(0, 1) == ' ') 
        strText = strText.substring(1, strText.length);
    while (strText.substring(strText.length - 1, strText.length) == ' ')
        strText = strText.substring(0, strText.length - 1);
   return strText;
} 
function OpenCart() {
   date = new Date();
   document.location.href = "/cart/index.php3?unique=" + date.getTime();
}
function Logout() {
   document.location.href = "/wholesale/index.php3?logout=true";
}
function isInvalid(strText, strMsg, bIsRequired, bIsNum) {
   if(bIsNum && !isNumeric(strText)) {
      alert('Invalid ' + strMsg + ' value.');
      return true;
   }
   if( bIsRequired && (!strText.length || (bIsNum && strText == 0)) ) {
      alert('Please enter a value for ' + strMsg + '.');
      return true;
   }
   return false;
}
var numbers = ".0123456789 ";
function isNumeric(str) {
   for(i=0; i<str.length; i++) {
      if(numbers.indexOf(str.substring(i, i + 1)) == -1)
         return false;
   }
   return true;
}
function openVehicle(nItemID, nVehID) {
	document.location.href = "/item/a/" + nItemID + "/" + nVehID + "/";
	return;
   strURL = "/search/itemview.php3?closeLink=true&itemID=" + nItemID + "&vehID=" + nVehID;
   wnd = window.open(strURL, "ACPItem", "resizable=yes,width=700,height=600,scrollbars=yes");
   wnd.focus();
}
function o ( url ) {
	document.location.href = url;
}
