var adresse = "http://www.adequatsize.com";

//----------------------------------------------------------------------------

function getUrlVal(offset,val){

	var endstr=val.indexOf ("&", offset);
	if (endstr==-1) endstr=val.length;
	return unescape(val.substring(offset, endstr));
}

function LireUrl(nom,val){

	var arg=nom+"=";
	var alen=arg.length;
	var clen=val.length;
	var i=0;
	while (i<clen)
	{
	var j=i+alen;
	if (val.substring(i, j)==arg) return getUrlVal(j,val);
	i=val.indexOf("&",i)+1;
	if (i==0) break;
	
	}
	return null;
}


function redirection(){

	url = parent.document.location.toString();
	val = url.substring(url.indexOf("?")+1,url.length);

	tab_var = new Array("login","pseudo","sexe","tete","poitrine","poitrinebas","taille","main","entrejambes","pied","hauteur","poids","email");
	tab_var_long = tab_var.length;

	sexe = LireUrl("sexe",val);
	langue = LireUrl("langue",val);
	email = LireUrl("email",val);
	
	if(sexe == null || sexe == "")sexe="h";
	if(langue == null || langue == "")langue="FR";
	
	variables = "?";
	
	for(x=0;x<tab_var_long;x++){
	var_val = LireUrl(tab_var[x],val);
	if(var_val){
		if(langue=="EN" && tab_var[x]!="login" && tab_var[x]!="pseudo" && tab_var[x]!="sexe" && tab_var[x]!="poids" && tab_var[x]!="email")var_val=Math.round((verif_champ_oxy(var_val)/2.54)*1000)/1000 
		if(langue=="EN" && tab_var[x]=="poids")var_val=Math.round(verif_champ_oxy(var_val)/0.45)
		variables += tab_var[x]+"="+var_val+"&";
		}
	}
	
	redirection = adresse+"/"+langue+"/html/070629-"+langue+"-taillant-morpho-"+sexe+".htm"+variables;
	document.location=redirection;

}

//------------------------------------------------------------------

function cookiesEnabled(){
	if(document.cookie.length==0){
		document.cookie = "test=cookiesEnabled";
		if(document.cookie.length==0)return false;
		else return true;
	}
	else return true;
}

