function checkforblanks()
    {
    for (var i = 0; i < arguments.length; i += 2)
        {
        if (!arguments[i])
            {alert("Please enter " + arguments[i+1] + ".");return false;}
        }
    return true;
    }

function checkEmail(field)
    {
    var newstr = "";
    var at = false;
    var dot = false;

    // IF EMAIL ADDRESS HAS '@'
    if (field.indexOf("@") != -1) {
      at = true;

    // IF EMAIL ADDRESS HAS '.'
    } else if (field.indexOf(".") != -1) {
      dot = true;
    }
    // check rest of STRING
    for (var i = 0; i < field.length; i++) {
        ch = field.substring(i, i + 1)
        if ((ch >= "A" && ch <= "Z") || (ch >= "a" && ch <= "z")
                || (ch == "@") || (ch == ".") || (ch == "_")
                || (ch == "-") || (ch >= "0" && ch <= "9")) {
                newstr += ch;
                if (ch == "@") {
                    at=true;
                }
                if (ch == ".") {
                    dot=true;
                }
        }
    }
    if ((at == true) && (dot == true)) {
        return true;
    }
    else {
      // DISPLAY ERROR MESSAGE
      alert ("Sorry, the email address you\nentered is not in the correct\nformat.");
      return false;
    }

    return true;
    }

function validateContact()
    {
    // Make sure none of the required fields are empty
    var isFull = checkforblanks(document.contact.name.value, "Your Name",document.contact.phone.value, "Your Phone Number");

    if (isFull)
    {
        isFull = checkEmail(document.contact.email.value);
    }
    if (!isFull)
        {return false;}
    }

function validateFull()
    {
    // Make sure none of the required fields are empty
    var isFull = checkforblanks(document.fullform.name.value, "Your Name",document.fullform.address.value, "Your Address",document.fullform.city.value, "Your City",document.fullform.provstate.value, "Your Province/State",document.fullform.country.value, "Your Country",document.fullform.postalzip.value, "Your Postal/Zip Code",document.fullform.phone.value, "Your Phone Number");

    if (isFull)
    {
        isFull = checkEmail(document.fullform.email.value);
    }
    if (!isFull)
        {return false;}
    }
