var array_pays=new Array("AFGHANISTAN", "AFRIQUE DU SUD", "ALAND, ILES", "ALBANIE", "ALGERIE", "ALLEMAGNE", "ANDORRE", "ANGOLA", "ANGUILLA", "ANTARCTIQUE", "ANTIGUA ET BARBUDA", "ARABIE SAOUDITE", "ARGENTINE", "ARMENIE", "ARUBA", "AUSTRALIE", "AUTRICHE", "AZERBAIDJAN", "BAHAMAS", "BAHREIN", "BANGLADESH", "BARBADE", "BELARUS", "BELGIQUE", "BELIZE", "BENIN", "BERMUDES", "BHOUTAN", "BOLIVIE, l'ETAT PLURINATIONAL DE", "BONAIRE, SAINT-EUSTACHE ET SABA", "BOSNIE-HERZEGOVINE", "BOTSWANA", "BOUVET, ILE", "BRESIL", "BRUNEI DARUSSALAM", "BULGARIE", "BURKINA FASO", "BURUNDI", "CAIMANES, ILES", "CAMBODGE", "CAMEROUN", "CANADA", "CAP-VERT", "CENTRAFRICAINE, REPUBLIQUE", "CHILI", "CHINE", "CHRISTMAS, ILE", "CHYPRE", "COCOS (KEELING), ILES", "COLOMBIE", "COMORES", "CONGO", "CONGO, LA REPUBLIQUE DEMOCRATIQUE DU", "COOK, ILES", "COREE, REPUBLIQUE DE", "COREE, REPUBLIQUE POPULAIRE DEMOCRATIQUE DE", "COSTA RICA", "COTE D'IVOIRE", "CROATIE", "CUBA", "CURACAO", "DANEMARK", "DJIBOUTI", "DOMINICAINE, REPUBLIQUE", "DOMINIQUE", "EGYPTE", "EL SALVADOR", "EMIRATS ARABES UNIS", "EQUATEUR", "ERYTHREE", "ESPAGNE", "ESTONIE", "ETATS-UNIS", "ETHIOPIE", "FALKLAND, ILES (MALVINAS)", "FEROE, ILES", "FIDJI", "FINLANDE", "FRANCE", "GABON", "GAMBIE", "GEORGIE", "GEORGIE DU SUD ET LES ILES SANDWICH DU SUD", "GHANA", "GIBRALTAR", "GRECE", "GRENADE", "GROENLAND", "GUADELOUPE", "GUAM", "GUATEMALA", "GUERNESEY", "GUINEE", "GUINEE-BISSAU", "GUINEE EQUATORIALE", "GUYANA", "GUYANE FRANCAISE", "HAITI", "HEARD, ILE ET MCDONALD, ILES", "HONDURAS", "HONG KONG", "HONGRIE", "ILE DE MAN", "ILES MINEURES ELOIGNEES DES ETATS-UNIS", "ILES VIERGES BRITANNIQUES", "ILES VIERGES DES ETATS-UNIS", "INDE", "INDONESIE", "IRAN, REPUBLIQUE ISLAMIQUE D'", "IRAQ", "IRLANDE", "ISLANDE", "ISRAEL", "ITALIE", "JAMAIQUE", "JAPON", "JERSEY", "JORDANIE", "KAZAKHSTAN", "KENYA", "KIRGHIZISTAN", "KIRIBATI", "KOWEIT", "LAO, REPUBLIQUE DEMOCRATIQUE POPULAIRE", "LESOTHO", "LETTONIE", "LIBAN", "LIBERIA", "LIBYENNE, JAMAHIRIYA ARABE", "LIECHTENSTEIN", "LITUANIE", "LUXEMBOURG", "MACAO", "MACEDOINE, L'EX-REPUBLIQUE YOUGOSLAVE DE", "MADAGASCAR", "MALAISIE", "MALAWI", "MALDIVES", "MALI", "MALTE", "MARIANNES DU NORD, ILES", "MAROC", "MARSHALL, ILES", "MARTINIQUE", "MAURICE", "MAURITANIE", "MAYOTTE", "MEXIQUE", "MICRONESIE, ETATS FEDERES DE", "MOLDOVA, REPUBLIQUE DE", "MONACO", "MONGOLIE", "MONTENEGRO", "MONTSERRAT", "MOZAMBIQUE", "MYANMAR", "NAMIBIE", "NAURU", "NEPAL", "NICARAGUA", "NIGER", "NIGERIA", "NIUE", "NORFOLK, ILE", "NORVEGE", "NOUVELLE-CALEDONIE", "NOUVELLE-ZELANDE", "OCEAN INDIEN, TERRITOIRE BRITANNIQUE DE L'", "OMAN", "OUGANDA", "OUZBEKISTAN", "PAKISTAN", "PALAOS", "PALESTINIEN OCCUPE, TERRITOIRE", "PANAMA", "PAPOUASIE-NOUVELLE-GUINEE", "PARAGUAY", "PAYS-BAS", "PEROU", "PHILIPPINES", "PITCAIRN", "POLOGNE", "POLYNESIE FRANCAISE", "PORTO RICO", "PORTUGAL", "QATAR", "REUNION", "ROUMANIE", "ROYAUME-UNI", "RUSSIE, FEDERATION DE", "RWANDA", "SAHARA OCCIDENTAL", "SAINT-BARTHELEMY", "SAINTE-HELENE, ASCENSION ET TRISTAN DA CUNHA", "SAINTE-LUCIE", "SAINT-KITTS-ET-NEVIS", "SAINT-MARIN", "SAINT-MARTIN (PARTIE FRANCAISE)", "SAINT-MARTIN (PARTIE NEERLANDAISE)", "SAINT-PIERRE-ET-MIQUELON", "SAINT-SIEGE (ETAT DE LA CITE DU VATICAN)", "SAINT-VINCENT-ET-LES GRENADINES", "SALOMON, ILES", "SAMOA", "SAMOA AMERICAINES", "SAO TOME-ET-PRINCIPE", "SENEGAL", "SERBIE", "SEYCHELLES", "SIERRA LEONE", "SINGAPOUR", "SLOVAQUIE", "SLOVENIE", "SOMALIE", "SOUDAN", "SRI LANKA", "SUEDE", "SUISSE", "SURINAME", "SVALBARD ET ILE JAN MAYEN", "SWAZILAND", "SYRIENNE, REPUBLIQUE ARABE", "TADJIKISTAN", "TAIWAN, PROVINCE DE CHINE", "TANZANIE, REPUBLIQUE-UNIE DE", "TCHAD", "TCHEQUE, REPUBLIQUE", "TERRES AUSTRALES FRANCAISES", "THAILANDE", "TIMOR-LESTE", "TOGO", "TOKELAU", "TONGA", "TRINITE-ET-TOBAGO", "TUNISIE", "TURKMENISTAN", "TURKS ET CAIQUES, ILES", "TURQUIE", "TUVALU", "UKRAINE", "URUGUAY", "VANUATU", "VENEZUELA, REPUBLIQUE BOLIVARIENNE DU", "VIET NAM", "WALLIS ET FUTUNA", "YEMEN", "ZAMBIE", "ZIMBABWE");

