var iNumSidebarLines = 36;
var asSidebarLines   = new Array(iNumSidebarLines);

var asTopLines       = new Array(9);
var asBottomLines    = new Array(7);
var sCounterLine     = '<TR><TD BGCOLOR="#424345"><CENTER><A HREF="http://member.bcentral.com/cgi-bin/fc/fastcounter-login?2670515" TARGET="_top"><IMG BORDER="0" SRC="http://fastcounter.bcentral.com/fastcounter?2670515+5341037" ALT="BCentral FastCounter"></A></CENTER></TD></TR>';

asSidebarLines[0]  = '<TABLE BORDER="2" CELLPADDING="0" CELLSPACING="0" BORDERCOLOR="#292A2D" WIDTH="140"><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[1]  = 'Images/BlackGreyStripe.gif">N a v i g a t i o n</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="';
asSidebarLines[2]  = 'Index.html" TITLE="The MHC home page." onMouseOver="return MOText(\'Home Page\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Home Page</A><BR>&nbsp;<A HREF="';
asSidebarLines[3]  = 'SiteMap/Index.html" TITLE="The site map contains links to every file on this website." onMouseOver="return MOText(\'Site Map\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Site Map</A></TD></TR><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[4]  = 'Images/BlackGreyStripe.gif">P r o d u c t s</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="';
asSidebarLines[5]  = 'Products/DXodus.html" TITLE="DXodus is a C++ class library for DirectX." onMouseOver="return MOText(\'DXodus\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">DXodus</A><BR>&nbsp;<A HREF="';
asSidebarLines[6]  = 'Products/EarthDefenders.html" TITLE="Earth Defenders is a homemade 2D space shooter."  onMouseOver="return MOText(\'Earth Defenders\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Earth Defenders</A><BR>&nbsp;<A HREF="';
asSidebarLines[7]  = 'Products/MetricTime.html" TITLE="Metric Time is a system of time based on tens." onMouseOver="return MOText(\'Metric Time\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Metric Time</A><BR>&nbsp;<A HREF="';
asSidebarLines[8]  = 'Products/PolynomialClasses.html" TITLE="The Polynomial Classes are C++ classes for manipulating polynomials." onMouseOver="return MOText(\'Polynomial Classes\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Polynomial Classes</A></TD></TR><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[9]  = 'Images/BlackGreyStripe.gif">G e e k&nbsp;&nbsp;&nbsp;W e a r</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="';
asSidebarLines[10] = 'GeekWear/Index.html" TITLE="The GeekWear home page." onMouseOver="return MOText(\'Home\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Home</A><BR>&nbsp;<A HREF="';
asSidebarLines[11] = 'GeekWear/Shirts.html" TITLE="The GeekWear shirts page." onMouseOver="return MOText(\'Shirts\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Shirts</A><BR>&nbsp;<A HREF="';
asSidebarLines[12] = 'GeekWear/IntelGuys.html" TITLE="The GeekWear IntelGuys." onMouseOver="return MOText(\'IntelGuys\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">IntelGuys</A><BR>&nbsp;<A HREF="';
asSidebarLines[13] = 'GeekWear/OrderForm.html" TITLE="The GeekWear order form." onMouseOver="return MOText(\'Order Form\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Order Form</A></TD></TR><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[14] = 'Images/BlackGreyStripe.gif">W e b&nbsp;&nbsp;&nbsp;D e s i g n</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="';
asSidebarLines[15] = 'WebDesign/Index.html" TITLE="The MHC Web Design home page." onMouseOver="return MOText(\'Home\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Home</A><BR>&nbsp;<A HREF="';
asSidebarLines[16] = 'WebDesign/Details.html" TITLE="MHC Web Design details." onMouseOver="return MOText(\'Details\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Details</A><BR>&nbsp;<A HREF="';
asSidebarLines[17] = 'WebDesign/Portfolio.html" TITLE="My web site portfolio." onMouseOver="return MOText(\'Portfolio\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Portfolio</A><BR>&nbsp;<A HREF="';
asSidebarLines[18] = 'WebDesign/RequestForm.html" TITLE="The web site request form." onMouseOver="return MOText(\'Request Form\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Request Form</A></TD></TR><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[19] = 'Images/BlackGreyStripe.gif">P r o j e c t&nbsp;&nbsp;&nbsp;N L</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="';
asSidebarLines[20] = 'ProjectNL/Index.html" TITLE="The home page for Project NL." onMouseOver="return MOText(\'Home\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Home</A><BR>&nbsp;<A HREF="';
asSidebarLines[21] = 'ProjectNL/Axioms.html" TITLE="Project NL axioms." onMouseOver="return MOText(\'Axioms\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Axioms</A><BR>&nbsp;<A HREF="';
asSidebarLines[22] = 'ProjectNL/Rules.html" TITLE="Project NL syntax and usage rules." onMouseOver="return MOText(\'Rules\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Rules</A><BR>&nbsp;<A HREF="';
asSidebarLines[23] = 'ProjectNL/Alphabet.html" TITLE="Project NL alphabet." onMouseOver="return MOText(\'Alphabet\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Alphabet</A><BR>&nbsp;<A HREF="';
asSidebarLines[24] = 'ProjectNL/Progress.html" TITLE="The current progress of Project NL." onMouseOver="return MOText(\'Progress\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Progress</A></TD></TR><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[25] = 'Images/BlackGreyStripe.gif">M y &nbsp;&nbsp;S t u f f</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="';
asSidebarLines[26] = 'MyStuff/MyComputer.html" TITLE="My computer stats." onMouseOver="return MOText(\'My Computer\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">My Computer</A><BR>&nbsp;<A HREF="';
asSidebarLines[27] = 'MyStuff/MyGames.html" TITLE="My computer games." onMouseOver="return MOText(\'My Games\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">My Games</A><BR>&nbsp;<A HREF="';
asSidebarLines[28] = 'MyStuff/MyFiles.html" TITLE="My downloaded files." onMouseOver="return MOText(\'My Files\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">My Files</A><BR>&nbsp;<A HREF="';
asSidebarLines[29] = 'MyStuff/MyLinks.html" TITLE="My favorite links." onMouseOver="return MOText(\'My Links\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">My Links</A><BR>&nbsp;<A HREF="';
asSidebarLines[30] = 'MyStuff/MyFuture.html" TITLE="My planned future." onMouseOver="return MOText(\'My Future\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">My Future</A></TD></TR><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[31] = 'Images/BlackGreyStripe.gif">A b o u t</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="';
asSidebarLines[32] = 'About/AboutMe.html" TITLE="About Domenic Denicola." onMouseOver="return MOText(\'About Me\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">About Me</A><BR>&nbsp;<A HREF="';
asSidebarLines[33] = 'About/AboutMHC.html" TITLE="About the MadHamster Creations company." onMouseOver="return MOText(\'About MHC\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">About MHC</A><BR>&nbsp;<A HREF="';
asSidebarLines[34] = 'About/AboutSite.html" TITLE="About the MadHamster Creations website." onMouseOver="return MOText(\'About This Site\');"  onMouseOut="return MOTextReset()" CLASS="SidebarLink">About This Site</A></TD></TR><TR><TD CLASS="SidebarHeading" BACKGROUND="';
asSidebarLines[35] = 'Images/BlackGreyStripe.gif">C o n t a c t</TD></TR><TR><TD BGCOLOR="#424345">&nbsp;<A HREF="mailto:domenic@techie.com" TITLE="E-mail Domenic Denicola at domenic@techie.com" onMouseOver="return MOText(\'Contact Me\');" onMouseOut="return MOTextReset()" CLASS="SidebarLink">Contact Me</A></TD></TR>';

