var validChar = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var validNum = "0123456789";

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);
  	}

// ***** zone ******
 if (f.zone.value == "" || isNaN(f.zone.value) || f.zone.value == 0){
	 alert("Please enter your NYSSMA zone.");
	 f.zone.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);
}


//**************************************
//*****  validation for Entries ********
//**************************************
function valf(f) {

var validChar = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
var validNum = "0123456789";

//****** location ********
    if (f.location.value == "" || f.location.value == 0){
  	alert("Please select a festival from the list.");
  	f.location.focus();
  	return false;
  }


 var checkOK = validNum  + "-()." + validChar;
   var checkStr = f.location.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 location field.");
     f.location.focus();
     return (false);
  }
// ***** building ******
if (f.building.value == ""){
	alert ("Please select a building.");
	f.building.focus();
	return false;
}

//alert(f.building.value);
//return false;


//****** event *******
if (f.event.value == 0){
		alert("Please select a NYSSMA event.");
		f.event.focus();
		return false;
}

// **** student first name ******
  if (f.stuf.value == "")
  {
    alert("Please enter your student's first name.");
    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);
  }





//***** composition ********
//if (f.title.value == "")
//  {
//    alert("Please enter the title of the composition.");
//    f.title.focus();
//    return (false);
//  }


var checkOK = validNum + validChar + ".'-#,";
  var checkStr = f.title.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 title field.");
    f.title.focus();
    return (false);
  }

//***** composer ********
//if (f.comp.value == "")
//  {
//    alert("Please enter the composer of the composition.");
//    f.title.focus();
//    return (false);
//  }

var checkOK = validNum + validChar + ".'-#,";
  var checkStr = f.comp.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 composer field.");
    f.comp.focus();
    return (false);
  }
//******** arranger ***********

var checkOK = validChar + validNum + ".',";
  var checkStr = f.arrang.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 arranger field.");
    f.arrang.focus();
    return (false);
  }

//******** accompanist ***********

var checkOK = validChar + ".'";
  var checkStr = f.accomp.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 accompanist field.");
    f.accomp.focus();
    return (false);
  }

//***** movements ********


var checkOK = validNum  + validChar + "-";
  var checkStr = f.mvmts.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 movements field.");
    f.mvmts.focus();
    return (false);
  }






//********** page number *********

//  if (f.pgnum.value)
//    {
//      alert("Please enter the page from the NYSSMA Manual for this composition.");
//      f.pgnum.focus();
//      return (false);
//    }




return(true);
}


function vallate(f){

//***** composition ********
//if (f.title.value == "")
//  {
//    alert("Please enter the title of the composition.");
//    f.title.focus();
//    return (false);
//  }


var checkOK = validNum + validChar + ".'-#,";
  var checkStr = f.title.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 title field.");
    f.title.focus();
    return (false);
  }

//***** composer ********
//if (f.comp.value == "")
//  {
//    alert("Please enter the composer of the composition.");
//    f.title.focus();
//    return (false);
//  }

var checkOK = validNum + validChar + ".'-#,";
  var checkStr = f.comp.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 composer field.");
    f.comp.focus();
    return (false);
  }
//******** arranger ***********

var checkOK = validChar + validNum + ".',";
  var checkStr = f.arrang.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 arranger field.");
    f.arrang.focus();
    return (false);
  }



//***** movements ********


var checkOK = validNum  + validChar + "-";
  var checkStr = f.mvmts.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 movements field.");
    f.mvmts.focus();
    return (false);
  }






//********** page number *********

//  if (f.pgnum.value)
//    {
//      alert("Please enter the page from the NYSSMA Manual for this composition.");
//      f.pgnum.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;

}

