function taille_zone_blanche(height)
{
	document.getElementById("zone_blanche").height = height;
}

// ============================================================
// Ouvre des popups centrées
// ============================================================
function PopupCentrer(page,largeur,hauteur,options) {
	var top=(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2;
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

// JavaScript Document
function ouvrir_lien(url) {
	var ma_fenetre = window.open(url, "_blank", "", "");	
}

// Affichage / masquage d'un objet spécifié par son attribut id
function toggle(object_id){
 var obj=document.getElementById(object_id)	
 	if(obj.style.display =='none')
 	{
 		obj.style.display='block'
 	}
 	else
 	{
  		obj.style.display='none'
	}
 }
 
 
 // Toggle pour les univers
function change(object_id,deplie,replie){
 var obj=document.getElementById(object_id);
 var objimg=document.getElementById('img_'+object_id);
	if(obj.style.display =='none') //si masqué on deplie
 	{
		obj.style.display='block';
		//alert(deplie);
		objimg.src = deplie;
 	}
 	else//sinon on replie
 	{
		obj.style.display='none';
		//alert(replie);
		objimg.src = replie;
	}
 }
 
  // Masquage d'un objet spécifié par son attribut id
function masque(object_id){
 var obj=document.getElementById(object_id)	
  obj.style.display='none'
 }
 
// Changement de l'image pour RS360
function rs360(nom_img){
 var mon_img=document.getElementById('image_big')	
 mon_img.src ='img/'+nom_img;
}



// blockage du menu
function menu_rouge(object_id){
 var obj=document.getElementById(object_id)	
 obj.style.display='block'
}

 // Pour la galerie de dessin
function etoile(object_id)
{
	var obj=document.getElementById(object_id);	
	if(obj.src=='img/creer_galerie005.gif')obj.src = 'img/creer_galerie006.gif';
	else obj.src = 'img/creer_galerie005.gif';
}
function etoile_neutre(object_id)
{
	var obj=document.getElementById(object_id);	
	obj.src='img/creer_galerie006.gif';
}

/**************************************************************************/
/*                      formulaire newsletter                             */
/**************************************************************************/
function enlever(zone){var obj=document.getElementById(zone);obj.style.display='none'}
function mettre(zone){var obj=document.getElementById(zone);obj.style.display='block'}
function cache(zone){ document.getElementById(zone).style.display='none';}
function associe_valeur(valeur,nb)
{
	document.getElementById('lu'+nb).value=valeur;
	document.getElementById('ma'+nb).value=valeur;
	document.getElementById('me'+nb).value=valeur;
	document.getElementById('je'+nb).value=valeur;
	document.getElementById('ve'+nb).value=valeur;
	document.getElementById('sa'+nb).value=valeur;
	document.getElementById('di'+nb).value=valeur;
}

// Changement de l'image  pour la newsletter en fonction de l'id
function mouseon_news(object_id,imagebg){var obj=document.getElementById(object_id);	obj.style.backgroundImage = 'url(../parent/img/'+imagebg+')';}
function mouseoff_news(object_id){var obj=document.getElementById(object_id);	obj.style.backgroundImage = 'none';}


// ================================================================
// Changement d'image et de couleur de fond pour la partie Magasin
// ================================================================
// Changement de la couleur de fond en fonction de l'id
function mouseon(object_id,couleuron)
{
	var obj=document.getElementById(object_id);	
	var obj2=document.getElementById("img_g"+object_id);	
	var obj3=document.getElementById("img_d"+object_id);

	obj.style.backgroundColor = couleuron;
	obj2.style.backgroundImage = 'url(../parent/img/magasins006.gif)';
	obj3.src = 'img/magasins005.gif';
}

function mouseoff(object_id,couleuroff)
{
	var obj=document.getElementById(object_id);	
	var obj2=document.getElementById("img_g"+object_id);
	var obj3=document.getElementById("img_d"+object_id);
	
	obj.style.backgroundColor = couleuroff;
	obj2.style.backgroundImage = 'none';
	obj3.src = 'img/magasins007.gif';
}


//===========================
// FONCTION D'OPACITE
//============================
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function opacity(id, opacStart, opacEnd, millisec) 
{
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;
	if(opacStart > opacEnd) 
	{
		for(i = opacStart; i >= opacEnd; i--) 
		{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} 
	else if(opacStart < opacEnd) 
	{
		for(i = opacStart; i <= opacEnd; i++) 
		{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}


// =======================
//	fonction automatique
// ========================
 function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' doit contenir une adresse email.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += ' '+nm+' est demandé.\n'; }
  } if (errors) alert('Veuillez remplir tous les champs');
  document.MM_returnValue = (errors == '');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}