function changeColors1(el,color1) {

el.style.backgroundColor= color1;      
}

function changeColors2(el,color2) {

el.style.backgroundColor= color2;      
}

function check_add_result_fields()

{
  
 var type1 = document.addResults.type.options.selectedIndex;
 var type2 = document.addResults.type.options[type1].value; 
 
 //alert(type2);
 
 var year1 = document.addResults.year.options.selectedIndex;
 var year2 = document.addResults.year.options[year1].value;
    
 if (type2 == "")
  
  {
  
  alert("Please enter a competition type.");
  return false;
  }
  
  if (year2 == "")
  
  {
  
  alert("Please enter a competition year.");
  return false;
  }
  
  var competition1 = document.addResults.competitionID.options.selectedIndex;
  var competition2 = document.addResults.competitionID.options[competition1].value;
  
  if (competition2 == "")
  
  {
  
  alert("Please enter a competition name.");
  
  return false;
  
  }
}

function check_camp_form_fields()

  {
  
  var camp_name = document.camps.name.value;
  var camp_type0 = document.camps.type[0].checked;
  var camp_type1 = document.camps.type[1].checked;
  var camp_type2 = document.camps.type[2].checked;
  var camp_city = document.camps.city.value;
  var camp_address = document.camps.address.value;
  var camp_zipcode = document.camps.zipcode.value;
  var camp_phone = document.camps.phone.value;  
  
  var state1 = document.camps.state.options.selectedIndex;
  var state2 = document.camps.state.options[state1].value;
  
  var age1 = document.camps.start_age.options.selectedIndex;
  var age2 = document.camps.start_age.options[age1].value;
  
  var age3 = document.camps.end_age.options.selectedIndex;
  var age4 = document.camps.end_age.options[age3].value;
  
   if(camp_type0 == false && camp_type1 == false && camp_type2 == false)
   
    {
    
    alert("Please enter the type of camp.")
    
    return false;
    
    }
   
   if (age2 == "")
  
    {
    
    alert("Please enter the start age range.")
    
    return false;
    
    }
    
    if (age4 == "")
  
    {
    
    alert("Please enter the end age range.")
    
    return false;
    
    }  
       
  if (camp_name == "")
  
    {
    
    alert("Please enter the name of the camp.")
    
    return false;
    
    }
   
       
    if (camp_address == "")
  
    {
    
    alert("Please enter the (location) address.")
    
    return false;
    
    }
    
    if (camp_city == "")
  
    {
    
    alert("Please enter the (location) city.")
    
    return false;
    
    }
           
    if (state2 == "")
  
    {
    
    alert("Please enter the (location) state.")
    
    return false;
    
    }
    
    if (camp_zipcode == "")
  
    {
    
    alert("Please enter the (location) zipcode.")
    
    return false;
    
    }
        
        
  }

function testLink()

  {
  
  var weblink = document.camps.website.value;
  
  if(weblink != "http://")
  
  {
  window.open(weblink);
  }
  
  }

function chkNumeric(objName,comma,period,hyphen)
{
// only allow 0-9 be entered, plus any values passed
// (can be in any order, and don't have to be comma, period, or hyphen)
// if all numbers allow commas, periods, hyphens or whatever,
// just hard code it here and take out the passed parameters
var checkOK = "0123456789" + comma + period + hyphen;
var checkStr = objName;
var allValid = true;
var decPoints = 0;
var allNum = "";

for (i = 0;  i < checkStr.value.length;  i++)
{
ch = checkStr.value.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch != ",")
allNum += ch;
}
if (!allValid)
{	
alertsay = "Please enter only these values \""
alertsay = alertsay + checkOK + "\" in this field."
alert(alertsay);
checkStr.value="";
return (false);
}
}

