$(document).ready(function(){
    if ($.browser.msie && $.browser.version < 7) return;
    
    $('#mainnav li')
        .removeClass('highlight')
        .find('a')
        .append('<span class="hover" />').each(function () {
                var $span = $('> span.hover', this).css('opacity', 0);
                $(this).hover(function () {
                    // on hover
                    $span.stop().fadeTo(500, 1);
                }, function () {
                    // off hover
                    $span.stop().fadeTo(500, 0);
                });
            });
            
});

// Image Toggle (#mainnav und #menu)
$(document).ready(function(){

	$("#mainnav img, .hoverme img")
	.mouseover(function(){
		this.src = this.src.replace("_n","_h");
		}
	)
	.mouseout(function(){
		this.src = this.src.replace("_h","_n");
		}
	)
});

// CENTER
	(function ($) {
	$.fn.vAlign = function() {
	    return this.each(function(i){
	    var h = $(this).height();
	    var oh = $(this).outerHeight();
	    var mt = (h + (oh - h)) / 2;	
	    $(this).css("margin-top", "-" + mt + "px");	
	    $(this).css("top", "50%");
	    $(this).css("position", "absolute");	
	    });	
	};
	})(jQuery);
	
	(function ($) {
	$.fn.hAlign = function() {
	    return this.each(function(i){
	    var w = $(this).width();
	    var ow = $(this).outerWidth();	
	    var ml = (w + (ow - w)) / 2;	
	    $(this).css("margin-left", "-" + ml + "px");
	    $(this).css("left", "50%");
	    $(this).css("position", "absolute");
	    });
	};
	})(jQuery);
	
	$(document).ready(function() {
	   //$("#mainnav").vAlign();
	   //$("#mainnav").hAlign();
	});




