var ie=(document.all)?1:0;

function recharge(){
	if(!ie){
		if(navigator.appVersion.indexOf("4.0")<0)self.location.reload()
	}
}

// ouverture pop estrat
function estrat(){
	var haut = (document.all) ? 610 : 500
	var large = (document.all) ? 760 : 740
	eval('regalMap = window.open("http://www.e-strat.loreal.com/loreal.html","estrat","width='+large+',height='+haut+'scrollbars=yes,resizable=yes,menubar=yes,directories=yes,status=yes,location=yes,toolbar=yes,top=0,left=0,status=1")')
}

// popup
function sesamus(url){
window.open(url,"LOreal","width=650,height=500,top=20,left=20,scrollbars=yes");
}

// n'autorise pas le clic droit sur les images
var doh = "Protected by copyright.";
function noclick(scx) {
truc=false;
if (document.all && event.button == 2) truc=true;
else if (!document.all && scx.which == 3) truc=true;
if (truc) { alert(doh); return false; } 
}

function init()
{
	for (i=0; i<document.images.length; i++) document.images[i].onmousedown = noclick;
}

// zoom sur les fotos
function popimage(url,param)
{
	window.open(url,"image",param);
}

// ONMOUSEOVER="glosse(1);" ONMOUSEOUT="ClearLyrDrag(1);" 
function glosse(num, gauche){
	if(arguments.length<2) gauche=0;
	LyrDrag("def"+num, true, 'both', -20, 20, gauche);
	//dlib.layers('def'+num).visible(true);	
	setTimeout("dlib.layers('def"+num+"').visible(true)", 5);
}

function ClearLyrDrag(num){
	//dlib_LyrObj('def'+num).visibility="hidden";
	LyrDrag('def'+num, false, 'both', -20, 20);
	dlib.layers('def'+num).visible(false);
	dlib.layers('def'+num).left(0);
	dlib.layers('def'+num).top(0);
}

//dlib.debug(1,"windowed");

function LyrDrag(LyrNme, Start, lequel, left, top, gauche)
{
	if (lequel.indexOf("l")==0 || lequel.indexOf("t")==0) mve=(lequel.indexOf("l")!=-1)?"l":"t";
	else mve="b";
	if (Start)
	{  
		if (dlib.navigator("NS4")) document.captureEvents(Event.MOUSEMOVE);												  
	   	document.onmousemove=function (e) 
		{ 
		   if (mve=="b" || mve=="t") 
		   {
		   		mousePosTop=(dlib.navigator("IE"))? window.event.y-parseInt(top)+document.body.scrollTop:e.pageY-parseInt(top);
				dlib.layers(LyrNme).top(mousePosTop);
		   }	
		   if (mve=="b" || mve=="l")
		   {
		   		mousePosLeft=(dlib.navigator("IE"))? window.event.x:e.pageX;
				if (gauche) dlib.layers(LyrNme).right(mousePosLeft+parseInt(left));
				else dlib.layers(LyrNme).left(mousePosLeft-parseInt(left));
		   }
		}
	}
	else document.onmousemove=function (e){};			
}

/*function LyrDrag(LyrNme, Start, lequel, left, top){
	if (lequel.indexOf("l")==0 || lequel.indexOf("t")==0) mve=(lequel.indexOf("l")!=-1)?"l":"t";
	else mve="b";
	if (Start){  
		if (GetNavType(0)) document.captureEvents(Event.MOUSEMOVE);												  
	   	document.onmousemove=function (e) { 
		   if (mve=="b" || mve=="t") dlib_LyrObj(LyrNme).pixelTop=(!GetNavType(0))? window.event.y-parseInt(top)+document.body.scrollTop:e.pageY-parseInt(top);
		   if (mve=="b" || mve=="l") dlib_LyrObj(LyrNme).pixelLeft=(!GetNavType(0))? window.event.x-parseInt(left):e.pageX-parseInt(left);
		   }}
		else document.onmousemove=function (e){};
		
		
dlib_LyrObj(LyrNme).visibility="visible";		
}*/