/*	<div id='mainTextArea4' class='mainAreaPanel'>
		<div style='width:$panelWidth;height:$panelHeight;'>
			<div style='text-align:left;width:100%;'><a href='#' onclick='closePanel();'>Fermer</a></div>
			<div style='text-align:left;width:100%;'><span class='h1'>Titre1</span></div>
			<div style='text-align:left;width:100%;height:180px;background-color:#ffffff;'>
				<span class='h2'>iPhone : Nous avons pour philosophie de vous ...</span>
			</div>
			<div style='text-align:left;width:100%;margin-Top:15px;'><span class='h1'>Titre2</span></div>
			<div style='text-align:left;width:100%;height:180px;background-color:#222222;opacity:0.8;'>
				<div id='appliPrev' style='text-align:left;width:20px;height:180px;float:left;background-color:#eedd22;opacity:0.5;'>
					<a href='#' onclick='moveElemBack(3,\"appli\",\"appliPrev\",\"appliNext\");'><</a>
				</div>
				<div style='text-align:left;width:512px;height:160px;margin-Top:10px;float:left;'>
						<img src='./images/LifeStreamWeb.png' alt='' id='appli0' style='width:163px;height:143px;position:absolute;Left:194.5;Top:286.5;z-index:6;border:0;'/>
						<img src='./images/skispotsWeb.png' alt='' id='appli1' style='width:76px;height:67px;position:absolute;Left:398;Top:326.5;z-index:5;border:0;'/>
						<img src='./images/stwhoWeb.png' alt='' id='appli2' style='width:76px;height:67px;position:absolute;Left:418;Top:326.5;z-index:4;'/>
						<img src='./images/iPopWeb.png' alt='' id='appli3' style='width:76px;height:67px;position:absolute;Left:438;Top:326.5;z-index:3;'/>
				</div>
				<div id='appliNext' style='text-align:left;width:20px;height:180px;float:left;background-color:#eedd22;'>
					<a href='#' onclick='moveElemFwd(3,\"appli\",\"appliPrev\",\"appliNext\");'>></a>
				</div>
			</div>
		</div>
	</div>*/

var increment = 0;
var coverFlowActive = false;
var sliddedElem = 0;
var widthMax = 0;
var widthMin = 0;
var heightMax = 0;
var heightMin = 0;
var posTopMax = 0;
var posTopMin = 0;
var posLeftLeft = 0;
var posLeftMiddle = 0;
var posLeftRight = 0;
var sliddedElemA = '';
var sliddedElemB = '';
var setup = false;

function initCoverFlow() {
	widthMax = 0;
	widthMin = 0;
	heightMax = 0;
	heightMin = 0;
	posTopMax = 0;
	posTopMin = 0;
	posLeftLeft = 0;
	posLeftMiddle = 0;
	posLeftRight = 0;
	setup = false;
}

function setupCoverFlow(aWidthMax,aHeightMax,aWidthMin,aHeightMin,aTopMax,aTopMin,aLeftLeft,aLeftMiddle,aLeftRight) {
	if(setup) return;
	widthMax = aWidthMax;
	widthMin = aWidthMin;
	heightMax = aHeightMax;
	heightMin = aHeightMin;
	posTopMax = aTopMax;
	posTopMin = aTopMin;
	posLeftLeft = aLeftLeft;
	posLeftMiddle = aLeftMiddle;
	posLeftRight = aLeftRight;
	setup = true;
}

function moveElemBack(limit,radical,linkBack,linkFwd) {
	if(coverFlowActive) {
		return;
	} else {
		coverFlowActive = true;
	}
	if(sliddedElem > 0) {
		document.getElementById(linkFwd).style.opacity = 1.0;
		sliddedElemB = radical+sliddedElem;
		document.getElementById(sliddedElemB).style.zIndex = 6-sliddedElem;
		sliddedElem -= 1;
		sliddedElemA = radical+sliddedElem;
		increment = 0;
		if(sliddedElem == 0) {
			document.getElementById(linkBack).style.opacity = 0.5;
		}
		doMoveElemBack();
	}
}
function doMoveElemBack() {
	document.getElementById(sliddedElemA).style.width = widthMin + (widthMax-widthMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemA).style.height = heightMin + (heightMax-heightMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemA).style.top = posTopMin - (posTopMin-posTopMax)*(0.1*increment)+'px';
	document.getElementById(sliddedElemA).style.left = (posLeftLeft+20*(sliddedElem+1)) - ((posLeftLeft+20*(sliddedElem+1))-posLeftMiddle)*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.width = widthMax - (widthMax-widthMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.height = heightMax - (heightMax-heightMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.top = posTopMax - (posTopMax-posTopMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.left = posLeftMiddle - (posLeftMiddle-(posLeftRight+20*sliddedElem))*(0.1*increment)+'px';
	increment += 1;
	if(increment < 11) {
		setTimeout('doMoveElemBack()', 50);
	} else {
		coverFlowActive = false;
	}
}
function moveElemFwd(limit,radical,linkBack,linkFwd) {
	if(coverFlowActive) {
		return;
	} else {
		coverFlowActive = true;
	}
	if(sliddedElem < limit) {
		document.getElementById(linkBack).style.opacity = 1.0;
		sliddedElemA = radical+sliddedElem;
		document.getElementById(sliddedElemA).style.zIndex = sliddedElem+1;
		sliddedElem += 1;
		sliddedElemB = radical+sliddedElem;
		increment = 0;
		if(sliddedElem == limit) {
			document.getElementById(linkFwd).style.opacity = 0.5;
		}
		doMoveElemFwd();
	}
}
function doMoveElemFwd() {
	setupCoverFlow (
		document.getElementById(sliddedElemA).offsetWidth,
		document.getElementById(sliddedElemA).offsetHeight,
		document.getElementById(sliddedElemB).offsetWidth,
		document.getElementById(sliddedElemB).offsetHeight,
		document.getElementById(sliddedElemA).offsetTop,
		document.getElementById(sliddedElemB).offsetTop,
		10,
		document.getElementById(sliddedElemA).offsetLeft,
		document.getElementById(sliddedElemB).offsetLeft
	);
	document.getElementById(sliddedElemA).style.width = widthMax - (widthMax-widthMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemA).style.height = heightMax - (heightMax-heightMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemA).style.top = posTopMax - (posTopMax-posTopMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemA).style.left = posLeftMiddle - (posLeftMiddle-(posLeftLeft+20*sliddedElem))*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.width = widthMin + (widthMax-widthMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.height = heightMin + (heightMax-heightMin)*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.top = posTopMin - (posTopMin-posTopMax)*(0.1*increment)+'px';
	document.getElementById(sliddedElemB).style.left = posLeftRight - (posLeftRight-posLeftMiddle)*(0.1*increment)+'px';
	increment += 1;
	if(increment < 11) {
		setTimeout('doMoveElemFwd()', 50);
	} else {
		coverFlowActive = false;
	}
}

