$(function() {
		 

// Sort out layers so that everything sits in the right place 
	
$(function() {
	var zIndexNumber = 10000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
}); 
	
// Sort out the drop down for the nav
	
$(".subnav-wwd").hover(
	function () { $('#wwd').fadeIn('normal');},
	function () { $('#wwd').fadeOut('fast');}
);

// Sort out the sliders.

$('#slider').nivoSlider({
		effect:'fade',
		pauseTime:8000,
		pauseOnHover:false,
		controlNav: false,
		directionNav:false}
	);
	s2int=setInterval(slider2,500);
	
// Sort out the accordian
	
	var okay=1;
	
	$('div.aB').mouseenter(function() {
		if(okay==1){						
		if($(this).next().is(':visible')) {
		} else {	
				okay=0;
				$('div.aC').slideUp('fast',function(){ okay=0;});	
				$(this).next().slideDown('fast',function(){ okay=1;});
			}
		}
	});
	
// Sort out getting the latest tweets in

$(".tweet").tweet({
            username: "tanyaleech",
            join_text: "auto",
            avatar_size: 0,
            count: 1,
            auto_join_text_default: "I said,", 
            auto_join_text_ed: "I",
            auto_join_text_ing: "I was",
            auto_join_text_reply: "I replied to",
            auto_join_text_url: "I was checking out",
            loading_text: "loading tweets..."
});
	
});

function slider2(){
	$('#slider2').nivoSlider({
		effect:'fade',
		pauseTime:8000,
		pauseOnHover:false,
		controlNav: false,
		directionNav:false}
	);	
	clearInterval(s2int);
}