asTopLines[0] = '<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD BGCOLOR="#0F0F0F" COLSPAN="3"><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%"><TR><TD><IMG SRC="';
asTopLines[1] = 'Images/Logo.gif" WIDTH="436" HEIGHT="90" ALT="MadHamster Creations"></TD><TD ALIGN="right"><TABLE BORDER="0" CELLPADDING="8" CELLSPACING="0" WIDTH="165" TITLE="Metric Date and Time" CLASS="MTDBox"><TR><TD CLASS="MTDLabel" ALIGN="left">Metric Date<BR>Metric Time</TD><TD ALIGN="right"><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="65" ALIGN="right"><TR><TD ALIGN="left"><SPAN ID="MetricDateTime">';
//Metric Date/Time goes here
asTopLines[2] = '</SPAN></TD></TR></TABLE></TD></TR></TABLE><TD><IMG SRC="';
asTopLines[3] = 'Images/1x1Transparent.gif" WIDTH="4" HEIGHT="15" ALT=""></TD></TD></TR></TABLE></TD></TR><TR><TD BGCOLOR="#1E1E1E" COLSPAN="3"><B>Random Quote:</B> ';
//Random quote goes here
asTopLines[4] = '</TD></TR><TR><TD VALIGN="top"><IMG SRC="';
asTopLines[5] = 'Images/1x1Transparent.gif" WIDTH="40" HEIGHT="15" ALT=""><BR></TD><TD VALIGN="top"><IMG SRC="';
asTopLines[6] = 'Images/1x1Transparent.gif" WIDTH="150" HEIGHT="15" ALT=""><BR>';
asTopLines[7] = '</TD><TD WIDTH="100%" VALIGN="top"><IMG SRC="';
asTopLines[8] = 'Images/1x1Transparent.gif" WIDTH="1" HEIGHT="15" ALT=""><BR>';