function getCookieVal(offset){
	var endstr=document.cookie.indexOf (";", offset);
	if (endstr==-1) endstr=document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function LireCookie(nom){
	var arg=nom+"=";
	var alen=arg.length;
	var clen=document.cookie.length;
	var i=0;
	while (i<clen)
	{
	var j=i+alen;
	if (document.cookie.substring(i, j)==arg) return getCookieVal(j);
	i=document.cookie.indexOf(" ",i)+1;
	if (i==0) break;
	
	}
	return null;
}

function EcrireCookie(nom, valeur){
	var argv=EcrireCookie.arguments;
	var argc=EcrireCookie.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path="/";
	//var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=nom+"="+escape(valeur)+
	((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
	((path==null) ? "" : ("; path="+path))+
	((domain==null) ? "" : ("; domain="+domain))+
	((secure==true) ? "; secure" : "");
}

function EffaceCookie(nom){
	date=new Date;
	date.setFullYear(date.getFullYear()-1);
	EcrireCookie(nom,null,date);
}

// morphocarte

function bouton_save(txt1,txt2,alerte1,alerte2){
	saved = document.getElementById('save');
	
	saved.style.display='none'; // pour désactiver le bouton
/*	if(cookiesEnabled()){
	
	texte1='<img src="../../images/taillant-print-omb-haut2.gif" width="171" height="4" /><br clear="all" /><span id="txt_save"><span class="enrg">'+txt1+'</span><span class="enrg">'+txt2+'</span></span><span><img name="save_pointe" src="../../images/taillant-save-pointe-o2.gif" width="51" height="26" /></span><br clear="all" /><span><img src="../../images/taillant-print-omb-bas2.gif" width="171" height="10" /></span>';
	texte2='<img src="../../images/taillant-print-omb-haut.gif" width="171" height="4" /><br clear="all" /><span onmouseover="javascript:changeclass(\'texte_save_on\',\'texte_save\');save_pointe.src=\'../../images/taillant-save-pointe-g.gif\'" onmouseout="javascript:changeclass(\'texte_save_off\',\'texte_save\');save_pointe.src=\'../../images/taillant-save-pointe-o.gif\'" onclick="javascript:enregistrer_oxylane(\''+alerte1+'\',\''+alerte2+'\');"><span><a id="texte_save" class="texte_save_off" href="#" onfocus="if(this.blur)this.blur();" >'+txt1+' '+txt2+'</a></span><span><a href="#" onfocus="if(this.blur)this.blur();" ><img name="save_pointe" src="../../images/taillant-save-pointe-o.gif" width="51" height="26" /></a></span></span><br clear="all" /><span><img src="../../images/taillant-print-omb-bas.gif" width="171" height="10" /></span>';
	
		if(LireCookie("modif")==0)saved.innerHTML = texte1;
		else saved.innerHTML = texte2;
	}*/
}

function maj_modification(maj){
	if(cookiesEnabled()){
	EcrireCookie("modif",maj);
	}
}


function verif_url(txt1,txt2,valide){
	
	url = parent.document.location.toString();
	nb_modif = 0;
	
	if(url.indexOf("?")!=-1){
	
	val = url.substring(url.indexOf("?")+1,url.length);
		if(url.indexOf("login")!=-1){ // après page traitement
		tab_var = new Array("login","pseudo","sexe","tete","poitrine","poitrinebas","taille","main","entrejambes","pied","hauteur","poids","email");
		tab_var_long = tab_var.length;
		
			if(cookiesEnabled()){			
				for(x=0;x<tab_var_long;x++){
					var_val = LireUrl(tab_var[x],val);
					if(var_val && !LireCookie(tab_var[x])){
						EcrireCookie(tab_var[x],var_val);
						nb_modif++;
						}
					else { // si pseudo déjà pris
						if(tab_var[x]=="pseudo" && var_val!=LireCookie(tab_var[x])){
						message = txt1+"\' "+LireCookie(tab_var[x])+"\' "+txt2;
						alert(message);
						EcrireCookie("pseudo",var_val);
						}
						else if(tab_var[x]=="login")EcrireCookie("login",var_val);
					}
				}
				if(nb_modif>0)maj_modification(0);
				else{info = document.getElementById('bas_morpho');
					info.innerHTML = valide;
					}
			}
			
		}
		else { // prise de mesure etape 2
			tab_var = new Array("tete","poitrine","poitrinebas","taille","main","entrejambes","pied","hauteur","poids");
			tab_var_long = tab_var.length;
				if(cookiesEnabled()){			
					for(x=0;x<tab_var_long;x++){
						var_val = LireUrl(tab_var[x],val);
						if(var_val){
							EcrireCookie(tab_var[x],var_val);
							nb_modif++;
							}
					}
					if(nb_modif>0)maj_modification(1);				
				}
			}
			
	}
}

function affiche_champs(){
	if(document.form1.sexe.value=="f")tab_var = new Array("pseudo","tete","poitrine","poitrinebas","taille","main","entrejambes","pied","hauteur","poids");
	else if(document.form1.sexe.value=="h")tab_var = new Array("pseudo","tete","poitrine","taille","main","entrejambes","pied","hauteur","poids");
		else tab_var = new Array("pseudo","tete","main","entrejambes","pied","hauteur","poids");
	tab_var_long = tab_var.length;
	
	if(cookiesEnabled()){
		for(x=0;x<tab_var_long;x++){
		var_val = LireCookie(tab_var[x]);
		if(var_val){
			document.form1[tab_var[x]].value = verif_champ_oxy(var_val);
			if(tab_var[x]!="pseudo" && tab_var[x]!="entrejambes" && tab_var[x]!="poids")modif(tab_var[x],verif_champ_oxy(var_val));
			}
		}		
	}
}

function change_val(nom,val){
	if(cookiesEnabled()){
		EcrireCookie(nom,val);
		maj_modification(1);
	}
	info = document.getElementById('bas_morpho');
	info.innerHTML = "&nbsp";
	
}


function verif_cookie(cook){
	if(cook)return true;
	else return false;
}

function pays(){

url_adequat =  parent.document.location.toString();

if(url_adequat == adresse || url_adequat == adresse+"/" || url_adequat == adresse+"/index.html")langue="FR"; // index global
else {
	if(url_adequat.indexOf ("/index.htm")!=-1)langue = url_adequat.substring(url_adequat.indexOf ("/index.htm")-2,url_adequat.indexOf ("/index.htm")); // index dossier langue
	else langue = url_adequat.substring(url_adequat.indexOf ("/html/")-2,url_adequat.indexOf ("/html/")); // autre page
}

return langue;
}

function adresse_morphocarte(){
url_adequat =  parent.document.location.toString();
lang = pays();
if(LireCookie("sexe")!=null)sexe = LireCookie("sexe");
else sexe="h";
adr = adresse+"/"+lang+"/html/070629-"+lang+"-taillant-morpho-"+sexe+".htm";
return adr;
}

function deconnexion(texte,txt1,txt2){
	if(cookiesEnabled()){
		if(LireCookie("modif")==1)reponse = confirm(texte);
		else reponse=false;	
	}
	else reponse=false;
	
	if(reponse==false){
	
		if(document.form1 && document.form2){
			if(document.form1.login.value!="")document.form1.login.value="";
			if(document.form1.pseudo.value!="")document.form1.pseudo.value="";
			if(document.form1.tete.value!="")document.form1.tete.value="";
			if(document.form1.poitrine && document.form1.poitrine.value!="")document.form1.poitrine.value="";
			if(document.form1.poitrinebas && document.form1.poitrinebas.value!="")document.form1.poitrinebas.value="";
			if(document.form1.taille && document.form1.taille.value!="")document.form1.taille.value="";
			if(document.form1.main.value!="")document.form1.main.value="";
			if(document.form1.entrejambes.value!="")document.form1.entrejambes.value="";
			if(document.form1.pied.value!="")document.form1.pied.value="";
			if(document.form1.hauteur.value!="")document.form1.hauteur.value="";
			if(document.form1.poids.value!="")document.form1.poids.value="";
			
			if(document.form2.tete_fr.value!="??")document.form2.tete_fr.value="??";
			if(document.form2.tete_eu.value!="??")document.form2.tete_eu.value="??";
			if(document.form2.poitrine_fr && document.form2.poitrine_fr.value!="??")document.form2.poitrine_fr.value="??";
			if(document.form2.poitrine_eu && document.form2.poitrine_eu.value!="??")document.form2.poitrine_eu.value="??";
			if(document.form2.poitrinebas_fr && document.form2.poitrinebas_fr.value!="??")document.form2.poitrinebas_fr.value="??";
			if(document.form2.poitrinebas_eu && document.form2.poitrinebas_eu.value!="??")document.form2.poitrinebas_eu.value="??";
			if(document.form2.taille_fr && document.form2.taille_fr.value!="??")document.form2.taille_fr.value="??";
			if(document.form2.taille_eu && document.form2.taille_eu.value!="??")document.form2.taille_eu.value="??";
			if(document.form2.main_fr && document.form2.main_fr.value!="??")document.form2.main_fr.value="??";
			if(document.form2.main_eu && document.form2.main_eu.value!="??")document.form2.main_eu.value="??";
			if(document.form2.entrejambes_fr && document.form2.entrejambes_fr.value!="??")document.form2.entrejambes_fr.value="??";
			if(document.form2.entrejambes_eu && document.form2.entrejambes_eu.value!="??")document.form2.entrejambes_eu.value="??";
			if(document.form2.pied_fr && document.form2.pied_fr.value!="??")document.form2.pied_fr.value="??";
			if(document.form2.pied_eu && document.form2.pied_eu.value!="??")document.form2.pied_eu.value="??";
			if(document.form2.hauteur_sac_fr && document.form2.hauteur_sac_fr.value!="??")document.form2.hauteur_sac_fr.value="??";
			if(document.form2.hauteur_sac_eu && document.form2.hauteur_sac_eu.value!="??")document.form2.hauteur_sac_eu.value="??";
			if(document.form2.hauteur_velo_fr && document.form2.hauteur_velo_fr.value!="??")document.form2.hauteur_velo_fr.value="??"
			if(document.form2.hauteur_velo_eu && document.form2.hauteur_velo_eu.value!="??")document.form2.hauteur_velo_eu.value="??"
		}

		if(cookiesEnabled()){	
			if(LireCookie("pseudo"))EffaceCookie("pseudo");
			if(LireCookie("login"))EffaceCookie("login");
			if(LireCookie("sexe"))EffaceCookie("sexe");
			if(LireCookie("tete"))EffaceCookie("tete");
			if(LireCookie("poitrine"))EffaceCookie("poitrine");
			if(LireCookie("poitrinebas"))EffaceCookie("poitrinebas");
			if(LireCookie("taille"))EffaceCookie("taille");
			if(LireCookie("main"))EffaceCookie("main");
			if(LireCookie("entrejambes"))EffaceCookie("entrejambes");
			if(LireCookie("pied"))EffaceCookie("pied");
			if(LireCookie("hauteur"))EffaceCookie("hauteur");
			if(LireCookie("poids"))EffaceCookie("poids");
			if(LireCookie("email"))EffaceCookie("email");
		}
		
		maj_modification(0);
		
		url = parent.document.location.toString();
		if(url.indexOf("?")!=-1)url = url.substring(0,url.indexOf("?"));
		document.location = url;
	}
	else enregistrer_oxylane(txt1,txt2);

}

function affichage_bandeau_oxylane(bonjour,morphocarte,deco,texte,txt1,txt2){
	/*if(cookiesEnabled()){
		changeclass('visible','oxylane'); // affichage bandeau oxylane
		if(verif_cookie(LireCookie("login"))){
			changeclass('hello','bonjour');		
			pseu = document.getElementById('bonjour');
			if(LireCookie("pseudo"))pseu.innerHTML = bonjour+" "+LireCookie("pseudo");
			else pseu.innerHTML = bonjour;
			oxy = document.getElementById('acces');
			oxy.innerHTML = "<a href='"+adresse_morphocarte()+"'>"+morphocarte+"</a> &nbsp;|&nbsp; <a href='javascript:deconnexion(\""+texte+"\",\""+txt1+"\",\""+txt2+"\");'>"+deco+"</a>";
		}
	}
*/
}

function bouton_mail(){
	if(LireCookie("login"))changeclass('visible','mail'); // bouton mail si connecté
}

function bouton_morpho(page,texte){
	if(cookiesEnabled()){
		if(verif_cookie(LireCookie("login"))){
		b_morpho1 = document.getElementById('eng-gauche');
		b_morpho2 = document.getElementById('eng-centre1-m');
		b_morpho3 = document.getElementById('eng-centre2-m');
		b_morpho4 = document.getElementById('eng-droite');
			if(page=="index0"){
			b_morpho1.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="'+pays()+'/images/'+pays()+'-nouveau.gif" width="110" height="61" border="0"></a>';
			b_morpho2.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'" id="eng-centre1-m">'+texte+'</a>';
			b_morpho3.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="images/070629-taillant-ongl-d-orange.gif" width="27" height="30" border="0"></a>';
			b_morpho4.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="images/interrogation.gif" width="102" height="87" border="0"></a>';
			}
			else if(page=="index1"){
				b_morpho1.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="images/'+pays()+'-nouveau.gif" width="110" height="61" border="0"></a>';
				b_morpho2.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'" id="eng-centre1-m">'+texte+'</a>';
				b_morpho3.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="../images/070629-taillant-ongl-d-orange.gif" width="27" height="30" border="0"></a>';
				b_morpho4.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="../images/interrogation.gif" width="102" height="87" border="0"></a>';				
				}
				else if(page=="etape1"){
					b_morpho1.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="../images/'+pays()+'-nouveau.gif" width="110" height="61" border="0"></a>';
					b_morpho2.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'" id="eng-centre1-m">'+texte+'</a>';
					b_morpho3.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="../../images/070629-taillant-ongl-d-orange.gif" width="27" height="30" border="0"></a>';
					b_morpho4.innerHTML = '<a onfocus="if(this.blur)this.blur();" href="'+adresse_morphocarte()+'"><img src="../../images/interrogation.gif" width="102" height="87" border="0"></a>';				
					}
		}
	}
}

function connexion(){
url_oxylane = "http://www.oxylaneclub.com/MonOxylane/adequatSize/Adequatsize.aspx";
url_oxylane += "?ret="+adresse+"/traitement.html";
url_oxylane += "&langue="+pays();

document.location=url_oxylane;
}

function verif_pseudo(val,err1,err2){
	reg = /^[a-zA-Z0-9_-]{6,15}$/; 
	if(!reg.test(val)){
		alert(err1+" [a-z], [A-Z], [0-9], '-' "+err2+" '_'");
		document.form1.pseudo.value="";
	}
}

// envoie des infos morphocarte

function verif_champ(n,v,erreur){
	if(v.indexOf(",") != -1){v = v.replace(",","."); // remplacement de la virgule par un point
	document.form1[n].value=v;
	}
	
	if(isNaN(v)){alert(v+erreur);
	v="";
	document.form1[n].value="";
	}
}

function verif_champ_inv(v){
	if(v.indexOf(".") != -1)v = v.replace(".",","); // remplacement du point par une virgule
return v;
}

function verif_champ_oxy(v){ // verification des champs en provenance d'oxylane
	if(v.indexOf(",") != -1)v = v.replace(",","."); // remplacement de la virgule par un point
return v;


}

function enregistrer_oxylane(txt1,txt2){
	if(document.form1){
		if(document.form1.pseudo.value=="")alert(txt1);
		else {
		
			url_oxylane = "http://www.oxylaneclub.com/MonOxylane/adequatSize/Adequatsize.aspx";
			url_oxylane += "?ret="+adresse+"/traitement.html";
			url_oxylane += "&langue="+pays();	
			url_oxylane += "&has_data=true";
			if(cookiesEnabled()){
				if(LireCookie("login"))url_oxylane += "&login="+LireCookie("login");
				if(LireCookie("email"))url_oxylane += "&email="+LireCookie("email");
				}
			else url_oxylane += "&login="+document.form1.login.value;
			url_oxylane += "&pseudo="+document.form1.pseudo.value;
			
			nb_champs = 0
			
			if(document.form1.tete && document.form1.tete.value!=""){
				if(pays()!="EN")url_oxylane += "&tete="+verif_champ_inv(document.form1.tete.value);
				else url_oxylane += "&tete="+verif_champ_inv((Math.round(document.form1.tete.value*2.54*10)/10)+"");
				nb_champs++;
			}
			if(document.form1.poitrine && document.form1.poitrine.value!=""){
				if(pays()!="EN")url_oxylane += "&poitrine="+verif_champ_inv(document.form1.poitrine.value);
				else url_oxylane += "&poitrine="+verif_champ_inv((Math.round(document.form1.poitrine.value*2.54*10)/10)+"");
				nb_champs++;
			}
			if(document.form1.poitrinebas && document.form1.poitrinebas.value!=""){
				if(pays()!="EN")url_oxylane += "&poitrinebas="+verif_champ_inv(document.form1.poitrinebas.value);
				else url_oxylane += "&poitrinebas="+verif_champ_inv((Math.round(document.form1.poitrinebas.value*2.54*10)/10)+"");
				nb_champs++;
			}
			if(document.form1.taille && document.form1.taille.value!=""){
				if(pays()!="EN")url_oxylane += "&taille="+verif_champ_inv(document.form1.taille.value);
				else url_oxylane += "&taille="+verif_champ_inv((Math.round(document.form1.taille.value*2.54*10)/10)+"");
				nb_champs++;
			}
			if(document.form1.main && document.form1.main.value!=""){
				if(pays()!="EN")url_oxylane += "&main="+verif_champ_inv(document.form1.main.value);
				else url_oxylane += "&main="+verif_champ_inv((Math.round(document.form1.main.value*2.54*10)/10)+"");
				nb_champs++;
			}	
			if(document.form1.entrejambes && document.form1.entrejambes.value!=""){
				if(pays()!="EN")url_oxylane += "&entrejambes="+verif_champ_inv(document.form1.entrejambes.value);
				else url_oxylane += "&entrejambes="+verif_champ_inv((Math.round(document.form1.entrejambes.value*2.54*10)/10)+"");
				nb_champs++;
			}
			if(document.form1.pied && document.form1.pied.value!=""){
				if(pays()!="EN")url_oxylane += "&pied="+verif_champ_inv(document.form1.pied.value);
				else url_oxylane += "&pied="+verif_champ_inv((Math.round(document.form1.pied.value*2.54*10)/10)+"");
				nb_champs++;
			}
			if(document.form1.hauteur && document.form1.hauteur.value!=""){
				if(pays()!="EN")url_oxylane += "&hauteur="+verif_champ_inv(document.form1.hauteur.value);
				else url_oxylane += "&hauteur="+verif_champ_inv((Math.round(document.form1.hauteur.value*2.54*10)/10)+"");
				nb_champs++;
			}
			if(document.form1.poids && document.form1.poids.value!=""){
				if(pays()!="EN")url_oxylane += "&poids="+verif_champ_inv(document.form1.poids.value);
				else url_oxylane += "&poids="+verif_champ_inv((Math.round(document.form1.poids.value*0.45))+"");
				nb_champs++;
			}

			if(nb_champs>0){
				if(cookiesEnabled())maj_modification(0);
				document.location = url_oxylane;
				}
				else alert(txt2);
			}
	}
	else{
	url_oxylane = "http://www.oxylaneclub.com/MonOxylane/adequatSize/Adequatsize.aspx";
	url_oxylane += "?ret="+adresse+"/traitement.html";
	url_oxylane += "&langue="+pays();	
	url_oxylane += "&has_data=true";
	if(LireCookie("login"))url_oxylane += "&login="+verif_champ_inv(LireCookie("login"));
	if(LireCookie("pseudo"))url_oxylane += "&pseudo="+verif_champ_inv(LireCookie("pseudo"));
	if(LireCookie("email"))url_oxylane += "&email="+LireCookie("email");
	if(LireCookie("tete")){
		if(pays()!="EN")url_oxylane += "&tete="+verif_champ_inv(LireCookie("tete"));
		else url_oxylane += "&tete="+verif_champ_inv(LireCookie("tete"));
		}
	if(LireCookie("poitrine")){
		if(pays()!="EN")url_oxylane += "&poitrine="+verif_champ_inv(LireCookie("poitrine"));
		else url_oxylane += "&poitrine="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("poitrine"))*2.54*10)/10);
		}
	if(LireCookie("poitrinebas")){
		if(pays()!="EN")url_oxylane += "&poitrinebas="+verif_champ_inv(LireCookie("poitrinebas"));
		else url_oxylane += "&poitrinebas="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("poitrinebas"))*2.54*10)/10);
		}
	if(LireCookie("taille")){
		if(pays()!="EN")url_oxylane += "&taille="+verif_champ_inv(LireCookie("taille"));
		else url_oxylane += "&taille="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("taille"))*2.54*10)/10);
		}
	if(LireCookie("main")){
		if(pays()!="EN")url_oxylane += "&main="+verif_champ_inv(LireCookie("main"));
		else url_oxylane += "&main="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("main"))*2.54*10)/10);
		}
	if(LireCookie("entrejambes")){
		if(pays()!="EN")url_oxylane += "&entrejambes="+verif_champ_inv(LireCookie("entrejambes"));
		else url_oxylane += "&entrejambes="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("entrejambes"))*2.54*10)/10);
		}
	if(LireCookie("pied")){
		if(pays()!="EN")url_oxylane += "&pied="+verif_champ_inv(LireCookie("pied"));
		else url_oxylane += "&pied="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("pied"))*2.54*10)/10);
		}
	if(LireCookie("hauteur")){
		if(pays()!="EN")url_oxylane += "&hauteur="+verif_champ_inv(LireCookie("hauteur"));
		else url_oxylane += "&hauteur="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("hauteur"))*2.54*10)/10);
		}
	if(LireCookie("poids")){
		if(pays()!="EN")url_oxylane += "&poids="+verif_champ_inv(LireCookie("poids"));
		else url_oxylane += "&poids="+verif_champ_inv(Math.round(verif_champ_oxy(LireCookie("poids"))*0.45*10)/10);
		}
	maj_modification(0);
	document.location = url_oxylane;
	}
}

