
function maskListe(){
	
	var	objTags = document.getElementsByTagName("SELECT");
 for (i=0; i<objTags.length; i++)
  {
       objTag =  objTags[i];
       objTag.style.display = "none";		
			 objTag.style.visibility = "hidden";		
  }

	
	}
	
	function afficheListe(){
	
	var	objTags = document.getElementsByTagName("SELECT");
 for (i=0; i<objTags.length; i++)
  {
       objTag =  objTags[i];
       objTag.style.display = "block";		
			 objTag.style.visibility = "visible";		
  }

	
	}


function checkConfirm(url) {
       var a = false;
       a= confirm ('Voulez-vous supprimer cet élément ?');
       if (a) {
           document.location.href = url;
       }
}
function checkPurge(url) {
       var a = false;
       a= confirm ('Cette opération est irréversible. Souhaitez-vous continuer ?');
       if (a) {
           document.location.href = url;
       }
}

function affiche(src){
		var imgCentre = document.getElementById("photoCentre");
		imgCentre.src=src;
	}


function insertCodeActu(idActu){
	
	var contenu = document.getElementById(idActu);
	obj.insertAtSelection(contenu.innerHTML);
	
	}



function delPhoto(inputId){
	var idInput = inputId + "par_img";
	var inputPhoto = document.getElementById(idInput);
	
	inputPhoto.value = "";
	
	var idPhoto = inputId + "image";
	var photo = document.getElementById(idPhoto);
	photo.style.display = "none";		
	photo.style.visibility = "hidden";	
	

	
	}
	
	
function getFiche(lang){
	var idBlocFiche = "blocFiche" + lang;
	var idBlocHome = "blocHome" + lang;
	
	var blocFiche = document.getElementById(idBlocFiche);
	var blocHome = document.getElementById(idBlocHome);
	
	 blocHome.style.display = "none";
    blocHome.style.visibility = "hidden";
    
     blocFiche.style.display = "block";		
			 blocFiche.style.visibility = "visible";	
	}	

function getHome(lang){
	
	var idBlocFiche = "blocFiche" + lang;
	var idBlocHome = "blocHome" + lang;
	var blocFiche = document.getElementById(idBlocFiche);
	var blocHome = document.getElementById(idBlocHome);
	
	 blocFiche.style.display = "none";
    blocFiche.style.visibility = "hidden";
    
     blocHome.style.display = "block";		
			 blocHome.style.visibility = "visible";	
	}	
	
	

function getLang(idBloc){
		 
		var blocClass = getElementsByClassName( "div", "blocLang");
		
		for( i=0; i < blocClass.length; i++){
    blocClass[i].style.display = "none";
    blocClass[i].style.visibility = "hidden";
  }
  
  var blocAffiche = document.getElementById(idBloc);
  
 	 		 blocAffiche.style.display = "block";		
			 blocAffiche.style.visibility = "visible";		
		
		}




function getElementsByClassName( strTagName, oClassNames){
	
	var arrElements =  document.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
		
	if(typeof oClassNames == "object"){
		for(var i=0; i<oClassNames.length; i++){
			arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
		}
	}
	else{
		arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
	}
	
	var oElement;
	var bMatchesAll;
	for(var j=0; j<arrElements.length; j++){
		oElement = arrElements[j];
		bMatchesAll = true;
		for(var k=0; k<arrRegExpClassNames.length; k++){
			if(!arrRegExpClassNames[k].test(oElement.className)){
				bMatchesAll = false;
				break;
			}
		}
		if(bMatchesAll){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}
// ---
// Array support for the push method in IE 5
if(typeof Array.prototype.push != "function"){
	Array.prototype.push = ArrayPush;
	function ArrayPush(value){
		this[this.length] = value;
	}
}























// fonction de gestion des pop-up
function pop(adresse) {
	var Nom_Browser = navigator.appName; 
   	var Version_Browser = navigator.appVersion; 
   	if (Nom_Browser ==  'Microsoft Internet Explorer' && !window.opera) {
		window.open(adresse, 'popup', 'height=500,width=460,status=no,toolbar=no,menubar=no,location=no,resizable=yes,left=50,top=50')
	} else {
		window.open(adresse, 'popup', 'height=520,width=490,status=no,toolbar=no,menubar=no,location=no,resizable=yes,left=50,top=50')	
	}
}

function showWidthInput(monCalque, action){

	if (action) {
		document.getElementById(monCalque).style.display = "block";
		document.getElementById(monCalque).style.visibility = "visible";				
	} else {
		document.getElementById(monCalque).style.display = "none";		
		document.getElementById(monCalque).style.visibility = "hidden";		
	}
	
}

function showCalque(calqueA) {
	if (document.getElementById(calqueA).style.visibility == "visible") {
		document.getElementById(calqueA).style.display = "none";		
		document.getElementById(calqueA).style.visibility = "hidden";	
	} else {
		document.getElementById(calqueA).style.display = "block";
		document.getElementById(calqueA).style.visibility = "visible";					
	}	
}


function checkConfirm(url) {
       var a = false;
       a= confirm ('Voulez-vous supprimer cet élément ?');
       if (a) {
           document.location.href = url;
       }
}
function checkPurge(url) {
       var a = false;
       a= confirm ('Cette opération est irréversible. Souhaitez-vous continuer ?');
       if (a) {
           document.location.href = url;
       }
}
/*function checkFields(formName) {
         var status;
         var alerteMsg;
         alerteMsg = "";
         if (formName == "formulaire") {         			
              if (document.formulaire.Nom.value == '') {
                      alerteMsg += "le champ Nom est obligatoire.\n";
                      document.formulaire.Nom.focus();
              } else if (document.formulaire.Prenom.value == '') {
                      alerteMsg += "le champ Prénom est obligatoire.\n";
                      document.formulaire.Prenom.focus();
              } else if (document.formulaire.Code_postal.value == '') {
                      alerteMsg += "le champ Code Postal est obligatoire.\n";
                      document.formulaire.Code_postal.focus();
              } else if (document.formulaire.Localite.value == '') {
                      alerteMsg += "le champ Localité est obligatoire.\n";
                      document.formulaire.Localite.focus();
              } else if (document.formulaire.Email.value == '') {
                      alerteMsg += "le champ E-mail est obligatoire.\n";
                      document.formulaire.Email.focus();
              } else if (document.formulaire.Code_postal.value.length < 5) {
                      alerteMsg += "le code Postal doit comporter 5 chiffres.\n";
                      document.formulaire.Code_postal.focus();
              } else if (document.formulaire.Telephone.value.length < 10) {
                      alerteMsg += "le N° de téléphone doit comporter 10 chiffres.\n";
                      document.formulaire.Telephone.focus();
              } else {
                       document.formulaire.submit();
              }
         } 
         if (alerteMsg != "") alert(alerteMsg);
}*/
function change(vignId, vignPhoto, bigId, bigPhoto) {
	vignId = eval("document."+vignId);	
	bigId = eval("document."+bigId);	
	bigId.src = bigPhoto;
	vignId.src = vignPhoto;
}
