<!--
function ShipFill() {
	if (document.form.ship_same.checked) 
	{
		document.form.firstname.value = document.form.ship_firstname.value;
		document.form.lastname.value = document.form.ship_lastname.value;
		document.form.company_name.value = document.form.ship_company_name.value;
		document.form.address1.value = document.form.ship_address1.value;
		document.form.address2.value = document.form.ship_address2.value;
		document.form.city.value = document.form.ship_city.value;
		document.form.state.value = document.form.ship_state.value;
		document.form.zipcode.value = document.form.ship_zipcode.value;
		document.form.country.value = document.form.ship_country.value;
		document.form.phone.value = document.form.ship_phone.value;
		document.form.email.value = document.form.ship_email.value;
		
	}
}

function MM_jumpMenu(targ,selObj,restore)
{
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}
	
	
function categoryCheck(theForm)
{
  if (theForm.strImage.value == "" && theForm.strOriginalImage.value == "")
  {
    alert("Please select an image from your local computer.");
    theForm.strImage.focus();
    return (false);
  }
	
	if (theForm.strName.value == "")
  {
    alert("Please enter a Category Name.");
    theForm.strName.focus();
    return (false);
  }
	
	
	return (true);
}


function deletecategoryCheck(theForm)
{
  return confirm("Are you sure you want to delete this Category?  Doing so will delete all Subcategories, Products, and Skus within this Category.");
}


function subCategoryCheck(theForm)
{
  if (theForm.strImage.value == "" && theForm.strOriginalImage.value == "")
  {
    alert("Please select an image from your local computer.");
    theForm.strImage.focus();
    return (false);
  }
	
	if (theForm.strName.value == "")
  {
    alert("Please enter a SubCategory Name.");
    theForm.strName.focus();
    return (false);
  }
	
	
	return (true);
}


function deletesubCategoryCheck(theForm)
{
  return confirm("Are you sure you want to delete this Subcategory?  Doing so will delete all Products, and Skus within this Subcategory.");
}


function productCheck(theForm)
{
  if (theForm.strImage.value == "" && theForm.strOriginalImage.value == "")
  {
    alert("Please select an image from your local computer.");
    theForm.strImage.focus();
    return (false);
  }
	
	if (theForm.strName.value == "")
  {
    alert("Please enter a Product Name.");
    theForm.strName.focus();
    return (false);
  }
	
	if (theForm.subCatID.value == "")
  {
    alert("Please select at least one Subcategory.");
    theForm.subCatID.focus();
    return (false);
  }
	
	if (theForm.strDesc.value == "")
  {
    alert("Please enter a Description.");
    theForm.strDesc.focus();
    return (false);
  }
	
	if (theForm.strShortDesc.value == "")
  {
    alert("Please enter a Short Description.");
    theForm.strShortDesc.focus();
    return (false);
  }
	
	
	return (true);
}


function deleteProductCheck(theForm)
{
  return confirm("Are you sure you want to delete this Product?  Doing so will delete all Skus within this Product.");
}


function manufCheck(theForm)
{
  if (theForm.strImage.value == "" && theForm.strOriginalImage.value == "")
  {
    alert("Please select an image from your local computer.");
    theForm.strImage.focus();
    return (false);
  }
	
	if (theForm.strName.value == "")
  {
    alert("Please enter a Manufacturer Name.");
    theForm.strName.focus();
    return (false);
  }
	
	
	return (true);
}


function deleteManufCheck(theForm)
{
  return confirm("Are you sure you want to delete this Manufacturer?");
}


function skuCheck(theForm)
{
  if (theForm.intMinQty.value != "")
	{
	  if (!checkInteger(theForm.intMinQty.value)) 
		{
		  alert("Please enter a whole number for the Minimum Quantity.");
		  return false;
		}
	}
	
	if (theForm.fltWeight.value == "")
  {
    alert("Please enter a Sku Weight.");
    theForm.fltWeight.focus();
    return (false);
  }
	else if (!checkFloating(theForm.fltWeight.value))
	{
	  alert("Please enter a number for the Sku Weight.");
		return (false);
	}
	
	if (theForm.fltFreightBuffer.value != "")
	{
	  if (!checkFloating(theForm.fltFreightBuffer.value)) 
		{
		  alert("Please enter a number for the Freight Charge Buffer.");
		  return false;
		}
	}
	
	
	return (true);
	
}


function deleteSkuCheck(theForm)
{
  return confirm("Are you sure you want to delete this Sku?");
}


function priceCheck(theForm)
{
  if (theForm.intQty.value == "")
  {
    alert("Please enter a Price Quantity.");
    theForm.intQty.focus();
    return (false);
  }
	else if (!checkInteger(theForm.intQty.value))
	{
	  alert("Please enter a whole number for the Price Quantity.");
		return (false);
	}
	
	
	if (theForm.fltListPrice.value == "")
  {
    alert("Please enter a List Price.");
    theForm.fltListPrice.focus();
    return (false);
  }
	else if (!checkFloating(theForm.fltListPrice.value))
	{
	  alert("Please enter a number for the List Price.");
		return (false);
	}
	
	
	if (theForm.fltWebPrice.value == "")
  {
    alert("Please enter a Web Price.");
    theForm.fltWebPrice.focus();
    return (false);
  }
	else if (!checkFloating(theForm.fltWebPrice.value))
	{
	  alert("Please enter a number for the Web Price.");
		return (false);
	}
	
	
	if (theForm.fltClearancePrice.value != "")
	{
	  if (!checkFloating(theForm.fltClearancePrice.value)) 
		{
		  alert("Please enter a number for the Clearance Price.");
		  return false;
		}
	}
	
	
	return (true);
}


function deletePriceCheck(theForm)
{
  return confirm("Are you sure you want to delete this Price Record?");
}


function userDefinedCheck(theForm)
{
  if (theForm.strLabel.value == "")
  {
    alert("Please enter a Label.");
    theForm.strLabel.focus();
    return (false);
  }
	
	
	return (true);
}


function deleteUserDefinedCheck(theForm)
{
  return confirm("Are you sure you want to delete this User Defined Field?");
}


function checkFloating(fltValue) 
{
  for (i=0; i < fltValue.length; i++) 
	{
    var ch = fltValue.substring(i,i+1)
    if ( (ch < "0" || "9" < ch) && ch !=".") 
		{
      return false
    }   
	} 
	
	return true;
}


function checkInteger(fltValue) 
{
  for (i=0; i < fltValue.length; i++) 
	{
    var ch = fltValue.substring(i,i+1)
    if (ch < "0" || "9" < ch) 
		{
      return false
    }   
	} 
	
	return true;
}




//-->

