var tmpStr = '';
var net6 = 0;
var appN = navigator.appName;
var appV = navigator.appVersion;
var majV = appV.substring(0,1);
NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
if (appN == 'Netscape' && majV == 5) {
	net6 = 1;} else {
	net6 = 0;
}
ver4 = (NS4 || IE4 || net6) ? 1 : 0;



// Hairy conditional that controls the navbar expansion. Special cases where a file
//  is housed in a different vhost than it's navbar category are noted below. JZAHN

var secFlag = '';
var url = location.href;
var chop = url.substr(7, 3);

if (chop == 'www' || chop == 'mai' || chop == 'uo.') {
	if (url.indexOf('uoshoppes') != -1 ||              // special case for uoshoppes section
	    url.indexOf('shop') != -1 ||
	    url.indexOf('merc.html') != -1 ||
	    url.indexOf('gtorder.html') != -1 ||
	    url.indexOf('order.asp') != -1)
		{secFlag='shop';}
	else if (url.indexOf('account.html') != -1 ||      // special case for account.html
		 url.indexOf('acct_xfer.html') != -1)      // special case for acct_xfer.html
		{secFlag = 'account';}
	else if (url.indexOf('uojobs') != -1)              // special case for uojobs.html
		{secFlag = 'contact';}
	else if (url.indexOf('newplayer') != -1)           // special case for newplayer sectionl
		{secFlag = 'newplayer';}
	else if (url.indexOf('news.html') != -1)           // special case for news.html
		{secFlag = 'update';}
	else if (url.indexOf('uo.custhelp') != -1)           // special case for Game Wiz
		{secFlag = 'support';}
	else
		{secFlag = 'main';}

} else if (chop == 'tow') {
	secFlag = 'town';
} else if (chop == 'gui') {
	secFlag = 'guide';
} else if (chop == 'upd') {
	secFlag = 'update';
} else if (chop == 'sup') {
	if (url.indexOf('contact') != -1) {                // special case for contact.html and contact_info.html
		secFlag = 'contact';
	}
	else if (url.indexOf('s_issue.html') != -1) {      // special case for contact.html and contact_info.html
		secFlag = 'update';
	}
	else {
		secFlag = 'support';
	}
} else if (chop == 'my.'){
	secFlag = 'myuo';
} else if (chop == 'boa') {
	secFlag = 'boards';
} else {
	secFlag = 'unknown';
}






if (ver4) {
	with (document) {
		write("<STYLE TYPE='text/css'>");
		if (NS4) {
			write(".parent {position:absolute; top: 145px; visibility:hidden}");
			write(".child {position:absolute; left:13px; visibility:hidden}");
			write(".regular {position:absolute; visibility:hidden}")
			write("A.nav {font-family:Arial; font-size:9pt; color:#FFCC33; text-decoration:none}");
			write("A.subnav {font-family:Arial; font-size:8pt; color:#FFCC33; text-decoration:none}");
		} else {
			write(".child {position:relative; left:13px; display:none}");
			write("A.nav {font-family:arial; font-size:8pt; color:#FFCC33; text-decoration:none}");
			write("A:Hover.nav {font-family:Arial; font-size:8pt; color:Yellow; text-decoration:none}");
			write("A.subnav {font-family:Arial; font-size:7pt; color:#FFCC33; text-decoration:none}");
			write("A:Hover.subnav {font-family:Arial; font-size:7pt; color:Yellow; text-decoration:none}");					}
		write("</STYLE>");
	}
}
function getIndex(el) {
	ind = null;
	for (i=0; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.id == el) {
			ind = i;
			break;
		}
	}
