
var x = 0;
var y = 0;
var timer;
posX = 0;
posY = 0;
anim = true;
oldpos = "http://www.monchval.com/images/cure-pieds.gif";
/*
if (document.getElementById)
   {
   if(navigator.appName.substring(0,3) == "Net")
      document.captureEvents(Event.MOUSEMOVE);
   document.onmousemove = Pos_Souris;
   //window.onload = BougeCadre;
   }
*/
function Pos_Souris(e)
   {
   x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
   y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
//   beep;
   }


function ShowCadre(ts,tc,tp)
	{
	timer = setTimeout("BougeCadre()", 15);
	tz =  "<img src='http://"+ts+"/composites/"+tc+"-"+tp+".jpg' height=400 width=266 class=icone style='border:1px outset;background-color:white;background-image:url(pro/jmj/pics/indicator.gif);background-repeat:no-repeat;background-position:center center;'  />";
    document.getElementById("CadrePhoto").innerHTML = tz;

	if (document.getElementById)
	   {
	   if(navigator.appName.substring(0,3) == "Net")
		  document.captureEvents(Event.MOUSEMOVE);
	   document.onmousemove = Pos_Souris;
	   //window.onload = BougeCadre;
	   }
   	
	}
	
function ShowImg(adr,h,w)
	{
	timer = setTimeout("BougeCadre()", 15);
	if (h>0)
	tz =  "<img src='"+adr+"' height='"+h+"' width='"+w+"' class=icone style='border:1px outset;background-color:white'  lowsrc=\"/pics/indicator.gif\" />";
	else
	tz =  "<img src='"+adr+"' class=icone style='border:1px outset;background-color:white'  lowsrc=\"/pics/indicator.gif\" />";
	
    document.getElementById("CadrePhoto").innerHTML = tz;

	if (document.getElementById)
	   {
	   if(navigator.appName.substring(0,3) == "Net")
		  document.captureEvents(Event.MOUSEMOVE);
	   document.onmousemove = Pos_Souris;
	   //window.onload = BougeCadre;
	   }
   	
	}
	
function ShowSite(u)
	{

	timer = setTimeout("BougeCadre()", 15);
	tz =  "<img src=\"http://open.thumbshots.org/image.pxf?url=" + u + '" ';
	tz += 'border="0" style="margin-top:160px;border:1px outset;" class=icone  onload="if (this.width>50) this.border=1; this.alt=\'Thumbnails by Thumbshots.org\';">';
	//alert(tz);
	document.getElementById("CadrePhoto").innerHTML = ''+tz;

	if (document.getElementById)
	   {
	   if(navigator.appName.substring(0,3) == "Net")
		  document.captureEvents(Event.MOUSEMOVE);
	   document.onmousemove = Pos_Souris;
	   //window.onload = BougeCadre;
	   }
	}

function ShowCadrePh(ts,tc,tp)
	{
	timer = setTimeout("BougeCadre()", 15);
	tz =  "<img src='http://"+ts+"/compositesphotographes/"+tc+"-"+tp+".jpg' height=400 width=266 class=icone style='border:1px outset;background-color:white;background-image:url(pro/jmj/pics/indicator.gif);background-repeat:no-repeat;background-position:center center;' lowsrc=\"/minisites/pics/indicator.gif\"  	>";
    document.getElementById("CadrePhoto").innerHTML = tz;

	if (document.getElementById)
	   {
	   if(navigator.appName.substring(0,3) == "Net")
		  document.captureEvents(Event.MOUSEMOVE);
	   document.onmousemove = Pos_Souris;
	   //window.onload = BougeCadre;
	   }
   	
	}
	
	
function HideCadre()
	{
	document.getElementById("CadrePhoto").style.visibility = "hidden";
	document.getElementById("CadrePhoto").innerHTML = "";
	clearTimeout(timer);
if (document.getElementById)
   {
   if(navigator.appName.substring(0,3) == "Net")
      document.releaseEvents(Event.MOUSEMOVE);
   document.onmousemove = null;
   //window.onload = BougeCadre;
   }
	}
function BougeCadre()
	{
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) 
		{
		//Non-IE
		w = window.innerWidth;
		h = window.innerHeight;
		vscroll = window.pageYOffset;
		y0 = 0;
		hscroll = window.pageXOffset;
		x0 = 0;
		} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
		{
		//IE 6+ in 'standards compliant mode'
		ie = 1;
		w = document.documentElement.clientWidth;
		h = document.documentElement.clientHeight;
		//vscroll = document.body.scrollTop;
		vscroll = document.documentElement.scrollTop;
		y0 = vscroll;
		hscroll = document.documentElement.scrollLeft;
		x0 = hscroll;
		//defaultStatus  = '->'+document.body.scrollTop+' ->'+document.documentElement.scrollTop;
		}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
		{
		//IE 4 compatible
		w = document.body.clientWidth;
		h = document.body.clientHeight;
		vscroll = document.body.scrollTop;
		y0 = vscroll;
		hscroll = document.documentElement.scrollLeft;
		x0 = hscroll;
		defaultStatus  = '->'+document.body.scrollTop;
		}

	//IE4:
	// document.body.offsetWidth : donne la largeur de la fenêtre
	// document.body.offsetHeight : donne la hauteur de la fenêtre
var doc = document.getElementById('CadrePhoto');		
if (document.all) // ok I.E
{
H = doc.currentStyle.height;
P = doc.currentStyle.left;
}
else // ok firefox.0.9.2 , pas mozilla.1.0 ni netscape.7.02
{
H = document.defaultView.getComputedStyle(doc, null).height;
P = document.defaultView.getComputedStyle(doc, null).left;
}
// ou H = doc.offsetHeight ; 
H=parseInt(H);
P=parseInt(P);

	if (x+x0+P>w) 
		posX = x + 30 - P + x0;
	else
		posX = x - 30 + x0 - 2*P; //posX+(((x-posX)+20)/15);
/*posX=0*/	  
	posX =  x + 30 + x0;	
	
	if (y+y0 + H - vscroll > h)
		posY = h-H+vscroll-20 ;
	else	  
      	posY = y +y0-20 ; //posY+(((y-posY)+20)/15);
		/*
		h-H+vscroll+210
		y+y0 = h - H + vscroll
		*/
	//alert(H);		
		
	document.getElementById("CadrePhoto").style.top = posY+'px';
	document.getElementById("CadrePhoto").style.left = posX+'px';
	document.getElementById("CadrePhoto").style.visibility = "visible";

	timer = setTimeout("BougeCadre()", 15);

}

/*
if(document.getElementById)
   {
   document.write('<DIV ID=CadrePhoto style="position: absolute;visibility:hidden;">');
   document.write('</DIV>');
   }
*/