function head(title){
	document.write('<link rel="Tilestyle" type="text/css" href="Tilestyle.css" />');
	document.write('<style>');
	document.write('@import "Tilestyle.css";');
	document.write('</style>');
	document.write('<title>'+title+'</title>');	
	document.write('<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />');	
	
	document.write('</head>');
	return;	
}

function navbuttons(){
	load="";
	if (location.href.indexOf("registration")>-1)
		load="onLoad=total();";
	document.write('<body id="pagestyle" '+load+'>');
	document.write('<table id="maintablestyle" cellspacing="0" align="center" width=93%>');
	document.write('<tr><td valign="top" cellpadding="5";>');
	document.write('<table class="navbar" cellspacing="1">');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.oregontile.net"><img border=0 src="images/tile 2009 mini.gif">');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="home.html">Home</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="tourney.html">Tournament Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="webreadyindex-M-ratings.html">Main Event Final Standings</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.cross-tables.com/entrants.php?u=367&flyer=http%3A%2F%2Fwww.oregontile.net%2F" target="_blank">Main Event Entrants</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="webreadyindex-E-ratings.html">Early Bird Final Standings</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.cross-tables.com/entrants.php?u=366&flyer=http%3A%2F%2Fwww.oregontile.net%2F" target="_blank">Early Bird Entrants</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="live.html">Live Games</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="hospitality.html">Hospitality</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="hotel.html">Hotel Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="area.html">Area Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="travel.html">Travel Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="cross-tables">');
	document.write('<a class="ct" href="http://www.cross-tables.com" target=blank>cross-tables.com</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www2.scrabble-assoc.com/" target=blank><img src="images/nsa_logo.jpg" border=0 align=middle>Nat\'l Scrabble® Assoc.</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="samtimer">');
	document.write('<a class="ct" href="http://www.samtimer.com" target=blank>SamTimer.com</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="/OT2007/index.html" target=blank>Oregon Tile 2007</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.aracnet.com/~dcw/oregontile.html" target=blank>Oregon Tile 2006</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="contact.html">Contact Us</a>');
	document.write('</td></tr>');
	document.write('</td></tr></table>');
	document.write('<td id="maincell">');
	document.write('<p align=center class=notice>Congratulations to Oregon TILE 2008 Champion, Joe Dackman!!</p>');
	return;
}

function uttons_datesensitive()
{
	// registration closed
	first_change=new Date(5,1,2008,0,1,0);
	// early bird commences
	second_change=new Date(5,2,2008,12,1,0);
	// early bird finished; main event commences
	third_change=new Date(5,2,2008,6,1,0);
	//main event goes into finals with live games
	fourth_change=new Date(5,4,2008,9,1,0);
	//final results known
	fifth_change=new Date(5,4,2008,2,1,0);
	load="";
	
	current_time=now.toString();
	if (current_time<first_change)
		open_reg_nav_buttons();
	if (first_change<current_time && current_time<second_change)
		reg_closed_nav_buttons();
	if (second_change<current_time && current_time<third_change)
		early_bird_starts_nav_buttons();
	if (third_change<current_time && current_time<fourth_change)
		main_event_starts_nav_buttons();
	if (fourth_change<current_time && current_time<fifth_change)
		live_games_start_nav_buttons();
	if (fifth_change<current_time)
		final_nav_buttons();
	return;

}

