/********************************************************************************
 * Name:        validation.js 
 * Description: Javascript functions for email validation. 
 *
 * Created:     May 25, 2007
 * Developer:   Steve Hadfield, Firestorm Technologies, LLC - 
 *                  http://www.firestorm-technologies.com/
 *              for Blue's Arthouse, http://www.bluesarthouse.com/
 ********************************************************************************
 */

/***********************************************
* Email Validation script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(f){
   //alert ("Into checkmail: email=" + f.myemail.value);
   var returnval=emailfilter.test(f.myemail.value)
   if (returnval==false){
      alert("Please enter a valid email address.")
      f.myemail.select()
   }
   return returnval;
}

/*------------------------------------------------------------
 * function fldTest() - verifies that the field has an entry.
 * If not, set the user's focus to the field.
 *------------------------------------------------------------
 */
function fldTest (f,name)
{
   //alert ("Into fldTest: field=" + f.value);
   if (f.value == "") {
      alert("The '" + name + "' must be entered.");
      f.focus();
      f.select();
      return (false);
   }
   return (true);
}


