//************************************************************************
//						Gestion JavaScript : Howard's
//************************************************************************
// Auteur : Abiotik / jean luc COSTAGLIOLA
// tous droits réservés
// contact : 04 67 57 03 72
//************************************************************************
// --------------------------------------- copyright abiotik 2009

/*	
TABLEAU DE CORRESPONDANCE
PWB / Nom rub / rub abk

num=121 	Chemises Cintrées			1
num=71	 	Chemises Traditionnelles	2
num=81	 	Cravates					3
num=131	 	Noeuds papillon				4
num=111 	Boutons de Manchettes		5
num=101 	Ceintures					6
num=61	 	Accessoires					7

*/
	


//*********************************************************************
//				           GESTION MENU 
//*********************************************************************
var memo=1;
var timeout;
var timeAttente;
var sousGammeOK=1;
var calque=1;
// Fonctions gestion calque
function temps(a){
//var memo = a
	timeout = setTimeout('supCalque(memo)',100);
	clearTimeout(timeAttente);
}

var tabCouleur = new Array("#C0B384","CDA212","#99843D","874923","#0F8A7A","#8A046C","#BF0303","#645959","","","","")
 
function affCalque(calque){
	c=calque;
	timeAttente = setTimeout('lanceCalque(c)',200);
}

function lanceCalque(c){
	var n=1;
	with (document.getElementById("SG" + memo).style)
		visibility="hidden";
	
	// gestions pour menu principal
	//------------------------
	if(c<10){
		if(memo<10){
			with (document.getElementById("celRub" + memo).style)
			backgroundColor = "";	
		}
	// forcage affiche image
		var tabImageCalque=new Array("","CC","CT","CR","NP","BM","CE","AC"); 
		AffichImageGamme(tabImageCalque[c], "gamme");	

		with (document.getElementById("celRub" + c).style)
			backgroundColor = tabCouleur[c];	
		// appel opac
		OpacOK(50);		
	}	
	//------------------------	
	
	with (document.getElementById("SG" + c).style)
		visibility="visible";	
	
	memo = c;	
}


function stopTemps(){
	clearTimeout(timeout);
	//OpacOK(50);
}

function supCalque() {
  if (sousGammeOK == 1){
	with (document.getElementById("SG" + memo).style)
		visibility="hidden";

	// gestions pour menu principal
	//------------------------
		if(memo<10){
			with (document.getElementById("celRub" + memo).style)
			backgroundColor = "#C0B384";			
			OpacOK(0);
		}
	
	}
}

//-------------------------------
// functions gestion imageGamme
//-------------------------------
// CC - CT - CR - NP - BM - CE - AC
// CC_img - CT_img - etc.
// CT_ClassiqueSimple ... //CT_gamme

function AffichImageGamme(calque, AppelImage){ 
	/*
	if(AppelImage != 0){
		document.getElementById("CT_img").src="../site/graph/ambianceCalques/images/"+calque+"_"+AppelImage+".jpg";
	}
	*/
}


//-------------------------------
// functions gestion calque fond
//-------------------------------
function tempsOpac(){
	clearTimeout(timeOpac);
	timeOpac= setTimeout('changeOpac()',50);
}


 function OpacOK(valeur){
	
	if (document.all){
		with (document.getElementById("fondPage").style)
			filter=eval('"alpha(opacity='+valeur+')"');
	}
	else{
		with (document.getElementById("fondPage").style)
			opacity=(valeur/100);			
	}
	if(valeur==50){
		with (document.getElementById("fondPage").style){			
			width="100%";
			height="115%";
		}
	}
	else{
		with (document.getElementById("fondPage").style){			
			width="1";
			height="1";	
		}
	}
 }