function open_reg_nav_buttons(){
	if (location.href.indexOf("registration")>-1)
		load="onLoad=total();";
	document.write('<body id="pagestyle" '+load+'>');
	document.write('<table id="maintablestyle" cellspacing="0" align="center" width=93%>');
	document.write('<tr><td valign="top" cellpadding="5";>');
	document.write('<table class="navbar" cellspacing="1">');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.oregontile.net"><img border=0 src="images/tile 2008 mini.gif">');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="index.html">Home</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="tourney.html">Tournament Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="registration_closed.html">Registration</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.cross-tables.com/entrants.php?u=366&flyer=http%3A%2F%2Fwww.oregontile.net%2F" target="_blank">Early Bird Entrants</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.cross-tables.com/entrants.php?u=367&flyer=http%3A%2F%2Fwww.oregontile.net%2F" target="_blank">Main Event Entrants</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="live.html">Live Games</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="hospitality.html">Hospitality</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="hotel.html">Hotel Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="area.html">Area Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="travel.html">Travel Information</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="cross-tables">');
	document.write('<a class="ct" href="http://www.cross-tables.com" target=blank>cross-tables.com</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www2.scrabble-assoc.com/" target=blank><img src="images/nsa_logo.jpg" border=0 align=middle>Nat\'l Scrabble® Assoc.</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="samtimer">');
	document.write('<a class="ct" href="http://www.samtimer.com" target=blank>SamTimer.com</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="/OT2007/index.html" target=blank>Oregon Tile 2007</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="http://www.aracnet.com/~dcw/oregontile.html" target=blank>Oregon Tile 2006</a>');
	document.write('</td></tr>');
	document.write('<tr><td class="navb">');
	document.write('<a class="nav" href="contact.html">Contact Us</a>');
	document.write('</td></tr>');
	document.write('</td></tr></table>');
	document.write('<td id="maincell">');
	return;
}
function navbuttons_050407(){
	document.write('<body id="pagestyle">');
	document.write('<table id="maintablestyle" cellspacing="0" align="center" width=93%>');
	document.write('<tr>');
	document.write('<td class="navbar">');
	document.write('<img src="images/new tile 2007 mini.bmp">');
	document.write('<a href="http://www.oregontilescrabble.com"><img src="images/home.gif" border="0"></a>');
	document.write('<a href="tourney.html"><img src="images/tourney.gif" border="0"></a>');
	document.write('<a href="registration_closed.html"><img src="images/registration.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/entrants.php?u=125" target="_blank"><img src="images/Entrant List EB.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/entrants.php?u=126" target="_blank"><img src="images/Entrant List ME.gif" border="0"></a>');
	document.write('<a href="live.html"><img src="images/live games.gif" border="0"></a>');
	document.write('<a href="hospitality.html"><img src="images/hospitality.gif" border="0"></a>');
	document.write('<a href="hotel.html"><img src="images/hotel.gif" border="0"></a>');
	document.write('<a href="area.html"><img src="images/area.gif" border="0"></a>');
	document.write('<a href="travel.html"><img src="images/travel.gif" border="0"></a>');
	document.write('<a href="http://www2.scrabble-assoc.com/" target="_blank"><img src="images/NSA.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/" target="_blank"><img src="images/cross tables.gif" border="0"></a>');
	document.write('<a href="http://www.aracnet.com/~dcw/oregontile.html" target="_blank"><img src="images/tile 2006.gif" border="0"></a>');
	document.write('<a href="contact.html"><img src="images/contact.gif" border="0"></a>');
	document.write('</td>');
	document.write('<td id="maincell">');
	return;
}

