function head(title){
	document.write('<link rel="tsh" type="text/css" href="tsh.css" />');
	document.write('<style>');
	document.write('@import "tsh.css";');
	document.write('</style>');
	document.write('<title>'+title+'</title>');	
	document.write('</head>');
	return;	
}

function navbuttons_050307am(){
	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="http://www.aracnet.com/~dcw/ot2007/registration.html" target="_blank"><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_050307pm(){
	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/Standings.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 Standings.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 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 2007<br/>');
	document.write('<a href="http://www.oregontilescrabble.com">http://www.oregontilescrabble.com/</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="green">');
	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=155;
	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-30;
	}
	if(document.form1.student[0].checked == true && document.form1.division.value != "none"){
		total=total-25;
	}
	if(document.form1.t_shirt.value == "plus"){
		total=total+2;
	}
	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=155;
		reset=false;
	}
	if (newtotalid.lastChild.nodeType == 3)	{
		newtotalid.lastChild.nodeValue="$"+newtotal+" USD";
	}
	else{
		/*var newnode=document.createTextNode(newtotal);
		newtotalid.appendChild(newnode);*/
		alert("error");
	}
}	
function totalReset(){
	reset=true;
	ChangeTotal();
}

function validateFirstName(){
	if (document.form1.first_name.value.length < 1){
		alert("Please enter your first name.");
		return false;
	}
	return true;
}	
function validateLastName(){
	if (document.form1.last_name.value.length < 1){
		alert("Please enter your last name.");
		return false;
	}
	return true;
}	
function validateEmail(){
	if (document.form1.email.value.length < 1){
		alert("Please enter your email address.");
		return false;
	}
	return true;
}
function validatePhone(){
	if (document.form1.home_phone1.value.length <1 && 
document.form1.home_phone2.value.length <1 && 
document.form1.home_phone3.value.length <1 &&
document.form1.cell_phone1.value.length <1 &&
document.form1.cell_phone2.value.length <1 &&
document.form1.cell_phone3.value.length <1){
		alert("Please enter a valid phone number.");
		return false;
	}
	return true;
}
function validateAddress(){
	if (document.form1.address1.value.length <1 && 
document.form1.address2.value.length <1){
		alert("Please enter your street address.");
		return false;
	}
	return true;
}	
function validateCity(){
	if (document.form1.city.value.length < 1){
		alert("Please enter your city.");
		return false;
	}
	return true;
}	
function validateState(){
	if (document.form1.state.value.length < 1){
		alert("Please enter your state or province.");
		return false;
	}
	return true;
}	
function validateZip(){
	if (document.form1.zip.value.length < 1){
		alert("Please enter your ZIP or postal code.");
		return false;
	}
	return true;
}	

function validate(){
	while (!validateFirstName()){
		return false;
	}
	while (!validateLastName()){
		return false;
	}
	while (!validateEmail()){
		return false;
	}
	while (!validatePhone()){
		return false;
	}
	while (!validateAddress()){
		return false;
	}
	while (!validateCity()){
		return false;
	}
	while (!validateState()){
		return false;
	}
	while (!validateZip()){
		return false;
	}
	return true;
}
