function GoCatalogue(famille) {
var URLCat = "http://62.161.248.215/fr/categorie.asp?nav=1&sFamille=";
window.location.href=URLCat+famille;
}

function GoCatalogueGB(famille) {
var URLCat = "http://62.161.248.215/an/categorie.asp?nav=1&sFamille=";
window.location.href=URLCat+famille;
}

function GoTous() {
var URLCat = "http://62.161.248.215/fr/home_catalogue.asp";
window.location.href=URLCat;
}

function GoTousGB() {
var URLCat = "http://62.161.248.215/an/home_catalogue.asp";
window.location.href=URLCat;
}

function GoProduit(famille) {
var URLCat = "http://62.161.248.215/fr/accueil.asp?nav=4&lig=1&pro=";
window.location.href=URLCat+famille;
}

function GoProduitGB(famille) {
var URLCat = "http://62.161.248.215/an/accueil.asp?nav=4&lig=1&pro=";
window.location.href=URLCat+famille;
}

function GoProduit2(idprod) {
var URLCat = "http://62.161.248.215/fr/accueil.asp?nav=2&lie=1&prod=";
window.location.href=URLCat+idprod;
}

function GoProduit2GB(idprod) {
var URLCat = "http://62.161.248.215/an/accueil.asp?nav=2&lie=1&prod=";
window.location.href=URLCat+idprod;
}


function allongeMenu(num) {
var d = document;
var dif;
	//calcul de la hauteur de la bande vide sous le menu
	if (navigator.appName.search("icrosoft")==-1) {                        // <-- ça c'est mon test pour navigateur IE .. si tu connais quelque chose de plus académique !
	 dif = (document.getElementById('contenu').offsetHeight-document.getElementById('gls').offsetTop+20);
	} else {
	  dif = (document.getElementById('contenu').offsetHeight-document.getElementById('gls').offsetTop-120);
	}
	if (dif>=0) {
	 document.getElementById('bande').style.display = "block";
	 document.getElementById('bande').style.height = dif+"px";
	} else {
	 document.getElementById('bande').style.display = "none";
	}
}



function AfficheBloc(nom) {
var bloc = document.getElementById(nom);
if (bloc.style.display=='block') {
	bloc.style.display='none';
} else {
	bloc.style.display='block';
}
}

function ChangeImage(nom, fichier) {
var d = document; 
var img;
img = null; 
if (d.images) {img = d.images[nom];}
if (!img && d.getElementById) {img = d.getElementById(nom);}
if (img) {img.src = fichier;}
}

function AfficheImage(ImageName, largeur, hauteur) {
m=window.open(ImageName, "popup", "scrollbars=no,status=no,width="+largeur+",height="+hauteur);
m.document.write("<HTML><HEAD></HEAD>");
m.document.write("<BODY><img src='"+ImageName+"' width='"+largeur+"' height='"+hauteur+"' /></BODY></HTML>");
}
	
function ListeRemplace(txt) {
txt = Remplace(txt,'à','a');
txt = Remplace(txt,'â','a');
txt = Remplace(txt,'ç','c'); 
txt = Remplace(txt,'é','e'); 
txt = Remplace(txt,'è','e'); 
txt = Remplace(txt,'ê','e'); 
txt = Remplace(txt,'ë','e');
txt = Remplace(txt,'ï','i'); 
txt = Remplace(txt,'î','i');
txt = Remplace(txt,'ô','o');
txt = Remplace(txt,'ö','o');
txt = Remplace(txt,'ù','u');
txt = txt.toUpperCase();
return txt;
}

   function Remplace(expr,a,b) {
      var i=0
      while (i!=-1) {
         i=expr.indexOf(a,i);
         if (i>=0) {
            expr=expr.substring(0,i)+b+expr.substring(i+a.length);
            i+=b.length;
         }
      }
      return expr
   }


function ValiDate(e, type_form) {
var f = document.cat_form;
var trouve = true;
if (type_form) {
	if (!(f.numberemployees[1].checked || f.numberemployees[2].checked || f.numberemployees[3].checked )) {
		alert("Indiquez si vous êtes un particulier ou membre d'un lycée ou d'une société, svp");
		trouve = false;
	}
	if (f.msurname.value =="") {
		alert("Entrez votre nom, svp");
		trouve = false;
	}
	if (f.firstname.value =="") {
		alert("Entrez votre prénom, svp");
		trouve = false;
	}
}
if (f.companyname.value ==""){
	alert("Entrez le nom de votre société ou de votre lycée, svp");
	trouve = false;
}
if (f.address01.value ==""){
	alert("Entrez votre adresse, svp");
	trouve = false;
}
if (f.postcode.value =="") {
	alert("Entrez votre code postal, svp");
	trouve = false;
}
if (f.town.value =="") {
	alert("Entrez votre ville, svp");
	trouve = false;
}
if (f.memail.value =="") {
	alert("Entrez votre email, svp");
	trouve = false;
}
if (!((f.memail.value.indexOf("@")>=0)&&(f.memail.value.indexOf(".")>=0))) {
	alert("email invalide !");
	trouve = false;
}
if (f.country.value == "Autres"){
	window.location.href='http://www.hpceurope.com/vfrnw/catalogue/catpdf.html';
	alert("Pas d'envoi de catalogue par courrier hors France mŽtropolitaine: tŽlŽchargez-le, svp");
	trouve = false;
}
if (!trouve) {
	if(window.event) {
       		window.event.returnValue = false;
    	} else {
		e.preventDefault();
    	}
} 
}

function ValiDateMess(e, type_form) {
var f = document.cat_form;
var trouve = true;
if (f.telephone.value ==""){
	alert("Veuillez indiquer votre numéro de téléphone, SVP");
	trouve = false;
}
if (f.msurname.value ==""){
	alert("Veuillez indiquer votre nom, svp");
	trouve = false;
}
if (f.email.value =="") {
	alert("Veuillez indiquer votre email, svp");
	trouve = false;
} else {
	if (!((f.email.value.indexOf("@")>=0)&&(f.email.value.indexOf(".")>=0))) {
		alert("email invalide !");
		trouve = false;
	}
}
if (!trouve) {
	if(window.event) {
       		window.event.returnValue = false;
    	} else {
		e.preventDefault();
    	}
} 
}

function GetAnnee() {
var dj=new Date();
document.write(dj.getFullYear());
}
