larg=screen.width/2;
haut=screen.height/2;
valeur=haut-(haut/2);

//------------------------------------------------------------------------------------
// Fonction CacheMail
//--------------------------------------------------------------------------------
function CacheMail(mail,domain) {
 this.location = 'mailto:' + mail + '@'+ domain;
}

//------------------------------------------------------------------------------------
// Script Notice légale
//------------------------------------------------------------------------------------
function showCPR(s) {
       var y = new Date().getYear();
       if (y<1900) y+=1900;
       if (s!=y)
          document.write(s + " - " + y);
	       else
          document.write(y);
}
//------------------------------------------------------------------------------------
// Swap Menu
//------------------------------------------------------------------------------------
var currentId;

function swap(id)
{
	var o1 = $("tab"+id);
	var o2 = $("bt"+id);
	
	if (o1.style.display == "none") {
		$("tab1").style.display ="none";
		$("tab2").style.display ="none";
		o1.style.display = "";
		
		if (typeof currentId != 'undefined') o2.src = "Images/Menu/bt_0"+ id +"_off.gif";
		o2.src = "Images/Menu/bt_0"+ id +"_on.gif";
		currentId = id;
		resize(id);
	} else {
		o1.style.display = "none";
		resize(0);
	}
}

function resizeHContent() {
	if ($('HContent') != null) {
		$('HContent').style.height = $('HContent').offsetHeight = "100%";
	}
}

function resize(id) {
	var h = 235;
	switch(id) {
		case 1: h = 330; break;
		case 2: h = 350; break;
	}
	if (typeof window.Rub == 'undefined') h+=80;
	$("Dummy").height = h;
}

function survol(id)
{
	$("bt"+id).src = "Images/Menu/bt_0"+ id +"_on.gif";
}
function survolOut(id)
{
	$("bt"+id).src = "Images/Menu/bt_0"+ id +"_off.gif";
}

function isCP(obj) {
	if (isNaN(obj.value)==false && obj.value.length==5)  return true;
	else return false;
}
function isEmail(obj) 
{
       if (obj.value.indexOf(" ") + "" == "-1"
       && obj.value.indexOf("@") + "" != "-1"
       && (obj.value.lastIndexOf(".") > obj.value.indexOf("@"))
       && obj.value != "") return true;
       else return false;
}
function TestParam()
{
	var Form = document.forms["FormContact"]; //forms = tous les formulaires du document
	if (Form.eNom.value == "")
		{ alert("Attention, le champ 'Nom' doit être renseigné"); Form.eNom.focus(); return false; }
	/*if (Form.ePrenom.value == "")
		{ alert("Attention, le champ 'Prénom' doit être renseigné"); Form.ePrenom.focus(); return false; }*/
	if (Form.eCodePostal.value != "" && !isCP(Form.eCodePostal))
		{ alert("Merci de renseigner le champ 'Code postal' correctement"); Form.eCodePostal.focus(); return false; }
	if (Form.eEmail.value == "" || !isEmail(Form.eEmail))
		{ alert("Merci de renseigner le champ 'Email' correctement"); Form.eEmail.focus(); return false; }
	if (Form.eMessage.value == "")
		{ alert("Attention, le champ 'Message' doit être renseigné"); Form.eMessage.focus(); return false; }
	if (Form.eCodePostal.value == "")
		{ alert("Attention, le champ 'Code postal' doit être renseigné"); Form.eMessage.focus(); return false; }
	if (Form.eVille.value == "")
		{ alert("Attention, le champ 'Ville' doit être renseigné"); Form.eMessage.focus(); return false; }
	if (Form.eTel.value == "")
		{ alert("Attention, le champ 'Téléphone' doit être renseigné"); Form.eMessage.focus(); return false; }
	return true;
}

function TestParamRecherche()
{
	var Form = document.forms["FormRecherche"]; //forms = tous les formulaires du document
	if (Form.eRecherche.value == "" || Form.eRecherche.value == "Mot-clé")
		{ alert("Veuillez saisir des mots-clé pour votre recherche."); Form.eRecherche.focus(); return false; }
	return true;
}

function checkForInt(evt) {
	var charCode = ( evt.which ) ? evt.which : event.keyCode;
	return (charCode < 32 || (charCode >= 48 && charCode <= 57));
}

function GetId(Ctl) {
	return document.getElementById(Ctl);
}

function closeall()
{
	var list = $$(".texteTab1")
	list.each(function(el) { el.style.display="none" });
}
function closeall1()
{
	var list = $$(".texteTab2")
	list.each(function(el) { el.style.display="none" });
}

function deroul(id)
{
//	alert (id);
	if (GetId("tab"+id).style.display=="none")
		{
			closeall();
			closeall1();
			GetId("tab"+id).style.display="";
		}
	else
		GetId("tab"+id).style.display="none";
}

function deroul1(id)
{
//	alert (id);
	if (GetId("tb"+id).style.display=="none")
		{
			closeall1();
			GetId("tb"+id).style.display="";
		}
	else
		GetId("tb"+id).style.display="none";
}

function fixFlash(s) { document.write(s); }
function openCarte(url, width, height){
  var pleft;
  pleft = 10;
  if (document.all) width = width + 20;
  if (document.all) { 
    if (width<document.body.clientWidth) pleft = (document.body.clientWidth-width)/2;
  } else { 
    if (width<window.innerWidth) pleft = (window.innerWidth-width)/2; 
  }

  window.open(url,'popup','width='+width+', height='+height+', top=10,left='+pleft+',status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,directories=no,resizable=yes');
}
