function processForm()
{
   // grab form info
   var myname   = top.topframe.document.mailorderform.myname_box.value;
   var company  = top.topframe.document.mailorderform.company_box.value;
   var address1 = top.topframe.document.mailorderform.address1_box.value;
   var address2 = top.topframe.document.mailorderform.address2_box.value;
   var city     = top.topframe.document.mailorderform.city_box.value;
   var state    = top.topframe.document.mailorderform.state_box.value;
   var zip      = top.topframe.document.mailorderform.zip_box.value;
   var country  = top.topframe.document.mailorderform.country_box.value;
   var email    = top.topframe.document.mailorderform.email_box.value;

   //Check for form errors ==========================
   var errors = 0;
   var errormessage = "I need the following information before proceeding:\n\n";

   if (myname.length == 0) { errormessage = errormessage + "-  You must fill in your name.\n"; errors = 1; }
   if (address1.length == 0) { errormessage = errormessage + "-  You must fill in your address.\n"; errors = 1; }
   if (country.length == 0) { errormessage = errormessage + "-  You must fill in your country.\n"; errors = 1; }
   if (emailcheck(email) == "bad") { errormessage = errormessage + "-  The email address you gave is not valid.\n"; errors = 1; }

   if (errors == 0)
   {
      // flag questionable items
      flags = 0;
      flagmessage = "I found some potential errors...\n\n";
      if (city.length == 0)  { flagmessage = flagmessage + "-  City is blank.\n"; flags = 1; }
      if (state.length == 0) { flagmessage = flagmessage + "-  State/Province is blank.\n"; flags = 1; }
      if (zip.length == 0)   { flagmessage = flagmessage + "-  Zip/Postal Code is blank.\n"; flags = 1; }

      if (flags == 0)
      {
         return true;
      }
      else
      {
         if (confirm(flagmessage + "\nAre you sure the information you gave is correct and complete? Press OK to continue with the info you've given. Press Cancel to stop and make changes.\n\n"))
         {
            return true;
         }
         else
         {
            return false;
         }
      }
   }
   else
   {
      alert(errormessage);
      return false;
   }
}





// Email check ===============================
// Checks to see that - it contains an @ sign
//                      it contains at least 1 period .
//                      is at least 6 characters long a@a.aa
// returns "good" or "bad"
function emailcheck(email)
{
   if (email.length < 6) { return "bad"; }
   else
   {
      if ((CheckForCharInString("@",email) == false)||(CheckForCharInString(".",email) == false)) { return "bad"; }
      else { return "good"; }
   }
}


// Checks for the existance of a character in a string, returns true for yes, false for no
function CheckForCharInString(mychar,mystring)
{
   charpresent = 0;
   for (var i = 0; i < (mystring.length*1); i++) {
      if (mystring.substring(i,i+1) == mychar) { charpresent++; }
   }

   if (charpresent == 0) { return false; } else { return true; }
}

