function movePanierPopup(elt) {
	//if(document.all) {
		var temp = availDimScreen();
		document.getElementById(elt).style.left = temp[2] + "px";
		//alert(document.getElementById(elt).style.left);
	//}
	var temporisation = new Array(1,3,2,8);
	new Effect.MoveBy(elt, 350, 0, {
		duration:temporisation[0], fps:12, afterFinishInternal: function(effect) {
			new Effect.MoveBy(elt, 0, 0, {duration:temporisation[1], fps:12, afterFinishInternal: function(effect) {
				new Effect.MoveBy(elt, -300, 0, {duration:temporisation[2], fps:12, afterFinishInternal: function(effect) {
					new Effect.MoveBy(elt, 0, 0, {duration:temporisation[3], fps:12, afterFinishInternal: function(effect) {
						new Effect.Fade(elt);
					}})
				}})
			}})
		}});
}

function availDimScreen() {
	// tableau de retour : largeur, hauteur, centreX, centreY
	var availDimScreen = new Array(0,0,0,0);
	
	availDimScreen[0] = (document.documentElement.clientWidth)?document.documentElement.clientWidth:window.innerWidth;
	availDimScreen[1] = (document.documentElement.clientHeight)?document.documentElement.clientHeight:window.innerHeight;
	availDimScreen[2] = Math.ceil(availDimScreen[0]/2);
	availDimScreen[3] = Math.ceil(availDimScreen[1]/2);
	
	return(availDimScreen);
}

function customPanierPopup() {
	var conteneurPopupPanier = document.createElement('div');
	conteneurPopupPanier.id = 'conteneurPopupPanier';
	document.body.appendChild(conteneurPopupPanier);
	
	var messPopupPanier = document.createElement('p');
	messPopupPanier.id = 'messPopupPanier';
	conteneurPopupPanier.appendChild(messPopupPanier);
	
	var txtMessPP1 = document.createTextNode(mess_panier1);
	//var txtMessPP2 = document.createTextNode(mess_panier2);
	messPopupPanier.appendChild(txtMessPP1);
	var ttlMessPopupPanier = document.createElement('strong');
	messPopupPanier.appendChild(ttlMessPopupPanier);
	//ttlMessPopupPanier.appendChild(txtMessPP2);
	// on passe en innerHTML � cause des r�gles typographiques de la fonction "moulinetteContenu" de la class "contenuHTML" du fichier "class.contenuHTML.php"
	ttlMessPopupPanier.innerHTML = mess_panier2;
	
	var linkPopupPanier = document.createElement('p');
	linkPopupPanier.id = 'linkPopupPanier';
	conteneurPopupPanier.appendChild(linkPopupPanier);
	var aLinkPopupPanier = document.createElement('a');
	linkPopupPanier.appendChild(aLinkPopupPanier);
	aLinkPopupPanier.href=link_panier;
	var txtLinkMesPP = document.createTextNode(txtlink_panier);
	aLinkPopupPanier.appendChild(txtLinkMesPP);
	
	var linkContinue = document.createElement('p');
	linkContinue.id = 'linkContinue';
	conteneurPopupPanier.appendChild(linkContinue);
	var aLinkContinue = document.createElement('a');
	linkContinue.appendChild(aLinkContinue);
	aLinkContinue.href='javascript:void(0);';
	var txtLinkMesContinue = document.createTextNode(txtlink_continue);
	aLinkContinue.appendChild(txtLinkMesContinue);
	aLinkContinue.onclick = function() {
		document.body.removeChild(document.getElementById('conteneurPopupPanier'));
	}
	
	movePanierPopup('conteneurPopupPanier');
}


function addLoadListenerPanierPopup(func) {
	if (window.addEventListener) {
		window.addEventListener("load", func, false);
	} else if (document.addEventListener) {
		document.addEventListener("load", func, false);
	} else if (window.attachEvent) {
		window.attachEvent("onload", func);
	}
}

if (document.getElementById && document.createTextNode) {
	addLoadListenerPanierPopup(function() {
		if(panierExiste != 0) customPanierPopup();		
	});
}


