function init() {
	findLocation();
}

function setTab(tabToSet) {
	if(document.getElementById(tabToSet)) { //If object exists, set style
		document.getElementById(tabToSet).style.backgroundImage = "url(/lonworld/images/tabGold.gif)";
	} 
}

function findLocation() {
	var currentPath = location.pathname;
	var splitPaths = new Array();
	splitPaths = currentPath.split("/lonworld/");
	splitPathsLen = splitPaths.length;
	//build RegEx to find .htm(l) or asp
	re = /htm$|html$|asp$/i;
	//determin contents of last element
	if(splitPaths[1].search(re) != -1) {
		//Found a file in the first postition
		setTab("home");
	} else {
		//determine tab
		if(splitPaths[1] == "") {
				setTab("home");
		} else {
			setTab(splitPaths[1]);
		}
	}
}