﻿var reklam;
//function arama_kutusu(event) {
//    if (event.keyCode == 13) {
//        var butonlar = document.getElementById('anasayfa_arama').getElementsByTagName('a');
//        for (var buton in butonlar) {
//            if (butonlar[buton].className && butonlar[buton].className == "anasayfa_arama_buton") {
//                __doPostBack(butonlar[buton].id.replace(/_/, '$'), '');
//                return false;
//            }
//        }
//    }
//    return true;
//}


jQuery(document).ready(function() {
    jQuery('#uyelik input[@type="text"]').attr('value', 'Kullanıcı adı');
    jQuery('#uyelik input[@type="password"]').attr('value', 'Parola');
    jQuery('.anasayfa_arama_input').attr('value', 'Tarif adı yazarak arayabilirsiniz');
    jQuery('#uyelik input[@type="text"]').focus(function() {
        if (jQuery(this).attr('value') == 'Kullanıcı adı') {
            jQuery(this).attr('value', '');
        }
    });
    jQuery('#uyelik input[@type="password"]').focus(function() {
        $(this).attr('value', '');
    });
    jQuery('#uyelik input[@type="text"]').blur(function() {
        if (jQuery(this).attr('value') == '') {
            jQuery(this).attr('value', 'Kullanıcı adı');
        }
    });

    jQuery('.anasayfa_arama_input').focus(function() {
    if (jQuery(this).attr('value') == 'Tarif adı yazarak arayabilirsiniz') {
            jQuery(this).attr('value', '');
        }
    });
    jQuery('.anasayfa_arama_input').blur(function() {
        if (jQuery(this).attr('value') == '') {
            jQuery(this).attr('value', 'Tarif adı yazarak arayabilirsiniz');
        }
    });
    
    jQuery("#urun_ana_sayfa_container").cycle({ fx: 'fade', timeout: 10000 });
    jQuery("#hamur_isi_tarifler_cycle").cycle({ fx: 'fade', timeout: 5000 });
    jQuery("#haberler_cycle").cycle({ fx: 'scrollVert', timeout: 3000 });
    jQuery("#kampanya_cycle").cycle({ fx: 'scrollHorz', timeout: 5000
        , prev: '#kampanya_onceki', next: '#kampanya_sonraki'
    });
    jQuery("#kampanya_onceki,#kampanya_sonraki").click(function(e) {
        e.preventDefault();
        jQuery(this).blur();
        return false;
    });

    jQuery("#tv_reklam_kapat").click(function(e) {
        e.preventDefault();
        jQuery("#video").html("");
        jQuery("div.tv_reklam").hide();
        jQuery(this).blur();
        return false;
    });

    //setTimeout("jQuery('#tv_reklam_kapat').click()", 30000);

    jQuery("#makaleler").click(function(e) {
        e.preventDefault();
        jQuery("#gunluk_burc_icerik").hide();
        jQuery("#ivillage_icerik").show();
        jQuery("#gunluk_burc").removeClass("gunluk_burc_aktif").addClass("gunluk_burc_pasif");
        jQuery("#makaleler").removeClass("makaleler_pasif").addClass("makaleler_aktif");
        jQuery(this).blur();
        return false;
    });

    jQuery("#gunluk_burc").click(function(e) {
        e.preventDefault();
        jQuery("#ivillage_icerik").hide();
        jQuery("#gunluk_burc_icerik").show();
        jQuery("#gunluk_burc").removeClass("gunluk_burc_pasif").addClass("gunluk_burc_aktif");
        jQuery("#makaleler").removeClass("makaleler_aktif").addClass("makaleler_pasif");
        jQuery(this).blur();
        return false;
    });

    if (animasyon && jQuery.browser.msie && jQuery.browser.version == "6.0") {
        jQuery("div.tv_reklam").show().animate({ left: "50%" }, 3000);
        reklam = new SWFObject("yuvaMayaFlv.swf", "yuvaMayaFlv", "320px", "250px", "9", "#000000");
        reklam.addParam("menu", "false");
        setTimeout("reklam.write('video')", 3000);
    }
});

function videoPenceresiniKapat()
{
    jQuery('#tv_reklam_kapat').click();
}

jQuery(window).ready(function(){
    if(animasyon)
    {
        jQuery("div.tv_reklam").show().animate({left:"50%"}, 3000);
        reklam = new SWFObject("yuvaMayaFlv.swf","yuvaMayaFlv", "320px", "250px", "9", "#000000");
	    reklam.addParam("menu", "false");
	    setTimeout("reklam.write('video')", 3000);
	}
	
	gunluk_burc_degistir();
	
    jQuery("#burclar").change(function(){
        gunluk_burc_degistir();        
    });	
});

function gunluk_burc_degistir()
{
    var b = document.getElementById("burclar");
    var burclar = ["koc", "boga", "ikizler", "yengec", "aslan", "basak", "terazi", "akrep", "yay", "oglak", "kova", "balik"];
    jQuery("#burc_icerik").html(gunluk_burc[b.options[b.selectedIndex].value] + ' &raquo');
    jQuery("#burc_icerik").attr("href", "http://astroloji.ivillage.mynet.com/fal/gunluk/"
        + burclar[parseInt(b.options[b.selectedIndex].value)]);
    jQuery("#burc").html(b.options[b.selectedIndex].text);
    //alert(burclar[parseInt(b.options[b.selectedIndex].value)]);
}