function pop()
{
	var myAs = document.getElementsByTagName('a');
	for (var a = 0; a < myAs.length; ++a) {
		// Si le lien a une classe de type pop
		if (myAs[a].className == 'pop') {
			// on extrait l'id de la popup à partir du href
			var pop = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));
			// si la popup existe on l'affiche (display block)
			if (pop) {
				pop.style.display = 'none';
				myAs[a].onclick = function() {
					thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1))
					thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none';
					return false;
				};
				// on efface la popup en cliquant dessus
				/*
				pop.onclick = function(){
				this.style.display = 'none';
				};
				*/

			}
		}
	}
}

/*
function pop()
{
var myAs = document.getElementsByTagName('a');
for (var a = 0; a < myAs.length; ++a) {
// Si le lien a une classe de type pop
if (myAs[a].className == 'pop') {
// on extrait l'id de la popup à partir du href
var pop = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));
// si la popup existe on l'affiche (display block)
if (pop) {
pop.style.display = 'none';
myAs[a].onclick = function() {
thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1))
thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none';
return false;
};
// on efface la popup en cliquant dessus
pop.onclick = function()
{
this.style.display = 'none';
};
}
}
}
}

window.onload = pop;

*/

function popv()
{
	var myAs = document.getElementsByTagName('a');
	for (var a = 0; a < myAs.length; ++a) {
		// Si le lien a une classe de type pop
		if (myAs[a].className == 'pop') {
			// on extrait l'id de la popup à partir du href
			var pop = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));
			var fermer = document.getElementById('fermer_'+ myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));

			// si la popup existe on l'affiche (display block)
			if (pop) {

				pop.style.display = 'none';
				myAs[a].onclick = function() {

					thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1))
					// on remplie le champs hidden qui s'appelle name
					document.formMail.Element.value = document.getElementById(this.lang).innerHTML;
					//document.formMail.Email.focus();
					thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none';

					return false;
				};

				fermer.onclick = function(){
					pop.style.display = 'none';
				};

			}
		}
	}
}


function popv_onlyFF()
{
	var myAs = document.getElementsByTagName('a');
	for (var a = 0; a < myAs.length; ++a) {
		// Si le lien a une classe de type pop
		if (myAs[a].className == 'pop') {
			// on extrait l'id de la popup à partir du href
			var pop = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));
			var fermer = document.getElementById('fermer_'+ myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));


			// si la popup existe on l'affiche (display block)
			if (pop) {

				pop.style.visibility = 'hidden';
				myAs[a].onclick = function() {

					thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1))
					// on remplie le champs hidden qui s'appelle name


					document.formMail.Element.value = document.getElementById(this.name).innerHTML;
					document.formMail.Email.focus();
					//alert(document.formMail.Element.value);
					thisPopup.style.visibility = (thisPopup.style.visibility == 'hidden') ? 'visible' : 'hidden';

					return false;
				};
				// on efface la popup en cliquant dessus

				fermer.onclick = function(){
					pop.style.visibility = 'hidden';
				};

			}
		}
	}
}

