function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function addClipping(objname, url)
{
	//obj=new lib_obj(objname);
	//obj.slideIt(820,0,10,10);
	frames['iframeOffre'].location.href = url;
	return false;
}

//rajouter par ZH : dans l'appel de la fonction JS, passage en param de l'id du calque
// renommage de l'appel de la fonction :addClipping11
function styleCalque(idCalque)
{
  if (document.all) calqueStyle = document.all[idCalque].style;
  if (document.layers) calqueStyle = document.layers[idCalque];
  if (document.getElementById) calqueStyle = document.getElementById(idCalque).style;
  return calqueStyle;
}
function deplaceCalqueDe(idCalque,stepX,stepY)
{
  //calqueStyle = styleCalque(idCalque);
  calqueStyle = document.all[idCalque].style;
  calqueStyle.left = parseInt(calqueStyle.left) + stepX;
  calqueStyle.top = parseInt(calqueStyle.top) + stepY;
}
function deplaceCalque(idCalque,posX,posY)
{
  //calqueStyle = styleCalque(idCalque);
  calqueStyle = document.all[idCalque].style;
  calqueStyle.left = posX;
  calqueStyle.top = posY;
}
function animTransMot(idCalque,stepLeft,stepTop,nbre,url,sCoefVitesse)
{
  deplaceCalqueDe(idCalque,stepLeft,stepTop);
  nbre = nbre - 1;
  if (nbre == 0) calqueStyle.visibility = "hidden";
  if (nbre == 0) frames['iframeOffre'].location.href = url;

  if (nbre > 0) setTimeout("animTransMot('"+idCalque+"',"+stepLeft+","+stepTop+","+nbre+",'"+url+"')",sCoefVitesse);
}
function animTrans(idCalque,destX,destY,nbre,url)
{
  //calqueStyle = styleCalque(idCalque);
  calqueStyle = document.all[idCalque].style;
  stepLeft = parseInt((destX-parseInt(calqueStyle.left))/nbre);
  stepTop = parseInt((destY-parseInt(calqueStyle.top))/nbre);
  animTransMot(idCalque,stepLeft,stepTop,nbre,url);
}
//function lanceAnim(sCoordLeft,sCoordTop,url)
function addClipping11(objname, url, cptPdt)
{
	 
	  sCoefVitesse = cptPdt * 20;
	  var objCalqueAjou = "monlien"+objname;
	  var objCalqueFin = "picto"+objname;
	  sCoordLeft = document.all[objCalqueAjou].offsetLeft; 
	  sCoordTop = document.all[objCalqueAjou].offsetTop; 
	  deplaceCalque('calque',sCoordLeft,sCoordTop);

	  calqueStyle.visibility = "visible";
	  //document.all[objCalqueAjou].style.visibility = "hidden";
	  //document.all[objCalqueAjou].style.top = -40;
	  //document.all[objCalqueAjou].style.left = -40;
	  //document.all[objCalqueFin].style.visibility = "visible";

	//gestion affichage de la bulle Prmoliste
	if(scanCookie("promolist1")=='0') 
	{
	  creationCookie('promolist1','OK');
	  document.location.href="#top";
	  affiche();
	}
	  animTrans('calque',650,-25,sCoefVitesse,url,sCoefVitesse);

}

function affiche()
{
	//affiche la bulle
	MM_showHideLayers('Layer1','','show');
	setTimeout("hide()",5000);
}

function creationCookie(nom,valeur)
{
//crée le cookie
document.cookie =nom +'=' + escape(valeur) + ';';
}

function scanCookie(nom)
{
	//récupère la valeur du cookie
	cook = document.cookie;
	nom +="=";
	place = cook.indexOf(nom,0);
	if(place<= -1)
	   return("0");
	else
	{
		end = cook.indexOf(";",place);
		if(end <= -1)
		return(unescape(cook.substring(place+nom.length,cook.length)));
		else
		return(unescape(cook.substring(place+nom.length,end)));
	}
}
function MM_showHideWebPoints() { //v6.0
  var i,p,v,obj,args=MM_showHideWebPoints.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'block':(v=='hide')?'none':v; }
    obj.display=v; }
}