(function($){
	$.fn.tools = function() {
		
	}
})(jQuery);

$(document).ready(function(){	
	$('div.yblock-MostRead div.tabs a').click(function(){
		$('div.yblock-MostRead div.tabs a').removeClass('active');
		$('div.yblock-MostRead div[class~=tab_MostRead]').removeClass('current');
		$(this).addClass('active');
		var v = $(this).attr('href').replace("#", "");
		$('#' + v).addClass('current');
		return false;
	});
	
	$('div.cuff div.left-hand li a').mouseover(function(){
			$('div.cuff div.left-hand .im').attr('src', 'http://www.webhaber.com/image.php?im=' + $($(this).parent()).attr('id'));
	});
	
	$("div.tools a").click(function(){
		popUpWindow($(this).attr('href').replace("#", ""), 0, 0, 600, 320);
	return false;
	});

	
	setTimeout("facebook();", 2000);
	


});

/*
function SaveNewsletter()
{
		$.ajax({type:'POST', url:'http://www.webhaber.com/index.html?cahce=' + Math.random(), data:'SaveNewsletter=1&fullname=' + $('#newsletter_fullname').val() + '&email=' + $('#newsletter_email').val(), dataType:'html', success: function(result){ $('div[class~=yblock-Newsletter] div.inside').html("Başarıyla kayıt oldunuz."); }});
}

		function stats(){
		$.ajax({type:'GET', url:'http://www.webhaber.com/NewStats.html?cahce=' + Math.random(), dataType:'html', success: function(result){ $('#NewStats').html(result); setTimeout("stats()", 4500); }});
	}
*/

function facebook(){
	$('#facebook').html('<iframe class="fan_box" id="facebook" scrolling="no" frameborder="0" height="255px" width="100%" src="http://www.facebook.com/widgets/fan.php?id=103819459657437&amp;connections=8"></iframe>');
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height) {
		if(popUpWin) {
		if(!popUpWin.closed) popUpWin.close();
		}

		popUpWin = open('http://www.webhaber.com/' + URLStr, 'popUpWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
	}
	
