<!--
function validate_required(field,alerttxt)
{
with (field)
{
value.replace(/^\s+|\s+$/g, '');
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_form(thisform)
{
    with (thisform)
    {
        if (validate_required(realname,"Please fill out your name.")==false)
          {realname.focus();return false}
        if (validate_email(email,"Please enter a valid email address.")==false)
          {email.focus();return false}
        if (validate_subject("Please choose a subject.")==false)
          {return false}  
        if (validate_required(comments,"Please select enter your comments/questions.")==false)
          {comments.focus();return false}
    }
}

function validate_email(field,alerttxt)
{
    with (field)
    {
        apos=value.indexOf("@")
        dotpos=value.lastIndexOf(".")
        if (apos<1||dotpos-apos<2) 
            {alert(alerttxt);return false}
        else {return true}
    }
}

function validate_subject(alerttxt)
{
    if (document.getElementById('subject').selectedIndex == 0)
    {
        alert(alerttxt);
        return false;
    } 
    else {return true}
}
//-->