$(document).ready(function () {	
$('.step1').click(function () {	
$('#populer-tab').css({'background-position': '0 0'}); 
$('#populer-tab li.step2 span').removeClass('active'); 
$('#populer-tab li.step1 span').addClass('active');
$("#news-tab .tab").hide();
$("#news-tab #sondakika").show();

});
$('.step2').click(function () {	
$('#populer-tab').css({'background-position': '0 -31px'}); 
$('#populer-tab li.step1 span').removeClass('active'); 
$('#populer-tab li.step2 span').addClass('active'); 
$("#news-tab .tab").hide();
$("#news-tab #populer").show();

});


$("input:text, textarea, input:password").each(function(){
	if(this.value == '')
		this.value = this.title;
});
$("input:text, textarea, input:password").focus(function(){
	if(this.value == this.title)
		this.value = '';
});
$("input:text, textarea, input:password").blur(function(){
	if(this.value == '')
		this.value = this.title;
});
$("input:image, input:button, input:submit").click(function(){
	$(this.form.elements).each(function(){
		if(this.type =='text' || this.type =='textarea' || this.type =='password' ){
			if(this.value == this.title && this.title != ''){
				this.value='';
			}
		}
	});
});

$(document).ready(function () {	
$(".tabcontent li .hiddentext:first").show();
$(".tabcontent li .list:first").hide();	
$('.tabcontent li').hover(
  function() {
	  $(".tabcontent li .hiddentext").hide();
	  $(".tabcontent li .list").show();
	   var hiddentext = $(this).find(".hiddentext").index(this);
	   var listtext	  = $(this).find(".list").index(this);
	   $(this).find(".hiddentext").eq(hiddentext).show();
	   $(this).find(".list").eq(listtext).hide();
  },function() {
	   var hiddentext = $(this).find(".hiddentext").index(this);
	   var listtext	  = $(this).find(".list").index(this);
	   $(this).find(".hiddentext").eq(hiddentext).show();
	   $(this).find(".list").eq(listtext).hide();

  });
});


$(".slider").jCarouselLite({
    btnNext: ".next",
    btnPrev: ".prev",
    auto: 2000,
    speed: 1500,
	visible: 4	
});

$(".fslider").jCarouselLite({
    btnNext: ".next",
    btnPrev: ".prev",
    auto: 2000,
    speed: 1500,
	visible: 6	
});


$("#yazarslider").jCarouselLite({
    btnNext: ".ynext",
    btnPrev: ".yprev",
	visible: 4,
    vertical: true
});

$("#piyasalar").jCarouselLite({
    btnNext: ".knext",
    btnPrev: ".kprev",
	visible: 1,
    vertical: true
});


$("#galeri-slide").jCarouselLite({
    btnNext: ".gnext",
    btnPrev: ".gprev",
    circular: true,
    beforeStart: function(a) {$(a).parent().hide();},
    afterEnd: function(a) {$(a).parent().show();},
    visible: 1
});




$(".slider li, #slide-galery .list li").hover(function(){$(this).find(".text").show()},function(){$(this).find(".text").hide()});

var originalFontSize = $('.newsdetail .text').css('font-size');
$(".fontdefault").click(function(){
$('.newsdetail .text').css('font-size', originalFontSize);
});

$(".fontup").click(function(){
var currentFontSize = $('.newsdetail .text').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*1.2;
$('.newsdetail .text').css('font-size', newFontSize);
return false;
});

$(".fontdown").click(function(){
  	var currentFontSize = $('.newsdetail .text').css('font-size');
 	var currentFontSizeNum = parseFloat(currentFontSize, 10);
    var newFontSize = currentFontSizeNum*0.8;
	$('.newsdetail .text').css('font-size', newFontSize);
	return false;
  });

$('.print').click(function(){
	window.print();
});

var	current=0;
var	count=$("#weather div").length;
var id;
	 
 bchange = function(id){
  $("#weather div").fadeOut(1000); 
  $("#weather #weatheritem"+id).fadeIn(1000);
}
 schange = function(){
  id=current+1; 
  if (id > count) id=1 ;
  bchange(id); current=id;
  setTimeout("schange()",7000);
}
schange(0);
});


function addfacebook(strURL) {
	window.open('http://www.facebook.com/sharer.php?u='+ strURL +'','scrollbars=no,toolbar=no,width=700,height=500');
};

function addtwitter(strURL, strTitle) {
	window.open('http://www.twitter.com/home?status='+strURL+'+'+strTitle+'', 'scrollbars=no,toolbar=no,width=700,height=500');
};

function adddigg (strURL, strTitle) {
	window.open('http://digg.com/submit?phase=2&url='+ strURL +'&title='+strTitle, 'scrollbars=no,toolbar=no,width=700,height=500');
};

function addtechnorati (strURL) {
	window.open('http://www.technorati.com/faves?add='+strURL+'', 'scrollbars=no,toolbar=no,width=700,height=500');
};