function check_add_athlete_form_fields()

  {
  
  var firstName = document.add_athlete.firstName.value;
  var lastName = document.add_athlete.lastName.value;
  var usagN = document.add_athlete.usag.value.length;
    
  
  var level1 = document.add_athlete.level.options.selectedIndex;
  var level2 = document.add_athlete.level.options[level1].value;
  
  var clubName1 = document.add_athlete.clubNumber.options.selectedIndex;
  var clubName2 = document.add_athlete.clubNumber.options[clubName1].value;
     
      
   if (firstName == "" || lastName == "")
  
    {
    
    alert("Please enter the athlete first and last name.")
    
    return false;
    
    }
    
    if (usagN < 6)
  
    {
    
    alert("Please enter a six digit USAG number.")
    
    return false;
    
    }  
       
  if (level2 == "")
  
    {
    
    alert("Please select a level.")
    
    return false;
    
    }
   
       
    if (clubName2 == "")
  
    {
    
    alert("Please select a club.")
    
    return false;
    
    }
        
  }
  
  
  function check_add_event_athlete_form_fields()

  {
  
  var firstName = document.add_event_athlete.firstName.value;
  var lastName = document.add_event_athlete.lastName.value;
  var usagN = document.add_event_athlete.usag.value.length;
  
  var bm1 = document.add_event_athlete.birthMonth.options.selectedIndex;
  var bm2 = document.add_event_athlete.birthMonth.options[bm1].value;
  
  var bd1 = document.add_event_athlete.birthDay.options.selectedIndex;
  var bd2 = document.add_event_athlete.birthDay.options[bd1].value;
  
  var by1 = document.add_event_athlete.birthYear.options.selectedIndex;
  var by2 = document.add_event_athlete.birthYear.options[by1].value;
  
  var program = document.add_event_athlete.program.options.selectedIndex;
  var program2 = document.add_event_athlete.program.options[program].value;        
      
   if (firstName == "" || lastName == "")
  
    {
    
    alert("Please enter the athlete first and last name.")
    
    return false;
    
    }
    
    if (usagN < 6)
  
    {
    
    alert("Please enter a six digit USAG number.")
    
    return false;
    
    }
    
    if (program2 == "")
  
    {
    
    alert("Please select a program.")
    
    return false;
    
    }
    
    if (bm2 == "" || bd2 == "" || by2 == "")
  
    {
    
    alert("Please enter the full birth date.")
    
    return false;
    
    }   
      
          
  }
  
  function check_add_event_coach_form_fields()

  {
  
  var firstName = document.add_event_coach.firstName.value;
  var lastName = document.add_event_coach.lastName.value;
  var usagN = document.add_event_coach.usag.value.length;
  var phone = document.add_event_coach.phone.value.length;
  var email = document.add_event_coach.email.value;
  
  var bm1 = document.add_event_coach.birthMonth.options.selectedIndex;
  var bm2 = document.add_event_coach.birthMonth.options[bm1].value;
  
  var bd1 = document.add_event_coach.birthDay.options.selectedIndex;
  var bd2 = document.add_event_coach.birthDay.options[bd1].value;
  
  var by1 = document.add_event_coach.birthYear.options.selectedIndex;
  var by2 = document.add_event_coach.birthYear.options[by1].value;
          
      
   if (firstName == "" || lastName == "")
  
    {
    
    alert("Please enter the athlete first and last name.")
    
    return false;
    
    }
    
    if (usagN < 6)
  
    {
    
    alert("Please enter a six digit USAG number.")
    
    return false;
    
    }
    
    if (bm2 == "" || bd2 == "" || by2 == "")
  
    {
    
    alert("Please enter the full birth date.")
    
    return false;
    
    } 
    
    if (phone < 10)
  
    {
    
    alert("Please enter the full phone number. Only use numbers.")
    
    return false;
    
    } 
    
    if (email == "")
  
    {
    
    alert("Please enter an e-mail address.")
    
    return false;
    
    }
    
         
          
  }
  
  function check_add_club_form_fields()

  {
  
  var name = document.add_club.name.value;
  var usagN = document.add_club.usag.value.length;
  var address = document.add_club.address.value;
  var city = document.add_club.city.value;
    
  var state1 = document.add_club.state.options.selectedIndex;
  var state2 = document.add_club.state.options[state1].value;
  
  var zipcode = document.add_club.zipcode.value;
           
      
   if (name == "" || usagN == "" || address == "" || city == "" || state2 == "" || zipcode == "")
  
    {
    
    alert("Please complete all required fields.")
    
    return false;
    
    }
    
    if (usagN < 6)
  
    {
    
    alert("Please enter a six digit USAG number.")
    
    return false;
    
    }
    
  }
  
  
  function check_ca_cc()

  {
  
  var athlete = document.step1.ca.value;
  
  var coach = document.step1.cc.value;           
  
  alert(athlete);
      
  if (athlete == 0)
  
    {
    
    alert("Go to Add Athlete, to add a new athlete before you proceed.")
    
    return false;
    
    }
    
    if (coach == 0)
  
    {
    
    alert("Go to Add Coach, to add a new coach before you proceed.")
    
    return false;
    
    }
    
  }
  
  
