// ----------------------------------------------------------------------------
// Browser detection (Could be improved)
// ----------------------------------------------------------------------------
var Browser = function(){
	var w      = window;
	var d      = w.document;
	var ua     = navigator.userAgent.toLowerCase();
	this.ie    = w.VBArray;
	if(this.ie){
		var intIeVersion = parseInt(ua.match(/msie (\d+)/)[1], 10);
		this.ie5   = (!d.createEventObject || !d.namespaces);
		this.ie55  = (!d.implementation);
		//this.ie6   = (d.implementation);
		this.ie6   = intIeVersion==6;
		//this.ie7   = (w.XMLHttpRequest);
		this.ie7   = intIeVersion==7;
	}
	this.opera = w.opera;
	this.gecko = (w.netscape && !this. opera);
	this.khtml = (ua.indexOf("safari")+1 || ua.indexOf("konqueror")+1);
};
var objBrowser = new Browser();


// ----------------------------------------------------------------------------
// Onload Function for IE6
// ----------------------------------------------------------------------------
sfHover = function(){
	var sfEls = document.getElementById("nav-primary").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++){
		sfEls[i].onmouseover=function(){
			this.className+=" sfhover";
		};
		sfEls[i].onmouseout=function(){
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		};
	}
};
// ----------------------------------------------------------------------------
// Detect IE6 and attach OnLoad Function
// ----------------------------------------------------------------------------
if (window.attachEvent && objBrowser.ie6){
	window.attachEvent("onload", sfHover);
}