String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function validateForm(f,title) {
  var r=true;

  $(".required",f).each(function(i,item) {
    $(".form-"+$(item).attr("name"),f).animate({color:"#333"});
    
    var v=$(item).val().trim();
    if(($(item).is("select") && (v=="Select One" || v=="------------")) || v.length<3) {
      $(".form-"+$(item).attr("name"),f).animate({color:"#F33"});
      r=false;
    }
  });

  if(!r)
    alert("One or more fields of the "+title+" form have not been filled out. Please revise your submission.");
  
  return r;
}