
//<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- Le champ '+nm+' doit contenir une adresse e-mail correcte.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- Le champ '+nm+' doit contenir un nombre.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- Le champ '+nm+' doit être un nombre entre '+min+' et '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- Le champ '+nm+' est obligatoire.\n'; }
  } if (errors) alert('Les erreurs suivantes sont apparues :\n\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  if (FormChoixLangue.langue.selectedIndex != 0)
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"&langue="+FormChoixLangue.langue.options[FormChoixLangue.langue.selectedIndex].value+"&id_qcm=0'");
}
function MM_goToURL2() { //v3.0
  var i, args=MM_goToURL2.arguments; document.MM_returnValue = false;
	alert(args[1]);
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_goToURLPays() { //v3.0
  var i, args=MM_goToURLPays.arguments; document.MM_returnValue = false;
  if (FormChoixPays.pays_liste.selectedIndex != 0)
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"&pays_liste="+FormChoixPays.pays_liste.options[FormChoixPays.pays_liste.selectedIndex].value+"'");
}

function MM_goToURLContact() { //v3.0
  var i, args=MM_goToURLContact.arguments; document.MM_returnValue = false;
  if (FormChoixContact.id_contact.selectedIndex != 0)
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"&id_contact="+FormChoixContact.id_contact.options[FormChoixContact.id_contact.selectedIndex].value+"'");
}

