isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
var V=navigator.appVersion;

if (isIE4 || isIE5 || isNS6 ) {
	isWIN=(V.indexOf("Win",0)>0)?true:false;
	isMAC=(V.indexOf("Mac",0)>0)?true:false;	
	isLINUX=(V.indexOf("Linux",0)>0)?true:false;	
}
if(isNS4) {
	isMAC=(V.indexOf("Mac",0)>0)?true:false;
	isLINUX=(V.indexOf("Linux",0)>0)?true:false;
	isWIN=(V.indexOf("Win",0)>0)?true:false;
}

function retCalc(nomdiv)
{
	if(isNS4) elm = document.layers[nomdiv];
	else if (isIE4 || isMAC) elm = document.all[nomdiv];
	else if (isIE5 || isNS6) elm = document.getElementById(nomdiv);

	return elm;
}
var idxongleth;
var idxonglet;

function reloadpage(idxonglet,lurl)
{
	window.location.href=lurl+"&actongh="+idxonglet;	
}

function chgonglet(idxonglet,lepath)
{
	
	if(idxonglet != "ong"+actong)
	{
		actclkong=retCalc(idxonglet);		
		oldclkong=retCalc("ong"+actong);
		if(isIE4 || isIE5 || isNS6) {
			actclkimg=retCalc("img"+ idxonglet.substring(3,idxonglet.length));
			oldclkimg=retCalc("img"+actong);
			oldclkong.style.zIndex=actong;
			actclkong.style.zIndex=100;
			
			actclkimg.src=lepath+"imgongleth.php?chaine="+parseInt(1+parseInt(idxonglet.substring(3,idxonglet.length)))+"&actif="+idxonglet.substring(3,idxonglet.length);
			oldclkimg.src=lepath+"imgongleth.php?chaine="+(1+parseInt(actong));
		} else {
			oldclkong.zIndex=actong;
			actclkong.zIndex=100;
			actclkimg=eval("document.img"+idxonglet.substring(3,idxonglet.length));
			oldclkimg=eval("document.img"+actong);
			actclkimg.src=lepath+"imgongleth.php?chaine="+parseInt(1+parseInt(idxonglet.substring(3,idxonglet.length)))+"&actif="+idxonglet.substring(3,idxonglet.length);
			oldclkimg.src=lepath+"imgongleth.php?chaine="+(1+parseInt(actong));
		}
		actong = idxonglet.substring(3,idxonglet.length);
	}
}

function chgongleth(idxongleth,lepath)
{
	if(idxongleth != "ongh"+actongh)
	{
		actclkongh=retCalc(idxongleth);		
		oldclkongh=retCalc("ongh"+actongh);
		
		if(isIE4 || isIE5 || isNS6) {
			actclkimgh=retCalc("imgh"+ idxongleth.substring(4,idxongleth.length));
			oldclkimgh=retCalc("imgh"+actongh);
			oldclkongh.style.zIndex=actongh;
			actclkongh.style.zIndex=100;	
			actclkimgh.src=lepath+"imgongleth.php?chaine="+parseInt(1+parseInt(idxongleth.substring(4,idxongleth.length)))+"&actif="+idxongleth.substring(4,idxongleth.length);
			oldclkimgh.src=lepath+"imgongleth.php?chaine="+(1+parseInt(actongh));
		} else {
			oldclkongh.zIndex=actongh;
			actclkongh.zIndex=100;
			actclkimgh=eval("document.imgh"+idxongleth.substring(4,idxongleth.length));
			oldclkimgh=eval("document.imgh"+actongh);
			actclkimgh.src=lepath+"imgongleth.php?chaine="+parseInt(1+parseInt(idxongleth.substring(4,idxongleth.length)))+"&actif="+idxongleth.substring(4,idxongleth.length);
			oldclkimgh.src=lepath+"imgongleth.php?chaine="+(1+parseInt(actongh));
		}
		actongh = idxongleth.substring(4,idxongleth.length);
	}
}