var currimg = 0;
var images = null;
$(document).ready(function(){

	// do we have a mobileshow div
	var show = $('div.mobileshow');
	if (show.length > 0) {
		
		images = show.find('.allimages img');
		show.find('.allimages div').width((images.length*209)+'px');
		// hide all but the first
		var i;
		for(i=1;i<images.length;i++) {
			images.eq(i).hide();
		}
		setTimeout("fadeImage()",5000);
		// set up timer
		
		

	}


});

function fadeImage() {
	images.eq(currimg).fadeOut('1000',function(){
		nextImage();
		images.eq(currimg).fadeIn('1000',function(){
			setTimeout("fadeImage()",5000);
		});
	});
	
	
}

function nextImage() {
	if (currimg+1 > images.length-1) {
		currimg = 0;
	} else {
		currimg++;
	}
}