function navbar (ontab)
{
	document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='996px'>");
	document.writeln("	<tr><td rowspan='2'><img src='images/outline/header_l.png' border='0'></td>");
	document.writeln("		<td><table border='0' cellpadding='0' cellspacing='0' width='855px'>");
	document.writeln("				<tr><td><img src='images/outline/header_1.png' border='0'></td>");
	document.writeln("					<td><img src='images/outline/header_2.png' border='0'></td>");
	document.writeln("					<td><img src='images/outline/header_3.png' border='0'></td></tr>");
	document.writeln("				<tr><td><img src='images/outline/top_tl.jpg' border='0'></td>");
	document.writeln("					<td><img src='images/outline/top_tm.jpg' border='0'></td>");
	document.writeln("					<td><img src='images/outline/top_tr.jpg' border='0'></td></tr>");
	document.writeln("			</table></td>");
	document.writeln("		<td rowspan='2'><img src='images/outline/header_r.png' border='0'></td></tr>");
	document.writeln("	<tr><td><table border='0' cellpadding='0' cellspacing='0' width='855px'>");
	document.writeln("				<tr><td><img src='images/outline/top_bl.jpg' border='0'></td>");
	
	pages = new Array("index.htm", "about.htm", "shows.htm", "music.htm", "photos.cgi", "news.htm", "contact.htm", "store.cgi");
	images = new Array("home", "about", "shows", "music", "photos", "news", "contact", "store");
	
	for (i=0; i<8; i++)
	{	if (ontab == i)
		{	document.writeln("	<td><img src='images/nav/"+images[i]+"_on.jpg' border='0'></td>");
		} else {
			document.writeln("	<td><a href='"+pages[i]+"'><img src='images/nav/"+images[i]+"_off.jpg' border='0' ");
			document.writeln("			onmouseover=\"this.src='images/nav/"+images[i]+"_on.jpg'\" ");
			document.writeln("			onmouseout=\"this.src='images/nav/"+images[i]+"_off.jpg'\"></a></td>");
		}
	}
	
	document.writeln("					<td><img src='images/outline/top_br.jpg' border='0'></td></tr>");
	document.writeln("			</table></td></tr>");
	document.writeln("</table>");
}


function bionav (ontab)
{
	  document.write("	<table border='0' cellpadding='0' cellspacing='0' width='509px' ");
		if (ontab == 0)
		{ document.writeln("background='images/bionav/about_bg.jpg'>"); }
			else
		{ document.writeln("background='images/bionav/bg.jpg'>"); }
	document.writeln("		<tr><td colspan='15'><img src='images/spacer.gif' height='8px' border='0'></td></tr>");
	document.writeln("		<tr><td><img src='images/spacer.gif' width='88px' height='55px' border='0'></td>");

	bioname = new Array("band", "ashley", "seth", "eric", "laura", "barrett", "joe");
	spaces = new Array(8, 9, 7, 7, 8, 6, 60);
	
	for (i=0; i<7; i++)
	{	link = "_"+bioname[i];
		if (i == 0) { link = ""; }
		
		if (ontab == i)
		{	document.writeln("	<td><img src='images/bionav/"+bioname[i]+"_on.jpg' border='0'></td>");
		} else {
			  document.write("	<td><a href='about"+link+".htm'><img src='images/bionav/"+bioname[i]+"_off.jpg' border='0' ");
			  document.write("			onmouseover=\"this.src='images/bionav/"+bioname[i]+"_on.jpg'\" ");
			document.writeln("			onmouseout=\"this.src='images/bionav/"+bioname[i]+"_off.jpg'\"></a></td>");
		}
		
		document.writeln("	<td><img src='images/spacer.gif' width='"+spaces[i]+"px' height='55px' border='0'></td>");
	}

	document.writeln("</tr>");
	document.writeln("	<tr><td colspan='15'><img src='images/spacer.gif' height='27px' border='0'></td></tr>");
	document.writeln("</table>");
}