function MM_goToURLID() { //v3.0
  var i, args=MM_goToURLID.arguments; document.MM_returnValue = false;	
  IDSel=eval(args[2]+".selectedIndex;");
  EltSel=eval(args[2]+".options["+IDSel+"].value;");
  eval(args[0]+".location='"+args[1]+"&id="+EltSel+"';");	
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function NavVersion() 
	{ //v2.0
	
	if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
	  isIe = 1;
	else
	  isIe = 0;
	 return isIe;
	 
}

function open_popup(mavar){
	popupWin = window.open('help.php3?ID='+ mavar, 'remote', 'width=300,height=200')	
}

function openit(img) {
	titre="Image";
	w=open("",'image','width=400,height=400,toolbar=no,scrollbars=no,resizable=yes');	
	w.document.writeln('<HTML><HEAD><TITLE>'+titre+'</TITLE></HEAD>');
	w.document.writeln('<BODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>');
	w.document.writeln('<IMG src="'+img+'" border=0><'+'SCRIPT Language="JavaScript">var wi,le;');
	w.document.writeln('if(navigator.appName=="Microsoft Internet Explorer"){wi=12;le=30;}else{wi=0;le=0;}');
	w.document.writeln('window.resizeTo(document.images[0].width+wi,document.images[0].height+le); window.focus(); ');
	w.document.writeln('<'+'/SCRIPT></BODY></HTML>');
	w.document.close();
}

function open_photo(photo,carac) {popupWin = window.open(photo,'remote',carac); popupWin.focus();}

function suppression(id, redir, msg)
    {
    if(confirm('Voulez-vous vraiment supprimer '+msg+' !'))
		{
		var url=redir+'&supp=1&id='+id;
		this.window.location=redir+'&supp=1&id='+id;
		}
    }
function supprapide(msg)
    {
    if(confirm('Voulez-vous vraiment supprimer '+msg+' !'))
		{ document.form1.submit(); }
    } 

function chcat(liste) {
  var n=liste.options[liste.selectedIndex].value;
  if (n==-1) this.window.location='news_liste.php';
  else  this.window.location='news_liste.php?SearchWhere='+n;
}
function chcat2(liste,choix,rub) {
  var n=liste.options[liste.selectedIndex].value;
  if (n==-1) this.window.location=choix;
  else  this.window.location=choix+'?SearchWhereEtat='+n+'&rubrik='+rub;
}
function chcat2(liste,choix,rub) {
  var n=liste.options[liste.selectedIndex].value;
  if (n==-1) this.window.location=choix;
  else  this.window.location=choix+'?SearchWhereEtat='+n+'&rubrik='+rub;
}
function chcat3(liste,choix,rub) {
  var n=liste.options[liste.selectedIndex].value;
  if (n==-1) this.window.location=choix;
  else  this.window.location=choix+'?SearchWhereRubrique='+n+'&rubrik='+rub;
}

function recherche(liste,choix,type) {
  var n=liste.options[liste.selectedIndex].value;
  if (n==-1) this.window.location=choix;
  else  this.window.location=choix+'&'+type+'='+n;
}


function open_photo(photo,carac) {popupWin = window.open(photo,'remote',carac); popupWin.focus();}

function VerifEmail(adresse){
         var place = adresse.indexOf("@",1);
         var point = adresse.indexOf(".",place+1);
         if ((place > -1)&&(adresse.length >2)&&(point > 1)) {return true;}
         else {return false;}
}

function LoadInfos(liste,destination) 
  {
  var n=liste.options[liste.selectedIndex].value;
  window.location=destination+"&type="+n;
  }

function ValidateFormAdmin(form)
	{
	alert(form.email.value);
	if (!VerifEmail(form.email.value)){
        alert("L'adresse email que vous avez saisie n'est pas valide!!.");
        return false;
	}else if(form.Nom.value == ""){
        alert("Le Nom que vous avez saisi n'est pas correct.");return false;
	}else if(form.Prenom.value == ""){
        alert("Le Prenom que vous avez saisi n'est pas correct.");return false;
	}else if(form.Login.value == ""){
        alert("Le Login que vous avez saisi n'est pas correct.");return false;
	}else if(form.Admin_Pass.value != form.Admin_Pass2.value) {
        alert("Les deux password que vous avez saisis ne correspondent pas.");return false;
	}else {return true;}
}

// Validation du formulaire de connexion (login)
function ValidateFormConnexion(form) 
	{
	MM_validateForm('UserID','','R','Password','','R');		
	retour=document.MM_returnValue;		
	if (retour==true)
		{
		if (form.UserID.value.length<4)
			{
			alert('Le login doit comporter un minimum de 4 caractères!');
			retour=false;
			}
		else
			{
			if (form.Password.value.length<4)
				{
				alert('Le mot de passe doit comporter un minimum de 4 caractères!');
				retour=false;
				}
			else
				{
				retour=true;
				}
			}
		}
	return retour;		
	}				

// Validation du formulaire d'ajout d'utilisateurs
function ValidateFormAjAdmin(form) 
	{
	MM_validateForm('nom_revendeur','','R','email_revendeur','','RisEmail','ident_revendeur','','R','mdp_revendeur','','R','tx_mat_revendeur','','RisNum','tx_mo_revendeur','','RisNum');
	retour=document.MM_returnValue;
	if (retour==true)
		{
		if (form1.ident_revendeur.value.length<4)
			{
			alert('L\'ID doit comporter un minimum de 4 caractères!');
			retour=false;
			}
		else
			{
			retour=true;
			if (form1.mdp_revendeur.value.length<4)
				{
				alert('Le mot de passe doit comporter un minimum de 4 caractères!');
				retour=false;
				}
			else
				{
				retour=true;
				if (form1.conf_revendeur.value!=form1.mdp_revendeur.value)
					{
					alert('La confirmation du mot de passe n\'est pas correct!');
					retour=false;
					}
				else
					{
					retour=true;
					}							
				}
			}	
		}
	return retour;									
	}

// Validation du formulaire d'ajout d'utilisateurs
function ValidateFormMAJAdmin(form) 
	{
	MM_validateForm('nom_revendeur','','R','email_revendeur','','RisEmail','ident_revendeur','','R','tx_mat_revendeur','','RisNum','tx_mo_revendeur','','RisNum');
	retour=document.MM_returnValue;
	if (retour==true)
		{
		if (form1.ident_revendeur.value.length<4)
			{
			alert('L\'ID doit comporter un minimum de 4 caractères!');
			retour=false;
			}
		else
			{
			retour=true;
			if (form1.mdp_revendeur.value!="" && form1.mdp_revendeur.value.length<4)
				{
				alert('Le mot de passe doit comporter un minimum de 4 caractères!');
				retour=false;
				}
			else
				{
				retour=true;
				if (form1.mdp_revendeur.value!="" && form1.conf_revendeur.value!=form1.mdp_revendeur.value)
					{
					alert('La confirmation du mot de passe n\'est pas correct!');
					retour=false;
					}
				else
					{
					retour=true;
					}							
				}
			}	
		}
	return retour;									
	}

// VALIDATION d'ACCES	
function validateFormAcces(form) 
	{
	retour=false;
	MM_validateForm('societe','','R','login','','R','pwd','','R');
	retour=document.MM_returnValue;
	if (retour==true)
		{
		if (comm.login.value.length<4)
			{
			alert('Le login doit comporter un minimum de 4 caractères!');
			retour=false;
			}
		else
			{
			retour=true;
			if (comm.pwd.value.length<4)
					{
					alert('Le mot de passe doit comporter un minimum de 4 caractères!');
					retour=false;
					}
				else
					{
					retour=true;
					if (comm.pwd.value!=comm.conf_pwd.value)
						{
						alert('Veuillez confirmer votre mot de passe correctement!');
						retour=false;
						}
					else
						{
						retour=true;
						}							
					}
				}
			}							

	if (retour)
		{
  		saveForm(form);	
	    retour=true;
		}
 	return retour;		
	}

function validateFormNews(form) {
  if (form.titre.value == "") {alert("Vous devez saisir un titre.");return false;}
  else {return true;}
}

function validateFormCiblage(form) {
if (form.Cible.value == ""){
        alert("Vous devez saisir un ciblage.");
        return false;
}else {return true;}
}

// FONCTION DE CALCUL DU MONTANT GLOBAL SUR SELECTION D'UN PRODUIT (REVENDEUR/DEVIS SUR MODIF)
function CocheRecup(valcoche,prix_public,prix_mo) 
	{
	var tmp=document.forms[0].elements[valcoche].value;
	if (document.forms[0].elements[valcoche].checked==true)
		{ 
		document.form1.montant_total_prod.value=parseFloat(document.form1.montant_total_prod.value)+parseFloat(prix_public);
		document.form1.montant_total_MO.value=parseFloat(document.form1.montant_total_MO.value)+parseFloat(prix_mo);	
		}
	else	
		{ 
		document.form1.montant_total_prod.value=parseFloat(document.form1.montant_total_prod.value)-parseFloat(prix_public);
		document.form1.montant_total_MO.value=parseFloat(document.form1.montant_total_MO.value)-parseFloat(prix_mo);		
		}
		document.form1.montant_total_HT.value=parseFloat(document.form1.montant_total_prod.value)+parseFloat(document.form1.montant_total_MO.value);		 
	}

function VerifyData() {
  if (document.frmUser.List_Name.value == "") {
    alert("You must enter the mailinglist name.");
    return false;
  } else if (document.frmUser.Admin_ID.value == "") {
    alert("You must enter an Admin ID.");
    return false;
  } else if (document.frmUser.Email.value == "") {
    alert("You must enter a Return Email.");
    return false;
  } else
    return true;
}
function loadContent() { }

function saveForm(form) 
	{
	document.comm.text.value = globalEditeur.document.body.innerHTML;
	}

function formatExec(what, opt) {
	if (opt==null)
		globalEditeur.document.execCommand(what);
	else
		globalEditeur.document.execCommand(what,"",opt);

	globalEditeur.focus();
}

function addHyperLink() {
	var isa = getElement("A",globalEditeur.document.selection.createRange().parentElement());
	var str=prompt("Saisissez l'URL (exemple: http://www.yahoo.fr):", isa ? isa.href : "http:\/\/");

	if ((str!=null) && (str!="http://")) {
		if (globalEditeur.document.selection.type=="None") {
			var sel=globalEditeur.document.selection.createRange();
			sel.pasteHTML("<A HREF=\""+str+"\">"+str+"</A> ");
			sel.select();
		}
		else formatExec("createlink",str);
	}
	else
		globalEditeur.focus();
}

function addImage(str) {
	globalEditeur.focus();
	if ((str!=null) && (str!="http://")) {
		if (globalEditeur.document.selection.type=="None") {
			var sel=globalEditeur.document.selection.createRange();
			sel.pasteHTML("<IMG SRC=\""+str+"\">");
			sel.select();
		}
		else formatExec("image",str);
	}
	else globalEditeur.focus();
}

function setHtml(val) {
	globalEditeur.document.body.innerHTML=val;
}

function viewInfo(theLayer,x,y,e){
	var NS = (navigator.appName == 'Netscape');

	if (NS){
		var mouseX = e.pageX+x;
		var mouseY = e.pageY+y;		
		document.layers[theLayer].top=mouseY;
		document.layers[theLayer].left=mouseX;
		document.layers[theLayer].visibility='show';
	}

	if (!NS){
		var mouseX = event.clientX+document.body.scrollLeft+x;
		var mouseY = event.clientY+document.body.scrollTop+y;
		document.all[theLayer].style.top=mouseY;
		document.all[theLayer].style.left=mouseX;
		document.all[theLayer].style.visibility='visible';
	}
}

function hideInfo(theLayer){
	var NS = (navigator.appName == 'Netscape');

	if (NS){
		document.layers[theLayer].visibility='hide';
	}

	if (!NS){
		document.all[theLayer].style.visibility='hidden';
	}
}

function setHtml(val) {
	globalEditeur.document.body.innerHTML=val;
}
function menu()
	{
	var i,x,tB,j=0,tA=new Array(),arg=menu.arguments; 
	if(arg[1]=="")
		arg[1]="contenu"+document.form1.type.value;
	if(document.getElementsByTagName)
		{
		for(i=4;i<arg.length;i++)
			{
			tB=document.getElementsByTagName(arg[i]);						
			for(x=0;x<tB.length;x++)
				{		
				tA[j]=tB[x]; j++;
				}
			}
		for(i=0;i<tA.length;i++)
			{
			if(tA[i].id==arg[1])
				{			
				if(arg[0]==1)
					{
					tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
					tA[i].className=arg[2];
					}
				else
					{tA[i].className=arg[2];}
				}
			}
		}
	//document.form1.produits_famille1.options[document.form1.produits_famille1.selectedIndex].value=0;
	}
function menu_efface(){
	var elems, arg=menu_efface.arguments;
	var nbcalque=arg[0];
	var nomdiv;
	arg[1]="contenu"+document.form1.type.value;
	for(var i=1;i<=nbcalque;i++)
    	{
		nomdiv="contenu"+i;
		//alert(nomdiv);
		//elems=document.getElementsById('divtheme1');
		//alert(nomdiv);
		if (nomdiv!=arg[1]){ 	
		menu(1,nomdiv,'cacher','cacher','div');
			}
		}
}
// UTILISE POUR LA DIAPORAMA DES NEWS
function agrandissement(imgsrc,photo,idxphoto)
	{
	eval("MM_swapImage('"+imgsrc+"','','"+photo+"',1);");
	if (idxphoto!=999)
		{ document.getElementById("commentaires").innerHTML = listeinfosphotos[idxphoto]; }
	}

// REDIRECTION DEPUIS UN SELECT VERS UNE SECTION
function redirsection(id)
	{
	document.location.href="/index.php?section="+id;
	}
// FONCTION D'OUVERTURE DE POPUP A LA DIMENSION DE L'IMAGE
function twPopupImage(img, titre, auteur) {
  // Compatible IE5+ / NN6+ / Mozilla
  oFenetre = window.open('','Image','width=400,height=400,toolbar=no,scrollbars=no,resizable=no');
  oFenetre.document.write("<html><head><title>"+titre+"</title></head>");
 oFenetre.document.write("<script type=\"text/javascript\">function twAjustePopUp() { if (document.images[0].complete) { window.resizeTo(document.images[0].width+10,document.images[0].height+40); window.focus();} else { setTimeout('twAjustePopUp()',1000) } }</"+"script>");
 oFenetre.document.write("<body onload='twAjustePopUp()' onblur='window.close()' onclick='window.close()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>");
 oFenetre.document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0' height='100%'><tr><td valign='middle' align='center'>");
 oFenetre.document.write("<img src='"+img+"' border='0' alt='"+auteur+"' title='"+auteur+"'>");
 oFenetre.document.write("</td></tr></table></body></html>");
 oFenetre.document.close();
}
function NavVersion() 
	{ //v2.0
	if(window.navigator.appName == "Microsoft Internet Explorer" && window.navigator.appVersion.substring(window.navigator.appVersion.indexOf("MSIE") + 5, window.navigator.appVersion.indexOf("MSIE") + 8) >= 5.5)
	  isIe = 1;
	else
	  isIe = 0;
	 return isIe;
}
ie5  = (document.all && document.getElementById); 
ns6 = (!document.all && document.getElementById); 
opac = 0; 
function InitfadeIn(divid) 
 {
 if(ie5) document.getElementById(divid).filters.alpha.opacity = 0;
 if(ns6) document.getElementById(divid).style.MozOpacity = 0;
 opac=0;
 
 fadeIn(divid);
 }
function fadeIn(divid) 
 {
 if(opac != 100)
	 {
	 opac+=5;
	 if(ie5) document.getElementById(divid).filters.alpha.opacity = opac;
	 if(ns6) document.getElementById(divid).style.MozOpacity = opac/100;
	 if(ie5) eval("setTimeout(\"fadeIn('"+divid+"')\", 20);");
	 if(ns6) eval("setTimeout(\"fadeIn('"+divid+"')\", 2);");  
	 }
 }
opacout = 100; 
function InitfadeOut(divid) 
 {
 if(ie5) document.getElementById(divid).filters.alpha.opacity = 100;
 if(ns6) document.getElementById(divid).style.MozOpacity = 100;
 opacout=100;

 fadeOut(divid);
 }
function fadeOut(divid) 
 {
 if(opacout > 30)
  {
  opacout=opacout-5;
  if(ie5) document.getElementById(divid).filters.alpha.opacity = opacout;
  if(ns6) document.getElementById(divid).style.MozOpacity = opacout/100;
  if(ie5) eval("setTimeout(\"fadeOut('"+divid+"')\", 20);");
  if(ns6) eval("setTimeout(\"fadeOut('"+divid+"')\", 2);");  
  }
 }
function MakeOpacity(divid,opacity) 
 {
 if(ie5) document.getElementById(divid).filters.alpha.opacity = opacity;
 if(ns6) document.getElementById(divid).style.MozOpacity = opacity;
 }
function opentext(text,titre) {
	w=open("",'text','width=1000, height=1000 toolbar=no,scrollbars=no,resizable=yes');	
	w.document.writeln('<HTML><HEAD><TITLE>'+titre+'</TITLE><link href="/style.css" rel="stylesheet" type="text/css"></HEAD>');
	w.document.writeln('<BODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>');
	w.document.writeln(text+'<'+'SCRIPT Language="JavaScript">var wi,le;');
	w.document.writeln('if(navigator.appName=="Microsoft Internet Explorer"){wi=12;le=30;}else{wi=0;le=0;}');
	//w.document.writeln('window.resizeTo(document.images[0].width+wi,document.images[0].height+le); window.focus(); ');
	w.document.writeln('<'+'/SCRIPT></BODY></HTML>');
	w.document.close();
	
}
function ValidateFormCompte(form)
	{
	MM_validateForm('nom','','R','prenom','','R','adresse','','R','ville','','R','telephone','','R','codepostal','','RisNum','nom2','','R','prenom2','','R','adresse2','','R','ville2','','R','codepostal2','','RisNum',
					'identifiant','','R','motdepasse','','R','email','','RisEmail');
	retour=document.MM_returnValue;
	if (retour==true)
		{
		if(form.motdepasse.value != form.motdepasse2.value) {
			retour=false;
        	alert("Les deux mots de passe que vous avez saisis ne correspondent pas.");
		}else{
			retour=true;
			// CONTROLE SUR LES CONDITIONS DE VENTES
			if (form.conditions_de_vente.checked==false)
			{
			retour=false;
			alert('Vous devez avoir pris connaissance des conditions de vente');
			}else{
			retour=true;
			}
		}
	}else{
	retour=false;
	}
return retour;
}
function opentext(text,titre) {
	w=open("",'text','width=400,height=200,toolbar=no,scrollbars=no,resizable=yes');	
	w.document.writeln('<HTML><HEAD><TITLE>'+titre+'</TITLE><link href="../style.css" rel="stylesheet" type="text/css"></HEAD>');
	w.document.writeln('<BODY leftMargin=0 topMargin=0 marginwidth=0 marginheight=0>');
	w.document.writeln('<p><strong> '+text+'</strong></p><'+'SCRIPT Language="JavaScript">var wi,le;');
	w.document.writeln('if(navigator.appName=="Microsoft Internet Explorer"){wi=12;le=30;}else{wi=0;le=0;}');
	//w.document.writeln('window.resizeTo(document.images[0].width+wi,document.images[0].height+le); window.focus(); ');
	w.document.writeln('<'+'/SCRIPT></BODY></HTML>');
	w.document.close();
}
<!--FORMULAIRE ECOMMERCE-->
function affectechamp(chpdest,chporig)
	{
	eval("document.commande."+chpdest+".value=document.commande."+chporig+".value");
	}
function MAJchps()
	{
	if (document.commande.livraison.checked) {effacer();}
	else {retablir();}
	}
function effacer()
	{
	document.commande.prenom2.value='';
	document.commande.nom2.value='';
	document.commande.societe2.value='';	
	document.commande.adresse2.value='';
	document.commande.codepostal2.value='';
	document.commande.ville2.value='';
	}
function retablir()
	{
	document.commande.prenom2.value=document.commande.prenom.value;
	document.commande.nom2.value=document.commande.nom.value;
	document.commande.societe2.value=document.commande.societe.value;	
	document.commande.adresse2.value=document.commande.adresse.value;
	document.commande.codepostal2.value=document.commande.codepostal.value;
	document.commande.ville2.value=document.commande.ville.value;
	}
function cdg(pdf)
	{
	window.open(pdf);	
	}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
	alert("coucou");
  var selObj = MM_findObj(selName);
 if (selObj) MM_jumpMenu(targ,selObj,restore);
}
// Permet de cocher ou décocher une liste de checkbox
function checkAll(pForm) {
  for (i=0, n=pForm.elements.length; i<n; i++){
    var objName = pForm.elements[i].name;
    var objType = pForm.elements[i].type;
    if (objType = "checkbox"){
      box = eval(pForm.elements[i]);
      if (box.checked == false) box.checked = true;
    }
  }
}
  
