$(function() {

    if($(".newsbild").length > 0){
        $(".newsbild").parent().prev().css({
            "margin-left": "400px",
            "margin-top": "30px"
        });
        $(".newsbild").css("margin-top","-45px");
    };
    
    $("#subNav li").hover(function(){
        $(this).addClass("iehover");
    }, function(){
        $(this).removeClass("iehover");     
    });
    
    $("#visual li").hover(function(){
        $(this).addClass("h");
        $("div", this).show();
    }, function(){
        $(this).removeClass("h");
        $("div", this).hide();
    });
    
    if($("select.ufd").length > 0){
        $("select.ufd").ufd();
    };
    
    $("#next, #prev").click(function(e){
         e.preventDefault();
         var buttonId = this.id,
         buttonClass = (buttonId == "prev") ? ".nivo-prevNav" : ".nivo-nextNav";
         $(".nivo-directionNav").find(buttonClass).click();
    });

    if($("#slider").length > 0){
        $("#slider").nivoSlider({
            effect: 'fade',
            pauseTime: 4000,
            controlNav: false,
            directionNav: true,
            pauseOnHover: true,
            boxCols: 12,
            boxRows: 4
        });
    };
    
});