function socialnav (cellwidth, bgimage)
{
	tablewidth = cellwidth + 286;
	
	document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='"+tablewidth+"px'>");
	document.writeln("	<tr><td style='font:900 12px Tahoma; color:#f6f4ef; padding-right:10px; padding-top:10px;' ");
	document.writeln("			background='images/social/bg_"+bgimage+".jpg' width='"+cellwidth+"px' ");
	document.writeln("			height='53px' align='right' valign='top'>FOLLOW US ON THE WEB</td>");
	document.writeln("		<td><a href='http://www.myspace.com/muddriverunion' target='_blank'><img ");
	document.writeln("				src='images/social/myspace.jpg' border='0'></a></td>");
	document.writeln("		<td><img src='images/social/no_div_1.jpg' border='0'></td>");
	document.writeln("		<td><img src='images/social/noshow_youtube.jpg' border='0'></td>");
	document.writeln("		<td><img src='images/social/no_div_2.jpg' border='0'></td>");
	document.writeln("		<td><img src='images/social/noshow_facebook.jpg' border='0'></td>");
	document.writeln("		<td><img src='images/social/right.jpg' border='0'></td></tr>");
	document.writeln("</table>");
}


// Contact forms are generated here so if I need to make any changes they're all in one spot
function about_email ()
{	
	origin = location.pathname;
	if (origin.indexOf("/") != -1) { origin = origin.substring(origin.indexOf("/")+1, origin.length); }
	
	document.writeln("<form action='email.cgi' method='post' style='margin:0px;'>");
	document.writeln("<input type='hidden' name='refpage' value='"+origin+"'>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='260px'>");
	document.writeln("	<tr><td width='130px' style='padding-left:3px;'><input type='text' name='email' style='background-color:#481f07; ");
	document.writeln("			width:122px; height:25px; border:1px solid #3c1804; color:#ffffff; vertical-align:center;'></td>");
	document.writeln("		<td width='130px' style='padding:2px 0px 1px 2px;'><input type='image' border='0' ");
	document.writeln("			src='images/email_button_off.png' onmouseover=\"this.src='images/email_button_on.png'\" ");
	document.writeln("			onmouseout=\"this.src='images/email_button_off.png'\"></td></tr>");
	document.writeln("</table></form>");
}

function photos_email ()
{
	origin = location.pathname;
	if (origin.indexOf("/") != -1) { origin = origin.substring(origin.indexOf("/")+1, origin.length); }

	document.writeln("<form action='email.cgi' method='post' style='margin:0px;'>");
	document.writeln("<input type='hidden' name='refpage' value='"+origin+"'>");
	document.writeln("<table border='0' cellpadding='0' cellspacing='0' width='315px'>");
	document.writeln("	<tr><td colspan='3'><img src='images/photos_email_1.jpg' border='0'></td></tr>");
	document.writeln("	<tr><td rowspan='2' width='93px'><img src='images/photos_email_2.jpg' border='0'></td>");
	document.writeln("		<td colspan='2' background='images/photos_email_txt_bg.jpg' style='font:12px Tahoma; color:#f6f4ef;' ");
	document.writeln("			width='235px' height='54px'>Signup for email updates for Mudd River Union here. Find out the ");
	document.writeln("			latest news and upcoming shows. Enter email address:</td></tr>");
	document.writeln("	<tr><td background='images/photos_email_inp_bg.jpg' width='130px' height='37px' align='center'><input ");
	document.writeln("			type='text' name='email' style='width:122px; height:25px; background-color:#481f07; ");
	document.writeln("			border:1px solid #3c1804; color:#ffffff; vertical-align:center;'></td>");
	document.writeln("		<td background='images/photos_email_bbg.jpg' style='padding-right:15px;'><input type='image' border='0' ");
	document.writeln("			src='images/email_button_off.png' onmouseover=\"this.src='images/email_button_on.png'\" ");
	document.writeln("			onmouseout=\"this.src='images/email_button_off.png'\"></td></tr>");
	document.writeln("		<tr><td colspan='3'><img src='images/photos_email_3.jpg' border='0'></td></tr>");
	document.writeln("</table></form>");
}

function email_alert ()
{	
	switch (location.hash)
	{	case "": break;
		case "#emailsent":	alert("Thank you for signing up!"); break;
		case "#noemail": 	alert("Please enter an email address before submitting"); break;
		case "#emailinv":	alert("Email address was invalid"); break;
	}
}
