function custCheck(infoCheck) {

customertName = infoCheck.customer.selectedIndex
if (infoCheck.customer.value == "") {
alert("You left the Customer Name field blank.")
infoCheck.customer.focus()
return false
}

eMail = infoCheck.email.selectedIndex
if (infoCheck.email.value == "") {
alert("You left the Email field blank.")
infoCheck.email.focus()
return false
}
str = infoCheck.email.value
re = /[^\w\@\.\-]/
check = re.exec(str)
if (check != null){
alert("You have a Invaild Character in your email address:\n"+infoCheck.email.value+"\n"+check[0])
infoCheck.email.focus()
infoCheck.email.select()
return false
}
re1 = /([\w\.\-]+)(\@)(\w+\.)(\w[\w\.\-]+)/
re2 = /([\w\.\-]+)(\@)(\w+\-\w+)(\.|\-)(\w\w+|\.\w\w+)+/
re3 = /spam/i
check1 = re1.exec(str)
check2 = re2.exec(str)
check3 = re3.test(str)
if (check1 == null && check2 == null){
alert("Your Email Address appears to be incomplete\n"+infoCheck.email.value)
infoCheck.email.focus()
infoCheck.email.select()
return false
}
if (check3 == true){
alert("Your Email Address may not contain the word SPAM\n"+infoCheck.email.value)
infoCheck.email.focus()
infoCheck.email.select()
return false
}

prodCheck = infoCheck.num_prod.selectedIndex
if (infoCheck.num_prod.value == ""){
alert("How many products are you ordering?")
infoCheck.num_prod.focus()
return false
}
str = infoCheck.num_prod.value
re = /[^0-9]/  //\D doesn't work
check = re.test(str)
if (check == true){
alert("The answer MUST be a number and BE greater than 0.")
infoCheck.num_prod.focus()
infoCheck.num_prod.select()
return false
}else if (infoCheck.num_prod.value <= 0) {
alert("The answer MUST BE greater than 0")
infoCheck.num_prod.focus()
infoCheck.num_prod.select()
return false
}
ship_info = infoCheck.ship.value
if (ship_info.value == "") {
alert("You left the Shipping Information field blank.")
infoCheck.ship.focus()
return false
}
}

