$(function(){

	$(".menuIc ul li:last a").css("background", "none");
	$("ul.Resim li:not(:first)").hide();
	$("ul.Buton li:first").addClass("aktif");
	$("ul.Buton li").hover(function(){
		var tiklanan = $(this).index();
		$("ul.Resim li").hide();
		$("ul.Resim li:eq("+tiklanan+")").show();
		$("ul.Buton li").removeClass("aktif");
		$(this).addClass("aktif");
		/*return false*/
	});
	
	// HEADLINE CYCLE
	$("#slider ul.Resim").cycle({
		fx: 'shuffle',
		delay: 0,
		pause: 1
	});
	
	var toplamHaber = $(".haber").length;
	for (var i = 0; i <= toplamHaber; i++){
		if (i % 2 == 1){
			$(".haber:eq("+i+")").css("border-right", "0");
		}
	}
	
	$(".haber:gt(1)").css("border-bottom", "0");
	$(".blok ul li:last").css("border-right", "0");
	
	// VIDEO
	$(".vV li:not(:first)").hide();
	$(".videoButon a:first span").show();
	$(".videoButon a").click(function(){
		$(".videoButon a span").hide();
		$("span", this).show();
		$(".vV li").hide();
		var a = $(this).index();
		$(".vV li:eq("+a+")").show();
		return false
	});
	
	$(".menuIc ul li").hover(function(){
		$(this).addClass("aktif");
		$("ul", this).show();
		
	}, function(){
		$(this).removeClass("aktif");
		$("ul", this).hide();
		
	});
	
	$(".side").hover(function() {
		$(".sideMenu").hide();
	}, function() {
		$(".sideMenu").hide();
	});
	
	$("iframe").each(function(){
        var ifr_source = $(this).attr('src');
        var wmode = "wmode=transparent";
        if(ifr_source.indexOf('?') != -1) {
            var getQString = ifr_source.split('?');
            var oldString = getQString[1];
            var newString = getQString[0];
            $(this).attr('src',newString+'?'+wmode+'&'+oldString);
        }
        else $(this).attr('src',ifr_source+'?'+wmode);
    });
	
	// PHOTO GALLERY
	$(".fotoIc ul li a").hover(function(){
		$("span", this).fadeIn(200);
	}, function(){
		$("span", this).fadeOut(200);
	});
	
	$("a[rel=external]").attr("target", "_blank");
	
	Cufon.now();
	
	Cufon.replace(".menuIc ul li a", {
		hover: true
	});
	
	Cufon.replace(".vBas h4, .hBaslik h3, .vBas span a, .hbSag a", {
		hover: true
	});
	
	Cufon.replace(".vBas h4", {
		hover: true,
		textShadow: "1px 0 0 #154778"
	});

});
