function linkify()
{
	twttr.anywhere(function (T) {
    	T(".tweet").hovercards();
  	});

/*	$('.tweet-text').each(function(index) {
		html = $(this).html();
		html = html.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi,'<a href="$1"  target="_blank" rel="nofollow">$1<\/a>');
		$(this).html(html);
	});*/
}

$(function(){
  	
	linkify();
	
	$(".tweet").live('hover',
		function(){
			$(".tweet").removeClass("selected-tweet");
			$(".tweet-actions").hide();
			$(this).find(".tweet-actions").show();
			$(this).addClass("selected-tweet");
		},
		function(){
			$(".tweet").removeClass("selected-tweet");
			$(".tweet-actions").hide();
		}
	);
	
	$("#slides").slides({ 
		play: 5000,
		pause: 2500,
		hoverPause: true,
		generatePagination: true
	});
		
	$("img").error(function(){
    	$(this).hide();
  	});
  	
  	$(".livecat").each(function(index){
  		$("#"+$(this).attr("id")).load("/home/category/"+$(this).attr("rel"),function(){
  			linkify();
  		});
  	});
});
