$().ready(function() {
	setTimeout('advanceSlideshow(1)', 7000);
});

function advanceSlideshow(nextpicno) {
	$('#mainImage').animate({ opacity: 0 }, 1000, 'easeInOutQuad', function(){
		$("#mainImage").css("background-image",'url(rotate/image'+nextpicno+'.jpg)');
		$('#mainImage').animate({ opacity: 1 }, 1000, 'easeInOutQuad');
	});
	if(nextpicno>4) {
		nextpicno=1;
	} else {
		nextpicno=nextpicno+1;
	};
	setTimeout('advanceSlideshow('+nextpicno+')', 7500);
};

jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	}
});