function navbuttons_050407(){
	document.write('<body id="pagestyle">');
	document.write('<table id="maintablestyle" cellspacing="0" align="center" width=93%>');
	document.write('<tr>');
	document.write('<td class="navbar">');
	document.write('<img src="images/new tile 2007 mini.bmp">');
	document.write('<a href="http://www.oregontilescrabble.com"><img src="images/home.gif" border="0"></a>');
	document.write('<a href="tourney.html"><img src="images/tourney.gif" border="0"></a>');
	document.write('<a href="webreadyindex-E-ratings.html"><img src="images/Early Bird ratings.gif" border="0"></a>');
	document.write('<a href="webreadyindex-E-pairings.html"><img src="images/Early Bird Results_Pairings.gif" border="0"></a>');
	document.write('<a href="commentary_index.html"><img src="images/commentary.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/entrants.php?u=125" target="_blank"><img src="images/Entrant List EB.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/entrants.php?u=126" target="_blank"><img src="images/Entrant List ME.gif" border="0"></a>');
	document.write('<a href="live.html"><img src="images/live games.gif" border="0"></a>');
	document.write('<a href="hospitality.html"><img src="images/hospitality.gif" border="0"></a>');
	document.write('<a href="hotel.html"><img src="images/hotel.gif" border="0"></a>');
	document.write('<a href="area.html"><img src="images/area.gif" border="0"></a>');
	document.write('<a href="travel.html"><img src="images/travel.gif" border="0"></a>');
	document.write('<a href="http://www2.scrabble-assoc.com/" target="_blank"><img src="images/NSA.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/" target="_blank"><img src="images/cross tables.gif" border="0"></a>');
	document.write('<a href="http://www.aracnet.com/~dcw/oregontile.html" target="_blank"><img src="images/tile 2006.gif" border="0"></a>');
	document.write('<a href="registration_closed.html"><img src="images/registration.gif" border="0"></a>');
	document.write('<a href="contact.html"><img src="images/contact.gif" border="0"></a>');
	document.write('</td>');
	document.write('<td id="maincell">');
	return;
}
function navbuttons_050407pm(){
	document.write('<body id="pagestyle">');
	document.write('<table id="maintablestyle" cellspacing="0" align="center" width=93%>');
	document.write('<tr>');
	document.write('<td class="navbar">');
	document.write('<img src="images/new tile 2007 mini.bmp">');
	document.write('<a href="http://www.oregontilescrabble.com"><img src="images/home.gif" border="0"></a>');
	document.write('<a href="tourney.html"><img src="images/tourney.gif" border="0"></a>');
	document.write('<a href="webreadyindex-M-ratings.html"><img src="images/ratings.gif" border="0"></a>');
//	document.write('<a href="commentary_index.html"><img src="images/commentary.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/entrants.php?u=126" target="_blank"><img src="images/Entrant List ME.gif" border="0"></a>');
	document.write('<a href="live.html"><img src="images/live games.gif" border="0"></a>');
	document.write('<a href="webreadyindex-E-ratings.html"><img src="images/Early Bird ratings.gif" border="0"></a>');
	document.write('<a href="hospitality.html"><img src="images/hospitality.gif" border="0"></a>');
	document.write('<a href="hotel.html"><img src="images/hotel.gif" border="0"></a>');
	document.write('<a href="area.html"><img src="images/area.gif" border="0"></a>');
	document.write('<a href="travel.html"><img src="images/travel.gif" border="0"></a>');
	document.write('<a href="http://www2.scrabble-assoc.com/" target="_blank"><img src="images/NSA.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/" target="_blank"><img src="images/cross tables.gif" border="0"></a>');
	document.write('<a href="http://www.aracnet.com/~dcw/oregontile.html" target="_blank"><img src="images/tile 2006.gif" border="0"></a>');
	document.write('<a href="registration_closed.html"><img src="images/registration.gif" border="0"></a>');
	document.write('<a href="contact.html"><img src="images/contact.gif" border="0"></a>');
	document.write('</td>');
	document.write('<td id="maincell">');
	return;
}
function navbuttons_050607am(){
	document.write('<body id="pagestyle">');
	document.write('<table id="maintablestyle" cellspacing="0" align="center" width=93%>');
	document.write('<tr>');
	document.write('<td class="navbar">');
	document.write('<img src="images/new tile 2007 mini.bmp">');
	document.write('<a href="http://www.oregontilescrabble.com"><img src="images/home.gif" border="0"></a>');
	document.write('<a href="tourney.html"><img src="images/tourney.gif" border="0"></a>');
	document.write('<a href="live.html"><img src="images/live games.gif" border="0"></a>');
	document.write('<a href="webreadyindex-M-ratings.html"><img src="images/ratings.gif" border="0"></a>');
	document.write('<a href="webreadyindex-M-pairings.html"><img src="images/Results_Pairings.gif" border="0"></a>');
	document.write('<a href="commentary_index.html"><img src="images/commentary.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/entrants.php?u=126" target="_blank"><img src="images/Entrant List ME.gif" border="0"></a>');
	document.write('<a href="webreadyindex-E-ratings.html"><img src="images/Early Bird ratings.gif" border="0"></a>');
	document.write('<a href="webreadyindex-E-pairings.html"><img src="images/Early Bird Results_Pairings.gif" border="0"></a>');
	document.write('<a href="hospitality.html"><img src="images/hospitality.gif" border="0"></a>');
	document.write('<a href="hotel.html"><img src="images/hotel.gif" border="0"></a>');
	document.write('<a href="area.html"><img src="images/area.gif" border="0"></a>');
	document.write('<a href="travel.html"><img src="images/travel.gif" border="0"></a>');
	document.write('<a href="http://www2.scrabble-assoc.com/" target="_blank"><img src="images/NSA.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/" target="_blank"><img src="images/cross tables.gif" border="0"></a>');
	document.write('<a href="http://www.aracnet.com/~dcw/oregontile.html" target="_blank"><img src="images/tile 2006.gif" border="0"></a>');
	document.write('<a href="registration_closed.html"><img src="images/registration.gif" border="0"></a>');
	document.write('<a href="contact.html"><img src="images/contact.gif" border="0"></a>');
	document.write('</td>');
	document.write('<td id="maincell">');
	return;
}
/*function navbuttons(){
	document.write('<body id="pagestyle">');
	document.write('<table id="maintablestyle" cellspacing="0" align="center" width=93%>');
	document.write('<tr>');
	document.write('<td class="navbar">');
	document.write('<a href="http://www.oregontilescrabble.com"><img src="images/new tile 2007 mini.bmp" border="0"></a>');
	document.write('<a href="http://www.oregontilescrabble.com"><img src="images/home.gif" border="0"></a>');
	document.write('<a href="tourney.html"><img src="images/tourney.gif" border="0"></a>');
	document.write('<a href="live.html"><img src="images/live games.gif" border="0"></a>');
	document.write('<a href="webreadyindex-M-ratings.html"><img src="images/ratings.gif" border="0"></a>');
//	document.write('<a href="commentary_index.html"><img src="images/commentary.gif" border="0"></a>');
	document.write('<a href="webreadyindex-E-ratings.html"><img src="images/Early Bird ratings.gif" border="0"></a>');
	document.write('<a href="photo_index.html"><img src="images/photos.gif" border="0"></a>');
	document.write('<a href="hospitality.html"><img src="images/hospitality.gif" border="0"></a>');
	document.write('<a href="hotel.html"><img src="images/hotel.gif" border="0"></a>');
	document.write('<a href="area.html"><img src="images/area.gif" border="0"></a>');
	document.write('<a href="travel.html"><img src="images/travel.gif" border="0"></a>');
	document.write('<a href="http://www2.scrabble-assoc.com/" target="_blank"><img src="images/NSA.gif" border="0"></a>');
	document.write('<a href="http://www.cross-tables.com/" target="_blank"><img src="images/cross tables.gif" border="0"></a>');
	document.write('<a href="http://www.aracnet.com/~dcw/oregontile.html" target="_blank"><img src="images/tile 2006.gif" border="0"></a>');
	document.write('<a href="registration_closed.html"><img src="images/registration.gif" border="0"></a>');
	document.write('<a href="contact.html"><img src="images/contact.gif" border="0"></a>');
	document.write('</td>');
	document.write('<td id="maincell">');
	document.write('<p align=center class=notice>Congratulations to Jerry Lerman, Oregon Tile 2007 Champion!!!</p>');
	return;
}
*/
function footer(){
	document.write('<p class="topref"><a class="topref" href="#top">Return to the Top</a></p>');
	document.write('</td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td  id="tileref" colspan="2">');
	document.write('<p>Oregon Tile 2008<br/>');
	document.write('<a href="http://www.oregontile.net">http://www.oregontile.net/</a></p>');
	document.write('</td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td colspan="2" bgcolor="white">');
	document.write('<br/>');
	document.write('</td>');
	document.write('</tr>');
	document.write('<tr>');
	document.write('<td colspan="2" bgcolor="blue">');
	document.write('<br/>');
	document.write('</td>');
	document.write('</tr>');
	document.write('</table>');
	document.write('</body>');
	document.write('</html>');
	return;
}
firsttime = true;
reset=false;
function total(){
	var total=195;
	if (document.form1.division.value == "Lite") {
		total=total-50;
	}
	if (document.form1.division.value == "None"){
		total=total-125;
	}
	if (document.form1.early_bird[1].checked == true){
		total=total-50;
	}
	if (document.form1.late_bird[1].checked == true){
		total=total-20;
	}
	if(document.form1.student[0].checked == true && document.form1.division.value == "Tile"){
		total=total-50;
	}
	if(document.form1.student[0].checked == true && document.form1.division.value == "Lite"){
		total=total-25;
	}
	if (firsttime == true){
		var newnode=document.createTextNode("$"+total+" USD");
		document.getElementById("totalid").appendChild(newnode);
		firsttime = false;
	}
	return total;
}

