function SansDomain(in_str)
{
	var str = String(in_str);
	str = str.toLowerCase();
	str = str.replace("http://", "");
	sarr = str.split("/");
	str = "";
	for (var x=1;x<sarr.length;x++) {
		str = str + "/" + sarr[x];
	}
	return str;
}

function IsLinkToMe(CurrentURL, TargetURL){
	//CurrentURL = CurrentURL.toLowerCase();
	//TargetURL = TargetURL.toLowerCase();
	if (TargetURL.indexOf('#') > 0 &&  TargetURL.indexOf('#') == TargetURL.length - 1 ){
		return false;
	} else {
		if (CurrentURL == TargetURL) {
			return true;
		} else if ( parseUri(TargetURL).queryKey.id && parseUri(TargetURL).queryKey.id == parseUri(CurrentURL).queryKey.id ) {
			return true;
		} else if ( parseUri(TargetURL).queryKey.ItemID && parseUri(TargetURL).queryKey.ItemID == parseUri(CurrentURL).queryKey.id ) {
			return true;
		} else if ("http://" + parseUri(CurrentURL).host + parseUri(CurrentURL).path == TargetURL && !parseUri(CurrentURL).query ){
			return true;
		} else if (parseUri(CurrentURL).directory == parseUri(TargetURL).directory && parseUri(CurrentURL).file  == "eventdisplay.php" && parseUri(TargetURL).file  == ""){
			return true;
		} else if (
			parseUri(TargetURL).file == "news.aspx" && 
			parseUri(CurrentURL).directory + parseUri(CurrentURL).file ==	
			parseUri(TargetURL).directory + parseUri(TargetURL).file 
		){
			return true;
		} else if (
			parseUri(TargetURL).file == "president-talks.aspx" && 
			parseUri(CurrentURL).directory + parseUri(CurrentURL).file ==	
			parseUri(TargetURL).directory + parseUri(TargetURL).file 
		){
			return true;
		} else if (CurrentMenuSelectorID != undefined) {
			if (GetURLToken(TargetURL, "ItemID") == CurrentMenuSelectorID) {
				return true;
			} else {
				return false;
			}
		} else if (CurrentMenuFormID != undefined) {
			if (GetURLToken(TargetURL, "ekfrm") == CurrentMenuFormID) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
}

function HighlightBelow(obj)
{
	var BelowList = obj.parentNode.getElementsByTagName("UL");
	for (var x=0;x<BelowList.length;x++) {
		if (BelowList[x].parentNode == obj.parentNode) {
			BelowList[x].className = "MenuShowMe SelectedAnchor";
		}
	}
}

function HighlightAbove(obj)
{
	if (obj.id != "Menu") {
		if (obj.tagName.toLowerCase() == "ul") {
			obj.className = "MenuShowMe";
		}
		if (obj.tagName.toLowerCase() == "li") {
			obj.className = "MenuParent";
		}
		HighlightAbove(obj.parentNode);
	}
}

function MenuExpandCurrent()
{
	var m = document.getElementById("Menu");
	var AnchorList = m.getElementsByTagName("A");
	
	var CurrentURL = String(document.location);
	
	for (var x=0;x<AnchorList.length;x++) {
		var a = String(AnchorList[x].href);
		if (IsLinkToMe(CurrentURL, a)) {
			HighlightBelow(AnchorList[x]);
			HighlightAbove(AnchorList[x]);
			AnchorList[x].className="SelectedAnchor";
		}
	}
}

addLoadEvent(MenuExpandCurrent);