// following two functions kindly provided by Jonathan Howard
$.fn.pause = function(milli,type) {
	milli = milli || 1000;
	type = type || "fx";
	return this.queue(type,function(){
		var self = this;
		setTimeout(function(){
			$.dequeue(self);
		},milli);
	});
};

$.fn.clearQueue = $.fn.unpause = function(type) {
	return this.each(function(){
		type = type || "fx";
		if(this.queue && this.queue[type]) {
			this.queue[type].length = 0;
		}
	});
};
 
/////////// 
 
 
 $(document).ready(function(){
	
	 
	$('#pic1').hide();
	$('#pic2').hide();
	$('#pic3').hide();
	$('#pic4').hide();

	

    
    // trigger off the fading
	 setTimeout("fade()", 10);
   
 });
	 
	
	 

 

function fade()
{
	setTimeout("fade()", 16000);
	

	$('#pic1').pause(1000).fadeIn(1500);	
	$('#pic2').pause(5000).fadeIn(1500).pause(3000).fadeOut(1500);	
	$('#pic3').pause(9000).fadeIn(1500).pause(3000).fadeOut(1500);
	$('#pic4').pause(13000).fadeIn(1500).pause(3000).fadeOut(1500);	

	

}
	

