function checkForm(){

 var form = document.checkout_form;

 if(form.fname.value.length == 0){
  alert("Please enter your first name");
  form.fname.focus();
  return false;
 }

 if(form.lname.value.length == 0){
  alert("Please enter your last name");
  form.lname.focus();
  return false;
 }


 if(form.cname.value.length == 0){
  alert("Please enter your company name");
  form.cname.focus();
  return false;
 }

 if(form.address.value.length == 0){
  alert("Please enter your billing address");
  form.address.focus();
  return false;
 }

 if(form.city.value.length == 0){
  alert("Please enter your billing city");
  form.city.focus();
  return false;
 }
 if(form.zip.value.length == 0){
  alert("Please enter your billing Zip Code");
  form.zip.focus();
  return false;
 }



 if(form.phone.value.length == 0){
  alert("Please enter your billing phone");
  form.phone.focus();
  return false;
 }


 if(form.ship_fname.value.length == 0){
  alert("Please enter your shipping first name");
  form.ship_fname.focus();
  return false;
 }

 if(form.ship_lname.value.length == 0){
  alert("Please enter your shipping last name");
  form.ship_lname.focus();
  return false;
 }


 if(form.ship_cname.value.length == 0){
  alert("Please enter your shipping company name");
  form.ship_cname.focus();
  return false;
 }



 if(form.ship_address.value.length == 0){
  alert("Please enter your shipping address");
  form.ship_address.focus();
  return false;
 }

 if(form.ship_city.value.length == 0){
  alert("Please enter your shipping city");
  form.ship_city.focus();
  return false;
 }
 if(form.ship_zip.value.length == 0){
  alert("Please enter your Shipping Zip Code");
  form.ship_zip.focus();
  return false;
 }



 if(form.ship_phone.value.length == 0){
  alert("Please enter your shipping phone");
  form.ship_phone.focus();
  return false;
 }



 if(form.cname.value.indexOf(',') != -1){
  alert("Please remove any commas from the company name");
  form.cname.focus();
  return false;
 }

 if(form.ship_cname.value.indexOf(',') != -1){
  alert("Please remove any commas from the company name");
  form.ship_cname.focus();
  return false;
 }


 if(form.address.value.indexOf(',') != -1){
  alert("Please remove any commas from the address");
  form.address.focus();
  return false;
 }

 if(form.ship_address.value.indexOf(',') != -1){
  alert("Please remove any commas from the ship_address");
  form.ship_address.focus();
  return false;
 }

 if(form.cperson.value.length == 0){
  alert("Please enter the  Contact Person name");
  form.cperson.focus();
  return false;
 }

 if(form.cperson.value.indexOf(',') != -1){
  alert("Please remove any commas from the Contact Person");
  form.cperson.focus();
  return false;
 }

 if(form.email.value.length == 0){
  alert("Please enter the  Contact Person email address");
  form.email.focus();
  return false;
 }



 if(form.cnumber.value.length == 0){
  alert("Please enter valid cc number");
  form.cnumber.focus();
  return false;
 }

 if(form.cvvcode.value.length ==0){
  alert("Please enter Security Code");
  form.cvvcode.focus();
  return false;
 }


 return true;
}
function showShipAdd(){

 var form = document.checkout_form;

 if(form.isSameAddr.checked){

  form.ship_address.value =  "";
  form.ship_city.value =  "";
  form.ship_zip.value =  "";
  form.ship_phone.value =  "";
  form.ship_address.focus();
 }
 else
  form.ship_address.focus();


}
function showResale(){

var st = document.checkout_form.state.options[document.checkout_form.state.selectedIndex].text;
if (st == 'TN'){
document.all.resale1.style.visibility="visible";
}
if (st != 'TN'){
document.all.resale1.style.visibility="hidden";
}
}

