/* Document JavaScript */
var packprodlayer;
var islayerexist=0;
var islayerexist2=0;

var poptmt;
function mpop_affiche(idprodlay,idpacklay){
	packprodlayer=findObj('pack_'+idpacklay+'prod_'+idprodlay);
  	packprodlayer.style.left=(tempX+2)+extpx;
	packprodlayer.style.top=(tempY+2)+extpx;
	packprodlayer.style.visibility='visible';
	packprodlayer.style.display='block';
	islayerexist=1;
}
function mpop_close(typeclose){
	if(islayerexist>0){
	packprodlayer.style.visibility='hidden';
	packprodlayer.style.display='none';
	islayerexist=0;
	}
}
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

var IE = document.all?true:false
if (!IE) {document.captureEvents(Event.MOUSEMOVE);var extpx='px';}else{var extpx='';}
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0
function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  }
  else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  if(islayerexist>0){
  	packprodlayer.style.left=(tempX+2)+extpx;
	packprodlayer.style.top=(tempY+2)+extpx;
  }
  if(islayerexist2>0){
  	assoclayer.style.left=(tempX+2)+extpx;
	assoclayer.style.top=(tempY+2)+extpx;
  }
	//clearTimeout(poptmt);
  return true
}
