var objValue=null;
var tmp=null;
var thisColor=null;
var thisColorId=null;
var masterObj;

function setObj(objId){
	var thisId=objId;
	thisColorId=(thisId==1)?'un':(thisId==2)?'deux':(thisId==3)?'trois':(thisId==4)?'quatre':(thisId==5)?'cinq':(thisId==6)?'six':(thisId==7)?'sept':(thisId==8)?'huit':(thisId==9)?'o9':(thisId==10)?'o10':(thisId==11)?'o11':(thisId==12)?'o12':(thisId==13)?'o13':(thisId==14)?'o14':(thisId==15)?'o15':(thisId==16)?'o16':(thisId==17)?'o17':(thisId==18)?'o18':(thisId==19)?'o19':(thisId==12)?'o20':1;
	setColor(thisColorId);
}

function setColor(id){
	masterObj=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:document.layers[id];
	thisColor=masterObj.style.color;
	masterObj.style.color=thisColor;
}
function out(){
//	alert(masterObj+' - '+thisColorId+' - '+thisColor);
	masterObj.style.color=thisColor;
}

function setClass(aId,numDiv){

	for(j=1;j<=numDiv;j++){// enleve la class du A

		aInnerId=(j==1)?'un':(j==2)?'deux':(j==3)?'trois':(j==4)?'quatre':(j==5)?'cinq':(j==6)?'six':(j==7)?'sept':(j==8)?'huit':(j==9)?'o9':(j==10)?'o10':(j==11)?'o11':(j==12)?'o12':(j==13)?'o13':(j==14)?'o14':(j==15)?'o15':(j==16)?'o16':(j==17)?'o17':(j==18)?'o18':(j==19)?'o19':(j==20)?'o20':1;
		aInnerObj=(document.getElementById)?document.getElementById(aInnerId):(document.all)?document.all[aInnerId]:document.layers[aInnerId];
//		aInnerObj.style.color='#00b5cb';
		aInnerObj.className='';
	
	}

//	aId=(aId==1)?'un':(aId==2)?'deux':(aId==3)?'trois':(aId==4)?'quatre':(aId==5)?'cinq':(aId==6)?'six':(aId==7)?'sept':(aId==8)?'huit':(aId==9)?'neuf':(aId==10)?'dix':1;
	aId=(aId==1)?'un':(aId==2)?'deux':(aId==3)?'trois':(aId==4)?'quatre':(aId==5)?'cinq':(aId==6)?'six':(aId==7)?'sept':(aId==8)?'huit':(aId==9)?'o9':(aId==10)?'o10':(aId==11)?'o11':(aId==12)?'o12':(aId==13)?'o13':(aId==14)?'o14':(aId==15)?'o15':(aId==16)?'o16':(aId==17)?'o17':(aId==18)?'o18':(aId==19)?'o19':(aId==20)?'o20':1;
	aObj=(document.getElementById)?document.getElementById(aId):(document.all)?document.all[aId]:document.layers[aId];
//	aObj.style.color='#132530';
	aObj.className='selected';

	objValue=null;
}


function blinkIt(id,couleur){
		realId = id;

	if(realId!=0){				
		id=(id==1)?'un':(id==2)?'deux':(id==3)?'trois':(id==4)?'quatre':(id==5)?'cinq':(id==6)?'six':(id==7)?'sept':(id==8)?'huit':(id==9)?'neuf':(id==10)?'dix':(id==10)?'o11':(id==10)?'o12':(id==10)?'o13':(id==10)?'o14':(id==10)?'o15':(id==10)?'o16':(id==10)?'o17':(id==10)?'o18':(id==10)?'o19':(id==10)?'o20':1;
		obj=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:document.layers[id];
			tmp=(couleur==null)?'#00b5cb':couleur;
			tmp=(tmp!='' || tmp != null)?tmp:'#00b5cb';
			objValue=(tmp=="#00b5cb")?"#068698":(tmp=="#068698")?"#132530":"#00b5cb";
		    obj.style.color=objValue;
			setTimeout("blinkIt(realId,objValue)",300)
	}else{
	// set master object back
		masterObj.style.color=thisColor;
	}

}
function showDiv(id,numDiv){
	counter=id;
	numDiv=numDiv;
	id='galerie'+id;
	divObj=(document.getElementById)?document.getElementById(id):(document.all)?document.all[id]:document.layers[id];

	for(i=1;i<=numDiv;i++){// cache tout les div`s
		innerId='galerie'+i;
		innerObj=(document.getElementById)?document.getElementById(innerId):(document.all)?document.all[innerId]:document.layers[innerId];
		innerObj.style.display="none";
	}
	
	// on affiche le div selectionne
	setClass(counter,numDiv);
	divObj.style.display="block";
	
}