function ChangeTotal(){
	if (!document.getElementById) return;
	var newtotal=total();
	var newtotalid=document.getElementById("totalid");
	if (reset == true){
		newtotal=195;
		reset=false;
	}
	if (newtotalid.lastChild.nodeType == 3)	{
		newtotalid.lastChild.nodeValue="$"+newtotal+" USD";
	}
	else{
		/*var newnode=document.createTextNode(newtotal);
		newtotalid.appendChild(newnode);*/
		alert("error");
	}
}
function feetotal(tourneyfees){
	var total=tourneyfees;
	if(document.form1.payment[2].checked == true && document.form1.country.value == "usa"){
		total=Math.round((total+0.30)/(1-0.029)*100)/100;
	}
	if(document.form1.country.value != "usa"){
		if(document.form1.payment[2].checked == true)
			total=Math.round((total+0.30)/(1-0.039)*100)/100;
	}
	return total;
}

function ChangeFee(tourneyfees){
	if (!document.getElementById) return;
	var newtotal=feetotal(tourneyfees);
	newtotalid=document.getElementById("totalid");
	var add_calc="";
	/*if (reset == true){
		newtotal=195;
		reset=false;
	}*/
	if (newtotalid.lastChild.nodeType == 3)	{
		newtotalid.lastChild.nodeValue="$"+newtotal+" (US Dollars)";
	}
	document.form1.totalidhidden.value=newtotal;
	
}

