$(document).ready(function(){


    function bgImgFadeUp ( obj ) {
        $("#submast").fadeTo(4000, 0.9, bgImgFadeDown)
    }

    function bgImgFadeDown ( obj ) {
        $("#submast").fadeTo(4000, 0.4, bgImgFadeUp)
    }


    $("#contentwrap").fadeIn(2000);
    
    $(".lang a").fadeTo(0,0.4);
    $("#submast").mouseenter(
        function(event) {
            $(this).fadeTo(500, 0.8);
        }
    );
    $("#submast").mouseleave(
        function(event) {
            $(this).fadeTo(1000, 0.4);
        }
    );
    $(".menu a").mouseenter(
        function(event) {
            $(this).animate({ color: "#001177" }, 500)
        }
    );
    $(".menu a").mouseleave(
        function(event) {
            $(this).animate({ color: "black" }, 2000)
        }
    );

    $(".lang a").mouseenter(
            function(event) {
                $(this).animate({ color: "#001177" }, 500);
                $(this).fadeTo(500, 0.8);
            }
        );
    $(".lang a").mouseleave(
            function(event) {
                $(this).animate({ color: "black" }, 2000);
                $(this).fadeTo(1000, 0.4);
            }
        );
    
    
    
    var sC = "#001177";
    var eC = "#f7f7f7";

    $("a img").mouseenter(
        function(event) {
            $(this).animate({borderLeftColor: sC, borderTopColor: sC,
                             borderRightColor: sC, borderBottomColor: sC},500)
        }
    );
    $("a img").mouseleave(
        function(event) {
            $(this).animate({borderLeftColor: eC, borderTopColor: eC, 
                             borderRightColor: eC, borderBottomColor: eC},700)
        }
    );

    $(".thumb a img").mouseenter( function(event) { $(this).stop(); } );
    $(".thumb a img").mouseleave( function(event) { $(this).stop(); } );

});