asBottomLines[0] = '</TABLE></TD></TR></TABLE><P><HR><TABLE WIDTH="100%"><TR><TD ALIGN="left" VALIGN="center"><I>Last modified: ';
asBottomLines[1] = '</I></TD><TD ALIGN="center" VALIGN="middle"><A HREF="http://www.microsoft.com/windows/ie" TARGET="_blank"><IMG SRC="';
asBottomLines[2] = 'Images/InternetExplorer.gif" WIDTH="88" HEIGHT="31" BORDER="0" ALT="Microsoft Internet Explorer"></A></TD><TD VALIGN="middle"><A HREF="http://browsers.netscape.com/browsers" STYLE="background: none" TARGET="_blank"><IMG SRC="';
asBottomLines[3] = 'Images/Netscape.gif" WIDTH="50" HEIGHT="40" BORDER="0" ALT="Netscape"></A></TD><TD ALIGN="right"><A HREF="http://validator.w3.org/check/referer" STYLE="background: none" TARGET="_blank"><IMG SRC="';
asBottomLines[4] = 'Images/HTML4Valid.gif" WIDTH="88" HEIGHT="31" BORDER="0" ALT="Valid under HTML 4.01"></A>&nbsp;&nbsp;&nbsp;<A HREF="http://jigsaw.w3.org/css-validator/check/referer" STYLE="background: none" TARGET="_blank"><IMG SRC="';
asBottomLines[5] = 'Images/CSSValid.gif" WIDTH="88" HEIGHT="31" BORDER="0" ALT="Valid under CSS2"></A>&nbsp;&nbsp;&nbsp;<A HREF="http://www.icra.org/labelv02.html" STYLE="background: none" TARGET="_blank"><IMG SRC="';
asBottomLines[6] = 'Images/ICRA.gif" WIDTH="88" HEIGHT="31" BORDER="0" ALT="Rated with ICRA"></A></TD></TR></TABLE>';

function DeterminePrefix(sRelLocation)
{
	var sPrefix = "";

	while(true)
	{
		var iLocation = sRelLocation.indexOf('/');

		if(iLocation != -1)
		{
			sPrefix += "../";
			sRelLocation = sRelLocation.substring(iLocation + 1, sRelLocation.length);
		}
		else
		{
			break;
		}
	}

	return sPrefix;
}

function WriteSidebar(sRelLocation)
{
	var sPrefix = DeterminePrefix(sRelLocation);

	for(var iLine = 0; iLine < iNumSidebarLines; iLine++)
	{
		document.write(asSidebarLines[iLine]);
		if(iLine < iNumSidebarLines - 1)
		{
			document.write(sPrefix);
		}
	}

	WriteIEButtons(sRelLocation);
	if(sRelLocation == "Index.html")
	{
		document.write(sCounterLine);
	}
	document.write('</TABLE>');
}


function WriteTopLayout(sRelLocation)
{
	var sPrefix = DeterminePrefix(sRelLocation);

	document.write(asTopLines[0]);
	document.write(sPrefix);
	document.write(asTopLines[1]);
	
	document.write(GetMetricDate() + "<BR>" + GetMetricTime());

	document.write(asTopLines[2]);
	document.write(sPrefix);
	document.write(asTopLines[3]);

	RandomQuote();

	document.write(asTopLines[4]);
	document.write(sPrefix);
	document.write(asTopLines[5]);
	document.write(sPrefix);
	document.write(asTopLines[6]);
	
	WriteSidebar(sRelLocation);

	document.write(asTopLines[7]);
	document.write(sPrefix);
	document.write(asTopLines[8]);
}

function WriteBottomLayout(sRelLocation)
{
	var sPrefix = DeterminePrefix(sRelLocation);

	document.write(asBottomLines[0]);
	document.write(document.lastModified);
	document.write(asBottomLines[1]);
	document.write(sPrefix);
	document.write(asBottomLines[2]);
	document.write(sPrefix);
	document.write(asBottomLines[3]);
	document.write(sPrefix);
	document.write(asBottomLines[4]);
	document.write(sPrefix);
	document.write(asBottomLines[5]);
	document.write(sPrefix);
	document.write(asBottomLines[6]);
}