$(document).ready(function() {

    $('#header_slider').nivoSlider({
        captionOpacity: 0.4
    });

    $(".newsticker-jcarousellite").jCarouselLite({
        vertical: true,
        hoverPause: true,
        visible: 2,
        auto: 2000,
        speed: 1000
    });

    $(".skypebutton").hover(function() {
        $(".skypebutton img")
                    .animate({ top: "-12px" }, 200).animate({ top: "-6px" }, 200)
                    .animate({ top: "-9px" }, 100).animate({ top: "-6px" }, 100)
                    .animate({ top: "-8px" }, 100).animate({ top: "-6px" }, 100);
    });




    //first dropdown menu
    var timer, tmp = 0;

    $("#lnkKurumsal").hover(function() {
        tmp = 0;
        window.clearInterval(timer);
        $(this).next().css("opacity", 0.7).slideDown("fast");
    }, function() {
        timer = window.setInterval(checkOver, 400);
    });

    function checkOver() {
        if (tmp == 0) {
            window.clearInterval(timer);
            $("#lnkKurumsal").next().slideUp("fast");
        }
    }

    $("#lnkKurumsal").next().hover(function() {
        tmp = 1;
    }, function() {
        tmp = 0;
    });


    //second dropdown menu
    var timer2, tmp2 = 0;

    $("#lnkProjeler").hover(function() {
        tmp2 = 0;
        window.clearInterval(timer2);
        $(this).next().css("opacity", 0.7).slideDown("fast");
    }, function() {
        timer2 = window.setInterval(checkOver2, 400);
    });

    function checkOver2() {
        if (tmp2 == 0) {
            window.clearInterval(timer2);
            $("#lnkProjeler").next().slideUp("fast");
        }
    }

    $("#lnkProjeler").next().hover(function() {
        tmp2 = 1;
    }, function() {
        tmp2 = 0;
    });



    //third dropdown menu
    var timer3, tmp3 = 0;

    $("#lnkGayrimenkul").hover(function() {
        tmp3 = 0;
        window.clearInterval(timer3);
        $(this).next().css("opacity", 0.7).slideDown("fast");
    }, function() {
        timer3 = window.setInterval(checkOver3, 400);
    });

    function checkOver3() {
        if (tmp3 == 0) {
            window.clearInterval(timer3);
            $("#lnkGayrimenkul").next().slideUp("fast");
        }
    }

    $("#lnkGayrimenkul").next().hover(function() {
        tmp3 = 1;
    }, function() {
        tmp3 = 0;
    });

    
});
