// JavaScript Document
function checkBrowser(){
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie55=((this.ver.indexOf("MSIE 5.5")>-1 || this.ie6) && this.dom)?1:0;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 & this.dom)?1:0;
	this.ie4=(document.all & !this.dom)?1:0;
	this.ns5=(this.dom & parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers & !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5 || this.ie6 || this.ie55);
	return this;
}
bw=new checkBrowser();
fromLeft=10;
fromTop=10;
function cursorInit(strimg){
	oCursor=new makeCursorObj('ZoomPhotoProd');
		document.getElementById('ZoomPhotoProd').innerHTML="<table cellspacing='0' cellpadding='0' width='100%' style='height: 400px;' border='0'><tr><td align='center'>"+strimg+"</td></tr></table>";
		document.getElementById('ZoomPhotoProd').style.display='';
	scrolled=bw.ns4 || bw.ns5?"window.pageYOffset":"document.body.scrollTop";
	if(bw.ns4) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove=move;
	Agrandir();
}
function makeCursorObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.';
		this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0;
	this.moveIt=b_moveIt;
	return this;
}
function b_moveIt(x,y){
	this.x=x; 
	this.y=y; 
	this.css.left=this.x+'px'; 
	this.css.top=this.y+'px';
}
function move(e){
	x=bw.ns4 || bw.ns5?e.pageX:event.x;
	y=bw.ns4 || bw.ns5?e.pageY:event.y;
	//x=bw.ie55 || bw.ie6?e.pageX:event.x;
	//y=bw.ie55 || bw.ie6?e.pageY:event.y;
	if(bw.ie4 || bw.ie5) y=y+eval(scrolled);
	oCursor.moveIt(x+fromLeft,y+fromTop);
}
//onload=cursorInit;
var width_orig = 400;
var height_orig = 400;
var timerZOOM="undefined";
function Agrandir() {
		var wActuel = 0;
		var hActuel = 0;
		document.getElementById('ZoomPhotoProd').style.width='0';
		document.getElementById('ZoomPhotoProd').style.height='0';
		var fct1 =        function () {
			wActuel  +=       10;  
			hActuel  += 	  10;   
			document.getElementById('ZoomPhotoProd').style.display='';
			document.getElementById('ZoomPhotoProd').style.width     =	 wActuel      +     'px';
			document.getElementById('ZoomPhotoProd').style.height    =	 hActuel      +     'px';
			if( wActuel >= 400) {
					clearInterval(timerZOOM);
					timerZOOM = "undefined";
			}
		}
		
		fct1();
		timerZOOM = setInterval(fct1,10);
}
function Retrecir() {
		if(timerZOOM!=="undefined") { clearInterval(timerZOOM); timerZOOM="undefined"; }
		/*var wActuel = width_orig;
		var hActuel = height_orig;*/
		//document.getElementById('ZoomPhotoProd').style.width='0';
		//document.getElementById('ZoomPhotoProd').style.height='0';
		/*var fct2 =        function () {
			wActuel  -=       8;
			hActuel  -= 	  8;
			
			document.getElementById('ZoomPhotoProd').style.width     =	 wActuel      +     'px';
			document.getElementById('ZoomPhotoProd').style.height    =	 hActuel      +     'px';
			if( wActuel <= 0) {
					clearInterval(timerZOOM);  
					document.getElementById('ZoomPhotoProd').style.display='none';
			}
		}
		
		fct2(); 
		var timerZOOM = setInterval(fct2,10);*/
		if(timerZOOM=="undefined") { document.getElementById('ZoomPhotoProd').style.display='none'; }
}