function totalReset(){
	reset=true;
	ChangeTotal();
}

isAlpha="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
isNumber="0123456789";
isAlphaNumeric=isAlpha+isNumber;
function isBadString(str,goodstring){
	for(i=0;i<str.length;i++){
		if (goodstring.indexOf(str.charAt(i))<0)
			return true;		
	}
	return false;
}
function validateFirstName(){
	if (document.form1.first_name.value.length < 1 || document.form1.first_name.value.length>20 || isBadString(document.form1.first_name.value,isAlpha+" -'"))
	{
		fn=document.getElementById('first_name_label');
		fn.innerHTML='First Name\*';
		fn.style.color='red';
		document.form1.first_name.focus();
		error_array[num_errors]="first name";
		num_errors++;
		return false;
	}
	fn=document.getElementById('first_name_label');
	fn.innerHTML='First Name';
	fn.style.color='black';
	return true;
}
function validateLastName(){
	if (document.form1.last_name.value.length < 1 || document.form1.last_name.value.length>20 || isBadString(document.form1.last_name.value,isAlpha+" -'"))
	{
		ln=document.getElementById('last_name_label');
		ln.innerHTML='Last Name\*';
		ln.style.color='red';
		document.form1.last_name.focus();
		error_array[num_errors]="last name";
		num_errors++;
		return false;
	}
	fn=document.getElementById('last_name_label');
	fn.innerHTML='Last Name';
	fn.style.color='black';
	return true;
}
function isValidEmail(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}
		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		 if (str.indexOf(" ")!=-1){
		    return false
		 }
 		 return true					
}
function validateEmail(){
	if (document.form1.email.value.length < 1 || document.form1.email.value.length>75 || !isValidEmail(document.form1.email.value)){
		e=document.getElementById('email_label');
		e.innerHTML='Email Address\*';
		e.style.color='red';
		document.form1.email.focus();
		error_array[num_errors]=" a valid email address";
		num_errors++;
		return false;
	}
	fn=document.getElementById('email_label');
	fn.innerHTML='Email Address';
	fn.style.color='black';
	return true;
}
phonesyntax="() .-"+isNumber;
function validatePhone(){
	if (document.form1.phone.value.length <10 && document.form1.alt_phone.value.length <10)
	{
		ph=document.getElementById('phone_label');
		ph.innerHTML='Phone\*';
		ph.style.color='red';
		document.form1.phone.focus();
		error_array[num_errors]="a valid phone number";
		num_errors++;
		return false;
	}
	if(document.form1.phone.value.length <10 || isBadString(document.form1.phone.value,phonesyntax))
	{
		ph=document.getElementById('phone_label');
		ph.innerHTML='Home Phone\*';
		ph.style.color='red';
		document.form1.phone.focus();
		error_array[num_errors]="a valid phone number";
		num_errors++;
		return false;
	}
	if((document.form1.alt_phone.value.length >1 && document.form1.alt_phone.value.length <10) || isBadString(document.form1.alt_phone.value,phonesyntax))
	{
		ph=document.getElementById('alt_phone_label');
		ph.innerHTML='Alternate Phone\*';
		ph.style.color='red';
		document.form1.alt_phone.focus();
		error_array[num_errors]="a valid alternate phone number (or you may leave it blank)";
		num_errors++;
		return false;
	}
	fn=document.getElementById('phone_label');
	fn.innerHTML='Phone';
	fn.style.color='black';
	fn=document.getElementById('alt_phone_label');
	fn.innerHTML='Alternate Phone';
	fn.style.color='black';
	return true;
}
addresssyntax="&,\/ .-"+isAlphaNumeric;
function validateAddress(){
	if (document.form1.address1.value.length <1 && document.form1.address2.value.length <1)
	{
		add1=document.getElementById('add1_label');
		add1.innerHTML='Street Address\*';
		add1.style.color='red';
		document.form1.address1.focus();
		error_array[num_errors]="a valid address";
		num_errors++;
		return false;
	}
	if(isBadString(document.form1.address1.value,addresssyntax))
	{
		add1=document.getElementById('add1_label');
		add1.innerHTML='Street Address\*';
		add1.style.color='red';
		document.form1.address1.focus();
		error_array[num_errors]="a valid address";
		num_errors++;
		return false;
	}
	if(isBadString(document.form1.address2.value,addresssyntax))
	{
		add1=document.getElementById('add1_label');
		add1.innerHTML='Street Address\*';
		add1.style.color='red';
		document.form1.address2.focus();
		error_array[num_errors]="a valid second address line (or you may leave it blank)";
		num_errors++;
		return false;
	}
	fn=document.getElementById('add1_label');
	fn.innerHTML='Street Address';
	fn.style.color='black';
	return true;
}	
function validateCity(){
	if (document.form1.city.value.length < 1 || document.form1.city.value.length > 50 || isBadString(document.form1.city.value,isAlpha+" -\'"))
	{
		cy=document.getElementById('city_label');
		cy.innerHTML='City\*';
		cy.style.color='red';
		document.form1.city.focus();
		error_array[num_errors]="a valid city name";
		num_errors++;
		return false;
	}
	fn=document.getElementById('city_label');
	fn.innerHTML='City';
	fn.style.color='black';
	return true;
}	
function validateState(){
	if (document.form1.state.value.length < 1 || document.form1.state.value.length > 50 || isBadString(document.form1.state.value,isAlpha+" -\'"))
	{
		cy=document.getElementById('state_label');
		cy.innerHTML='State or Province\*';
		cy.style.color='red';
		document.form1.state.focus();
		error_array[num_errors]="a valid state/province name";
		num_errors++;
		return false;
	}
	fn=document.getElementById('state_label');
	fn.innerHTML='State or Province';
	fn.style.color='black';
	return true;
}	
function validateZip(){
	if (document.form1.zip.value.length < 1 || document.form1.zip.value.length > 10 || isBadString(document.form1.zip.value,isAlphaNumeric+" -"))
	{
		cy=document.getElementById('zip_label');
		cy.innerHTML='ZIP or Postal Code\*';
		cy.style.color='red';
		document.form1.zip.focus();
		error_array[num_errors]="a valid ZIP/postal code";
		num_errors++;
		return false;
	}
	fn=document.getElementById('zip_label');
	fn.innerHTML='ZIP or Postal Code';
	fn.style.color='black';
	return true;
}	
function validateRating(){
	if (document.form1.newbie.checked == true){
		fn=document.getElementById('rating_label');
		fn.innerHTML='Current NSA Rating';
		fn.style.color='black';
		return true;
	}
	if(document.form1.rating.value<1 || document.form1.rating.value>2500 || isBadString(document.form1.rating.value,isNumber)){
		cy=document.getElementById('rating_label');
		cy.innerHTML='Current NSA Rating\*';
		cy.style.color='red';
		document.form1.rating.focus();
		error_array[num_errors]="a valid rating";
		num_errors++;
		return false;
	}
	fn=document.getElementById('rating_label');
	fn.innerHTML='Current NSA Rating';
	fn.style.color='black';
	if(document.form1.rating.value>1299 && document.form1.division.value=="Lite"){
		extra_error="The LITE division is reserved for those players with a rating lower than 1300. Please alter the rating you entered or change your division. Thank you.";
		return false;
	}
	return true;		
}

