// generic script
// if element NAME begins with "v" or "V", validate contains 1+ alphanumeric characters
// highlight incomplete fields
function formValidate(formName,popup){
  formName=formName?formName:"form1";
  var e=document.forms[formName].elements,ok=true,f=false;
  for(var i=0;i<e.length;i++){//>
    if(e[i].name.match(/^v/i)){
      if(e[i].value.match(/\w/)){
        e[i].style.backgroundColor="white";
      }else{
        e[i].style.backgroundColor="pink";
        if(!f){e[i].focus();f=true;}
        ok=false;
      }
    }
  }
  if(ok){
    if(popup){
      _formwin=window.open("about:blank","formwin","top=300,left=300,width=300,height=250");
      _formwin.focus();
    }
	return true;
  }else{
    alert("One or more of the fields were left blank.\n\nPlease complete all fields marked '*'.\n\nThank you.");
    return false;
  }
}