var delay = 8;


function hide(n) {
	$('#scrollimage' + n).hide();
}
function show(n) {
	$('#scrollimage' + n).show();
}





function fadeIn(n, leftpos) {

	$('#scrollimage' + n).fadeIn(1000 * delay);

	$('#scrollimage' + n).animate({
		left: leftpos
	}, {duration: 1500 * delay, queue: false, easing: 'linear'});

}





var leftstartpos = 0;
var zi = 0;
var basex = 0;
var basey = 0;
var basez = 0;
var basenum = '';
function iterateScroll() {
	$("#scrollimage" + basenum + "1").css("left", (basex) + "px");
	$("#scrollimage" + basenum + "1").css("top", (-1350 * basenum) + "px");
	$("#scrollimage" + basenum + "1").css("zindex", basez + basenum + 1);
	setTimeout("fadeIn(" + basenum + "1, '" + (basex-210) + "')", 0 * delay);

	$("#scrollimage" + basenum + "2").css("left", (basex-280) + "px");
	$("#scrollimage" + basenum + "2").css("top", (-1350 * basenum -450) + "px");
	$("#scrollimage" + basenum + "3").css("zindex", basez + basenum + 2);
	setTimeout("fadeIn(" + basenum + "2, '" + (basex) + "')", 1000 * delay);

	$("#scrollimage" + basenum + "3").css("left", (basex) + "px");
	$("#scrollimage" + basenum + "3").css("top", (-1350 * basenum -900) + "px");
	$("#scrollimage" + basenum + "3").css("zindex", basez + basenum + 3);
	setTimeout("fadeIn(" + basenum + "3, '" + (basex-320) + "')", 2000 * delay);


	basenum = basenum * 1 + 1;
	if(basenum <= 6) {
		setTimeout("iterateScroll()", 3000 * delay);
	}


}





function startScroll() {
	var p = $("#contentrightinnerinner");
	var position = p.position();
	leftstartpos = position.left;


	hide(1);
	hide(2);
	hide(3);


	iterateScroll();
}





