// Nicer Easing Function (easeInOutQuad)
	jQuery.extend( jQuery.easing, {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; } });
	// Define images, speed, delay etc.
	//var siteBGs = ['/ptcwp/wp-content/themes/ptc2011/_inc/img/new_bg_1.jpg','/ptcwp/wp-content/themes/ptc2011/_inc/img/new_bg_2.jpg','/ptcwp/wp-content/themes/ptc2011/_inc/img/new_bg_3.jpg'], bgContainer, bgWidth = 1024, bgSpeed = 2000, bgWait = 4000;
	var siteBGs = ['/ptcwp/wp-content/themes/ptc2011/_inc/img/banner_blackbird.jpg','/ptcwp/wp-content/themes/ptc2011/_inc/img/banner_darkoutside.jpg','/ptcwp/wp-content/themes/ptc2011/_inc/img/banner_misconception.jpg'], bgContainer, bgWidth = 1024, bgSpeed = 2000, bgWait = 4000;
	jQuery(function(){
		bgContainer = jQuery('#background').css({'width':1024*(siteBGs.length+1)+'px'});
		jQuery(siteBGs).each(function(){ jQuery(bgContainer).append('<img src="'+this+'" alt="">'); });
		jQuery(bgContainer).append('<img src="'+siteBGs[0]+'" alt="">');
		// Maybe only do this fade-in on the home-page
		jQuery(bgContainer).fadeTo(0,0).fadeTo(500,1);
		slideBackground(1);
	});
	// The animation function
	function slideBackground(pos) {
		var nextPos = pos+1;
		if(pos>siteBGs.length) { jQuery(bgContainer).css({'left':'0px'}); pos = 1; nextPos = 2; }
		jQuery(bgContainer).delay(bgWait).animate({'left':0-(pos*bgWidth)}, bgSpeed, 'easeInOutQuad', function(){ slideBackground(nextPos); });
	}
	jQuery(window).load(function () {
		setTimeout(function(){jQuery('#homelogo').fadeIn(2000);},3000);
	});	
