var validChar = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var validNum = "0123456789";

function valch(f) {

//dir-vp-tea

if (!f.dir.checked && !f.vp.checked && !f.tea.checked) {
		alert("Please select a chair type for this person.");
		return false;
}

// **** director first name ******
  if (f.fname.value == "")
  {
    alert("Please enter a first name.");
    f.fname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.fname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for a first name.");
    f.fname.focus();
    return (false);
  }

// **** director last name ******
  if (f.lname.value == "")
  {
    alert("Please enter a last name.");
    f.lname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.lname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for the last name.");
    f.lname.focus();
    return (false);
  }
//***** street1 ********
if (f.street1.value == "")
  {
    alert("Please enter an address.");
    f.street1.focus();
    return (false);
  }


var checkOK = validNum + validChar + ".'-#";
  var checkStr = f.street1.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the address field.");
    f.street1.focus();
    return (false);
  }


//******** city ***********
if (f.city.value == "")
  {
    alert("Please enter a city.");
    f.city.focus();
    return (false);
  }


var checkOK = validChar + ".'";
  var checkStr = f.city.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the city field.");
    f.city.focus();
    return (false);
  }

//***** zip ********
if (f.zip.value == "")
  {
    alert("Please enter a zip code.");
    f.zip.focus();
    return (false);
  }


var checkOK = validNum  + "-";
  var checkStr = f.zip.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the zip code field.");
    f.zip.focus();
    return (false);
  }



//****** phone ********
    if (f.phone1.value == ""){
  	alert("Please enter a phone number.");
  	f.phone1.focus();
  	return false;
  }


 var checkOK = validNum  + "-(). ";
   var checkStr = f.phone1.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone1.focus();
     return (false);
  }

   var checkStr = f.phone2.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone2.focus();
     return (false);
  }


//********** password *********

  if (f.pwd.value == "")
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }

    if (f.pwd.value.length < 6)
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }
var checkOK = validNum + validChar;
  var checkStr = f.pwd.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the Password field.");
    f.pwd.focus();
    return (false);
  }


//********** user name *********

  if (f.user.value == "")
    {
      alert("Please enter a value for the Username field.");
      f.user.focus();
      return (false);
    }

    if (f.user.value.length < 6)
    {
      alert("Please enter at least 6 characters in the Username field.");
      f.user.focus();
      return (false);
    }
var checkOK = validNum + validChar;
  var checkStr = f.user.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the Username field.");
    f.user.focus();
    return (false);
  }

//***** email ******


  if (f.email.value == "" ) {
  	alert("Please enter a valid e-mail address");
  		f.email.focus();
  		return(false);
  	}



return(true);
}


function val(f) {


// **** county *******
  if (f.county.value == 0){
	  	alert("Please choose your county");
	  	return false;
  }
// **** district *******
  if (f.dist.value == 0){
	  	alert("Please choose your district");
	  	return false;
  }
// **** director first name ******
  if (f.fname.value == "")
  {
    alert("Please enter your first name.");
    f.fname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.fname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your first name.");
    f.fname.focus();
    return (false);
  }

// **** director last name ******
  if (f.lname.value == "")
  {
    alert("Please enter your last name.");
    f.lname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.lname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your last name.");
    f.lname.focus();
    return (false);
  }
//***** street1 ********
if (f.street1.value == "")
  {
    alert("Please enter your address.");
    f.street1.focus();
    return (false);
  }


var checkOK = validNum + validChar + ".'-#";
  var checkStr = f.street1.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the address field.");
    f.street1.focus();
    return (false);
  }

//***** street2 ********

var checkOK = validNum + validChar + ".'-#";
  var checkStr = f.street2.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the second address field.");
    f.street2.focus();
    return (false);
  }
//******** city ***********
if (f.city.value == "")
  {
    alert("Please enter your city.");
    f.city.focus();
    return (false);
  }


var checkOK = validChar + ".'";
  var checkStr = f.city.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the city field.");
    f.city.focus();
    return (false);
  }

//***** zip ********
if (f.zip.value == "")
  {
    alert("Please enter your zip code.");
    f.zip.focus();
    return (false);
  }


var checkOK = validNum  + "-";
  var checkStr = f.zip.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the zip code field.");
    f.zip.focus();
    return (false);
  }



//****** phone ********
    if (f.phone1.value == ""){
  	alert("Please enter a phone number.");
  	f.phone1.focus();
  	return false;
  }


 var checkOK = validNum  + "-(). ";
   var checkStr = f.phone1.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone1.focus();
     return (false);
  }

   var checkStr = f.phone2.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone2.focus();
     return (false);
  }


