
$(document).ready(function () {
        $(".btn-ok").hover( /* IE 6 button :hover*/
                function () {
                    $(".btn-ok").css("background-position","0 -24px");
                },
                function () {
                    $(".btn-ok").css("background-position","0 0px");
            });
        $(".btn-login").hover( /* IE 6 button :hover*/
                function () {
                    $(".btn-login").css("background-position","0 -24px");
                },
                function () {
                    $(".btn-login").css("background-position","0 0px");
            });
        // stylish select
        $("#selectContinent, #selectCountry").sSelect({ddMaxHeight:'200px'});
        
            
                $("#selectContinent").change(function() {
                        var continentId = $("#selectContinent").val().split("_")[0];
                        var language = $("#selectContinent").val().split("_")[1];
                        jQuery.ajax({
                                url:"/sattler_elements/countryselect?continentId=" + escape(continentId) + "&language=" + escape(language),
                                dataType:"html",
                                type:"POST",
                                success:function(data) {
                                        $("#selectCountry").next().remove();
                                        $("#selectCountry").css("display", "block");
                                        var old = $("#selectCountry option:eq(0)").clone(true);
                                        $("#selectCountry").html(data).prepend(old).get(0).selectedIndex = 0;
                                        $("#selectCountry").sSelect({ddMaxHeight:'200px'});
                                    }
                            });
                    });
                $("#btnOk").click(function() {
                        $("#selectContinent").next().remove();
                        $("#selectContinent").css("display", "block");
                        $("#selectContinent").get(0).selectedIndex = 0;
                        $("#selectContinent").sSelect({ddMaxHeight:'200px'});
                        $("#selectCountry").next().remove();
                        $("#selectCountry").css("display", "block");
                        $("#countryId").val($("#selectCountry").val())
                        $("#selectCountry").get(0).selectedIndex = 0;
                        $("#selectCountry").sSelect({ddMaxHeight:'200px'});
                        $("#frm").submit();
                    });
            
        
        $(document).pngFix();
        
            // accordion
            $("ul.download-slider").accordion();
            $("a.btn-open").click(function () {
                    $('.download-slider li').removeClass("current");
                });
        
        // fancybox
        $("a.ansprechpartner").fancybox({
                width:382,
                height:362,
                padding:20,
                autoDimensions:false, 
                opacity:true,
                overlayOpacity:0.8
            });
        /* center Menus*/
        var noMenus = $(".top-navi a").size();
        var totalWidth = 0;
        var totalPadding = noMenus * 60;
        for(i = 0; i < noMenus; i++) {
            totalWidth += $('.top-navi').find('a').eq(i).width();
        }
        var sumaSumarum = totalWidth+totalPadding + 15;
        $(".top-navi-center").css("width", "" + sumaSumarum + "px");
    });