function validateForm(whichbutton) {
	var btton = whichbutton;
	if(btton =="validate"){
		with (document.form1) {
			var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";

			if (firstname.value == "") alertMsg += "\n First Name";	
			if (lastname.value == "") alertMsg += "\n Last Name";
			if (addr1.value == "") alertMsg += "\n Address";
			if (city.value == "") alertMsg += "\n City";			
			//if (type.selectedIndex == 0) alertMsg += "\n Type";
			if (State.selectedIndex == 0) alertMsg += "\n State";
			if (zip.value == "") alertMsg += "\n Zip";
			if (email.value == "") alertMsg += "\n Email";
			if (phone.value == "") alertMsg += "\n Phone";			
			
			if (!(IsNumeric(quantitydvd.value)) || !(IsNumeric(quantitycd.value)) || !(IsNumeric(quantityboth.value))) alertMsg += "\n All quantities must be numeric";
			
									
			if (alertMsg != "The following REQUIRED fields\nhave been left empty:\n") {
				alert(alertMsg);
				return false;
			} else {
				return true;
				//alert("test");
			}
		}
	}
}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }