<!-- Begin

var speedHardScroll=0;
var nbHardScroll=360;
var backgroundOffset = 0;

var picW = 1714 ;
var picH = 900; //(picW*9)/16 ;

// place background at the center
var cw = picW/2 - getWidth()/2 + 100;
var ch = picH/2 - getHeight()/2;

// PROFILER
var stepBGloop = 100;
var totalTimeBG = 0;
var avgTimeBG =0;
var avgTotalBG = 0;
// END PROFILER

function scrollBG(maxSize, bgObj)
{

	// PROFILER
	//startTimeBG = new Date();
	// END PROFILE	

	backgroundOffset -= speedHardScroll;
	//if (Math.abs(backgroundOffset) > maxSize) backgroundOffset = 0;
	

	newW = -cw + backgroundOffset;
	newH = -ch + backgroundOffset
	
	bgObj.style.backgroundPosition = newW + " " + -ch;


	nbHardScroll += 0.2;
	speedHardScroll = 50 * Math.sin(nbHardScroll);
	
	// PROFILER
	//endTimeBG = new Date();
	
	//stepBGloop--;
	//totalTimeBG = totalTimeBG + (endTimeBG-startTimeBG);
	
	//if(stepBGloop == 0){
	//	avgTimeBG = avgTimeBG + totalTimeBG;
	//	avgTotalBG++;
	//	stepBGloop = 100;
	//	window.status = "Temps d'execution " + stepBGloop + " moveBG() = " + totalTimeBG + " ms (avg = " + Math.floor(avgTimeBG/avgTotalBG) + " ms)";
	//	totalTimeBG = 0;
	//}	
	// END PROFILE		

}
// End -->