function getInternetExplorerVersion() {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer') {
        var ua = navigator.userAgent;
        var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat(RegExp.$1);
    }
    return rv;
}


$(document).ready(function() {
	$("#nav > div > ul > li").hover(function() {
		$("ul", this).show();
	}, function() {
		$("ul", this).hide();
	});
	$('input#newsletterlogin').focus(function() {
		if (this.value == this.defaultValue){  
			this.value = '';  
		}
		if(this.value != this.defaultValue){  
			this.select();  
		}   
	});
	  
	$('input#newsletterlogin').blur(function() {
		if (this.value == ''){
			this.value = "E-mail"; 
		}  
	});  
});

if (getInternetExplorerVersion() < 8) {
	sfHover = function() {
		var sfEls = document.getElementById("nav").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" ie_does_hover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" ie_does_hover"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);
}