var temp,lang,local,path,myxml,timeout;
var maxfilesize=1024000;
var newform, newinput, newdiv, newp, newspan, newimg, newselect, newoption;
var gallery=new Array;
var req,timeout;
var lang='fr';
var mouseX,tempX,frameWidth;
var newid,newtitle,newcomment;
var Step='type';
var Type=false; var voirie=false;
var devisHeight=0;
var currentbrush='';
var emailReg="^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,6}\$";
var myxmlid='_brosse_com_xml';
function GetObj(o,d){return (d==null?document:d).getElementById(o);};
function EregReplace(str,searc,replac){ var reg=new RegExp(searc,'gi'); return str.replace(reg,replac); };
function RegMatch(tx,rg){ var reg=new RegExp(rg,'gi'); return reg.test(tx); };
function AddOnload(f){ var oldonload=window.onload; if(typeof window.onload!='function'){window.onload=f;}else{window.onload=function(){oldonload();f();}; }};
function RemoveTag(theTag){if(theTag){theTag.parentNode.removeChild(theTag);}};
function CreateTag(rootTag,parentTag,theTag,idTag,classTag,option){ var newtag=rootTag.createElement(theTag);if(idTag!=null){newtag.id=idTag;} if(classTag!=null){newtag.className=classTag;} if(option && theTag=='td'){newtag.colSpan=option;} parentTag.appendChild(newtag); return newtag;};
function CreateFirstTag(rootTag,parentTag,theTag,idTag,classTag,option){ var newtag=rootTag.createElement(theTag);if(idTag!=null){newtag.id=idTag;} if(classTag!=null){newtag.className=classTag;} if(option && theTag=='td'){newtag.colSpan=option;} parentTag.insertBefore(newtag,parentTag.firstChild); return newtag; };
function CreateInput(rootTag,parentTag,theTag,typeTag,idTag,classTag,titleTag,clickTag,editionTag,srcImg,valueTag){ var newtag=rootTag.createElement(theTag);if(srcImg!=null){var newimg=rootTag.createElement('img');newtag.appendChild(newimg);newimg.setAttribute('src',srcImg);} if(typeTag!=null){newtag.setAttribute('type',typeTag);} if(idTag!=null){newtag.id=idTag;newtag.name=idTag;} if(classTag!=null){newtag.className=classTag;} if(editionTag!=null){newtag.setAttribute('edition',editionTag);} if(titleTag!=null){newtag.setAttribute('alt',titleTag);newtag.setAttribute('title',titleTag);} if(clickTag!=null){newtag.onclick=function(){eval(clickTag);};} if(valueTag!=null){newtag.value=valueTag;} parentTag.appendChild(newtag); return newtag;};
function CreateFirstInput(rootTag,parentTag,theTag,typeTag,idTag,classTag,titleTag,clickTag,editionTag,srcImg,valueTag){ var newtag=rootTag.createElement(theTag);if(srcImg!=null){var newimg=rootTag.createElement('img');newtag.appendChild(newimg);newimg.setAttribute('src',srcImg);} if(typeTag!=null){newtag.setAttribute('type',typeTag);} if(idTag!=null){newtag.id=idTag;newtag.name=idTag;} if(classTag!=null){newtag.className=classTag;} if(editionTag!=null){newtag.setAttribute('edition',editionTag);} if(titleTag!=null){newtag.setAttribute('alt',titleTag);newtag.setAttribute('title',titleTag);} if(clickTag!=null){newtag.onclick=function(){eval(clickTag);};} if(valueTag!=null){newtag.value=valueTag;} parentTag.insertBefore(newtag,parentTag.firstChild); return newtag;};
function CreateText(rootTag,parentTag,theText){var newtext=rootTag.createTextNode(theText); parentTag.appendChild(newtext); return true;};
function FindX(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft; obj=obj.offsetParent;}}else if(obj.x){curleft+=obj.x;} return curleft;};
function FindY(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop; obj=obj.offsetParent;}}else if(obj.y){curtop+=obj.y;} return curtop;};
function GetWinH(){if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){return document.documentElement.clientHeight;}else if(document.body && (document.body.clientWidth || document.body.clientHeight)){return document.body.clientHeight;}else if(typeof(window.innerWidth)=='number'){return window.innerHeight;}  return false;};
function SetOpacity(obj,o){ o=(o==100)?99.999:o; obj.style.filter="alpha(opacity:"+o+")"; obj.style.KHTMLOpacity=o/100; obj.style.MozOpacity=o/100; obj.style.opacity=o/100; return true;};
function FadeIn(obj,opacity){clearTimeout(timeout); if(opacity<=100){var objs=obj.split('|'); for(var i=0;i<objs.length;i++){SetOpacity(GetObj(objs[i]),opacity); } opacity+=5; timeout=window.setTimeout("FadeIn('"+obj+"',"+opacity+")", 50); } };
function Include(file){ var Head=document.getElementsByTagName('head')[0]; var head_inc=document.createElement('script'); head_inc.setAttribute('type','text/javascript'); head_inc.setAttribute('src',file); Head.appendChild(head_inc);};
function IsArray(obj){return (obj instanceof Array);};
function Fixed(){GetObj('admin_form').style.top=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+'px'; setTimeout('Fixed()',10); };
function Chr(x){return String.fromCharCode(x);};
function Trim(x){ return x.replace(/^[\s\n\r\t\v]+/,'').replace(/[\s\n\r\t\v]+$/,'');};
function Start()
{
 lang=document.body.getAttribute('lang');
 local=GetObj('local');
 path='http://'+(local?'127.0.0.1/':'')+'www.brosse.com/';
 if(GetObj('popup')){ GetObj('popup').onmouseover=function(){ this.blur(); RemoveTag(this); }; }
 if(GetObj('qualite')){ GetObj('qualite').onclick=function(){ this.blur(); return false; }; }
 if(lang!='admin')
 {
  newdiv=CreateTag(document,document.body,'div','admin_div',null,null,null); newdiv.onclick=ShowLog;
  if(GetObj('gallery')){ if(GetXml()){ StartGallery(); } }
  else if(GetObj('devis')){ StartDevis(); }
  else if(GetObj('form_contact')){ StartContact(); }
  local?'':Stats();
 }
 else
 {
  ShowLog();
  if(GetObj('gallery'))
  {
   var newbutton=CreateInput(document,GetObj('admin_div_buttons'),'button','button','submit_reload',null,'Supprimer l\'article',null,null,'img/info_ko.png',null); CreateText(document,newbutton,' Supprimer');
   newbutton.onclick=function(){ this.blur(); DeleteItem(); return false; };
   var newbutton=CreateInput(document,GetObj('admin_div_buttons'),'button','button','submit_update',null,'Mettre à jour l\'article',null,null,'img/info_ok.png',null); CreateText(document,newbutton,' Mettre à jour');
   newbutton.onclick=function(){ this.blur(); SaveItem(); return false; };
   var W=((GetObj('galleryimage').offsetWidth-50-GetObj('divimage').offsetWidth)+'px');
   GetObj('input_title').style.width=W;
   GetObj('input_comment').style.width=W;
  }
 }
};

