function checkForm(f) 
{
  // f is a reference to our form, so if we have a field called firstname
  // then we can get the value of that field by:f.firstname.value;
  
	
 //	Check that both team names and week number have been filled in
	if(f.hometeam.selectedIndex == 0)
	{
		alert("Please fill in the Home Team");
		f.hometeam.focus();
		return false;
	}

	if(f.awayteam.selectedIndex == 0)
	{
		alert("Please fill in the Away Team");
		f.awayteam.focus();
		return false;
	}

	
	if(f.weekNo.value == "")
	{
		alert("Please fill in the Week numer");
		f.weekNo.focus();
		return false;
	}
	

if(f.htScore.value =="" || f.htScore.value  ==" " )
{
alert("Please fill in the home team score");
f.htScore.focus();
return false;}

if(f.atScore.value  =="" || f.atScore.value  ==" " )
{
alert("Please fill in the away team score");
f.atScore.focus();
return false;}

if(f.password.value != "crawleypoolleague2009" || f.password.value =="" || f.password.value ==" " )
{
alert("Please fill in the password");
f.password.focus();
return false;}

return true;
}

