// Current Page Reference
// copyright Stephen Chapman, 1st Jan 2005
// you may copy this function but please keep the copyright notice with it
function getURL(uri) {
uri.dir = location.href.substring(0,location.href.lastIndexOf('\/'));
uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
uri.page = location.href.substring(uri.dir.length+1,location.href.length+1);
pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
uri.file = uri.page;
if (uri.ext != '') uri.file += '.' + uri.ext;
if (uri.file == '') uri.page = 'index';
uri.args = location.search.substr(1).split("?");
return uri;
}

var uri = new Object();
getURL(uri);


// Jordan Bradford's code:
function printNav() {
	files = new Array(
				"currentissue.html",
				"about.html",
				"advertise.html",
				"subscribe.php",
				"faqs.html",
				"archive.html",
				"contact.php",
                "index.html"
			);

	titles = new Array(
				"In This Issue",
				"About Us",
				"Advertise",
				"Subscribe",
				"FAQs",
				"Archive",
				"Contact Us",
                "Home Page"
			);

	text = new Array(
				"IN THIS ISSUE",
				"ABOUT US",
				"ADVERTISE",
				"SUBSCRIBE",
				"FAQs",
				"ARCHIVE",
				"CONTACT US",
                "HOME"
			);

	document.writeln("        <ul id=\"nav\">");
	for(var i = 0; i < files.length; i++)
	{
		if(uri.file === files[i])
			document.writeln("          <li class=\"currentpage\"><a class=\"currentpage\" href=\"" + files[i] + "\" title=\"" + titles[i] + "\">" + text[i] + "</a></li>");
		else
			document.writeln("          <li><a href=\"" + files[i] + "\" title=\"" + titles[i] + "\">" + text[i] + "</a></li>");
	}
	document.writeln("        </ul>");
}
