(function($){


$.fn.pics = function(){
	var l = this;
	l.curEl = l.find('li:first');
	l.find('li:not(:first)').hide();		
	l.imgs = [];
	
	l.find('li').css({
			'position': 'absolute'
	}).each(function(){
		l.imgs.push($(this));		
	});
	
	window.setInterval(function() { l.nextImg.call(); }, 4000);
	
	l.nextImg = function(){
		var t = l.imgs.shift();
		l.imgs.push(t);
		l.curEl.fadeOut(900);
		l.curEl = l.imgs[0].fadeIn(900);
	}
};

$(window).load(function(){
	$('#page .head .pictures ul').pics();
});



})(jQuery);
