function schnellauswahl(eingabe){
    document.location.href = "../index.html?idcat=" + eingabe.hidden.val();
};

$(function(){

    $(".scrollbar").jScrollPane({
        showArrows: true
    });
    
    $("a[href^='http://']").attr("target","_blank");
    
    $("#suche input:text").focus(function(){
        if($(this).val() == "Suche"){
            $(this).val("");
        };
    }).blur(function(){
        if($(this).val() == ""){
            $(this).val("Suche");
        };
    });
    
    $("ul").each(function(){
        if($(this).children().length == 0){
            $(this).remove();
        };
    });
    
    $("table").attr("cellpadding","0").attr("cellspacing","0");
    
    $("a[href^='http://']").attr("target","_blank");
    $("#navi_cover").height($("#holder").height());
    
    $('#nivo-slider').nivoSlider({
        directionNav: false,
        pauseOnHover: false,
        effect: 'fold',
        pauseTime: 5000,
        animSpeed: 1000
    });
    
    $("#reiter_rechts").tabs();
    if($.trim($("#reiter-2").text()) == ""){
        $("a.reiterlink[href='#reiter-2']").parent().remove();
    };
    if($("a.reiterlink[href='#reiter-1']").text() == "" && $("a.reiterlink[href='#reiter-2']")){
        $("#reiter_rechts .ui-tabs-nav").remove();
        $("#reiter-1").remove();
        $("#reiter-2").remove();
    };
    
    news1_text = $("#spalte_links .item.news_1 h3 a").text();
    $("#spalte_links .item.news_1 h3 a").replaceWith("<span>"+news1_text+"</span>");
    
    $(".ie7 br.stopper").replaceWith("<span class='stopper'></span>");
    
    $("#hauptnavigation select").sexyCombo({
        emptyText: "Schnellauswahl...",
        hideListCallback: function(){
            schnellauswahl(this);
        }
    });
    $(".kontaktformular select").sexyCombo();
    $(".sexy.combo input:text").attr("readonly","readonly");
    
    /*
    $("#hauptnavigation li").mouseenter(function(){
        $("#navi_cover").show();
    });
    $("#hauptnavigation").mouseleave(function(){
        $("#navi_cover").hide();
    })
    */
    
});
