﻿/* Anasayfa Manşet Haber Animasyonu (jQuery) // Emrah Zengin (emrahzengin@gmail.com)  // Temmuz // 2009 */
var bAnimation = true;
function ShowMainNews(n) { $("a.bignews").hide(); $("a.bignews").eq(n).show(); $("div.front-news-content").hide(); $("div.front-news-content").eq(n).show();
    $("#front-news-thumbs a").removeClass("smallnewshover"); $("#front-news-thumbs a").eq(n).addClass("smallnewshover"); $("#front-news-thumbs a").eq(n).find("img").fadeTo("fast", 1);
    $('#front-news-thumbs img:not(a.smallnewshover img)').fadeTo("fast", 0.50);
}
var slideShowSpeed = 3000; var t; var ftx = -1;
function MainAnimation() { if (bAnimation) { ftx++; if (ftx > 4) { ftx = 0; } ShowMainNews(ftx); } t = setTimeout('MainAnimation()', slideShowSpeed); }
$(document).ready(function() {
    $("#front-news-thumbs a").each(function(i) { var n = i; $(this).bind("mouseenter", function(e) { ShowMainNews(n); ftx = n; bAnimation = false; }); $(this).bind("mouseleave", function(e) { bAnimation = true; }); });
    $("#front-news-content-wrapper").bind("mouseenter", function(e) { bAnimation = false; }); $("#front-news-big").bind("mouseenter", function(e) { bAnimation = false; });
    $("#front-news-content-wrapper").bind("mouseleave", function(e) { bAnimation = true; }); $("#front-news-big").bind("mouseleave", function(e) { bAnimation = true; });
    MainAnimation();

    /*$('div#front-anouns-items').cycle({
    fx: 'scrollLeft',
    timeout: 4000,
    speed: 5000,
    pause: 1,
    easeIn: 'bounceout',
    easeOut: 'backin',
    next: '#front-anouns-header-arrow-next',
    prev: '#front-anouns-header-arrow-prev' 
    });
    */

    $('div#front-anouns-items').cycle({
    fx: 'custom',
        cssBefore: {  
            left: 440,  
            top:  0,  
            width: 0,  
            height: 0,  
            opacity: 1, 
            zIndex: 1 
        }, 
        animOut: {  
            opacity: 0  
        }, 
        animIn: {  
            left: 0,  
            top: 0,  
            width: 440,  
            height: 30  
        }, 
        cssAfter: {  
            zIndex: 0 
        },
        delay: -5000,
        timeout: 5000,
        speed: 1000,
        next: '#front-anouns-header-arrow-next',
        prev: '#front-anouns-header-arrow-prev',
        pause: 1
    });
    
    
    
    
    });