function StartContact()
{
 RemoveTag(GetObj('content').getElementsByTagName('noscript')[0]);
 GetObj('form_contact').className='form';
 var elmnts=GetObj('form_contact').elements;
 for(var i=0; i<elmnts.length; i++)
 {
  if(elmnts[i].className=='coord')
  {
   elmnts[i].parentNode.className=elmnts[i].value==''?'link':'selected';
   elmnts[i].onkeyup=function()
   {
    if(this.value==''){ this.parentNode.className='link'; if(this.parentNode.getElementsByTagName('label')[0]){this.parentNode.getElementsByTagName('label')[0].className='red'; } }
    else{ this.parentNode.className=this.parentNode.className.substr(0,4)=='link'?'link active':'active'; if(this.parentNode.getElementsByTagName('label')[0]){this.parentNode.getElementsByTagName('label')[0].className=''; } }
   };
  }
 }

};
function StartDevis()
{
 if(document.location.toString().indexOf('-plates')>0){Type='plates';}
 else if(document.location.toString().indexOf('-rotatives')>0){Type='rotatives';}
 else if(document.location.toString().indexOf('-plateaux')>0){Type='plateaux';}
 else if(document.location.toString().indexOf('-strip')>0){Type='strip';}
 else if(document.location.toString().indexOf('-ecouvillons')>0){Type='ecouvillons';}
 else if(document.location.toString().indexOf('-voirie')>0){Type='voirie';}
 RemoveTag(GetObj('content').getElementsByTagName('noscript')[0]);
 newdiv=CreateFirstTag(document,GetObj('content'),'form','devis','form',null,null); newdiv.setAttribute('enctype','multipart/form-data'); newdiv.setAttribute('action',document.location.toString()); newdiv.setAttribute('method','post');
  newp=CreateTag(document,newdiv,'h3','devisask',null,null,null);
  newp=CreateTag(document,newdiv,'div','deviscontent',null,null,null);
  newp=CreateTag(document,newdiv,'h3','nextstep',null,null,null);
  newp=CreateTag(document,newdiv,'div','bottom',null,null,null);
 newdiv=CreateFirstTag(document,GetObj('content'),'div','papier',null,null,null);
  newp=CreateTag(document,newdiv,'h4','papiertitre',null,null,null);
  CreateText(document,newp,'Vous avez un projet de brosse à nous soumettre ?');CreateTag(document,newp,'br',null,null,null,null);
  newp=CreateTag(document,newdiv,'p','papierimg',null,null,null);
  newp.style.height='215px';
  CreateText(document,newp,'Que votre brosse soit standard ou spécifique, suivez ce questionnaire étape par étape, nous vous répondrons le plus rapidement possible.');CreateTag(document,newp,'br',null,null,null,null);
  NextStep();
};
function NextStep()
{
 devisHeight=devisHeight==0?100:(GetObj('devis').offsetHeight-20);
 GetObj('deviscontent').style.height=devisHeight+'px';
 GetObj('deviscontent').style.background=' url(\'img/wait.gif\') center center no-repeat';
 GetObj('devisask').style.display='none';
 GetObj('deviscontent').innerHTML='';
 GetObj('nextstep').style.display='none';
 clearTimeout(timeout); timeout=setTimeout('StepDevis();',500);
};
function StepDevis()
{
 GetObj('deviscontent').style.background='';
 GetObj('deviscontent').style.height='';
 switch(Step)
 {
  case'type':
   GetObj('devisask').innerHTML='Choisissez un type de brosse...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='... puis passez au choix suivant';
   GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   if(Type=='rotatives'||Type==false)
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','rota',null,null,null);
    CreateText(document,newp,'Brosse rotative avec axe');
     newp.onclick=function(){ voirie=false; ValidStep(this,'utilisation','Type de brosse'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','rots',null,null,null);
    CreateText(document,newp,'Brosse rotative sans axe');
     newp.onclick=function(){ voirie=false; ValidStep(this,'utilisation','Type de brosse'); };
   }
   if(Type=='plates'||Type==false)
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','plat',null,null,null);
    CreateText(document,newp,'Brosse plate linéaire');
     newp.onclick=function(){ voirie=false; ValidStep(this,'utilisation','Type de brosse'); };
   }
   if(Type=='plateaux'||Type==false)
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','pltx',null,null,null);
    CreateText(document,newp,'Brosse plateau circulaire');
     newp.onclick=function(){ voirie=false; ValidStep(this,'utilisation','Type de brosse'); };
   }
   if(Type=='strip'||Type==false)
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','strh',null,null,null);
    CreateText(document,newp,'Brosse strip ou brosse sertie en H');
     newp.onclick=function(){ voirie=false; ValidStep(this,'utilisation','Type de brosse'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','strf',null,null,null);
    CreateText(document,newp,'Brosse strip ou brosse sertie en F');
     newp.onclick=function(){ voirie=false; ValidStep(this,'utilisation','Type de brosse'); };
   }
   if(Type=='ecouvillons'||Type==false)
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','ecou',null,null,null);
    CreateText(document,newp,'Brosse écouvillon');
     newp.onclick=function(){ voirie=false; ValidStep(this,'utilisation','Type de brosse'); };
   }
   if(Type=='voirie'||Type==false)
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','voiriebros',null,null,null);
    CreateText(document,newp,'Brosse de voirie');
     newp.onclick=function(){ voirie='voiriebros'; ValidStep(this,'voiriemodele','Type de brosse'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','voiriemach',null,null,null);
    CreateText(document,newp,'Brosse de voirie suivant une marque et un type de balayeuse');
     newp.onclick=function(){ voirie='voiriemach'; ValidStep(this,'quantite','Type de brosse'); };
   }
   if(Type!='voirie')
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','spec',null,null,null);
    CreateText(document,newp,'Brosse spécifique sur plan');
     newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Type de brosse'); };
   }
  break;
  case'voiriemodele':
   GetObj('devisask').innerHTML='Choisissez un modèle...';
   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';
   GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','voirielat',null,null,null); newp.style.padding=' 0 0 0 30px';
   newspan=CreateTag(document,newp,'span',null,null,null,null); newspan.style.background=' url(\'img/bg_voirielat.png\') left center no-repeat'; newspan.style.padding=' 5px 0 5px 45px'; newspan.style.display='block';
   CreateText(document,newspan,'Brosse latérale');
    newp.onclick=function(){ voirie='voirielat'; ValidStep(this,'dimensions','Modèle de brosse'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr',null,null,null); newp.style.padding=' 0 0 0 30px';
   newspan=CreateTag(document,newp,'span',null,null,null,null); newspan.style.background=' url(\'img/bg_voiriecentr.png\') left center no-repeat'; newspan.style.padding=' 5px 0 5px 45px'; newspan.style.display='block';
   CreateText(document,newspan,'Brosse centrale');
    newp.onclick=function(){ voirie='voiriecentr'; ValidStep(this,'voirieimplantation','Modèle de brosse'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriedesh',null,null,null); newp.style.padding=' 0 0 0 30px';
   newspan=CreateTag(document,newp,'span',null,null,null,null); newspan.style.background=' url(\'img/bg_voiriedesh.png\') left center no-repeat'; newspan.style.padding=' 5px 0 5px 45px'; newspan.style.display='block';
   CreateText(document,newspan,'Brosse de désherbage');
    newp.onclick=function(){ voirie='voiriedesh'; ValidStep(this,'quantite','Modèle de brosse'); };
  break;
  case'voirieimplantation':
   GetObj('devisask').innerHTML='Choisissez un type d\'implantation...';
   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';
   GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr1',null,null,null);
   CreateText(document,newp,'Touffes implantées sur fût');
    newp.onclick=function(){ voirie='voiriecentr1'; ValidStep(this,'dimensions','Implantation'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr2',null,null,null);
   CreateText(document,newp,'Barres');
    newp.onclick=function(){ voirie='voiriecentr2'; ValidStep(this,'voiriecentr2','Implantation'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr3',null,null,null);
   CreateText(document,newp,'Anneaux');
    newp.onclick=function(){ voirie='voiriecentr3'; ValidStep(this,'voiriecentr3','Implantation'); };
  break;
  case'voiriecentr2':
   GetObj('devisask').innerHTML='Choisissez un type de garnissage...';
   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';
   GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr21',null,null,null);
   CreateText(document,newp,'Fibres serties');
    newp.onclick=function(){ voirie='voiriecentr21'; ValidStep(this,'voiriegarnissage','Type de fibres'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr22',null,null,null);
   CreateText(document,newp,'Fibres implantées par touffes');
    newp.onclick=function(){ voirie='voiriecentr22'; ValidStep(this,'voiriegarnissage','Type de fibres'); };
  break;
  case'voiriecentr3':
   GetObj('devisask').innerHTML='Choisissez un type de monture...';
   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';
   GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr31',null,null,null);
   CreateText(document,newp,'Monture plastique');
    newp.onclick=function(){ voirie='voiriecentr31'; ValidStep(this,'dimensions','Type de monture'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','voiriecentr32',null,null,null);
   CreateText(document,newp,'Monture acier feuillard');
    newp.onclick=function(){ voirie='voiriecentr32'; ValidStep(this,'voiriecentr32','Type de monture'); };
  break;
  case'voiriecentr32':
   GetObj('devisask').innerHTML='Choisissez la matière du garnissage...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';             GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','macier',null,null,null);
   CreateText(document,newp,'Acier');
    newp.onclick=function(){ voirie='voiriecentr321'; ValidStep(this,'dimensions','Matière du garnissage'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','mpvc',null,null,null);
   CreateText(document,newp,'Synthetique (PVC, PP, PA, POM)');
    newp.onclick=function(){ voirie='voiriecentr322'; ValidStep(this,'dimensions','Matière du garnissage'); };
  break;
  case'utilisation':
   GetObj('devisask').innerHTML='Choisissez une température d\'utilisation...';
   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';
   GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','tambiante',null,null,null);
   CreateText(document,newp,'Température ambiante');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush!='ecou'?'alimentaire':'chimique'),'Température d\'utilisation'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','t-60',null,null,null);
   CreateText(document,newp,'Température inférieure à 60°C');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush!='ecou'?'alimentaire':'chimique'),'Température d\'utilisation'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','t60',null,null,null);
   CreateText(document,newp,'Température supérieure à 60°C');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush!='ecou'?'alimentaire':'chimique'),'Température d\'utilisation'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','t120',null,null,null);
   CreateText(document,newp,'Température à plus de 120°C');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush!='ecou'?'alimentaire':'chimique'),'Température d\'utilisation'); };
  break;
  case'alimentaire':
   GetObj('devisask').innerHTML='Indiquez si la brosse a des contacts avec des produits alimentaires...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';                                 GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','noalim',null,null,null);
   CreateText(document,newp,'Non');
    newp.onclick=function(){ voirie=false; ValidStep(this,'chimique','Contact alimentaire'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','alim',null,null,null);
   CreateText(document,newp,'Oui');
    newp.onclick=function(){ voirie=false; ValidStep(this,'chimique','Contact alimentaire'); };
  break;
  case'chimique':
   GetObj('devisask').innerHTML='Indiquez si la brosse a des contacts avec des produits chimiques...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';                               GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','nochim',null,null,null);
   CreateText(document,newp,'Non');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush!='ecou'?'support':'garniture'),'Contact produits chimiques'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','chim',null,null,null);
   CreateText(document,newp,'Oui');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush!='ecou'?'support':'garniture'),'Contact produits chimiques'); };
  break;
  case'support':
   GetObj('devisask').innerHTML='Choisissez la matière du support...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';             GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   if(currentbrush!='strh' && currentbrush!='strf'){
   newp=CreateTag(document,GetObj('deviscontent'),'p','mpvc',null,null,null);
   CreateText(document,newp,'Synthetique (PVC, PP, PA, POM)');
    newp.onclick=function(){ voirie=false; ValidStep(this,'garniture','Matière du support'); };  }
   newp=CreateTag(document,GetObj('deviscontent'),'p','malu',null,null,null);
   CreateText(document,newp,'Aluminium');
    newp.onclick=function(){ voirie=false; ValidStep(this,'garniture','Matière du support'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','macier',null,null,null);
   CreateText(document,newp,'Acier');
    newp.onclick=function(){ voirie=false; ValidStep(this,'garniture','Matière du support'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','minox',null,null,null);
   CreateText(document,newp,'Acier inoxydable');
    newp.onclick=function(){ voirie=false; ValidStep(this,'garniture','Matière du support'); };
   if(currentbrush!='strh' && currentbrush!='strf'){
   newp=CreateTag(document,GetObj('deviscontent'),'p','mbois',null,null,null);
   CreateText(document,newp,'Bois');
    newp.onclick=function(){ voirie=false; ValidStep(this,'garniture','Matière du support'); };  }
  break;
  case'voiriegarnissage':
   GetObj('devisask').innerHTML='Choisissez la matière du garnissage...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';             GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','macier',null,null,null);
   CreateText(document,newp,'Acier');
    newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Matière du garnissage'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','mpvc',null,null,null);
   CreateText(document,newp,'Synthetique (PVC, PP, PA, POM)');
    newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Matière du garnissage'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','macierpvc',null,null,null);
   CreateText(document,newp,'Acier et synthétique');
    newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Matière du garnissage'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','mindefini',null,null,null);
   CreateText(document,newp,'Indéfini');
    newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Matière du garnissage'); };
  break;
  case'garniture':
   GetObj('devisask').innerHTML='Choisissez le type de garniture...';   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';             GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','gsynt',null,null,null);
   CreateText(document,newp,'Synthétique (PA6, PP, PBT, RILSAN, Antistatique)');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush=='strh' || currentbrush=='strf'?'profilstrip':'dimensions'),'Matière de la garniture'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','gsoie',null,null,null);
   CreateText(document,newp,'Soie');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush=='strh' || currentbrush=='strf'?'profilstrip':'dimensions'),'Matière de la garniture'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','gcrin',null,null,null);
   CreateText(document,newp,'Crin');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush=='strh' || currentbrush=='strf'?'profilstrip':'dimensions'),'Matière de la garniture'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','gtamp',null,null,null);
   CreateText(document,newp,'Tampico');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush=='strh' || currentbrush=='strf'?'profilstrip':'dimensions'),'Matière de la garniture'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','gmetal',null,null,null);
   CreateText(document,newp,'Métallique (ACIER, INOX, LAITON)');
    newp.onclick=function(){ voirie=false; ValidStep(this,(currentbrush=='strh' || currentbrush=='strf'?'profilstrip':'dimensions'),'Matière de la garniture'); };
  break;
  case'dimensions':
   GetObj('devisask').innerHTML='Saisissez les dimensions...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';     GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   if(currentbrush=='rota')
   {
    CreateDimText(6);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Longueur du support : '); newinput=CreateInput(document,newp,'input','text','rota_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur du support = A'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur du support = A'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur du support = A'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Diamètre du support : '); newinput=CreateInput(document,newp,'input','text','rota_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre du support = B'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre du support = B'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre du support = B'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
    CreateText(document,newp,'Diamètre de l\'arbre : '); newinput=CreateInput(document,newp,'input','text','rota_c','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre de l\'arbre = C'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre de l\'arbre = C'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre de l\'arbre = C'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','d',null,null,null);
    CreateText(document,newp,'Longueur de l\'arbre : '); newinput=CreateInput(document,newp,'input','text','rota_d','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur de l\'arbre = D'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur de l\'arbre = D'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur de l\'arbre = D'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','e',null,null,null);
    CreateText(document,newp,'Longueur du garnissage : '); newinput=CreateInput(document,newp,'input','text','rota_e','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur du garnissage = E'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur du garnissage = E'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur du garnissage = E'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','f',null,null,null);
    CreateText(document,newp,'Diamètre du garnissage : '); newinput=CreateInput(document,newp,'input','text','rota_f','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre du garnissage = F'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre du garnissage = F'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre du garnissage = F'); };
   }
   else if(currentbrush=='rots')
   {
    CreateDimText(5);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Longueur du support : '); newinput=CreateInput(document,newp,'input','text','rots_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur du support = A'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur du support = A'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur du support = A'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Diamètre du support : '); newinput=CreateInput(document,newp,'input','text','rots_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre du support = B'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre du support = B'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre du support = B'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
    CreateText(document,newp,'Diamètre de l\'alésage : '); newinput=CreateInput(document,newp,'input','text','rots_c','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre de l\'alésage = C'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre de l\'alésage = C'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre de l\'alésage = C'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','d',null,null,null);
    CreateText(document,newp,'Longueur du garnissage : '); newinput=CreateInput(document,newp,'input','text','rots_d','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur du garnissage = D'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur du garnissage = D'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur du garnissage = D'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','e',null,null,null);
    CreateText(document,newp,'Diamètre du garnissage : '); newinput=CreateInput(document,newp,'input','text','rots_e','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre du garnissage = E'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre du garnissage = E'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre du garnissage = E'); };
   }
   else if(currentbrush=='plat')
   {
    CreateDimText(6);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Longueur du support : '); newinput=CreateInput(document,newp,'input','text','plat_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur du support = A'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur du support = A'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur du support = A'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Largeur du support : '); newinput=CreateInput(document,newp,'input','text','plat_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Largeur du support = B'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Largeur du support = B'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Largeur du support = B'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
    CreateText(document,newp,'Epaisseur du support : '); newinput=CreateInput(document,newp,'input','text','plat_c','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Epaisseur du support = C'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Epaisseur du support = C'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Epaisseur du support = C'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','d',null,null,null);
    CreateText(document,newp,'Longueur du garnissage : '); newinput=CreateInput(document,newp,'input','text','plat_d','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur du garnissage = D'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur du garnissage = D'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur du garnissage = D'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','e',null,null,null);
    CreateText(document,newp,'Largeur du garnissage : '); newinput=CreateInput(document,newp,'input','text','plat_e','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Largeur du garnissage = E'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Largeur du garnissage = E'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Largeur du garnissage = E'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','f',null,null,null);
    CreateText(document,newp,'Hauteur des fibres : '); newinput=CreateInput(document,newp,'input','text','plat_f','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Hauteur des fibres = F'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Hauteur des fibres = F'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Hauteur des fibres = F'); };
   }
   else if(currentbrush=='pltx')
   {
    CreateDimText(6);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Diamètre du support : '); newinput=CreateInput(document,newp,'input','text','pltx_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre du support = A'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre du support = A'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre du support = A'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Diamètre d\'alésage : '); newinput=CreateInput(document,newp,'input','text','pltx_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre d\'alésage = B'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre d\'alésage = B'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre d\'alésage = B'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
    CreateText(document,newp,'Epaisseur du support : '); newinput=CreateInput(document,newp,'input','text','pltx_c','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Epaisseur du support = C'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Epaisseur du support = C'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Epaisseur du support = C'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','d',null,null,null);
    CreateText(document,newp,'Diamètre extérieur du garnissage : '); newinput=CreateInput(document,newp,'input','text','pltx_d','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre extérieur du garnissage = D'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre extérieur du garnissage = D'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre extérieur du garnissage = D'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','e',null,null,null);
    CreateText(document,newp,'Diamètre intérieur du garnissage : '); newinput=CreateInput(document,newp,'input','text','pltx_e','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre intérieur du garnissage = E'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre intérieur du garnissage = E'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre intérieur du garnissage = E'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','f',null,null,null);
    CreateText(document,newp,'Hauteur des fibres : '); newinput=CreateInput(document,newp,'input','text','pltx_f','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Hauteur des fibres = F'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Hauteur des fibres = F'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Hauteur des fibres = F'); };
   }
   else if(currentbrush=='strh' || currentbrush=='strf')
   {
    newp=CreateTag(document,GetObj('deviscontent'),'p','d',null,null,null);
    CreateText(document,newp,'Hauteur des fibres : '); newinput=CreateInput(document,newp,'input','text',currentbrush+'_d','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'longueurstrip','Hauteur des fibres = D'); };
     newinput.onclick=function(){ ValidDim(this,'longueurstrip','Hauteur des fibres = D'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'longueurstrip','Hauteur des fibres = D'); };
   }
   else if(currentbrush=='ecou')
   {
    CreateDimText(6);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Longueur totale : '); newinput=CreateInput(document,newp,'input','text','ecou_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur totale = A'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur totale = A'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur totale = A'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Longueur du garnissage : '); newinput=CreateInput(document,newp,'input','text','ecou_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Longueur du garnissage = B'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Longueur du garnissage = B'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Longueur du garnissage = B'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
    CreateText(document,newp,'Diamètre du garnissage : '); newinput=CreateInput(document,newp,'input','text','ecou_c','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'remplacement','Diamètre du garnissage = C'); };
     newinput.onclick=function(){ ValidDim(this,'remplacement','Diamètre du garnissage = C'); };
     newinput.onblur=function(){ CorrectDim(); ValidDim(this,'remplacement','Diamètre du garnissage = C'); };
   }
   else if(currentbrush=='voirielat')
   {
    CreateDimText(2);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Diamètre monture : '); newinput=CreateInput(document,newp,'input','text','voirielat_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'voiriegarnissage','Diamètre monture'); };
     newinput.onclick=function(){ ValidDim(this,'voiriegarnissage','Diamètre monture'); };
     newinput.onblur=function(){  ValidDim(this,'voiriegarnissage','Diamètre monture'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Hauteur des fibres : '); newinput=CreateInput(document,newp,'input','text','voirielat_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'voiriegarnissage','Hauteur des fibres'); };
     newinput.onclick=function(){ ValidDim(this,'voiriegarnissage','Hauteur des fibres'); };
     newinput.onblur=function(){  ValidDim(this,'voiriegarnissage','Hauteur des fibres'); };
   }
   else if(currentbrush=='voiriecentr' && voirie=='voiriecentr1')
   {
    CreateDimText(3);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Diamètre monture : '); newinput=CreateInput(document,newp,'input','text','voiriecentr_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'voiriegarnissage','Diamètre monture'); };
     newinput.onclick=function(){ ValidDim(this,'voiriegarnissage','Diamètre monture'); };
     newinput.onblur=function(){  ValidDim(this,'voiriegarnissage','Diamètre monture'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Longueur monture : '); newinput=CreateInput(document,newp,'input','text','voiriecentr_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'voiriegarnissage','Longueur monture'); };
     newinput.onclick=function(){ ValidDim(this,'voiriegarnissage','Longueur monture'); };
     newinput.onblur=function(){  ValidDim(this,'voiriegarnissage','Longueur monture'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
    CreateText(document,newp,'Diamètre total : '); newinput=CreateInput(document,newp,'input','text','voiriecentr_c','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'voiriegarnissage','Diamètre total'); };
     newinput.onclick=function(){ ValidDim(this,'voiriegarnissage','Diamètre total'); };
     newinput.onblur=function(){  ValidDim(this,'voiriegarnissage','Diamètre total'); };
   }
   else if(currentbrush=='voiriecentr' && (voirie=='voiriecentr31'||voirie=='voiriecentr321'||voirie=='voiriecentr322'))
   {
    CreateDimText(2);
    newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
    CreateText(document,newp,'Diamètre alésage : '); newinput=CreateInput(document,newp,'input','text','voiriecentr_a','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'quantite','Diamètre alésage'); };
     newinput.onclick=function(){ ValidDim(this,'quantite','Diamètre alésage'); };
     newinput.onblur=function(){  ValidDim(this,'quantite','Diamètre alésage'); };
    newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
    CreateText(document,newp,'Longueur total : '); newinput=CreateInput(document,newp,'input','text','voiriecentr_b','dim',null,null,null,null,null); CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidDim(this,'quantite','Diamètre total'); };
     newinput.onclick=function(){ ValidDim(this,'quantite','Diamètre total'); };
     newinput.onblur=function(){  ValidDim(this,'quantite','Diamètre total'); };
   }
  break;
  case'profilstrip':
   CreateDimText(4);
   GetObj('devisask').innerHTML='Choisissez un profil...';   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';             GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
   CreateText(document,newp,(currentbrush=='strh'?'Hauteur du profil':'Largeur du profil')+' : 16mm');
    newp.onclick=function(){ voirie=false; ValidStep(this,'dimensions','Type de profil'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
   CreateText(document,newp,(currentbrush=='strh'?'Hauteur du profil':'Largeur du profil')+' : 25mm');
    newp.onclick=function(){ voirie=false; ValidStep(this,'dimensions','Type de profil'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
   CreateText(document,newp,(currentbrush=='strh'?'Hauteur du profil':'Largeur du profil')+' : 50mm');
    newp.onclick=function(){ voirie=false; ValidStep(this,'dimensions','Type de profil'); };
  break;
  case'longueurstrip':
   CreateDimText(4);
   GetObj('devisask').innerHTML='Choisissez la longueur du profil...';   GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';             GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','a',null,null,null);
   CreateText(document,newp,'Standard 1 mètre');
    newp.onclick=function(){ voirie=false; ValidStep(this,'remplacement','Longueur du profil'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','b',null,null,null);
   CreateText(document,newp,'Standard 2 mètres');
    newp.onclick=function(){ voirie=false; ValidStep(this,'remplacement','Longueur du profil'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','c',null,null,null);
   CreateText(document,newp,'Standard 3 mètres');
    newp.onclick=function(){ voirie=false; ValidStep(this,'remplacement','Longueur du profil'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','d',null,null,null);
   CreateText(document,newp,'Hors standard (merci de joindre un plan ou d\'ajouter un commentaire)');
    newp.onclick=function(){ voirie=false; ValidStep(this,'remplacement','Longueur du profil'); };
  break;
  case'remplacement':
   GetObj('devisask').innerHTML='Indiquez si c\'est pour un remplacement d\'une brosse existante...';  GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';                    GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p','rnon',null,null,null);
   CreateText(document,newp,'Non');
    newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Remplacement d\'une brosse'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','riden',null,null,null);
   CreateText(document,newp,'A l\'identique');
    newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Remplacement d\'une brosse'); };
   newp=CreateTag(document,GetObj('deviscontent'),'p','ramel',null,null,null);
   CreateText(document,newp,'Pour amélioration');
    newp.onclick=function(){ voirie=false; ValidStep(this,'quantite','Remplacement d\'une brosse'); };
  break;
  case'quantite':
   GetObj('devisask').innerHTML='Saisissez une quantité...';         GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis passez au choix suivant';          GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
    newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    CreateText(document,newp,'Quantité : '); newinput=CreateInput(document,newp,'input','text','qte','dim',null,null,null,null,null); //CreateText(document,newp,' mm');
     newinput.onkeyup=function(){ ValidQte(this,'coordonnees','Quantité'); };
     newinput.onclick=function(){ ValidQte(this,'coordonnees','Quantité'); };
     newinput.onblur=function(){ ValidQte(this,'coordonnees','Quantité'); };
  break;
  case'coordonnees':
   GetObj('devisask').innerHTML='Saisissez vos coordonnées...';     GetObj('devisask').style.display='block';
   GetObj('nextstep').innerHTML='...puis envoyer votre demande';         GetObj('nextstep').style.display='block'; GetObj('nextstep').className='disabled';
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','societe','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Société'); };
    CreateText(document,newp,'Société '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','activite','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Activité'); };
    CreateText(document,newp,'Activité');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','adresse','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Adresse'); };
    CreateText(document,newp,'Adresse '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','cp','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Code postal'); };
    CreateText(document,newp,'Code postal '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','ville','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Ville'); };
    CreateText(document,newp,'Ville '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');

   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newselect=CreateTag(document,newp,'select','pays','coord',null); newselect.setAttribute('name','pays');
    for(var i=0; i<array_pays.length; i++){
      newoption=CreateTag(document,newselect,'option',null,null,null);
      if(array_pays[i]=='FRANCE'){ newoption.setAttribute('selected','selected'); }
      CreateText(document,newoption,array_pays[i]);
    }
    CreateText(document,newp,'Pays ');

   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','nom','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Nom'); };
    CreateText(document,newp,'Nom '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','prenom','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Prénom'); };
    CreateText(document,newp,'Prénom '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','fonction','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Fonction'); };
    CreateText(document,newp,'Fonction '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','tel','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Téléphone'); };
    CreateText(document,newp,'Téléphone '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','fax','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'Fax'); };
    CreateText(document,newp,'Fax');
   newp=CreateTag(document,GetObj('deviscontent'),'p',null,null,null,null);
    newinput=CreateInput(document,newp,'input','text','email','coord',null,null,null,null,null);
    newinput.onkeyup=function(){ ValidCoord(this,'E-mail'); };
    CreateText(document,newp,'E-mail '); newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');
   newp=CreateTag(document,GetObj('deviscontent'),'p','pfile',null,null,null);
    CreateText(document,newp,'Vous pouvez joindre un plan détaillé à votre demande.'); CreateTag(document,newp,'br',null,null,null,null);
    newspan=CreateTag(document,newp,'span',null,'small',null,null);
    CreateText(document,newspan,'Taille du fichier limitée à '+Math.round(maxfilesize/1024)+'Ko'); CreateTag(document,newspan,'br',null,null,null,null);
    CreateText(document,newspan,'Formats conseillés : image JPEG ou PNG, fichier PDF, fichier DOC'); CreateTag(document,newspan,'br',null,null,null,null);
    //newspan=CreateTag(document,newp,'span',null,null,null,null);
    //newspan.innerHTML='<iframe id="fileiframe" frameborder="0" scrolling="no" src="iframe.php?maxfilesize='+maxfilesize+'"></iframe>';
    newinput=CreateInput(document,newp,'input','file','input_file',null,null,null,null,null,null);
    CreateTag(document,newp,'br',null,null,null,null);
    newspan=CreateTag(document,newp,'span',null,'required',null,null);
    CreateText(document,newspan,'* champs nécessaires');
    $("#input_file").uploadify({
     'uploader'       : 'upload_uploadify.swf',
     'script'         : 'upload_uploadify.php',
     'cancelImg'      : 'img/error_ko.png',
     'folder'         : 'upload',
     'auto'           : true,
     'multi'          : false,
     'buttonText'     : 'Parcourir...',
     'sizeLimit'      : maxfilesize,
     onSelect         : function(event,queueID,fileObj){
      $('#pfile').removeClass('red').addClass('uploading');
      $('#input_fileQueue').addClass('small').empty();
     },
     onCancel       : function(event,queueID,fileObj,response,data){
      $('#pfile').removeClass('red').removeClass('selected').removeClass('uploading');
      $('#file_uploaded').remove();
      $('#input_fileQueue').addClass('small').empty();
      $('#h4upload').remove();
     },
     onComplete       : function(event,queueID,fileObj,response,data){
      $('#pfile').removeClass('red').removeClass('uploading').addClass('selected');
      $('#file_uploaded').remove();
      $('<input type="hidden" id="file_uploaded" name="file" value="'+fileObj.name+'||||'+fileObj.size+'" />').appendTo('#devis');
      $('#input_fileQueue').addClass('small').empty().html('Le fichier <i>'+fileObj.name+' ('+Math.round(fileObj.size/1024*100)/100+'Ko)</i> sera joint à votre demande.');
      $('#h4upload').remove();
      $('<h4 id="h4upload">Fichier joint : <span class="greenok">'+fileObj.name+' ('+Math.round(fileObj.size/1024*100)/100+'Ko)</span></h4>').appendTo('#papier');
     },
     onError: function (a, b, c, d) {
         if (d.status == 404)
            var err=('Could not find upload script. Use a path relative to: '+'<?= getcwd() ?>');
         else if (d.type === "HTTP")
            var err=('Erreur : '+d.type+": "+d.status);
         else if (d.type ==="File Size")
            var err=('Le fichier <i>'+c.name+'</i> est trop gros : '+Math.round(c.size/1024*100)/100+' Ko >'+Math.round(maxfilesize/1024)+' Ko');
         else
            var err=('Erreur : '+d.type+": "+d.text);
      $('#input_fileQueue').addClass('small').empty().html(err);
      $('#pfile').removeClass('uploading').removeClass('selected').addClass('red');
      $('#file_uploaded').remove();
      $('#h4upload').remove();
     }
    });

  break;
 }
 if(Step!='dimensions' && Step!='coordonnees' && Step!='quantite'){Deactivate(GetObj('deviscontent').firstChild);}
 GetObj('footer').className='footer';
};
function SendDevis()
{
 if(!GetObj('email').value.match(emailReg) || GetObj('temp_comment').value==''){
  var err=new Array();
  if(!GetObj('email').value.match(emailReg)){err.push('Merci de vérifier votre adresse e-mail, elle semble ne pas être au bon format.');}
  if(GetObj('temp_comment').value==''){err.push(currentbrush.substr(0,6)=='voirie'?'Merci d\'indiquer les références, la marque, le type ou toute autre information concernant la balayeuse.':'Merci d\'ajouter un commentaire sur le domaine d\'utilisation et l\'environnement de cette (ces) brosse(s), il nous permettra de mieux vous conseiller.'); GetObj('temp_comment').focus(); }
  alert(err.join('\n\n'));
 }
 else
 {
  GetObj('nextstep').innerHTML='Merci de patienter...';
  GetObj('nextstep').className='disabled'; GetObj('nextstep').onclick=function(){return false; };
  newinput=CreateInput(document,GetObj('devis'),'input','hidden','do_it',null,null,null,null,null,'senddevis');
  newinput=CreateInput(document,GetObj('devis'),'input','hidden','comment',null,null,null,null,null,GetObj('temp_comment').value.split('\n').join('[br]'));
  newinput=CreateInput(document,GetObj('devis'),'input','hidden','pays',null,null,null,null,null,GetObj('pays').value);
  newinput=currentbrush!='spec'?CreateInput(document,GetObj('devis'),'input','hidden','currentbrush',null,null,null,null,null,currentbrush):'';
  GetObj('devisask').innerHTML='Envoi de votre demande';
  GetObj('deviscontent').style.height='150px';
  GetObj('deviscontent').style.background=' url(\"img/wait.gif\") center center no-repeat';
  var elmnts=GetObj('deviscontent').getElementsByTagName('p');
  for(var i=0; i<elmnts.length; i++){ elmnts[i].className='hidden2'; }
  newspan=CreateTag(document,GetObj('h4comment'),'span','greenok','greenok',null,null);  CreateText(document,newspan,GetObj('temp_comment').value);
  GetObj('temp_comment').style.display='none';
  $('#devis').submit();
 }
 return false;
};
function ValidCoord(obj,post)
{
 if(obj.id=='input_file'){ GetObj('pfile').className=obj.value==''?'':'selected'; }
 else
 {
  obj.parentNode.className='selected';
  if(!GetObj('coord_'+obj.id)){ newinput=CreateInput(document,GetObj('devis'),'input','hidden','form[]',null,null,null,null,null,null); newinput.id='coord_'+obj.id; }
  GetObj('coord_'+obj.id).value=post+' = '+obj.value;
  var unablenext=true;
  var inputs=obj.parentNode.parentNode.getElementsByTagName('input');
  for(var i=0; i<inputs.length; i++)
  {
   if(inputs[i].value=='' && inputs[i].parentNode.id!='pfile'){ inputs[i].parentNode.className=''; if(inputs[i].id!='input_file' && inputs[i].id!='fax' && inputs[i].id!='activite'){unablenext=false;} }
  }
  if(unablenext){GetObj('nextstep').className=''; GetObj('nextstep').onclick=function(){ SendDevis(); }; }
  else{ GetObj('nextstep').className='disabled'; GetObj('nextstep').onclick=function(){return false; }; }
 }
 Footer();
};
function ValidDim(obj,step,post)
{
 obj.parentNode.className='selected';
 if(obj.id.indexOf('voirielat')!=-1 || obj.id.indexOf('voiriecentr')!=-1){
  if(!GetObj('dim_'+obj.id)){ newinput=CreateInput(document,GetObj('devis'),'input','hidden','form[]',null,null,null,null,null,null); newinput.id='dim_'+obj.id; }
  GetObj('text_'+obj.id).innerHTML=obj.value==''?'':post+' = '+obj.value+' mm';
 }
 else{
  if(!GetObj('img_'+obj.id)){ newimg=CreateTag(document,GetObj('papierimg'),'img','img_'+obj.id,null,null,null); newimg.src='img/img_'+obj.id+'.png'; newimg.style.position='absolute'; }
  if(!GetObj('dim_'+obj.id)){ newinput=CreateInput(document,GetObj('devis'),'input','hidden','form[]',null,null,null,null,null,null); newinput.id='dim_'+obj.id; }
  GetObj('text_'+obj.id).innerHTML=obj.value==''?'':obj.parentNode.id.toUpperCase()+' = '+obj.value+' mm';
 }
 GetObj('dim_'+obj.id).value=post+' = '+obj.value+' mm';
 var unablenext=true;
 var inputs=obj.parentNode.parentNode.getElementsByTagName('input');
 for(var i=0; i<inputs.length; i++)
 {
  if(inputs[i].value==''){ inputs[i].parentNode.className=''; unablenext=false;}
  if(inputs[i].id!=obj.id && inputs[i].value==''){ RemoveTag(GetObj('img_'+inputs[i].id));}
 }
 if(unablenext){ GetObj('nextstep').className=step; GetObj('nextstep').onclick=function(){ NextStep(); Step=this.className; }; }
 else{ GetObj('nextstep').className='disabled'; GetObj('nextstep').onclick=function(){return false; }; }
 Footer();
};
function ValidQte(obj,step,post)
{
 var val=obj.value;//.replace(/[^0-9]/g,'');
 RemoveTag(GetObj('h4'+Step));
 newp=CreateTag(document,GetObj('papier'),'h4','h4'+Step,null,null,null); CreateText(document,newp,post+' : ');
  newspan=CreateTag(document,newp,'span',null,'greenok',null,null);  CreateText(document,newspan,val);
 if(val=='')
 {
  obj.parentNode.className='';
  GetObj('nextstep').className='disabled';
  GetObj('nextstep').onclick=function(){return false; };
 }
 else
 {
  obj.parentNode.className='selected';
  RemoveTag(GetObj(Step)); newinput=CreateInput(document,GetObj('devis'),'input','hidden','form[]',null,null,null,null,null,post+' = '+val); newinput.id=Step;
  GetObj('nextstep').className=step;
  GetObj('nextstep').onclick=function(){ NextStep(); Step=this.className; this.onclick=function(){return false;}; };
 }
 Footer();
};
function ValidStep(obj,step,post)
{
 var v=(voirie=='voirielat' || voirie=='voiriecentr' || voirie=='voiriedesh')?true:false;
 if(v)
 {
  currentbrush=voirie;
  GetObj('img_voiriebros').src='img/img_'+obj.id+''+'.png';
 }
 if(Step=='type')
 {
  GetObj('papier').innerHTML='';
  newp=CreateTag(document,GetObj('papier'),'h4','papiertitre',null,null,null); CreateText(document,newp,post+' : ');
   newspan=CreateTag(document,newp,'span',null,'greenok',null,null);  CreateText(document,newspan,obj.firstChild.data);
  newp.style.height='';
  currentbrush=obj.id;
  newp=CreateTag(document,GetObj('papier'),'div','papierimg',null,null,null);
  RemoveTag(GetObj('papierdim')); CreateTag(document,newp,'div','papierdim',null,null,null);
  newp.style.height='215px';
  newimg=CreateTag(document,newp,'img','img_'+obj.id+'',null,null,null); newimg.src='img/img_'+obj.id+''+'.png'; newimg.style.position='absolute';
  newp=CreateTag(document,GetObj('papier'),'h4','h4comment',null,null,null); CreateText(document,newp,(currentbrush.substr(0,6)=='voirie'?'Indiquez la référence de la balayeuse (marque, type) :':'Ajoutez un commentaire : '));
      newspan=CreateTag(document,newp,'span',null,'required',null,null); CreateText(document,newspan,'*');

  newinput=CreateTag(document,GetObj('papier'),'textarea','temp_comment',null,null,null); newinput.setAttribute('rows','4');
 }
 else if(Step=='profilstrip')
 {
  if(!GetObj('img_'+currentbrush+'_a')){ newimg=CreateTag(document,GetObj('papierimg'),'img','img_'+currentbrush+'_a',null,null,null); newimg.src='img/img_'+currentbrush+'_a'+'.png'; newimg.style.position='absolute';  }
  if(obj.id=='a'){      GetObj('text_'+currentbrush+'_a').innerHTML='A = 16 mm'; GetObj('text_'+currentbrush+'_b').innerHTML='B = 7 mm';  GetObj('text_'+currentbrush+'_c').innerHTML='C = '+(currentbrush=='strh'?'6,2':'10')+' mm';  }
  else if(obj.id=='b'){ GetObj('text_'+currentbrush+'_a').innerHTML='A = 25 mm'; GetObj('text_'+currentbrush+'_b').innerHTML='B = 9 mm';  GetObj('text_'+currentbrush+'_c').innerHTML='C = '+(currentbrush=='strh'?'8,2':'17')+' mm';  }
  else if(obj.id=='c'){ GetObj('text_'+currentbrush+'_a').innerHTML='A = 50 mm'; GetObj('text_'+currentbrush+'_b').innerHTML='B = 12 mm'; GetObj('text_'+currentbrush+'_c').innerHTML='C = '+(currentbrush=='strh'?'13,5':'36')+' mm';  }
 }
 else
 {
  RemoveTag(GetObj('h4'+Step));
  newp=CreateTag(document,GetObj('papier'),'h4','h4'+Step,null,null,null); CreateText(document,newp,post+' : ');
   newspan=CreateTag(document,newp,'span',null,'greenok',null,null);  CreateText(document,newspan,(v?obj.firstChild.firstChild.data:obj.firstChild.data));
 }
 Deactivate(obj);
 obj.className='selected';
 if(obj.firstChild.data || obj.firstChild.firstChild.data){ RemoveTag(GetObj(Step)); newinput=CreateInput(document,GetObj('devis'),'input','hidden','form[]',null,null,null,null,null,post+' = '+(v?obj.firstChild.firstChild.data:obj.firstChild.data)); newinput.id=Step; }
 GetObj('nextstep').className=step;
 GetObj('nextstep').onclick=function(){ NextStep(); Step=this.className; this.onclick=function(){return false;}; };
 Footer();
};
function CorrectDim()
{
 if(currentbrush=='rota')
 {
  if(GetObj('rota_a').value!=''){if(parseFloat(GetObj('rota_a').value)<10){GetObj('rota_a').value=10;}else if(parseFloat(GetObj('rota_a').value)>3500){GetObj('rota_a').value=3500;} }
  if(GetObj('rota_b').value!=''){if(parseFloat(GetObj('rota_b').value)<30){GetObj('rota_b').value=30;}else if(parseFloat(GetObj('rota_b').value)>300){GetObj('rota_b').value=300;} }
  if(GetObj('rota_c').value!='' && GetObj('rota_b').value!=''){if(parseFloat(GetObj('rota_c').value)>parseFloat(GetObj('rota_b').value)){GetObj('rota_c').value=GetObj('rota_b').value;} }
  if(GetObj('rota_d').value!='' && GetObj('rota_a').value!=''){if(parseFloat(GetObj('rota_d').value)<parseFloat(GetObj('rota_a').value)){GetObj('rota_d').value=GetObj('rota_a').value;} }
  if(GetObj('rota_e').value!='' && GetObj('rota_a').value!=''){if(parseFloat(GetObj('rota_e').value)>parseFloat(GetObj('rota_a').value)){GetObj('rota_e').value=GetObj('rota_a').value;} }
  if(GetObj('rota_f').value!='' && GetObj('rota_b').value!=''){if(parseFloat(GetObj('rota_f').value)<parseFloat(GetObj('rota_b').value)+20){GetObj('rota_f').value=parseFloat(GetObj('rota_b').value)+20;}else if(parseFloat(GetObj('rota_f').value)>parseFloat(GetObj('rota_b').value)+1000){GetObj('rota_f').value=parseFloat(GetObj('rota_b').value)+1000;} }
 }
 else if(currentbrush=='rots')
 {
  if(GetObj('rots_a').value!=''){if(parseFloat(GetObj('rots_a').value)<10){GetObj('rots_a').value=10;}else if(parseFloat(GetObj('rots_a').value)>3500){GetObj('rots_a').value=3500;} }
  if(GetObj('rots_b').value!=''){if(parseFloat(GetObj('rots_b').value)<30){GetObj('rots_b').value=30;}else if(parseFloat(GetObj('rots_b').value)>300){GetObj('rots_b').value=300;} }
  if(GetObj('rots_c').value!='' && GetObj('rots_b').value!=''){if(parseFloat(GetObj('rots_c').value)>parseFloat(GetObj('rots_b').value)){GetObj('rots_c').value=GetObj('rots_b').value;} }
  if(GetObj('rots_d').value!='' && GetObj('rots_a').value!=''){if(parseFloat(GetObj('rots_d').value)>parseFloat(GetObj('rots_a').value)){GetObj('rots_d').value=GetObj('rots_a').value;} }
  if(GetObj('rots_e').value!='' && GetObj('rots_b').value!=''){if(parseFloat(GetObj('rots_e').value)<parseFloat(GetObj('rots_b').value)+20){GetObj('rots_e').value=parseFloat(GetObj('rots_b').value)+20;}else if(parseFloat(GetObj('rots_e').value)>parseFloat(GetObj('rots_b').value)+1000){GetObj('rots_e').value=parseFloat(GetObj('rots_b').value)+1000;} }
 }
 else if(currentbrush=='plat')
 {
  if(GetObj('plat_a').value!=''){if(parseFloat(GetObj('plat_a').value)<10){GetObj('plat_a').value=10;}else if(parseFloat(GetObj('plat_a').value)>2000){GetObj('plat_a').value=2000;} }
  if(GetObj('plat_b').value!=''){if(parseFloat(GetObj('plat_b').value)<8){GetObj('plat_b').value=8;}else if(parseFloat(GetObj('plat_b').value)>500){GetObj('plat_b').value=500;} }
  if(GetObj('plat_c').value!=''){if(parseFloat(GetObj('plat_c').value)<6){GetObj('plat_c').value=6;}else if(parseFloat(GetObj('plat_c').value)>100){GetObj('plat_c').value=100;} }
  if(GetObj('plat_d').value!='' && GetObj('plat_a').value!=''){if(parseFloat(GetObj('plat_d').value)>parseFloat(GetObj('plat_a').value)){GetObj('plat_d').value=GetObj('plat_a').value;} }
  if(GetObj('plat_e').value!='' && GetObj('plat_b').value!=''){if(parseFloat(GetObj('plat_e').value)>parseFloat(GetObj('plat_b').value)){GetObj('plat_e').value=GetObj('plat_b').value;} }
  if(GetObj('plat_f').value!=''){if(parseFloat(GetObj('plat_f').value)<5){GetObj('plat_f').value=5;}else if(parseFloat(GetObj('plat_f').value)>500){GetObj('plat_f').value=500;} }
 }
 else if(currentbrush=='pltx')
 {
  if(GetObj('pltx_a').value!=''){if(parseFloat(GetObj('pltx_a').value)<30){GetObj('pltx_a').value=30;}else if(parseFloat(GetObj('pltx_a').value)>1000){GetObj('pltx_a').value=1000;} }
  if(GetObj('pltx_b').value!='' && GetObj('pltx_a').value!=''){if(parseFloat(GetObj('pltx_b').value)>parseFloat(GetObj('pltx_a').value)-20){GetObj('pltx_b').value=parseFloat(GetObj('pltx_a').value)-20;} }
  if(GetObj('pltx_c').value!=''){if(parseFloat(GetObj('pltx_c').value)<6){GetObj('pltx_c').value=6;}else if(parseFloat(GetObj('pltx_c').value)>100){GetObj('pltx_c').value=100;} }
  if(GetObj('pltx_d').value!='' && GetObj('pltx_a').value!=''){if(parseFloat(GetObj('pltx_d').value)>parseFloat(GetObj('pltx_a').value)){GetObj('pltx_d').value=GetObj('pltx_a').value;} }
  if(GetObj('pltx_d').value!='' && GetObj('pltx_b').value!=''){if(parseFloat(GetObj('pltx_d').value)<parseFloat(GetObj('pltx_b').value)+20){GetObj('pltx_d').value=parseFloat(GetObj('pltx_b').value)+20;} }
  if(GetObj('pltx_e').value!='' && GetObj('pltx_d').value!=''){if(parseFloat(GetObj('pltx_e').value)>parseFloat(GetObj('pltx_d').value)-20){GetObj('pltx_e').value=parseFloat(GetObj('pltx_d').value)-20;} }
  if(GetObj('pltx_e').value!='' && GetObj('pltx_b').value!=''){if(parseFloat(GetObj('pltx_e').value)<parseFloat(GetObj('pltx_b').value)){GetObj('pltx_e').value=GetObj('pltx_b').value;} }
  if(GetObj('pltx_f').value!=''){if(parseFloat(GetObj('pltx_f').value)<5){GetObj('pltx_f').value=5;}else if(parseFloat(GetObj('pltx_f').value)>500){GetObj('pltx_f').value=500;} }
 }
 else if(currentbrush=='strh' || currentbrush=='strf')
 {
  if(GetObj(currentbrush+'_d').value!=''){if(parseFloat(GetObj(currentbrush+'_d').value)<5){GetObj(currentbrush+'_d').value=5;}else if(parseFloat(GetObj(currentbrush+'_d').value)>300){GetObj(currentbrush+'_d').value=300;} }
 }
 else if(currentbrush=='ecou')
 {
  if(GetObj('ecou_a').value!=''){if(parseFloat(GetObj('ecou_a').value)<50){GetObj('ecou_a').value=50;}else if(parseFloat(GetObj('ecou_a').value)>2000){GetObj('ecou_a').value=2000;} }
  if(GetObj('ecou_b').value!='' && GetObj('ecou_a').value!=''){if(parseFloat(GetObj('ecou_b').value)>parseFloat(GetObj('ecou_a').value)){GetObj('ecou_b').value=GetObj('ecou_a').value;} }
  if(GetObj('ecou_b').value!=''){if(parseFloat(GetObj('ecou_b').value)<50){GetObj('ecou_b').value=50;}else if(parseFloat(GetObj('ecou_b').value)>2000){GetObj('ecou_b').value=2000;} }
  if(GetObj('ecou_c').value!=''){if(parseFloat(GetObj('ecou_c').value)<3){GetObj('ecou_c').value=3;}else if(parseFloat(GetObj('ecou_c').value)>200){GetObj('ecou_c').value=200;} }
 }
 Footer();
};
function Footer()
{
 GetObj('footer').className='';
 GetObj('footer').className='footer';
};

function Deactivate(div)
{
 var allp=div.parentNode.getElementsByTagName('p');
 for(var i=0; i<allp.length; i++)
 {
   allp[i].className='link';
   allp[i].onmouseover=function(){ if(this.className!='selected'){ this.className=this.className.substr(0,4)=='link'?'link active':'active'; } };
   allp[i].onmouseout=function(){ if(this.className!='selected'){ this.className=this.className.substr(0,4)=='link'?'link':''; } };
 }
};
function CreateDimText(n)
{
 var letters=new Array('a','b','c','d','e','f','f','g');
 for(var i=0; i<n; i++)
 {
  CreateTag(document,GetObj('papierdim'),'p','text_'+currentbrush+'_'+letters[i],null,null,null);
 }
};
function StartGallery()
{
 var list_items=GetObj('gallerythumbs').getElementsByTagName('a');
 for(var i=0; i<list_items.length; i++)
 {
  var item_src=list_items[i].getElementsByTagName('img')[0].src.split('/'); var preload=new Image(); preload.src=path+'documents/'+item_src[item_src.length-1].substr(1);
  list_items[i].onclick=function(){newid=this.getAttribute('id').substr(1); swapImage(); this.blur(); return false; };
 }
};
function DeleteItem()
{
 var list_items=GetObj('gallerythumbs').getElementsByTagName('a');
 if(GetObj('input_id').value=='new'){alert('L\'article n\'a pas encore été enregistré!');}
 else if(list_items.length<3){alert('Impossible de supprimer le dernier article!'); }
 else if(confirm('Supprimer définitivement l\'article ?')){ GetObj('do_it').value='delete_gallery'; GetObj('galleryimage').submit(); }
 return false;
};
function SaveItem()
{
 var ext=GetObj('input_file').value.toLowerCase().split('.');
 if(GetObj('input_id').value=='new')
 {
  if(GetObj('input_file').value==''){alert('Choisissez une image en cliquant sur "Parcourir"'); return false;}
  else if(ext[ext.length-1]!='jpg'&&ext[ext.length-1]!='jpeg'){alert('L\'image doit être au format JPEG'); return false; }
  else if(confirm('Créer le nouvel article ?')){  GetObj('do_it').value='create_gallery'; GetObj('galleryimage').submit(); }
 }
 else
 {
  if(GetObj('input_file').value!=''&&ext[ext.length-1]!='jpg'&&ext[ext.length-1]!='jpeg'){alert('L\image doit être au format JPEG'); return false; }
  else if(confirm('Mettre à jour l\'article ?')){  GetObj('do_it').value='update_gallery'; GetObj('galleryimage').submit(); }
 }
 return false;
};
function swapImage()
{
 GetObj('divimage').className='I'+newid;
 var galleryHeight=GetObj('mainimage').offsetHeight<200?200:GetObj('mainimage').offsetHeight;
 GetObj('galleryimage').style.height=galleryHeight+'px';
 GetObj('galleryimage').style.background=' url(\'img/wait.gif\') center center no-repeat';
  GetObj('titleimage').innerHTML='';
  GetObj('commentimage').innerHTML='';
 GetObj('pimage').style.display='none';
 GetObj('mainimage').src=path+'documents/'+newid+'.jpg';
 TestImage();
 return false;
};
function TestImage()
{
 clearTimeout(timeout);
 if(GetObj('mainimage').complete){ timeout=setTimeout('ImageLoaded();',1000); }
 else{ timeout=setTimeout('TestImage();',200);}
};
function ImageLoaded()
{
 GetObj('pimage').style.display='block';
 FadeIn('mainimage',0);
 GetObj('galleryimage').style.height=(GetObj('mainimage').offsetHeight<200?200:GetObj('mainimage').offsetHeight)+'px';
 GetObj('galleryimage').style.background=' url(\'img/blank.png\')';
 var newtitle=EregReplace(gallery[newid]['title'],'(\\\\)','');
 var newcomment=EregReplace(gallery[newid]['comment'],'(\\\\)','');
     newcomment=EregReplace(newcomment,'\r','');
     newcomment=EregReplace(newcomment,'\n\n','<br />');
 GetObj('titleimage').innerHTML=newtitle;
 GetObj('commentimage').innerHTML=newcomment;
 var list_items=GetObj('gallerythumbs').getElementsByTagName('a');
 for(var i=0; i<list_items.length; i++){list_items[i].className='';}
 GetObj('P'+newid).className='selected';
 var documenttitle=document.title.split('-');
 document.title=newtitle+' -'+documenttitle[documenttitle.length-1];
};
function GetXml()
{
  var xmlhttp;
  /*@cc_on
  @if(@_jscript_version >= 5)
  {
    try {
      xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e){
      try {
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        } catch (E){
        xmlhttp=false;
        }
      }
  }
  @else  {xmlhttp=false;}
  @end @*/
  if(!xmlhttp && typeof XMLHttpRequest != 'undefined')
  {
   try{xmlhttp=new XMLHttpRequest();}
   catch(e){xmlhttp=false;}
  }
  if(xmlhttp)
  {
   xmlhttp.onreadystatechange=function()
   {
    if(xmlhttp.readyState==4)
    {
     if(xmlhttp.status==200)
     {
      var xmldoc=xmlhttp.responseXML;
      var items=xmldoc.getElementsByTagName(GetObj('gallery').className);
      for(var m=0; m<items.length; m++)
      {
       var newid=items[m].getAttribute('id');
       gallery[newid]=new Array();
       gallery[newid]['title']=items[m].getElementsByTagName('title')[0].firstChild.data=='[empty]'?'':items[m].getElementsByTagName('title')[0].firstChild.data;
       gallery[newid]['comment']=items[m].getElementsByTagName('comment')[0].firstChild.data=='[empty]'?'':items[m].getElementsByTagName('comment')[0].firstChild.data;
      }
     }
     else{ return false; }
    }
   };
   xmlhttp.open('GET',myxmlid+'.xml',true);
   xmlhttp.send(null);
  }
  return true;
};
function ShowLog()
{
 newform=CreateTag(document,document.body,'form','admin_form',null,null); newform.setAttribute('name','admin_form'); newform.setAttribute('method','post'); newform.setAttribute('action',window.location.toString().toLowerCase());
 newdiv=CreateTag(document,newform,'div','admin_white',null,null);
 if(window.ActiveXObject){SetOpacity(newdiv,75); }
 newdiv=CreateTag(document,newdiv,'div','admin_div_buttons',null,null);
 if(lang=='admin')
 {
  temp=CreateInput(document,newdiv,'button','submit','admin[logout]',null,'Fermer',null,null,'img/info_close.png',null); CreateText(document,temp,' Fermer'); temp.setAttribute('id','admin_logout');
  //temp.onclick=function(){GetObj('admin_form').submit();};
  if(window.ActiveXObject){Fixed();}
 }
 else
 {
  temp=CreateInput(document,newdiv,'input','password','admin[pass]',null,'Mot de passe',null,null,null,''); temp.setAttribute('id','admin_pass');
  temp.select();
  temp=CreateInput(document,newdiv,'button','submit','admin[submit]',null,'Entrer',null,null,'img/info_ok.png',null); CreateText(document,temp,' Ouvrir'); temp.setAttribute('id','admin_submit');
  //temp.onclick=function(){GetObj('admin_form').submit();};
  temp=CreateInput(document,newdiv,'button','button','admin[cancel]',null,'Annuler',null,null,'img/info_ko.png',null); CreateText(document,temp,' Annuler');  temp.setAttribute('id','admin_cancel');
  temp.onclick=function(){document.body.removeChild(GetObj('admin_form'));};
 }
};

function Stats()
{
 var pageTracker = _gat._getTracker('UA-2296884-4');
 pageTracker._initData();
 pageTracker._trackPageview();
};

Include('http://www.google-analytics.com/ga.js');
AddOnload(Start);