function email_oxylane(txt1,txt2){

	if(document.form1.pseudo.value=="")alert(txt1);
	else {
	
	nb_champs = 0
	
	url_oxylane = "http://www.oxylane.com/MonOxylane/adequatSize/SendMail.aspx";
	url_oxylane += "?pseudo="+document.form1.pseudo.value;
	url_oxylane += "&sexe="+document.form1.sexe.value;
	url_oxylane += "&email="+LireCookie("email");
	
	if(document.form1.tete && document.form1.tete.value!=""){
		url_oxylane += "&tete="+document.form1.tete.value;
		url_oxylane += "&tete_fr="+document.form2.tete_fr.value;
		url_oxylane += "&tete_eu="+document.form2.tete_eu.value;
		nb_champs++;
		}
	
	if(document.form1.poitrine && document.form1.poitrine.value!=""){
		url_oxylane += "&poitrine="+document.form1.poitrine.value;
		url_oxylane += "&poitrine_fr="+document.form2.poitrine_fr.value;
		url_oxylane += "&poitrine_eu="+document.form2.poitrine_eu.value;
		nb_champs++;
		}
	
	if(document.form1.poitrinebas && document.form1.poitrinebas.value!=""){
		url_oxylane += "&poitrinebas="+document.form1.poitrinebas.value;
		url_oxylane += "&poitrine_bas_fr="+document.form2.poitrinebas_fr.value;
		url_oxylane += "&poitrine_bas_eu="+document.form2.poitrinebas_eu.value;
		nb_champs++;
		}
		
	if(document.form1.taille && document.form1.taille.value!=""){
		url_oxylane += "&taille="+document.form1.taille.value;
		url_oxylane += "&taille_fr="+document.form2.taille_fr.value;
		url_oxylane += "&taille_eu="+document.form2.taille_eu.value;
		nb_champs++;
		}
	
	if(document.form1.main && document.form1.main.value!=""){
		url_oxylane += "&main="+document.form1.main.value;
		url_oxylane += "&main_fr="+document.form2.main_fr.value;
		url_oxylane += "&main_eu="+document.form2.main_eu.value;
		nb_champs++;
		}

	if(document.form1.entrejambes && document.form1.entrejambes.value!=""){
		url_oxylane += "&entrejambes="+document.form1.entrejambes.value;
		nb_champs++;
		}	

	if(document.form1.pied && document.form1.pied.value!=""){
		url_oxylane += "&pied="+document.form1.pied.value;
		url_oxylane += "&pied_fr="+document.form2.pied_fr.value;
		url_oxylane += "&pied_eu="+document.form2.pied_eu.value;
		nb_champs++;
		}
		
	if(document.form1.hauteur && document.form1.hauteur.value!=""){
		url_oxylane += "&hauteur="+document.form1.hauteur.value;
		url_oxylane += "&hauteur_sac_fr="+document.form2.hauteur_sac_fr.value;
		url_oxylane += "&hauteur_sac_eu="+document.form2.hauteur_sac_eu.value;
		url_oxylane += "&hauteur_velo_fr="+document.form2.hauteur_velo_fr.value;
		url_oxylane += "&hauteur_velo_eu="+document.form2.hauteur_velo_eu.value;
		nb_champs++;
		}
		
	if(document.form1.poids && document.form1.poids.value!=""){
		url_oxylane += "&poids="+document.form1.poids.value;
		nb_champs++;
		}
		
	if(nb_champs>0) window.open(url_oxylane,'email','width=735, height=300,top=100,left=150');
	else alert(txt2);

	}

}

function popup(page){
open(page,'pop','width=340,height=590,top=100,left=0')
}
