$(document).ready(function() {
	$('a.tooltip').tipsy({fade: true, html: true, trigger: 'hover', gravity: 'n'});
	$('#menu li').hover(
		function() { 
			$(this).children("a").addClass("over");
			$(this).children("ul").addClass("over");
		},
		function() {
			$(this).children("a").removeClass("over");
			$(this).children("ul").removeClass('over');
		}
	);
	$('#menu li ul li').hover(
		function() { 
			$(this).children("a").addClass("over"); 
			$(this).children("ul").addClass("over"); 
		},
		function() {
			$(this).children("a").removeClass("over"); 
			$(this).children("ul").removeClass('over'); 
		}
	);
	
	$('.person').hover(function() {
		$(this).addClass("overme");
		$(this).children('.moreinfo').stop(true, true).fadeIn("fast");
	}, function() {
		$(this).removeClass("overme");
		$(this).children('.moreinfo').stop(true, true).fadeOut("fast");
	});

	
	$('#contentWrap #content img').each(function(index){
		var src = $(this).attr("src");
		//if(src.indexOf("http://") == -1) {
		//	$(this).attr('src', '/ellacotts.co.uk'+$(this).attr('src'));
		//}
		var att = $(this).attr('style');
		if(att.indexOf("float: left;") != -1) {
			$(this).addClass("left");
		}else if(att.indexOf("float: right;") != -1) {
			$(this).addClass("right");
		}
	});
	$('.redBar').stop().fadeTo(50,0.9);
	
	
	$("ul.pageme").quickPager({pageSize:"8",pagerLocation:"bottom"});
	$('#slider').nivoSlider({
		animSpeed:800,
        pauseTime:5000
	});
	jQuery(".tweet").tweet({
		username: "ellacotts",
		join_text: "auto",
		avatar_size: 0,
		count: 5,
		auto_join_text_default: "",
		auto_join_text_ed: "",
		auto_join_text_ing: "", 
		auto_join_text_reply: "",
		auto_join_text_url: "",
		loading_text: "loading tweets..."
	});
		
});
