try {
	document.execCommand('BackgroundImageCache', false, true);
}
catch(e) {}

sfHover = function() {
	var isIE = /msie|MSIE/.test(navigator.userAgent);
	var sfEls = document.getElementById("nav_main").getElementsByTagName("LI");
	var docLocation = "" + document.location;
	var fileName = GetFileName(docLocation);
	var current = false;
	for (var i=0; i<sfEls.length; i++) {
		if ((current == false) && (sfEls[i].id == fileName)) {
			sfEls[i].className+=" current";
			current = true;
		}
		if (isIE == true) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
				child = this.childNodes[0];
				reposition(child);
			}
		}
		if (isIE == true) {
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
				child.style.marginTop = "auto";
			}
		}
	}
}

function reposition(el) {
	var parent;
	var x = 1;
	var isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
	oldParentEl = el;
	oldSiblingEl = el;
	
	while (el.parentNode != null) {
		if (el.parentNode.id == "nav_main") {
			parent = el.parentNode;
			break;
		}
		else {
			el = el.parentNode;
		}
		x++;
	}
	if ((parent != null) && (x >= 5)) {
		var sibling;
		while (oldParentEl.nextSibling != null) {
			if ((oldParentEl.nextSibling.tagName) && (oldParentEl.nextSibling.tagName.toLowerCase() == "ul")) {
				sibling = oldParentEl.nextSibling;
				if (isIE6 == true)
					sibling.style.marginTop = "-"+((oldSiblingEl.offsetHeight)-3)+"px";
				else
					sibling.style.marginTop = "-"+(oldSiblingEl.offsetHeight)-1+"px";
				break;
			}
			else {
				oldParentEl = oldParentEl.nextSibling;
			}
		}
		
	}
}

function GetFileName(url) {
	var f = /([^\/\\]+)$/.exec(url) || ['',''];
	f = /^([^\.]+)(\.\w+)?/.exec(f[1]);
	return f[1];
}