/*
*	@JavaScript Dosyası
*	@Tayfun Erbilen
*/

$(function(){

	$("#kategoriler ul li").hover(function(){
		$(this).animate({backgroundColor: "#f1f1f1"}, "fast");
	}, function(){
		$(this).animate({backgroundColor: "#fff"}, "fast");
	});
	
	$("#etiketler a").hover(function(){
		$(this).animate({backgroundColor: "#f3f6e8"}, "fast");
	}, function(){
		$(this).animate({backgroundColor: "#fff"}, "fast");
	});
	
	$(".copyright a").hover(function(){
		$(this).animate({backgroundColor: "#000", color: "#fff"}, "fast").css("text-shadow","none");
	}, function(){
		$(this).animate({backgroundColor: "#f1f1f1", color: "#656565"}, "fast");
	});
	
	$("#solVideoListe li a").hover(function(){
		$("span.vlSure", this).animate({marginRight : "-40px"}, 230);
		$("span.vlPlay", this).fadeIn(230);
	}, function(){
		$("span.vlSure", this).animate({marginRight : "0"}, 230);
		$("span.vlPlay", this).fadeOut(230);
	});
	
	$("#girisYap").click(function(){
		var ekranYukseklik = $(window).height()/4;
		$("body").prepend('<div id="karart"></div>');
		$("#girisForm").animate({top: ekranYukseklik+"px"}, 500);
	});
	
	$("#karart").live("click", function(){
		$(this).fadeOut();
		$("#girisForm").animate({top: "-400px"}, 300);
	});
	
	/* Tipsy */
	$("[rel=_prototurk]").tipsy({gravity: 's'});
	
	var videoDeger = 0;
	$("#genislet").click(function(){
		if (videoDeger == 0){
			$("#sag").animate({marginTop : "506px"});
			$(".videoKod").delay(100).animate({width : "950px", height: "450px"});
			$(".videoBlok h2").delay(100).animate({width : "950px"});
				$(".videoBlok h2 span").text("Videoyu Küçült");
			videoDeger++;
		}else {
			$(".videoKod").animate({width: "690px", height: "300px"});
			$(".videoBlok h2").animate({width : "690px"});
				$(".videoBlok h2 span").text("Videoyu Genişlet");
			$("#sag").delay(130).animate({marginTop : "0"});
			videoDeger = 0;
		}
	});
	
	$("#yorumYap textarea").click(function(){
		$(this).animate({height: "60px"}, 350);
		$("#yGonder").fadeIn();
	});
	
	$("#yGonder span").click(function(){
		$("#yorumYap textarea").animate({height: "15px"}, 350);
		$("#yGonder").hide();
	});
	
	$(".yorum").hover(function(){
		$(".cevapla", this).show();
	}, function(){
		$(".cevapla", this).hide();
	});
	
	$(".cevapla").click(function(){
		var kim = $(this).next("strong").text();
		$(this).parent().next(".yorumaYorumYap").slideDown();
		$(this).parent().next(".yorumaYorumYap").find("textarea").val(kim + ", ");
	});
	
	$(".yyyGizli span").click(function(){
		$(this).parent().parent().slideUp();
	});
	
	$(".alt_yorum:even").css("background-color","#f1f1f1");
	
	$("#formKapat").click(function(){
		$("#karart").fadeOut();
		$("#girisForm").animate({top: "-400px"}, 300);
	});

});