return ind;
}
function showAll() {
    for (i=firstInd; i<document.layers.length; i++) {
        whichEl = document.layers[i];
        whichEl.visibility = "show";
    }
}
function arrange() {
	nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
	for (i=firstInd+1; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		if (whichEl.visibility != "hide") {
			if (whichEl.name.indexOf('el') != -1){
				whichEl.pageY = nextY;
				nextY += whichEl.document.height;			}
		}
	}
}
function whichSec() {
	if (!ver4) return;
	//IE
	if (IE4) {
		if (secFlag == 'main') {
			// The main/home section no longer expands, special cases housed in main expand
			//  other sections via the secFlag conditional above
		} else if (secFlag == 'newplayer') {
			elThreeChild.style.display = 'block';
			document.images.elThree.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'guide') {
			elFourChild.style.display = 'block';
			document.images.elFour.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'town') {
			elFiveChild.style.display = 'block';
			document.images.elFive.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'account') {
			elSixChild.style.display = 'block';
			document.images.elSix.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'support') {
			elSevenChild.style.display = 'block';
			document.images.elSeven.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'update') {
			elEightChild.style.display = 'block';
			document.images.elEight.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'myuo') {
			elNineChild.style.display = 'block';
			document.images.elNine.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'boards') {
			elTenChild.style.display = 'block';
			document.images.elTen.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'shop') {
			elElevenChild.style.display = 'block';
			document.images.elEleven.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'contact') {
			elTwelveChild.style.display = 'block';
			document.images.elTwelve.src = "http://www.uo.com/images/minus.gif";
		} else {
		 	// Else expand nothing, since home/main is no longer a navbar section
		}

	// Netscape 6
	} else if (net6) {
		if (secFlag == 'main') {
			// The main/home section no longer expands, special cases housed in main expand
			//  other sections via the secFlag conditional above
		} else if (secFlag == 'newplayer') {
			var idName = document.getElementById('elThreeChild');
			idName.style.display = 'block';
			document.images.elThree.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'guide') {
			var idName = document.getElementById('elFourChild');
			idName.style.display = 'block';
			document.images.elFour.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'town') {
			var idName = document.getElementById('elFiveChild');
			idName.style.display = 'block';
			document.images.elThree.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'account') {
			var idName = document.getElementById('elSixChild');
			idName.style.display = 'block';
			document.images.elSix.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'support') {
			var idName = document.getElementById('elSevenChild');
			idName.style.display = 'block';
			document.images.elSeven.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'update') {
			var idName = document.getElementById('elEightChild');
			idName.style.display = 'block';
			document.images.elEight.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'myuo') {
			var idName = document.getElementById('elNineChild');
			idName.style.display = 'block';
			document.images.elNine.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'boards') {
			var idName = document.getElementById('elTenChild');
			idName.style.display = 'block';
			document.images.elTen.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'shop') {
			var idName = document.getElementById('elElevenChild');
			idName.style.display = 'block';
			document.images.elEleven.src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'contact') {
			var idName = document.getElementById('elTwelveChild');
			idName.style.display = 'block';
			document.images.elTwelve.src = "http://www.uo.com/images/minus.gif";
		} else {
		 	// Else expand nothing, since home/main is no longer a navbar section
		}

	// Netscape 4
	} else {
		if (secFlag == 'main') {
			// The main/home section no longer expands, special cases housed in main expand
			//  other sections via the secFlag conditional above
		} else if (secFlag == 'newplayer') {
			document.elThreeChild.visibility = 'show';
			document.elThreeParent.document.images['elThree'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'guide') {
			document.elFourChild.visibility = 'show';
			document.elFourParent.document.images['elFour'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'town') {
			document.elFiveChild.visibility = 'show';
			document.elFiveParent.document.images['elFive'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'account') {
			document.elSixChild.visibility = 'show';
			document.elSixParent.document.images['elSix'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'support') {
			document.elSevenChild.visibility = 'show';
			document.elSevenParent.document.images['elSeven'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'update') {
			document.elEightChild.visibility = 'show';
			document.elEightParent.document.images['elEight'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'myuo') {
			document.elNineChild.visibility = 'show';
			document.elNineParent.document.images['elNine'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'boards') {
			document.elTenChild.visibility = 'show';
			document.elTenParent.document.images['elTen'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'shop') {
			document.elElevenChild.visibility = 'show';
			document.elElevenParent.document.images['elEleven'].src = "http://www.uo.com/images/minus.gif";
		} else if (secFlag == 'contact') {
			document.elTwelveChild.visibility = 'show';
			document.elTwelveParent.document.images['elTwelve'].src = "http://www.uo.com/images/minus.gif";
		} else {
		 	// Else expand nothing, since home/main is no longer a navbar section
		}
	}
}
function initIt(){
	if (!ver4) return;
		if (NS4) {
			for (i=0; i<document.layers.length; i++) {
				whichEl = document.layers[i];
				if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
			}
		whichSec();
		arrange();
		} else if (net6) {
			divColl = document.getElementsByTagName("DIV");
			for (i=0; i<divColl.length; i++) {
				whichEl = divColl[i];
					if (whichEl.className == "child") whichEl.style.display = "none";
			}
			whichSec();
		} else {
			divColl = document.all.tags("DIV");
			for (i=0; i<divColl.length; i++) {
				whichEl = divColl(i);
					if (whichEl.className == "child") whichEl.style.display = "none";
			}
			whichSec();
		}
}
function expandIt(el) {
	if (!ver4) return;
	//IE
	if (IE4) {
		whichEl = eval(el + "Child");
		whichIm = event.srcElement;
			if (whichEl.style.display == "none") {
				whichEl.style.display = "block";
				whichIm.src = "http://www.uo.com/images/minus.gif";
			} else {
				whichEl.style.display = "none";
				whichIm.src = "http://www.uo.com/images/plus.gif";
			}
	// Netscape 6
	} else if (net6) {
		var idStr = el + "Child";
		var getId = document.getElementById(idStr);
		whichIm = eval("document.images." + el);
			if (getId.style.display == "none") {
				getId.style.display = "block";
				whichIm.src = "http://www.uo.com/images/minus.gif";
			} else {
				getId.style.display = "none";
				whichIm.src = "http://www.uo.com/images/plus.gif";
			}
	// Netscape 4
	} else {
		whichEl = eval("document." + el + "Child");
		whichIm = eval("document." + el + "Parent.document.images[el]");		if (whichEl.visibility == "hide") {
			whichEl.visibility = "show";
			whichIm.src = "http://www.uo.com/images/minus.gif";
		} else {
			whichEl.visibility = "hide";
			whichIm.src = "http://www.uo.com/images/plus.gif";
		}
	arrange();
	}
}
onload = initIt;

if (IE4) {
	tmpStr += '<table cellspacing="0" cellpadding="0" border="0" width="95"><tr><td>';
} else {
	tmpStr += '<img SRC="/images/blank.gif" width="95" height = "1">';
}
//Home
tmpStr += '<DIV ID="elOneParent" CLASS="parent">';
tmpStr += '<IMG NAME="elOne" SRC="/images/blank.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="">';
tmpStr += ' <a href="http://www.uoherald.com/" class="nav"><b>HOME</b></a></DIV>';

//Visitor Center
//tmpStr += '<DIV ID="elTwoParent" CLASS="parent">';
//tmpStr += '<IMG NAME="elTwo" SRC="/images/blank.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="">';
//tmpStr += ' <a href="http://www.uo.com/ageofshadows/viscent.html" class="nav"><b>VISITOR CTR</b></a></DIV>';
//

//Playguide
tmpStr += '<DIV ID="elFourParent" CLASS="parent">';
tmpStr += '<IMG NAME="elFour" SRC="/images/blank.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="">';
tmpStr += ' <a href="http://www.uoherald.com/guide/" class="nav"><b>PLAYGUIDE</b></a></DIV>';

//Community
tmpStr += '<DIV ID="elFiveParent" CLASS="parent">';
tmpStr += '<A HREF="#" onClick="expandIt(\'elFive\'); return false"><IMG NAME="elFive" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
tmpStr += ' <a href="http://www.uoherald.com/town/" class="nav"><b>COMMUNITY</b></a></DIV>';

tmpStr += '<DIV ID="elFiveChild" CLASS="child">';
tmpStr += '<a href="http://www.uoherald.com/liveevents/index.php" class="subnav">Live Events</a><br>';
tmpStr += '<a href="http://www.uoherald.com/town/credits.php" class="subnav">Game Credits</a><br>';
tmpStr += '<a href="http://www.uoherald.com/newsletterarchive/" class="subnav">Newsletter</a><br>';
tmpStr += '<a href="http://www.uoherald.com/town/affiliates.php" class="subnav">UO International</a><br>';
tmpStr += '<a href="http://www.uoherald.com/fansites/" class="subnav">Fansites</a><br>';
tmpStr += '<a href="http://www.facebook.com/pages/Ultima-Online/79061181602" class="subnav">UO Facebook</a><br>';
tmpStr += '</DIV>';

//My Account
tmpStr += '<DIV ID="elSixParent" CLASS="parent">';
tmpStr += '<A HREF="#" onClick="expandIt(\'elSix\'); return false"><IMG NAME="elSix" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
tmpStr += ' <a href="http://www.uoherald.com/acct_mgmt.php" class="nav"><b>ACCT MGMT</b></a></DIV>';
tmpStr += '<DIV ID="elSixChild" CLASS="child">';
tmpStr += '<a href="https://account.ea.com/myacct/uo/uo-hub.jsp?skin=uo" class="subnav">New/Edit Acct</a><br>';
//tmpStr += '<a href="https://account.ea.com/myacct/uo/uo-hub.jsp?skin=uo" class="subnav">Modify Acct</a><br>';
tmpStr += '<a href="http://support.ea.com/cgi-bin/ea.cfg/php/enduser/std_adp.php?p_faqid=6174" class="subnav">Acct Transfer</a><br>';
tmpStr += '<a href="https://www.uogamecodes.com" class="subnav">UOGameCodes</a><br>';
tmpStr += '</DIV>';
//tmpStr += '<a href="http://eamembers.custhelp.com/" class="subnav">Acct Support</a><br>';

//Support
tmpStr += '<DIV ID="elSevenParent" CLASS="parent">';
tmpStr += '<A HREF="#" onClick="expandIt(\'elSeven\'); return false"><IMG NAME="elSeven" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
tmpStr += ' <a href="http://www.uoherald.com/support.php" class="nav"><b>SUPPORT</b></a></DIV>';

tmpStr += '<DIV ID="elSevenChild" CLASS="child">';
tmpStr += '<a href="http://support.ea.com/cgi-bin/ea.cfg/php/enduser/std_alp.php?&p_page=1&p_cv=&p_pv=2.769&p_prods=7%2C769&p_cats=0&p_hidden_prods=&prod_lvl1=7&prod_lvl2=769&prod_lvl3=0&cat_lvl1=0" class="subnav">Knowledge Base</a><br>';
tmpStr += '<a href="http://support.ea.com/cgi-bin/ea.cfg/php/enduser/std_alp.php?&p_page=1&p_cv=&p_pv=2.769&p_prods=7%2C769&p_cats=0&p_hidden_prods=&prod_lvl1=7&prod_lvl2=769&prod_lvl3=0&cat_lvl1=0" class="subnav">Contact Support</a><br>';
tmpStr += '<a href="http://www.uoherald.com/support/service.php" class="subnav">Policies & Rules</a><br>';
tmpStr += '<a href="http://ea.custhelp.com/cgi-bin/ea.cfg/php/enduser/std_adp.php?p_faqid=10671" class="subnav">Avoid Scams</a><br>';
tmpStr += '<a href="http://support.ea.com/cgi-bin/ea.cfg/php/enduser/std_adp.php?p_faqid=10940" class="subnav">Requirements</a><br>';
tmpStr += '<a href="http://ea.custhelp.com/cgi-bin/ea.cfg/php/enduser/std_adp.php?p_faqid=300" class="subnav">Maint. Times</a><br>';
tmpStr += '<a href="http://ea.custhelp.com/cgi-bin/ea.cfg/php/enduser/std_adp.php?p_faqid=306" class="subnav">UO Approved Apps</a><br></DIV>';
//tmpStr += '<a href="http://support.uo.com/downloads.html" class="subnav">Downloads</a><br>';

//Update Center
tmpStr += '<DIV ID="elEightParent" CLASS="parent">';
tmpStr += '<A HREF="#" onClick="expandIt(\'elEight\'); return false"><IMG NAME="elEight" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
tmpStr += ' <a href="http://uoherald.com/town/updates.php" class="nav"><b>UPDATE CTR</b></a></DIV>';

tmpStr += '<DIV ID="elEightChild" CLASS="child">';
//tmpStr += '<a href="http://www.uo.com/news.html" class="subnav">Site News</a><br>';
//tmpStr += '<a href="http://support.uo.com/s_issue.html" class="subnav">Shard Issues</a><br>';
//tmpStr += '<a href="http://update.uo.com/fyi.html" class="subnav">FYI</a><br>';
tmpStr += '<a href="http://www.uoherald.com/fof/" class="subnav">Five on Friday</a><br>';
//tmpStr += '<a href="http://update.uo.com/concept.html" class="subnav">In Concept</a><br>';
tmpStr += '<a href="http://www.uoherald.com/news/index.php" class="subnav">Latest Update</a><br></DIV>';

//MyUO
tmpStr += '<DIV ID="elNineParent" CLASS="parent">';
tmpStr += '<A HREF="#" onClick="expandIt(\'elNine\'); return false"><IMG NAME="elNine" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
tmpStr += ' <a href="http://www.uoherald.com/my_uo.php" class="nav"><b>MyUO</b></a></DIV>';

tmpStr += '<DIV ID="elNineChild" CLASS="child">';
tmpStr += '<a href="http://my.uo.com/cgi-bin/my_chars.pl" class="subnav">My Chars</a><br>';
tmpStr += '<a href="http://my.uo.com/char_search.html" class="subnav">Char Search</a><br>';
tmpStr += '<a href="http://town.uo.com/guilds/" class="subnav">Guilds</a><br>';
tmpStr += '<a href="http://town.uo.com/factions/" class="subnav">Factions</a><br>';

//Message Boards
//tmpStr += '<DIV ID="elTenParent" CLASS="parent">';
//tmpStr += '<A HREF="#" onClick="expandIt(\'elTen\'); return false"><IMG NAME="elTen" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
//tmpStr += ' <a href="http://boards.uo.com/cgi-bin/wwwthreads.pl" class="nav"><b>BOARDS</b></a></DIV>';
//
//tmpStr += '<DIV ID="elTenChild" CLASS="child">';
//tmpStr += '<a href="http://boards.uo.com/cgi-bin/newuser.pl?Cat=" class="subnav">New User</a><br>';
//tmpStr += '<a href="http://boards.uo.com/agree.html" class="subnav">Rules</a><br>';
//tmpStr += '<a href="http://boards.uo.com/cgi-bin/login.pl?Cat=" class="subnav">Log In</a><br>';
//tmpStr += '<a href="http://boards.uo.com/cgi-bin/faq_english.pl?Cat=" class="subnav">FAQ</a><br></DIV>';
//
//UO Shop
tmpStr += '<DIV ID="elElevenParent" CLASS="parent">';
tmpStr += '<A HREF="#" onClick="expandIt(\'elEleven\'); return false"><IMG NAME="elEleven" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
tmpStr += ' <a href="http://www.uoherald.com/stores.php" class="nav"><b>STORES</b></a></DIV>';

tmpStr += '<DIV ID="elElevenChild" CLASS="child">';
tmpStr += '<a href="https://www.uogamecodes.com" class="subnav">UOGameCodes</a><br>';
tmpStr += '<a href="http://www.mythicstore.com/" class="subnav">Mythic Store</a><br></DIV>';

//Contact Information
tmpStr += '<DIV ID="elTwelveParent" CLASS="parent">';
tmpStr += '<A HREF="#" onClick="expandIt(\'elTwelve\'); return false"><IMG NAME="elTwelve" SRC="http://www.uo.com/images/plus.gif" WIDTH=9 HEIGHT=9 BORDER=0 ALT="Expand/Collapse Item"></A>';
tmpStr += ' <a href="http://uoherald.com/town/contact.php" class="nav"><b>CONTACT US</b></a></DIV>';

tmpStr += '<DIV ID="elTwelveChild" CLASS="child">';
tmpStr += '<a href="http://www.uoherald.com/support/contact_info.php" class="subnav">Contact Info</a><br>';
//tmpStr += '<a href="http://www.origin.ea.com/" class="subnav">Origin Home</a><br>';
tmpStr += '<a href="http://www.ea.com/" class="subnav">EA.com</a><br>';
tmpStr += '<a href="http://jobs.ea.com/" class="subnav">Employment</a><br></DIV>';

tmpStr += '<p>';

tmpStr += '<DIV ID="elBod" CLASS="regular">';
//tmpStr += 'Rest';
tmpStr += '</DIV>';

tmpStr += '<DIV ID="elFooter" CLASS="regular">';
//tmpStr += 'Footer';
tmpStr += '</DIV>';
if (IE4) {
tmpStr += '</td></tr></table>';
}
document.write(tmpStr);
	if (document.layers) {
		firstEl = "elOneParent";
		firstInd = getIndex(firstEl);
		showAll();
        arrange();
	}