function check_tfc_form(action)

  {
  
  var name = document.tfc.clubName.value;     
  var address = document.tfc.address.value;
  var city = document.tfc.city.value;
  var state1 = document.tfc.state.options.selectedIndex;
  var state2 = document.tfc.state.options[state1].value;
  var zipcode = document.tfc.zipcode.value.length;
  var zipcode2 = document.tfc.zipcode.value;
  var contact = document.tfc.contact.value;
  var email = document.tfc.email.value;
  var phone = document.tfc.phone.value.length;
  var phone2 = document.tfc.phone.value;
  var fax = document.tfc.fax.value;
  var website = document.tfc.website.value;
       
  if (name == "" || address == "" || city == "" || state2 == "" || zipcode < 5 || phone < 10 || email == "")
  
    {
    
    alert("Please complete all required fields.")
    
    return false;
    
    }
        
       
  }
  
  function placelink2(){
	   
	 	  
	if(http.readyState == 4){
		var response = http.responseText;
		//alert(field_id);     	
		document.getElementById("placelink2").innerHTML = response;
	}
}

function testLink2()

  {
  
  var weblink = document.tfc.website.value;
  
  if(weblink != "http://")
  
  {
  window.open(weblink);
  }
  
  }


function check_industry_form()

  {
  
  var name = document.industry.name.value;     
  
  var address = document.industry.address.value;
  var city = document.industry.city.value;
  var state = document.industry.state.value;  
  var country1 = document.industry.country.options.selectedIndex;
  var country2 = document.industry.country.options[country1].value;
  var zipcode = document.industry.zipcode.value.length;
  var zipcode2 = document.industry.zipcode.value;
  var contact = document.industry.contact.value;
  var email = document.industry.email.value;
  var phone = document.industry.phone.value.length;
  var description = document.industry.description.value;
    
  
       
  if (name == "" || address == "" || city == "" || state == "" || zipcode < 5 || phone < 10 || email == "" || contact == "" || description == "")
  
    {
    
    alert("Please complete all required fields.")
    
    return false;
    
    }
    
           
  }
  
  
function check_industry_form2()

  {
  
  var address = document.industry.address.value;
  var city = document.industry.city.value;
  var state = document.industry.state.value;
  var country = document.industry.country.value;
  var zipcode = document.industry.zipcode.value.length;
  var contact = document.industry.contact.value;
  var email = document.industry.email.value;
  var phone = document.industry.phone.value.length;
  var description = document.industry.description.value;
    
       
  if (address == "" || city == "" || state == "" || zipcode < 5 || phone < 10 || email == "" || contact == "" || description == "" || country  == "")
  
    {
    
    alert("Please complete all required fields.")
    
    return false;
    
    }
    
           
  }
 
function check_tg()

  {
  var firstName = document.finish.firstName;
  var lastName = document.finish.lastName;
  var address = document.finish.address.value;
  var city = document.finish.city.value;
  var state = document.finish.state.value;
  var zipcode = document.finish.zipcode.value.length;
  var email = document.finish.email.value;
  var phone = document.finish.dayPhone.value.length;
  var usag = document.finish.usag.value.length;
    
       
  if (firstName == "" || lastName == "" || address == "" || city == "" || state == "" || zipcode < 5 || phone < 10 || email == "" || usag < 6)
  
    {
    
    alert("Please complete all required fields.")
    
    return false;
    
    }
    
           
  }


function check_tfc_form2(action)

  {
  
  var name = document.tfc.clubName.value;     
  var address = document.tfc.address.value;
  var city = document.tfc.city.value;
  var state1 = document.tfc.state.options.selectedIndex;
  var state2 = document.tfc.state.options[state1].value;
  var zipcode = document.tfc.zipcode.value.length;
  var zipcode2 = document.tfc.zipcode.value;
  var contact = document.tfc.contact.value;
  var email = document.tfc.email.value;
  var phone = document.tfc.phone.value.length;
  var phone2 = document.tfc.phone.value;
  var fax = document.tfc.fax.value;
  var website = document.tfc.website.value;
  var plans = document.tfc.plans.value;
  var cmn = document.tfc.cmn.value;
       
  if (plans == "" || name == "" || address == "" || city == "" || state == "" || zipcode < 5 || phone < 10 || email == "")
  
    {
    
    alert("Please complete all required fields.")
    
    return false;
    
    }
           
  }