function unCheckAll(pForm) {
  for (i=0, n=pForm.elements.length; i<n; i++){
    var objName = pForm.elements[i].name;
    var objType = pForm.elements[i].type;
    if (objType = "checkbox"){
      box = eval(pForm.elements[i]);
      if (box.checked == true) box.checked = false;
    }
  }
}
  
function switchAll(pForm) {
  for (i=0, n=pForm.elements.length; i<n; i++){
    var objName = pForm.elements[i].name;
    var objType = pForm.elements[i].type;
    if (objType = "checkbox"){
      box = eval(pForm.elements[i]);
      box.checked = !box.checked;
    }
  }
}
// Faire une pause de n milliseconde
function pausecomp(millis)
	{
	date = new Date();
	var curDate = null;
	
	do { var curDate = new Date(); }
	while(curDate-date < millis);
	}
function AfficheCalqueBlock(calque,type)
	{
	
	if (type==1)
		{ eval("document.getElementById('"+calque+"').style.display = 'block';"); 
		//eval("MM_showHideLayers('"+calque+"','','show');"); 
		}
	else
		{ eval("document.getElementById('"+calque+"').style.display = 'none';"); 
		//eval("MM_showHideLayers('"+calque+"','','hide');"); 
		}
	}
//-->
function Display(calque)
	{
	var etat=document.getElementById(calque).style.display;
	if (etat!="none") { document.getElementById(calque).style.display="none"; }
	else { document.getElementById(calque).style.display="block"; }
	}