//********** password *********

  if (f.pwd.value == "")
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }

    if (f.pwd.value.length < 6)
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }
var checkOK = validNum + validChar;
  var checkStr = f.pwd.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the Password field.");
    f.pwd.focus();
    return (false);
  }


//********** user name *********

  if (f.user.value == "")
    {
      alert("Please enter a value for the Username field.");
      f.user.focus();
      return (false);
    }

    if (f.user.value.length < 6)
    {
      alert("Please enter at least 6 characters in the Username field.");
      f.user.focus();
      return (false);
    }
var checkOK = validNum + validChar;
  var checkStr = f.user.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the Username field.");
    f.user.focus();
    return (false);
  }

//***** email ******


  if (f.email.value == "" ) {
  	alert("Please enter a valid e-mail address");
  		f.email.focus();
  		return(false);
  	}



return(true);
}


//*********************************************
//*****  validation for Update Profile ********
//*********************************************

function valp(f) {

var validChar = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var validNum = "0123456789";


// **** director first name ******
  if (f.fname.value == "")
  {
    alert("Please enter your first name.");
    f.fname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.fname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your first name.");
    f.fname.focus();
    return (false);
  }

// **** director last name ******
  if (f.lname.value == "")
  {
    alert("Please enter your last name.");
    f.lname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.lname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your last name.");
    f.lname.focus();
    return (false);
  }
//***** street1 ********
if (f.street1.value == "")
  {
    alert("Please enter your address.");
    f.street1.focus();
    return (false);
  }


var checkOK = validNum + validChar + ".'-#";
  var checkStr = f.street1.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the address field.");
    f.street1.focus();
    return (false);
  }

//***** street2 ********

var checkOK = validNum + validChar + ".'-#";
  var checkStr = f.street2.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the second address field.");
    f.street2.focus();
    return (false);
  }
//******** city ***********
if (f.city.value == "")
  {
    alert("Please enter your city.");
    f.city.focus();
    return (false);
  }


var checkOK = validChar + ".'";
  var checkStr = f.city.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the city field.");
    f.city.focus();
    return (false);
  }

//***** zip ********
if (f.zip.value == "")
  {
    alert("Please enter your zip code.");
    f.zip.focus();
    return (false);
  }


var checkOK = validNum  + "-";
  var checkStr = f.zip.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the zip code field.");
    f.zip.focus();
    return (false);
  }



//****** phone ********
    if (f.phone1.value == ""){
  	alert("Please enter a phone number.");
  	f.phone1.focus();
  	return false;
  }


 var checkOK = validNum  + "-().";
   var checkStr = f.phone1.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone1.focus();
     return (false);
  }

   var checkStr = f.phone2.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone2.focus();
     return (false);
  }


//********** password *********

  if (f.pwd.value == "")
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }

    if (f.pwd.value.length < 6)
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }
var checkOK = validNum + validChar;
  var checkStr = f.pwd.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the Password field.");
    f.pwd.focus();
    return (false);
  }



//***** email ******


  if (f.email.value == "" ) {
  	alert("Please enter a valid e-mail address");
  		f.email.focus();
  		return(false);
  	}

return(true);
}
function cap() {
with (document.pform) {
	var fc = String(stuf.value).charAt(0).toUpperCase();
	var rest = String(stuf.value).substr(1,30).toLowerCase();
	stuf.value = fc + rest;

	fc = String(stul.value).charAt(0).toUpperCase();
	rest = String(stul.value).substr(1,30).toLowerCase();
	stul.value = fc + rest;
}}

//*********************************************
//*****  validation for Update Admin Profile ********
//*********************************************

function valap(f) {

var validChar = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var validNum = "0123456789";


// **** director first name ******
  if (f.fname.value == "")
  {
    alert("Please enter your first name.");
    f.fname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.fname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your first name.");
    f.fname.focus();
    return (false);
  }

// **** director last name ******
  if (f.lname.value == "")
  {
    alert("Please enter your last name.");
    f.lname.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.lname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your last name.");
    f.lname.focus();
    return (false);
  }
//***** street1 ********
if (f.street1.value == "")
  {
    alert("Please enter your address.");
    f.street1.focus();
    return (false);
  }


var checkOK = validNum + validChar + ".'-#";
  var checkStr = f.street1.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the address field.");
    f.street1.focus();
    return (false);
  }


//******** city ***********
if (f.city.value == "")
  {
    alert("Please enter your city.");
    f.city.focus();
    return (false);
  }


var checkOK = validChar + ".'";
  var checkStr = f.city.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the city field.");
    f.city.focus();
    return (false);
  }

//***** zip ********
if (f.zip.value == "")
  {
    alert("Please enter your zip code.");
    f.zip.focus();
    return (false);
  }


var checkOK = validNum  + "-";
  var checkStr = f.zip.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the zip code field.");
    f.zip.focus();
    return (false);
  }



