$(function(){

// Biografi - Link rengi animasyonu

   $(".header-right a").hover(function(){

      $(this).stop().animate({ color : "#AAA" }, 200, function(){ $(this).animate({ color : "#666" }); });

   }, function(){ $(this).stop().animate({ color : "#CC6600" }); });

// Açılır menü

   $(".primary-menu li").hover(function(){ 

      $(this).find("ul:first").slideDown();
	  $(this).find("a:first").addClass("p-menu-hover");
   
   }, function(){ 
   
      $(this).find("ul:first").slideUp();
	  $(this).find("a:first").removeClass("p-menu-hover");

   });

// Açılır menü - Padding animasyonu

   $(".primary-menu li li a").hover(function(){

      $(this).animate({ paddingLeft : "25px" }, 300);

   }, function(){

      $(this).animate({ paddingLeft : "15px" }, 300);

   });
   
// Sosyal Medya İkonları

   $(".follow-me-content li img").css({ opacity : "0.7" });
   
   $(".follow-me-content li img").hover(function(){

	  $(this).stop().animate({ opacity : "1" });
	  
   }, function(){

      $(this).stop().animate({ opacity : "0.5" });
      
   });

// Respect

   var respect = '<div class="respect"><p>Tema yapımcısının linkini silmemenizi öneririm. Eğer özel bir durumunuz varsa cdemir1991@gmail.com adresinden iletişime geçebilirsiniz.</p></div>';

// Yazı Başlığı - Link Animasyonu

   $(".article-title a").hover(function(){

      $(this).stop().animate({ color : "#CCC" }, 150, function(){ $(this).animate({ color : "#CC6600" }); });

   }, function(){ $(this).stop().animate({ color : "#666" }); });

// Küçük Resim için renk animasyonu

   $(".article-thumbnail img").hover(function(){

      $(this).stop().animate({ backgroundColor : "#CC6600" });

   }, function(){

      $(this).stop().animate({ backgroundColor : "#EBEBEB" });

   });

// Paylaş - Yeni pencere

   $('.article-share a[href^="http://"]').attr("target", "_blank");
   
// Yan Menü - Link Animasyonu

   $(".widget a, .tab_content a").hover(function(){

      $(this).stop().animate({ color : "#CCC" }, 150, function(){ $(this).animate({ color : "#CC6600" }); });

   }, function(){ $(this).stop().animate({ color : "#666" }); });

// Çift sütunlu bileşenlerde hizalama sorunu giderildi

   $(".blogroll").find("li:odd").css("margin-right","0");
   
   $(".cat-item").parent().css("margin-left","-10px");

// Reklamlar

   $(".ad-125 img:even").css("margin-right","10px");
   
   $(".ad-125 img, .tab_avatar img").hover(function(){

      $(this).stop().animate({ backgroundColor : "#CC6600" });

   }, function(){

      $(this).stop().animate({ backgroundColor : "#FFF" });

   });

// Tab Menu

   $('#tabs').tabs({ 
					  
      fx: { opacity: 'toggle', duration: 'fast' }
      
   }).bind('select.ui-tabs', function(e, ui) { alert('event: ' + e.type);

   }).bind('show.ui-tabs', function(e, ui) { alert('event: ' + e.type);

   });

// Tab Menu - Etiketler
   
   $(".tab_tags a").hover(function(){

      $(this).stop().animate({

         backgroundColor : "#000"

      }, 500);

   }, function(){

      $(this).stop().animate({

         backgroundColor : "#487695"

      }, 500);

   });

// Sağ panel

   $("a#searchh").toggle(function(){ $(".search").slideDown(); }, function(){ $(".search").fadeOut(200); });
   
   $("a#rsss").toggle(function(){ $(".rss").slideDown(); }, function(){ $(".rss").fadeOut(200); });

// Yukarı ışınla

   $(window).scroll(function() {
							 
      if($(this).scrollTop() != 0) { $('.jump').fadeIn(); } else { $('.jump').fadeOut(); }
	  
   });

   $('.jump').click(function() { $('body,html').animate({ scrollTop:0 },750); });

// Emeğe saygı...

   var authorHref = $(".footer-middling p:last a:last").attr("href");
   
   var authorText = $(".footer-middling p:last a:last").text();

   if ( authorHref == "http://www.cemdemir.net" && authorText == "Cem Demir" ) {  }
   else { $("body").empty().append(respect) }
   
// İkincil menüde ilk elemanın hizalama sorunu giderildi

   $(".footer-middling li:first").css({ paddingLeft : "0", border : "0" });

// Yorumlar - İlk yorumun çerçeve sorunu giderildi

   $(".article-comments li:first").css("border","0");

// Yorum yazma

   $(".leave-comment-text").focusin(function(){

      $(this).css("outline","none"); $(this).stop().animate({ width : "200px", backgroundColor : "#FFF" });

   });
   
   $(".leave-comment-text").focusout(function(){

      $(this).css("outline","none"); $(this).stop().animate({ width : "130px", backgroundColor : "#FAFAFA" });
	  
   });
   
   $(".leave-comment-textarea").focusin(function(){ $(this).css("outline","none"); $(this).stop().animate({ backgroundColor : "#FFF" }); });
   
   $(".leave-comment-textarea").focusout(function(){ $(this).css("outline","none"); $(this).stop().animate({ backgroundColor : "#FAFAFA" }); });
   
   $(".leave-comment-submit").hover(function(){ $(this).stop().animate({ backgroundColor : "#333" }, 500); 

   }, function(){ $(this).stop().animate({ backgroundColor : "#CC6600" }, 500); });
   
   $(".writeName").focusin(function(){ var vl = $(this).val(); if(vl == "İsim") { $(this).val(""); } });
   
   $(".writeName").focusout(function(){ var vl = $(this).val(); if (vl == "") { $(this).val("İsim"); } });
   
   $(".writeMail").focusin(function(){ var vl = $(this).val(); if(vl == "Mail") { $(this).val(""); } });
   
   $(".writeMail").focusout(function(){ var vl = $(this).val(); if (vl == "") { $(this).val("Mail"); } });
   
   $(".writeWebsite").focusin(function(){ var vl = $(this).val(); if(vl == "Website") { $(this).val(""); } });
   
   $(".writeWebsite").focusout(function(){ var vl = $(this).val(); if (vl == "") { $(this).val("Website"); } });
   
   $(".writeComment").focusin(function(){ var vl = $(this).text(); if(vl == "Mesaj") { $(this).text(""); } });
   
   $(".writeComment").focusout(function(){ var vl = $(this).text(); if (vl == "") { $(this).text("Mesaj"); } });
   
   $(".search-text").focusin(function(){ $(this).css("outline","none"); var vl = $(this).val(); if(vl == "Arama") { $(this).val(""); } });
   
   $(".search-text").focusout(function(){ $(this).css("outline","none"); var vl = $(this).val(); if (vl == "") { $(this).val("Arama"); } });
   
   $(".rss-text").focusin(function(){ $(this).css("outline","none"); var vl = $(this).val(); if(vl == "Mail Adresiniz") { $(this).val(""); } });
   
   $(".rss-text").focusout(function(){ $(this).css("outline","none"); var vl = $(this).val(); if (vl == "") { $(this).val("Mail Adresiniz"); } });
   
   $(".try-again").focusin(function(){ 

      $(this).css("outline","none"); 
	  var vl = $(this).val(); 
	  if(vl == "Tekrar deneyin" || vl == "Aramayı deneyin") { $(this).val(""); } 

   });
   
});
