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;
}

function mainmenu(){
$("#nav ul ul").css({display: "none"});
$("#nav ul li").hover(function(){
	if(getInternetExplorerVersion() == 6 || getInternetExplorerVersion() == 7 || getInternetExplorerVersion() == 8) {
		$(this).find('ul:first').show();
	} else {
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(300);
	}
},function(){
	$(this).find('ul:first').hide();
});
}

$(function() {
	mainmenu();
	
	$('#nav ul ul li:first-child').addClass('first');
	$('#nav ul ul li:last-child').addClass('last');
	
	$('#nav li.menu-item-721 a, #nav li.menu-item-722 a').attr({"target":"_blank"});
	
	$('#nav ul ul').parent('li').append('<span class="arrow"></span>');
	
	$('.postlist .archivepost:last').addClass('archivepostlast');
	
	var numberofslides = $('#banner .slider li').size();
	var currentslide = 0;
	$('#banner .arrowleft a').click(function() {
		currentslide = currentslide-1;
		if(currentslide == -1) { currentslide = numberofslides - 1; }
		$('#banner .slider li').fadeOut();
		$('#banner .slider li').eq(currentslide).fadeIn();
		return false;
	});
	$('#banner .arrowright a').click(function() {
		currentslide++;
		if(currentslide == numberofslides) { currentslide = 0; }
		$('#banner .slider li').fadeOut();
		$('#banner .slider li').eq(currentslide).fadeIn();
		return false;
	});
	
	
});
