/*
JavaScript for personal website

Main JavaScript
Author:	Marshall Farrier
Date:	7/30/09

Filename:	mfdotcom.js
*/

// every other letter is simply fill here
function stringDecode(encryptedString)
{
	if (!encryptedString) return '';
	var decodedString = '';
	for (i = 0; i < encryptedString.length; i += 2)
	{
		decodedString += encryptedString.charAt(i);
	}
	return decodedString;
}

function showEM(userName)
{
	var realName = stringDecode(userName);
	document.write("<a href='mailto:" + realName + "@marshallfarrier.com'>");
	document.write(realName + "@marshallfarrier.com");
	document.write("</a>");
}

function emailAnchor(anchorText)
{
	document.write("<a href='mailto:info");
	document.write("@marshallfarrier.com'>");
	document.write(anchorText);
	document.write("</a>");
}

function showMenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="visible";
}

function hideMenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="hidden";
}
function aristotleMenu(root_path) {
    document.write("<a href='" + root_path + "aristotle/index.htm'>Aristotle</a>");
}
function blogArchiveMenu(root_path) {
    document.write("<a id='archiveTitle' style='border-bottom: none'>Archive topics:</a>");
    document.write("<a href='" + root_path + "pages/archive/aristotle.php'>Aristotle</a>");
    document.write("<a href='" + root_path + "pages/archive/christo.php'>Christo</a>");
    document.write("<a href='" + root_path + "pages/archive/goldsworthy.php'>Goldsworthy</a>");
    document.write("<a href='" + root_path + "pages/archive/river.php'>Installation</a>");
    document.write("<a href='" + root_path + "pages/archive/irrigation.php'>Irrigation</a>");
    document.write("<a href='" + root_path + "pages/archive/programming.php'>Programming</a>");
    document.write("<a href='" + root_path + "pages/archive/website.php'>Website</a>");
}

function waltonEvent(type, xNum, yNum, lastNum, eventName)
{
	var linkCode = "http://tickets.waltonartscenter.org/" + type + "/view.asp?id=" + xNum + "&x=" + yNum + "&y=" + lastNum;
	document.write("<a href='" + linkCode + "'>");
	document.write(eventName + "</a>");
}

function mainMenu(root_path)
{
	document.write("<a href='" + root_path + "index.php'>Home</a>");
	document.write("<a href='" + root_path + "pages/blog.php'>Blog</a>");
	document.write("<a href='" + root_path + "pages/events.php'>Events</a>");
	document.write("<a href='" + root_path + "pages/images1.php'>Images</a>");
	document.write("<a href='" + root_path + "pages/bio.php'>Bio</a>");
	document.write("<a href='" + root_path + "pages/links.php'>Links</a>");
}