//****** phone ********
    if (f.phone1.value == ""){
  	alert("Please enter a phone number.");
  	f.phone1.focus();
  	return false;
  }


 var checkOK = validNum  + "-().";
   var checkStr = f.phone1.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone1.focus();
     return (false);
  }

   var checkStr = f.phone2.value;
   var allValid = true;
   for (i = 0;  i < checkStr.length;  i++)
   {
     ch = checkStr.charAt(i);
     for (j = 0;  j < checkOK.length;  j++)
       if (ch == checkOK.charAt(j))
         break;
     if (j == checkOK.length)
     {
       allValid = false;
       break;
     }
   }
   if (!allValid)
   {
     alert("Please enter only numbers in the phone fields.");
     f.phone2.focus();
     return (false);
  }


//********** password *********

  if (f.pwd.value == "")
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }

    if (f.pwd.value.length < 6)
    {
      alert("Please enter at least 6 characters in the Password field.");
      f.pwd.focus();
      return (false);
    }
var checkOK = validNum + validChar;
  var checkStr = f.pwd.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the Password field.");
    f.pwd.focus();
    return (false);
  }



//***** email ******


  if (f.email.value == "" ) {
  	alert("Please enter a valid e-mail address");
  		f.email.focus();
  		return(false);
  	}

return(true);
}

//**************************************
//*****  validation for Entries ********
//**************************************
function valf(f) {


//alert("hi there");
var validChar = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var validNum = "0123456789";

//****** location ********
    if (f.festival.value == "" || f.festival.value == 0){
  	alert("Please choose a festival from the list.");
  	f.festival.focus();
  	return false;
  }



// ***** building ******
if (f.building.value == ""){
	alert ("Please select a building.");
	f.building.focus();
	return false;
}


//****** grade ********
    if (f.gr.value == "" || f.gr.value == 0){
  	alert("Please select the grade for this student.");
  	f.gr.focus();
  	return false;
  }



// **** student first name ******
  if (f.stuf.value == "")
  {
    alert("Please enter your student's first name here in this box.");
    f.stuf.focus();
    return (false);
  }


var checkOK = validChar + ". -'";
  var checkStr = f.stuf.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your student's first name.");
    f.stuf.focus();
    return (false);
  }

// **** student last name ******
  if (f.stul.value == "")
  {
    alert("Please enter your student's last name.");
    f.stul.focus();
    return (false);
  }


var checkOK = validChar + ". -',";
  var checkStr = f.stul.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for your student's last name.");
    f.stul.focus();
    return (false);
  }

  if (f.comments.value == ""){
	  alert("Please enter comments about this student.");
	  f.comments.focus();
	  return false;
 }


return true;
}



//*********************************
//******* festival setup **********
//*********************************
function vfest(f) {

var validChar = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var validNum = "0123456789";


// **** festival name ******
  if (f.festival.value == "")
  {
    alert("Please enter a name for this festival.");
    f.festival.focus();
    return (false);
  }


var checkOK = validChar + validNum + ". -'";
  var checkStr = f.festival.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for the festival name.");
    f.festival.focus();
    return (false);
  }

// **** location name ******
  if (f.locname.value == "")
  {
    alert("Please enter the name of the location.");
    f.locname.focus();
    return (false);
  }


var checkOK = validChar + validNum + ". -'";
  var checkStr = f.locname.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers for the location name.");
    f.locname.focus();
    return (false);
  }
//***** location address ********
if (f.locadd.value == "")
  {
    alert("Please enter the location address.");
    f.locadd.focus();
    return (false);
  }


var checkOK = validNum + validChar + ".'-#";
  var checkStr = f.locadd.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters and numbers in the address field.");
    f.locadd.focus();
    return (false);
  }


//******** city ***********
if (f.loccity.value == "")
  {
    alert("Please enter the city of the location.");
    f.loccity.focus();
    return (false);
  }


var checkOK = validChar + ".'";
  var checkStr = f.loccity.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letters in the city field.");
    f.loccity.focus();
    return (false);
  }

//***** zip ********
if (f.loczip.value == "")
  {
    alert("Please enter the zip code of the location.");
    f.loczip.focus();
    return (false);
  }


var checkOK = validNum  + "-";
  var checkStr = f.loczip.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the zip code field.");
    f.loczip.focus();
    return (false);
  }

//***** festival chair *******
	if (f.fchair.value == ""){
		alert("Please select a chairperson for this festival");
		return false;
	}

//****** festival date ******
	if (f.fdate.value == "") {
		alert("Please enter the date of the festival");
		return false;
}
//****** deadline date ******
	if (f.ddate.value == "") {
		alert("Please enter the deadline date of the festival");
		return false;
}

return true;

}