function validate(){
	num_errors=1;
	error_array=new Array();
	d=document.getElementById('message2');
	d.style.display = 'none';
	extra_error=false;
	while (num_errors>0){
		num_errors=num_errors-1;
		validateRating();
		validateZip();
		validateState();
		validateCity();
		validateAddress();
		validatePhone();
		validateEmail();
		validateLastName();
		validateFirstName();
		if (num_errors>0){
			string="Please enter ";
			if (num_errors == 1)
				string=string+error_array[0];
			if (num_errors == 2)
				string=string+error_array[1]+" and "+error_array[0];
			if (num_errors >2)
			{
				for (i=num_errors-1;i>0;i--){
					string=string+error_array[i]+", ";
				}
				string=string+"and "+error_array[i];
			}	
			string=string+".";
			d=document.getElementById('message');
			d.innerHTML=string;
			d.style.display = 'block';
			return false;
		}
		if (extra_error){
			d=document.getElementById('message2');
			d.innerHTML=extra_error;
			d.style.display = 'block';
			return false;
		}		
	}
	while (!validateFirstName() || !validateLastName() || 
		!validateEmail() || !validatePhone() || 
		!validateUserName() || !validatePassword() ||
		!validateAddress() || !validateCity() ||
		!validateState() || !validateZip() || !validateRating()){	
		return false;
	}
	return true;
}
function SetPerson(row_num){
	this_person=eval("document.form3.arr"+row_num).value;
	this_person_arr=this_person.split(",");
	document.form1.first_name.value=this_person_arr[0];
	document.form1.last_name.value=this_person_arr[1];
	document.form1.email.value=this_person_arr[2];
	document.form1.phone.value=this_person_arr[3];
	document.form1.alt_phone.value=this_person_arr[4];
	document.form1.address1.value=this_person_arr[5];
	document.form1.address2.value=this_person_arr[6];
	document.form1.city.value=this_person_arr[7];
	document.form1.state.value=this_person_arr[8];
	document.form1.zip.value=this_person_arr[9];
	document.form1.country.value=this_person_arr[10];
	if (document.getElementById("registrants"))
		document.getElementById("registrants").style.display='none';
}
function CheckPayment(){
	i=0;
	while(document.form1.payment[i]){
		if (document.form1.payment[i].checked)
			return true;
		i++;
	}
	return false;

}
function getDiv(){
	var browser = navigator.appName;
	div=document.getElementById("scrolling_div");
	if(browser == "Netscape")
		div.className="overflowfixed";
	else{
		if(browser == "Microsoft Internet Explorer")
			div.className="overflow";

	}
	return;
}
