var delta2, paral,initX, camX,camY,delta;
camX = 23;
camY = 7;
delta = 0;
var scrollLVL = 0;

function finscroll() {
	delta = 0;
}

function fl_ClickToPosition(e) {
	e.preventDefault();
	if (scrollLVL == 1){
	e = window.event || e;
	d = 0;
	d = Math.max(-3, Math.min(3, (e.wheelDelta || -e.detail)));
	positionLVL = CameraObject.camera.y - StageInfos[1]/2 //- thiss.LVL1.regY;

	if ((positionLVL <= 0 && d > 0) || (positionLVL >= Hmax && d < 0))
		{
		delta = 0;
	} else {
		//console.log(positionLVL);
		if (positionLVL == 0 || positionLVL == Hmax ){delta = 0}
		delta = delta + d;
		//valeur de scroll
		if (scrollLVL == 1) {
			
			tweencam = TweenLite.to(CameraObject.camera , 0.2, {
				y: CameraObject.camera.y - (delta * 20),
				ease: Power1.easeInOut, onComplete: finscroll
			});
		}
		//bouclage BG
		/*if (delta < 0 && position < -1400) {}
		if (delta > 0 && position > 0) {}*/
	}

}
if (paral == 1){
	
	
	
e = window.event || e;
	d = 0;
	d = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
	d	= d * 2;
	console.log (d);
		delta = delta + d;
		valx = CameraObject.camera.x - (delta * camX)
		valy = 	CameraObject.camera.y - (delta * camY)
		
		if (valx < initX ) {valx = initX}
		if (valx > niveau1.nominalBounds.width - StageInfos[0]/2 + 4.8 ) {valx = niveau1.nominalBounds.width - StageInfos[0]/2 + 4.8}
		
		
		
		//valeur de scroll
			tweencam = TweenLite.to(CameraObject.camera, 0.15, {
				y: valy,
				x: valx,
				ease: Power1.easeInOut, onComplete: finscroll
			});

}
if (txtdefil == 1){
e = window.event || e;
	d = 0;
	d = Math.max(-3, Math.min(3, (e.wheelDelta || -e.detail)));
	console.log (d);
		delta = delta + d;
		//valeur de scroll
			tweencam = TweenLite.to(thiss.fxb3, 0.2, {
				y: thiss.fxb3.y + (delta * 20),
				ease: Power1.easeInOut, onComplete: finscroll
			});

}


}


function fl_ClickToPosition2(e) {
	//console.log("delta:  " + e.deltaY);

}