//NIVOSLIDER//
$.fn.cycle.defaults.timeout = 10000;
$(function() {
    $('.stat1').cycle({
        fx: 'scrollDown',
        easing: 'bounceout',
        delay: -6000
    });
    $('.stat2').cycle({
        fx: 'scrollDown',
        easing: 'bounceout',
        delay: -5000
    });
    $('.stat3').cycle({
        fx: 'scrollDown',
        easing: 'bounceout',
        delay: -4000
    });
    $('.stat4').cycle({
        fx: 'scrollDown',
        easing: 'bounceout',
        delay: -3000
    });
    $('.stat5').cycle({
        fx: 'scrollDown',
        easing: 'bounceout',
        delay: -2000
    });
});


//MENU//
$(document).ready(function() {
    $("ul.topnav li span").click(function() {
        $(this).parent().find("ul.subnav").slideDown('fast').show();
        $(this).parent().hover(function() {
        }, function() {
            $(this).parent().find("ul.subnav").slideUp('slow');
        });
    }).hover(function() {
        $(this).addClass("subhover");
    }, function() {
        $(this).removeClass("subhover");
    });
});


//ACCORDION//
function initMenu() {
    $('.menu ul').hide();
    $('.menu ul:first').show();
    $('.menu li a').click(
    function() {
        var checkElement = $(this).next();
        if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {
            return false;
        }
        if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
            $('.menu ul:visible').slideUp('normal');
            checkElement.slideDown('normal');
            $('.menu li a').css;

            return false;
        }
    }
    );
}
$(document).ready(function() { initMenu(); });


//HABERLER SLIDER //
jQuery(function() {
    jQuery("#jcarousellite1").jCarouselLite({
        vertical: true,
        hoverPause: true,
        visible: 4,
        auto: 2000,
        speed: 400,
        btnNext: "#sag-kolon-yorumlar .yorum-buton div a.down",
        btnPrev: "#sag-kolon-yorumlar .yorum-buton div a.up"
    });
});
var aktif = 1;
var timer;

//MAKALESLĘDER//
$(document).ready(function() {
    $("#alan div").hide();
    $("#alan div:first").show();
    timer = setInterval(degistir, 5000);

    $("#alan div").mouseover(function() {
        clearInterval(timer);
    }).mouseout(function() {
        timer = setInterval(degistir, 5000);
    });
});
function degistir() {
    $("#alan div:nth-child(" + aktif + ")").slideUp(200);
    aktif = (aktif + 1) % $("#alan div").length;
    if (aktif == 0) aktif = $("#alan div").length;
    $("#alan div:nth-child(" + aktif + ")").slideDown(300);
}
