
function getsiteroot()
{
	if(document.location.host == "homepage.mac.com")
	{
		return "http://homepage.mac.com/clarkcox3/";
	}
	else if(document.location.protocol == "file:")
	{
		return "file://Users/clarkcox/Sites/";
	}
	else if(document.location.pathname.indexOf("~clarkcox") >= 0)
	{
	    return "/~clarkcox/"
	}
	else
	{
		return "/";
	}
}

function aboutHeader()
{
	var siteroot	= getsiteroot();
	document.write("<a name=\"About\"><img src=\"" + siteroot + "graphics/downloads_about.png\">About</a>");
}

function downloadHeader()
{
	var siteroot	= getsiteroot();
	document.write("<a name=\"Download\"><img src=\"" + siteroot + "graphics/downloads_download.png\">Download</a>");
}

function helpHeader()
{
	var siteroot	= getsiteroot();
	document.write("<a name=\"Help\"><img src=\"" + siteroot + "graphics/downloads_help.png\">Help</a>");
}

function definitionsHeader()
{
	var siteroot	= getsiteroot();
	document.write("<a name=\"Definitions\"><img src=\"" + siteroot + "graphics/downloads_definitions.png\">Definitions</a>");
}

function fileDownloadLink(title, filename)
{
	document.write("<a href=\"" + getsiteroot() + "files/" + filename + "\">" + title + "</a>");
}

function animeseriesbegin(seriesname)
{
	document.write("<div class=\"bodybanner\">" + seriesname + "</div><div class=\"bodysection\">");
}

function linkTagForASIN(ASIN)
{
	return "<a href=\"http://www.amazon.com/exec/obidos/ASIN/" + ASIN + "/clarkshomepag-20/\">";
}

function imageTagForASIN(ASIN)
{
	return "<img src=\"http://images.amazon.com/images/P/" + ASIN + ".01.MZZZZZZZ.jpg\" border=\"0\">";
}

function animeseriesdiscbegin(discname, firstepisode, ASIN)
{
	var	openLinkTag		= linkTagForASIN(ASIN);
	var	closeLinkTag	= "</a>";
	var	imageTag		= imageTagForASIN(ASIN);
	
	document.write("<div class=\"bodysubbanner\">" + openLinkTag + discname + " (click to buy from Amazon.com)" + closeLinkTag + "</div>" + 
		"<table class=\"tracklist\"><tr><td><div class=\"coverart\">" +
		openLinkTag + imageTag + closeLinkTag + 
		"</td><td><ol start=\"" + firstepisode + "\">");
}

function animeseriestrack(trackname)
{
	document.write("<li>" + trackname + "</li>");
}

function animeseriesdiscend()
{
	document.write("</ol></td></tr></table>");
}

function animeseriesdisc(discname, ASIN)
{
	animeseriesdiscbegin(discname, 0, ASIN);
	animeseriesdiscend()
}

function animeseriesend()
{
	document.write("</div>");
}


function animemovie(moviename, ASIN)
{
	animeseriesbegin(moviename);
	animeseriesdisc(moviename, ASIN);
	animeseriesend();
}

function definitionReferenceNoLink(text)
{
	document.write("<span class=\"definitionreference\">" + text + "</span>");
}

function definitionReference(text, defineditem)
{
	document.write("<span class=\"definitionreference\"><a href=\"#definitions_" + defineditem + "\">" + text + "</a></span>");
}

function underConstruction()
{
	document.write("<div align=\"center\">Please bear with me as I update my site design.</div>");
}

function commonFooter()
{
	document.write("<div class=\"footer\"><br clear=all /><hr noshade size=1 />&#169; Copyright 1999 - 2004<br>Clark S. Cox &#x2162;</div>");
	//This is a hack to solve a sizing issue
	document.write("<pre>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  </pre>");
}

function styleSheet()
{
	var siteroot	= getsiteroot();
	document.write("<link rel=\"stylesheet\" href=\"" + siteroot + "styles-site.css\" type=\"text/css\" />");
}
