//function to check if an id exists
jQuery.fn.exists = function() {
	return ( this.is('*') )
}

//function to fadeToggle elements
jQuery.fn.fadeToggle = function(speed) {
   return this.animate({opacity: 'toggle'}, {queue: 'false', speed: speed, easing: 'linear'});
}

$(function() {
	$('body').addClass('js');
	
	//Store the images html in a variable
	images = '<img src="images/scrolling/painter.gif" alt="" height="200" width="300" /><img src="images/scrolling/crane.gif" alt="" height="200" width="300" /><img src="images/scrolling/crane2.gif" alt="" height="200" width="300" /><img src="images/scrolling/painter2.gif" alt="" height="200" width="300" /><img src="images/scrolling/spray.gif" alt="" height="200" width="300" /><img src="images/scrolling/spray2.gif" alt="" height="200" width="300" /><img src="images/scrolling/spray3.gif" alt="" height="200" width="300" />';
	
	//Insert the images
	$('#rot-images').html(images).innerfade({ animationtype: 'fade', speed: 2000, timeout: 4000, type: 'random', containerheight: '21em' }); 
});
