// JavaScript Document

function montreMenu(id) {
var d = document.getElementById(id);
	for (var i = 1; i<=10; i++) {
		if (document.getElementById('smenu'+i)) {document.getElementById('smenu'+i).style.display='none';}
	}
if (d) {d.style.display='block';}
}


function afficheTexte(n){
	
	for(var z=0;z<15;z++){		
		
		if (document.getElementById){   document.getElementById("marque_"+z).style.visibility="hidden";	}
		if (document.all && !document.getElementById){ document.all["marque_"+z].style.visibility="hidden";}
		if (document.layers){	document.layers["marque_"+z].visibility="hidden";}
	
	}
	
	if (document.getElementById){   document.getElementById("marque_"+n).style.visibility="visible";}
	
	if (document.all && !document.getElementById){   document.all["marque_"+n].style.visibility="visible";}
	
	if (document.layers){    document.layers["marque_"+n].visibility="visible";}
	
	
}

function cacheTout(){
	
	
	for(var i=1;i<15;i++){
		
		if (document.getElementById){   
		
			document.getElementById("marque_"+i).style.visibility="hidden";
			document.getElementById("marque_"+i).style.position="absolute";
			document.getElementById("marque_"+i).style.zIndex=i;
			
		
		}
		
		if (document.all && !document.getElementById){
			
			document.all["marque_"+i].style.visibility="hidden";
			document.all["marque_"+i].style.position="absolute";
			document.all["marque_"+i].style.zIndex=i;
			
			
			
		}
		if (document.layers){
			
			document.layers["marque_"+i].visibility="hidden";
			document.layers["marque_"+i].position="absolute";
			document.layers["marque_"+i].zIndex=i;
			
			
			
		}
	}
	
	if (document.getElementById){
			
			document.getElementById("marque_"+0).style.position="absolute";
			document.getElementById("marque_"+0).style.zIndex=0;
			}
		if (document.all && !document.getElementById){	
			
			document.all["marque_"+0].style.position="absolute";
			document.all["marque_"+0].style.zIndex=0;
			}
		if (document.layers){
			
			document.layers["marque_"+0].position="absolute";
			document.layers["marque_"+0].zIndex=0;
			}
		
	
}

function PopupCentrer(page,largeur,hauteur) {
	
	if(! window.focus){  return; }
  	var top=(screen.height-hauteur)/2;
 	var left=(screen.width-largeur)/2;
  	var option = "scrollbars=no,status=no,menubar=no,resizable=no";
  	var credit = window.open(page,'mentions',"top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+option);
  	credit.focus();
	page.target = 'mentions';
}

function PopupImage(img) {
	var titre="Rien ne va plus";
	w=open("",'image','width=640,height=480,toolbar=no,scrollbars=no,resizable=yes');	
	w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
	w.document.write("<SCRIPT language=javascript>function checksize()  { if (document.images[0].complete) {  window.resizeTo(document.images[0].width+12,document.images[0].height+30); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
	w.document.write("<BODY onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0 alt=Fermer onClick=window.close()>");
	w.document.write("");
	w.document.write("</BODY></HTML>");
	w.document.close();
}

// Fonction de rollover (photos des boutiques)
function afficheBig(nom,src) {	
	// nom est le nom de l'image
	// src est l'adresse du fichier d'image	
	var chaine = src;
	chaine = chaine.replace('-mini','');
	//alert (chaine);
	document.images[nom].src=chaine;
}

// Fonction de rollover classique
function rollover(nom,src) {	
	// nom est le nom de l'image
	// src est l'adresse du fichier d'image	
	var chaine = src;
	chaine = chaine.replace('.jpg','-roll.jpg');
	//alert (chaine);
	document.images[nom].src=chaine;
}
function rollout(nom,src) {	
	// nom est le nom de l'image
	// src est l'adresse du fichier d'image	
	var chaine = src;
	chaine = chaine.replace('-roll','');
	//alert (chaine);
	document.images[nom].src=chaine;
}

// Fonction de preload automatique des grandes vignettes des page boutique
function trouveBig() {
	
		
		var tab = new Array();
			
		for (var i = 0; i < document.images.length ; i++) {
			
			var source = document.images[i].src;
			
			if(source.indexOf('boutique')!= -1){
				
				var chaine = source;
				chaine = chaine.replace('-mini','');
				
				tab.push(chaine);						
				
				
			}		
			
		}
		
		var temp = new load(tab);
		
		
		
}
// Fonction de preload
function load(tab) {
	if (document.images) {
		for (var i = 0; i < tab.length ; i++) {
			this[i+1] = new Image();
			this[i+1].src = tab[i];
		}
	}
}

// fonction d'ajout aux favoris
function favoris(){
	{
	if (document.all)
	{
	window.external.AddFavorite(location.href, document.title);
	}
	else
	{
	alert('Vous pouvez faire CTRL + D pour ajouter cette page dans vos signets, ou favoris.')
	}
	} 
} 