var isNS = false;
var isIE = false;
var isW3C = false;
if (navigator.appName.indexOf('Netscape')>-1) {isNS=true; isIE=false; isW3C=false;}
if (document.getElementById) {isNS=false; isIE=false; isW3C=true;}
if (document.all) {isNS=false; isIE=true; isW3C=false;}

function setImg(imgName, srcFile)
	{
	imgName.src=srcFile;
	}

function popUp(src,name,x,y,w,h)
	{
	window.open(src,name,"left="+x+",top="+y+",height="+h+",width="+w+",scrollbars=0,status=0,location=0,menubar=0,resizable=0");
	}

function popUpScroll(src,name,x,y,w,h)
	{
	window.open(src,name,"left="+x+",top="+y+",height="+h+",width="+w+",scrollbars=1,status=0,location=0,menubar=0,resizable=0");
	}

function displayLayer(l) { zl_hd(l,(isNS)?'show':'visible'); }

function hideLayer(l) { zl_hd(l,(isNS)?'hide':'hidden'); }

function moveLayer(l,x,y) {
if (isNS) {
zl_lref(l).x = x;
zl_lref(l).y = y;
} else {
zl_lref(l).style.left = x;
zl_lref(l).style.top = y;
}
}

function zl_hd(l,s) {
if (isNS) zl_lref(l).visibility = s;
else zl_lref(l).style.visibility=s;
}

function zl_lref(l) {
if (isNS) return document.layers[l];
if (isIE) return document.all[l];
if (isW3C) return document.getElementById(l);
}

function checkContent(checked,numid) {
	if(checked) {zl_lref("prn"+numid).className="txtPromo";zl_lref("prp"+numid).className="titreViolet";zl_lref("tabProm"+numid).style.background="#FFCC99";}
	else {zl_lref("prn"+numid).className="titreViolet";zl_lref("prp"+numid).className="txtPromo";zl_lref("tabProm"+numid).style.background="#FFF5F5";}
	}

function initMovelistener()
	{
	if (isIE) document.onmousemove = mouseMove;
	if (isW3C) document.addEventListener("mousemove", mouseMove, true);
	}
	
function mouseMove(ev)
	{
	if (isIE) {window.m_X=event.x+document.body.scrollLeft; window.m_Y=event.y+document.body.scrollTop;}
	if (isW3C) {window.m_X=ev.clientX+window.pageXOffset; window.m_Y=ev.clientY+window.pageYOffset;}
	}

function show_coul(coul)
	{
	if (isIE)
		{
		couleurimg.src=coul;
		}
	else
		{
		document.getElementById('couleurimg').src=coul;
		}
	moveLayer('couleurzoom',window.m_X-50,window.m_Y-125);
	displayLayer('couleurzoom');
	}
	
function hide_coul()
	{
	hideLayer('couleurzoom');
	if (isIE)
		{
		couleurimg.src="media/produits/chargement.gif";
		}
	else
		{
		document.getElementById('couleurimg').src="media/produits/chargement.gif";
		}
	}

function select_coul(form,radio_num)
	{
	document.forms['prod_'+form].couleur[radio_num].checked=true;
	}
