
function validateForm(form) {
//      alert("This is the Form Validation Function!");

   if( form.pmtmethod.value == "" ) {
      alert("A Payment Method is required!");
      form.pmtmethod.focus();
      return false;
   } else if( form.pmtmethod.value == "Visa" || form.pmtmethod.value == "MC" || form.pmtmethod.value == "Discover"    || form.pmtmethod.value == "American Express" ) {

      if( form.cardnumber.value == "" ) {
         alert(" A Valid Card Number is required!");
         form.cardnumber.focus();
         return false;
      } else if (form.expmonth.value == "--" ) {
         alert("A valid Expiration Month is required!");
         form.expmonth.focus();
         return false;
      } else if (form.expyear.value == "--" ) {
         alert("A valid Expiration Year is required!");
         form.expyear.focus();
         return false;
      } else if (form.cardholder.value == "" ) {
         alert("A valid Card Holder Name is required!");
         form.cardholder.focus();
         return false;
      }
   } else {
      form.cardnumber.value = "";
      form.expmonth.value = "--";
      form.expyear.value = "--";
      form.cardholder.value = "";
   }
   
   return true;
} // end validateForm function

function findPrice() {
   if (window.document.join.cities.value > 0 && window.document.join.cities.value < 10){
      window.document.join.each.value = "7.00";
      window.document.join.eachshow.value = "7.00";
      makePrice();
   } else if (window.document.join.cities.value >= 10 && window.document.join.cities.value < 25) {
      window.document.join.each.value = "5.00";
      window.document.join.eachshow.value = "5.00";
      makePrice();
   } else if (window.document.join.cities.value >= 25 && window.document.join.cities.value < 50) {
      window.document.join.each.value = "3.00";
      window.document.join.eachshow.value = "3.00";
      makePrice();
   } else if (window.document.join.cities.value >= 50 && window.document.join.cities.value <= 99) {
      window.document.join.each.value = "2.00";
      window.document.join.eachshow.value = "2.00";
      makePrice();
   } else {
      window.document.join.cities.value = 0;
      window.document.join.each.value = "0.00";
      window.document.join.eachshow.value = "0.00";
      window.document.join.total.value = "0.00";
      window.document.join.totalshow.value = "0.00";
   }
}

function makePrice() {
   setTimeout("makePrice()", 500);
   unitTotal = parseFloat(window.document.join.cities.value * window.document.join.each.value);
   unitTotal2 = new String(unitTotal)
   if (unitTotal2.indexOf(".") == -1) {
      unitTotal2 = unitTotal + ".00";
   } else if (unitTotal2.indexOf(".5") != -1) {
      unitTotal2 = unitTotal + "0";
   }
   window.document.join.total.value=unitTotal2;
   window.document.join.totalshow.value=unitTotal2;
}

