/* Author: 

*/

var twitterLinks = function(cssSelector) {
	$("" + cssSelector).each(function(){
		if (!$(this).find("a").length) {
		    $(this).html( 
		      $(this).html().
		      replace(/http:\/\/\S+/g,  '<a href="$&" target="_blank">$&</a>').
		      replace(/\s(@)(\w+)/g,    ' <a href="http://twitter.com/$2" target="_blank">@$2</a>').
		      replace(/\s(#)(\w+)/g,    ' <a href="http://www.twitter.com/search?q=$2" target="_blank">#$2</a>').
		      replace(/^\w+/,           '<a href="http://twitter.com/$&" target="_blank">$&</a>') 
		    );
		}
	});
}

$(document).ready(function() {
	if ($(".twittersliderwrapper ul").length) twitterLinks(".twittersliderwrapper ul > li");
	
	$("#perslist ul li").hover(function () {
		$(this).children('.social-pers').removeClass('hidden');
	}, function () {
		$(this).children('.social-pers').addClass('hidden');
	});
	

});

 $(window).load(function() {
if ($('#slider').length) {
	$('#slider').orbit({
		animation: 'horizontal-push',
		animationSpeed: 500,
		timer: true, // true or false to have the timer
		advanceSpeed: 6000,
		captions: true,
		captionAnimation: 'fade', // fade, slideOpen, none
		captionAnimationSpeed: 800,
		pauseOnHover: false // if you hover pauses the slider
	});
}
});


