﻿//avoid conflict with other script
$j = jQuery.noConflict();

$j(document).ready(function ($) {


   
    if ($(window).width() > 1400) {
        $(".LanguageSwitch").width(216);
        $(".LanguageSwitch").css("left", ($(window).width() - 216) + "px");  //216
        $(".LanguageSwitch").css("margin-left", "0px");
        $(".LanguageSwitch").css("top", "0px");
        $(".LanguageSwitch .DB").css("font-size", "8pt");
        $(".LanguageSwitch .DB").css("padding-top", "6px");
        $(".LanguageSwitch .DB").css("padding-bottom", "6px");
        $(".LanguageSwitch .DBLeft").css("border-top-left-radius", "0px");
        $(".LanguageSwitch .DBLeft").css("border-bottom-left-radius", "13px");
        $(".LanguageSwitch .DB").removeClass("DBRight");
        $(".LanguageSwitch .DB").width(65);

    }



    if ($j.browser.msie && parseInt($j.browser.version, 10) < 9) {

    } else {
        $j('#LogoTag').css({ display: 'none' });
        $j('#LogoTag').fadeIn({
            duration: 1500
        });


        var $floatingbox = $j('#LogoTag');
        var bodyY = 70;
        $(window).scroll(function () {

            var scrollY = $(window).scrollTop();
            var isfixed = $floatingbox.css('position') == 'fixed';

            $floatingbox.css({ opacity: 1 });


            if ($floatingbox.length > 0) {

                if (scrollY > bodyY && !isfixed) {
                    $floatingbox.stop().css({
                        position: 'fixed',
                        'top': '0px',
                        'margin-top': '-70px'

                    });
                } else if (scrollY < bodyY && isfixed) {
                    $floatingbox.css({
                        position: 'absolute',
                        'top': '0px',
                        'margin-top': '0px'

                    });
                }
            }
        });



    }

    $j('#SubMenuContent').css('margin-top', -25);
    $j("#SubMenuContent").animate(
        { marginTop: "0px" },
        { duration: 1000 }
        );

});
