Object.extend(Prototype.Browser,{IE6:Prototype.Browser.IE&&!window.XMLHttpRequest});var IntuiCat={BrowserKO:function(){window.alert("Désolé, votre navigateur ne permet pas d'exécuter ZenBuyer technologie Ajax"+this.cCRLF+this.cCRLF+"ZenBuyer fonctionne avec les navigateurs suivants :"+this.cCRLF+"- Internet Explorer pour Windows, version 6 ou supérieure"+this.cCRLF+"- FireFox pour Mac et Windows, version 1.0.4 ou supérieure"+this.cCRLF+"- Safari pour Mac et Windows, version 1.2.4 ou supérieure"+this.cCRLF+"- Netscape Navigator, version 8 ou supérieure");},Error:function(tcError){if(tcError.toLowerCase().indexOf('<html>')==-1)tcError=tcError.replace(new RegExp(this.cCRLF,'gm'),'<br/>');tcError="<p>Le serveur ZenBuyer technologie Ajax a produit une erreur inattendue."+"<br/>Veuillez nous en excuser et réessayer ultérieurement."+"<br/><br/>Détails de l'erreur :</p>"+"<br/>"+tcError;Dialog.alert(tcError,{windowParameters:{width:600,opacity:1},okLabel:'fermer'})},oEvent:function(event){return Event.extend(event||window.event);},oEventSrce:function(event){return event.target||event.srcElement;},DOMEvent:function(event,value){var llResult=this.lBrowserOK;if(llResult){event=this.oEvent(event);var eventSrce=this.oEventSrce(event);llResult=event&&eventSrce;if(llResult){llResult=!eventSrce.disabled;if(llResult)llResult=this.DOMEvent_send(eventSrce,event,value);}else this.BrowserKO();if(event)event.stop();}else this.BrowserKO();return llResult;},DOMEvent_send:function(element,event,value){var lcTag=element.tagName.toLowerCase(),lcEvent=event.type?event.type.toLowerCase():event.toLowerCase(),llResult=true;if(value===undefined){switch(lcTag){case 'select':value=element.selectedIndex;llResult=value>-1&&!(Prototype.Browser.IE&&element.options.item(value).isDisabled);if(!llResult){element.selectedIndex=-1;};break;case 'input':var lcType=element.type.toLowerCase();if(lcType==='checkbox'){value=element.checked?1:0;}else if(lcType==='radio'){value=parseInt(element.value,10);element=element.parentNode;}else if(lcEvent=='keypress'){value=Prototype.Browser.IE?event.keyCode:event.charCode;}else{value=element.value;};break;case 'textarea':value=element.value;break;}};if(lcTag=='input'&&['blur','change'].include(lcEvent)){llResult=value!==element.valueOld;element.valueOld=value;};if(llResult){value=(typeof value==='string')?escape(value):value;if(!element.id)element=element.up('[id]');var id=element.id;if(id.substr(id.length-4)==='_img'){id=id.substr(0,id.length-4);};this.ServerRequest("DOMEvent~&Event="+lcEvent+"&ObjAddr="+id,element,value);};return llResult;},PropChange:function(event,tcObjAddr,tcProp,value){var llResult=this.lBrowserOK;if(llResult){event=this.oEvent(event);var loObject=this.oEventSrce(event);llResult=event&&loObject;if(llResult)this.ServerRequest("PropCh~&Prop="+tcProp+"&ObjAddr="+tcObjAddr,loObject,value);if(event)event.stop();else this.BrowserKO();}else this.BrowserKO();return llResult;},ValueUpdate:function(element){if(element.value!==undefined&&element.id)this.ServerRequest("AJAXValueUpdate~&ObjAddr="+element.id,element,element.value);},MethExec:function(event,tcObjAddr,tcMeth,value,VScompat){var llResult=this.lBrowserOK;if(llResult){var eventSrce=Object.isElement(event)?event:(this.oEventSrce(this.oEvent(event))||null);this.ServerRequest((VScompat?"Dialog":"MethExec")+"~&ObjAddr="+tcObjAddr+"&MethAddr="+tcMeth,eventSrce,value);if(event&&event.stop)event.stop();}else{this.BrowserKO();};return llResult;},FormDisplay:function(event,tcForm,uPK,id){var llResult=this.lBrowserOK;if(llResult){event=this.oEvent(event);if(event)event.stop();var eventSrce=this.oEventSrce(event)||event||null;id=id||eventSrce.id;this.ServerRequest('AjaxFormDisplay~&cForm='+tcForm,eventSrce,uPK);}else this.BrowserKO();return llResult;},DOMEltUpdate:function(elt,table,uPK){var id;if(typeof elt==='string'){id=elt;elt=$(id);}else{elt=$(elt);id=elt.identify();};var offsetParent=elt.getOffsetParent(),pos=elt.positionedOffset(),dims=elt.getDimensions(),div=$(document.createElement('div'));div.setStyle({position:'absolute',left:pos.left+'px',top:pos.top+'px',padding:'10px',width:dims.width-2*10+'px',height:dims.height-2*10+'px',backgroundColor:'gray'});div.setOpacity(.4);offsetParent.appendChild(div);this.ServerRequest('AJAXDOMEltUpdate~&ObjAddr='+id+'&cTable='+table,elt,uPK,true);offsetParent.removeChild(div);},oForm:null,aRequests:[],ServerRequest:function(tcRequest,element,value,lInit){var loWGridRecs=document.getElementById('WGridRowsMax');if(loWGridRecs){tcRequest+="&nWGridRowsMax="+loWGridRecs.value;};if(document.body.id){tcRequest+="&Form="+document.body.id;this.oForm=document.getElementById('form');}else{if(element&&element.id)this.oForm=document.getElementById(element.id.substr(0,element.id.indexOf('_')));};lInit=Boolean(lInit)||this.lInit;this.lInit=false;tcRequest+="&PageInit="+(lInit?'true':'')+"&UserID="+this.cUserID;if(this.aRequests.length<20)this.aRequests[this.aRequests.length]=[tcRequest,element,this.dRequest-this.dEnd];this.RequestSend(tcRequest,element,value,lInit);},CGI:'bin/wc.dll',wcURL:function(tcRequest){if(this.CGI.indexOf('wc.dll')==-1){var parms=tcRequest.split('~');tcRequest=parms.shift()+'.'+this.CGI+'?'+parms.join('~');}else tcRequest=this.CGI+'?IntuiCat~'+tcRequest;return tcRequest;},lRequest:false,dRequest:null,nRequests:0,aReqsPend:[],parameters:{},oObject:null,RequestSend:function(tcRequest,element,value,sync){sync=Boolean(sync);if(this.lRequest){this.aReqsPend.push([tcRequest,element,value,sync]);}else{this.WaitState(true,element);this.dRequest=new Date();if(value!==undefined){this.parameters['Value']=(value===null)?'null':value.toString();this.parameters['ValueType']=typeof value;tcRequest+="&Value="+this.parameters['Value'].truncate(60)+"&ValueType="+this.parameters['ValueType'];};this.nRequests+=1;tcRequest+="&nReq="+this.nRequests;var lcURLParms=window.location.search.substr(1);lcURLParms=lcURLParms.length==0?'':(lcURLParms.substr(0,1)==='&'?'':'&'+lcURLParms);tcRequest+=lcURLParms;tcRequest=this.wcURL(tcRequest);var oAjax=new Ajax.Request(tcRequest,{asynchronous:!sync,parameters:this.parameters,onException:this.AjaxException.bind(this),onFailure:this.AjaxFailure.bind(this),onSuccess:this.AjaxSuccess.bind(this),onComplete:this.AjaxComplete.bind(this)});this.oXHR=oAjax.transport;this.oObject=$(element);}},valueReset:function(){if(this.oObject){var object=$(this.oObject.parentNode).childElements().find(function(el){return typeof el.valueOld!=='undefined';});if(object)object.valueOld=null;}}.bind(IntuiCat),nRequestTO:0,localURL:window.location.href.toLowerCase().startsWith('http://localhost/'),nRequestTOsecs:0,WaitState:function(tlWait,element){this.lRequest=tlWait;this.nRequestTOsecs=this.localURL?200:25;if(tlWait)this.nRequestTO=this.ServerMute.bind(this).delay(this.nRequestTOsecs);else{this.parameters={};window.clearTimeout(this.nRequestTO);this.oXHR.onreadystatechange=Prototype.emptyFunction;if(this.oXHR.readyState>0&&this.oXHR.readyState<4&&this.oXHR.abort)this.oXHR.abort();};this.WaitPic(tlWait,element);document.body.style.cursor=tlWait?'wait':'default';window.status=tlWait?'Recherche en cours ...':(this.cSecs?'Recherche terminée en '+this.cSecs:'Recherche avortée');},oWaitPic:null,WaitPic:function(show,element){if(this.oWaitPic)this.oWaitPic.hide();if(show){this.oWaitPic=$('waitpic')||(this.oForm?$(this.oForm.id+'_'+'waitpic'):null);if(this.oWaitPic){if(Object.isElement(element)&&Object.isElement(this.oForm)){var loPos=this.DOMEltPosIn(element,this.oForm.id);this.oWaitPic.setStyle({left:[loPos.x-this.oWaitPic.getWidth()+1,0].max()+'px',top:[loPos.y-this.oWaitPic.getHeight()-2,0].max()+'px',zIndex:100});};this.oWaitPic.show();}}},ServerMute:function(){this.Error("Le serveur n'a pas répondu dans le délai imparti de "+this.nRequestTOsecs.toString()+" secondes.");this.WaitState(false);},AjaxException:function(Ajax,exception){if(this.localURL){if(Windows)Dialog.alert(exception.name+'<br/>'+exception.message+'<br/>ligne: '+exception.lineNumber||'N/A',{width:200});else alert(exception.name+this.cCRLF+exception.message);}else window.status=exception.name+' - '+exception.message;},AjaxFailure:function(transport){this.Error('Erreur de protocole HTTP : '+(transport.statusText?transport.statusText:transport.status));},AjaxComplete:function(transport){this.WaitState(false);if(this.aReqsPend.length>0){var req=this.aReqsPend.shift();this.RequestSend(req[0],req[1],req[2],req[3]);}},dResponse:null,dEnd:null,cSecs:'',AjaxSuccess:function(transport){this.dResponse=new Date();var lcXML=transport.responseText;if(lcXML){var loDOM=transport.responseXML;if(loDOM){if(loDOM.childNodes.length>0){if(this.lDOMParse(loDOM)){if(this.DOMRead(loDOM)){this.dEnd=new Date();this.cSecs=this.ExeTimeDisplay(lcXML);}}}else this.Error("Le DOM construit à partir du XML reçu du serveur n'a aucun noeud enfant"+this.cCRLF+lcXML);}else this.Error("Le XML reçu du serveur n'a pas pu être converti en DOM"+this.cCRLF+lcXML);}else this.Error("Le serveur a retourné une réponse XML vide.");},lDOMParse:function(toDOM){var llResult=true,lcError;if(Prototype.Browser.IE){var loError=this.oXHR.parseError;if(loError){llResult=loError.errorCode==0;if(!llResult)lcError="- Code d'erreur :"+loError.errorCode+this.cCRLF+"- Raison :"+loError.reason+this.cCRLF+"- N° de ligne :"+loError.line+this.cCRLF+"- N° de caractère :"+loError.linepos+this.cCRLF+"- Ligne en erreur :"+loError.srcText;}}else{llResult=toDOM.childNodes.item(0).nodeName!='parseerror';if(!llResult)lcError=toDOM.childNodes.item(0).firstChild.nodeValue;};if(!llResult)this.Error("L'interprétation du document XML a rencontré une erreur : "+this.cCRLF+lcError);return llResult;},cUserID:'',cServerStatus:'',nServerSecs:0,nAppSecs:0,DOMRead:function(toDOM){var llResult=true;var loIntuiCat=this.oDOMEltChildByName(toDOM,'IntuiCat');llResult=Boolean(loIntuiCat);if(llResult){loIntuiCat.normalize();var loError=this.oDOMEltChildByName(loIntuiCat,'ServerError');llResult=!Boolean(loError);if(llResult){var loDialog=this.oDOMEltChildByName(loIntuiCat,'HTMLDialog');if(loDialog){llResult=this.DialogShow(loDialog);if(!llResult){this.Error('Échec de l\'affichage du dialogue modal');}};if(llResult){var loProps=this.oDOMEltChildByName(loIntuiCat,'PCHTML');if(loProps){llResult=this.PageUpdate(loProps);if(!llResult){this.Error('Échec de la mise à jour de la page');}};if(llResult){var script=this.oDOMEltChildByName(loIntuiCat,'script');if(script){script=script.firstChild.nodeValue;if(script){eval(script);}};var loUserID=this.oDOMEltChildByName(loIntuiCat,'UserID');this.cUserID=loUserID?loUserID.firstChild.nodeValue:'';var loServerStatus=this.oDOMEltChildByName(loIntuiCat,'ServerStatus');this.cServerStatus=loServerStatus?loServerStatus.firstChild.nodeValue:'';var loServerSec=this.oDOMEltChildByName(loIntuiCat,'ServerTime');this.nServerSecs=loServerSec?parseFloat(loServerSec.firstChild.nodeValue):0;var loAppSec=this.oDOMEltChildByName(loIntuiCat,'AppTime');this.nAppSecs=loAppSec?parseFloat(loAppSec.firstChild.nodeValue):0;var location=this.oDOMEltChildByName(loIntuiCat,'location');if(location){location=location.firstChild?location.firstChild.nodeValue:'';window.location.href=location||window.location.href;}}}}else{this.Error(loError.firstChild.nodeValue);}}else{this.Error("Élément 'IntuiCat' introuvable dans le document.");};return llResult;},PageUpdate:function(toProps){var llResult;var laProps=this.aDOMEltChildren(toProps);llResult=laProps.length>0;if(llResult){var laProp,id,elt,lcPropName,lcPropType,lcPropVal;for(var lnProp=0,lnProps=laProps.length,loProp;lnProp<lnProps;lnProp++){loProp=laProps[lnProp];laProp=this.aDOMEltChildren(loProp);llResult=laProp.length==4;if(llResult){id=laProp[0].firstChild?laProp[0].firstChild.nodeValue:'';elt=$(id);if(elt)llResult=this.PageUpdate_Obj(elt,toProps,laProp);}else this.Error("Quatre déterminants de propriétés attendus au lieu de "+laProp.length);if(!llResult)break;}}else this.Error("Le tableau de propriétés est vide.");return llResult;},PageUpdate_Obj_Shell:function(element,property,type,value){},PageUpdate_Obj:function(element,toProps,laProp){var llResult=true;var lcProp=laProp[1].firstChild?laProp[1].firstChild.nodeValue:'';var lcType=laProp[2].firstChild?laProp[2].firstChild.nodeValue.toUpperCase():'';var luVal=laProp[3],lcVal;if(new RegExp('^http(s)*://localhost/').test(window.location.href))this.PageUpdate_Obj_Shell(element,lcProp,lcType,luVal);if(lcType=="A"){var loCursor;if(this.aDOMEltChildren(luVal).length===0){lcVal=luVal.firstChild.nodeValue;loCursor=this.oDOMEltChildByName(toProps.parentNode,lcVal);llResult=Boolean(loCursor);}else loCursor=luVal;if(llResult){lcProp=lcProp.toLowerCase();switch(lcProp){case "tabsrce":llResult=this.PageUpdate_SELECT(element,loCursor);break;default:this.Error("Unsupported cursor property: "+lcProp);llResult=false;break;}}else this.Error("Le curseur nommé "+lcVal+" associé à la propriété "+lcProp+" est introuvable dans le document XML");}else{lcVal=luVal.firstChild?luVal.firstChild.nodeValue:'';if(lcProp){luVal=this.uValue(lcVal,lcType);if(lcProp.indexOf('style.')===0){this.StyleSet(element,lcProp,luVal);if(element.type&&element.type==='checkbox'){element=document.getElementById(element.id+'_txt');if(element)this.StyleSet(element,lcProp,luVal);}}else this.AttribSet(element,lcProp,luVal);}else with(element){eval(lcVal);}};return llResult;},StyleSet:function(element,tcProp,tuVal){element=$(element);tcProp=tcProp.substr('style.'.length);var lVis=tcProp==='visibility',lDis=tcProp==='display';if((lVis||lDis)&&tuVal!==element.getStyle(lVis?'visibility':'display')&&element.tagName.toLowerCase()!=='select'&&!element.lEffectVisibleNo){if(tuVal===(lVis?'inherit':'block')){element.appear({from:0});}else{element.fade();}}else{var lDisp=element.style.display!=='none'&&element.style.visibility==='visible';if(tcProp==='width'&&lDisp){var percent=parseInt(tuVal,10)/parseInt(element.style.width,10)*100;new Effect.Scale(element,percent,{scaleY:false,scaleContent:false});}else{if(tcProp==='height'&&lDisp){var percent=parseInt(tuVal,10)/parseInt(element.style.height,10)*100;new Effect.Scale(element,percent,{scaleX:false,scaleContent:false});}else{if(tcProp==='top'&&lDisp){new Effect.Move(element,{y:parseInt(tuVal,10)-parseInt(element.style.top,10)});}else{if(tcProp==='left'&&lDisp){new Effect.Move(element,{x:parseInt(tuVal,10)-parseInt(element.style.left,10)});}else{if(lVis){element.style.display=(tuVal==='inherit'?'block':'none');}else{element.style[tcProp]=tuVal;}}}}}};return true;},lastChildUnique:function(elt){var result=$(elt);while(result.descendants().length==1){result=result.descendants()[0];};return result;},lImgSrcEffect:true,AttribSet:function(element,tcAttrib,tuVal){element=$(element);var lChange=element[tcAttrib]!==tuVal,lcAttrib=tcAttrib.toLowerCase(),lcTag=element.tagName?element.tagName.toLowerCase():'',lcType=element.type?element.type.toLowerCase():'',llAutoSuggest=lcTag==='input'&&lcType==='text'&&lcAttrib==='value'&&element.lAutoSuggest,lnStart=llAutoSuggest?element.value.length:0;switch(lcAttrib){case 'innerhtml':element.update(tuVal);this.XBrowserFix(element);break;case 'replace':Element.replace(element,tuVal);break;case 'textcontent':var oTarget=this.lastChildUnique(element);if(Prototype.Browser.IE)oTarget.innerText=tuVal;else oTarget.textContent=tuVal;break;case 'selectedindex':if(element.options&&tuVal<element.options.length){var scrollTop=element.scrollTop;element.selectedIndex=tuVal;element.scrollTop=scrollTop;};break;default:element[tcAttrib]=tuVal;};if(lcTag==='img'&&lcAttrib==='src'&&lChange&&this.lImgSrcEffect&&element.visible()&&parseInt(element.getOpacity())===1){element.appear({from:0.5,to:1});};if(llAutoSuggest){var lnEnd=element.value.length;if(element.setSelectionRange){element.setSelectionRange(lnStart,lnEnd);}else if(element.createTextRange){var oTextRange=element.createTextRange();oTextRange.moveStart("character",lnStart);oTextRange.moveEnd("character",lnEnd);oTextRange.select();}else if(element.select){element.select();}};return true;},uValue:function(tcValue,tcType){switch(tcType.toUpperCase()){case 'S':return tcValue;case 'B':return tcValue==='true';case 'N':tcValue=tcValue.replace(',','.').replace(' ','');return(tcValue.indexOf('.')>-1)?parseFloat(tcValue):parseInt(tcValue,10);default:return null;}},PageUpdate_SELECT:function(toSelect,toCursor){var lcTag=toSelect.tagName.toLowerCase(),llResult=lcTag==='select';if(llResult){var lnSelectedIndex=toSelect.selectedIndex,selectedValue=lnSelectedIndex>-1?toSelect.options.item(lnSelectedIndex).value:null;for(var lnOpt=toSelect.length-1;lnOpt>=0;lnOpt--){toSelect.remove(lnOpt);};var laRecs=this.aDOMEltChildren(toCursor);if(laRecs.length>0){var laFields,loOption,lnOptions=0,lcOption,lnAccFirst=-1;for(var lnRec=0,lnRecs=laRecs.length,loRec;lnRec<lnRecs;lnRec++){loRec=laRecs[lnRec];laFields=this.aDOMEltChildren(loRec);if(laFields.length>0){lnOptions+=1;loOption=document.createElement('option');lcOption=(laFields[0].firstChild?laFields[0].firstChild.nodeValue:'')||'&nbsp;';if(lcOption.substr(0,1)=='\\'){lcOption=lcOption.substr(1);if(Prototype.Browser.IE){loOption.disabled=true;loOption.style.color='gray';}else{loOption.disabled='disabled';}}else{lnAccFirst=(lnAccFirst==-1)?lnRec:lnAccFirst;};if(Prototype.Browser.IE){toSelect.options.add(loOption);loOption.innerHTML=lcOption;}else{loOption.innerHTML=lcOption;toSelect.add(loOption,null);}}};lnSelectedIndex=(lnSelectedIndex>-1&&lnSelectedIndex<toSelect.length&&toSelect.options.item(lnSelectedIndex).value===selectedValue)?lnSelectedIndex:-1;toSelect.selectedIndex=lnSelectedIndex;if(toSelect.size>1&&(lnSelectedIndex>-1||lnAccFirst>-1)){var lnScrollTop=(lnSelectedIndex>-1)?(lnSelectedIndex-toSelect.size/2+1):(lnAccFirst-1);if(lnScrollTop>0){this.selectScrollTopSet.delay(this.effectDuration+.5,toSelect,lnScrollTop);}}}}else{this.Error("Tag of this object should be 'select' instead of "+lcTag);};return llResult;},selectScrollTopSet:function(toSelect,lines){if(toSelect&&typeof toSelect.scrollTop!=="undefined"){var height=$(toSelect).firstDescendant().getHeight()||parseInt(parseInt(toSelect.style.fontSize,10)*1.35,10);toSelect.scrollTop=parseInt(lines*height,10);}},DialogShow:function(toDialog){var laSpecs=this.aDOMEltChildren(toDialog),llResult=laSpecs.length>0;if(llResult){var lcID=unescape(laSpecs[0].firstChild.nodeValue);var lcTitle=unescape(laSpecs[1].firstChild.nodeValue);var lcHTML=laSpecs[2].firstChild.nodeValue;var lnWidth=parseInt(laSpecs[3].firstChild.nodeValue,10);var lnHeight=parseInt(laSpecs[4].firstChild.nodeValue,10);var loModal=this.oDOMEltChildByName(toDialog,'DivModal');var llModal=loModal&&loModal.firstChild?this.uValue(loModal.firstChild.nodeValue,'B'):false;var loObjAddr=this.oDOMEltChildByName(toDialog,'ObjAddr');var lcObjAddr=loObjAddr&&loObjAddr.firstChild?loObjAddr.firstChild.nodeValue:'';var loMethod=this.oDOMEltChildByName(toDialog,'MethAddr');var lcMethod=loMethod&&loMethod.firstChild?loMethod.firstChild.nodeValue:'';var loContent=$(document.createElement('div')).update(lcHTML);if(loContent){var loFirst=loContent.firstDescendant();if(loFirst.id.indexOf('_title')>-1){loContent.setStyle({top:'0px',left:'0px'});loFirst.remove();lnWidth=lnWidth+2;lnHeight=lnHeight-1;lcHTML=loContent.innerHTML;}};llResult=this.WindowOpen(this.oObject,lcTitle,lnWidth,lnHeight,lcHTML,llModal,lcObjAddr,lcMethod);};return llResult;},WindowOpen:function(toSrce,tcTitle,tnWidth,tnHeight,tcHTML,tlModal,tcObjAddr,tcMethod){if(!toSrce.nodeType){var event=this.oEvent(toSrce);toSrce=event?this.oEventSrce(event):toSrce;};var llResult=Boolean(toSrce);if(llResult){var lcID='Window'+tcTitle.replace(/\W/g,'_').replace(/_+/g,'_'),loWindow=$(lcID);if(loWindow&&!loWindow.visible()){loWindow.destroy();loWindow=null;};llResult=!loWindow;if(llResult){var loPos=this.DOMEltDocPos(toSrce),VPoffsets=document.viewport.getScrollOffsets(),VPdims=document.viewport.getDimensions(),llCenter=!loPos||tlModal;loWindow=new Window(lcID,{className:"mac_os_x",title:tcTitle,width:tnWidth,height:tnHeight,left:(loPos?Math.max(Math.min(loPos.x-tnWidth,VPoffsets['left']+VPdims['width']-(tnWidth+80)),20):null),top:(loPos?Math.max(Math.min(loPos.y-tnHeight/3,VPoffsets['top']+VPdims['height']-(tnHeight+80)),20):null),showEffect:Element.show,resizable:false,hideEffectOptions:{duration:tlModal?0.5:1.5},closable:!tlModal,minimizable:!tlModal,maximizable:!tlModal,destroyOnClose:true,onDestroy:function(win){if(tinyMCE)Object.values(tinyMCE.editors).each(function(inst){if($(inst.id).descendantOf(win.content))inst.remove();});if(win.SWFUploads)win.SWFUploads.invoke('destroy');}.bind(this)});loWindow.toFront();Object.extend(loWindow,{cObjAddr:tcObjAddr,cMethod:tcMethod});var loContent=$(loWindow.getContent()),nDelay=tcHTML.length/ 1024/ 3*.01,defer=Function.prototype.defer;Function.prototype.defer=Function.prototype.delay.curry(nDelay);loContent.setStyle({overflow:'hidden'}).update(tcHTML);Function.prototype.defer=defer;loContent.firstDescendant()._window=loWindow;if(event&&event.type&&event.type.toLowerCase()==='mouseover'){toSrce._window=loWindow;toSrce._winTO=llCenter?loWindow.showCenter.bind(loWindow).delay(.5,tlModal):loWindow.show.bind(loWindow).delay(.5,tlModal);$(toSrce).observe('mouseout',function(event){window.clearTimeout(this._winTO);if(this._window&&!this._window.isVisible())this._window.destroy();this._window=null;}.bindAsEventListener(toSrce));}else{loWindow['oSrce']=toSrce;if(llCenter){loWindow.showCenter(tlModal);}else{loWindow.show(tlModal);}}}};return llResult;},ModalChoice:function(event,value,VScompat){this.WindowClose(event,value,VScompat);if(this.oObject&&this.oObject.visible()){if(this.oObject.focus)this.oObject.focus();if(this.oObject.select)this.oObject.select();}},WindowClose:function(event,value,VScompat){var win=Windows.getFocusedWindow();if(win&&win.getId){Windows.close(win.getId());if(value!==null){var srce=win.oSrce,parent=srce.parentNode?$(srce.parentNode):null,cMethod=win.cMethod,cObjAddr=win.cObjAddr,done=false;if(parent&&parent.cTable&&parent.hasClassName('EditImgs')){this.DOMEltUpdate($(parent.parentNode).identify(),parent.cTable,value);done=true;};if(!done&&cMethod)this.MethExec(event,cObjAddr,cMethod,value,VScompat);}}},oDOMEltChildByName:function(toDOMElt,tcChild){var loResult=null;var laChildren=this.aDOMEltChildren(toDOMElt);if(laChildren.length>0){var loChild,lcChild=tcChild.toLowerCase();for(var lnChild=0;lnChild<laChildren.length;lnChild++){loChild=laChildren[lnChild];if(loChild.nodeName.toLowerCase()==lcChild){loResult=loChild;break;}}};return loResult;},aDOMEltChildren:function(toDOMElt){var laResult=[];if(toDOMElt&&toDOMElt.hasChildNodes()){for(var lnChild=0,loChild;lnChild<toDOMElt.childNodes.length;lnChild++){loChild=toDOMElt.childNodes.item(lnChild);if(loChild.nodeType==1){laResult[laResult.length]=loChild;}}};return laResult;},nAppsSecs:0,nServersSecs:0,nEventsSecs:0,nInetsSecs:0,nClientsSecs:0,nPageskBytes:0,nXMLkBytes:0,ExeTimeDisplay:function(tcXML){var lnRequestSec=(this.dResponse-this.dRequest)/1000;var lnEventSec=(this.dEnd-this.dRequest)/1000,lnInetSec=lnRequestSec-this.nServerSecs,lnClientSec=lnEventSec-lnRequestSec,lnPageBytes=document.documentElement.innerHTML.length/1024, lnXMLkBytes= tcXML.length/1024;this.nServerSecs=this.nServerSecs-this.nAppSecs;this.nAppsSecs+=this.nAppSecs;this.nServersSecs+=this.nServerSecs;this.nInetsSecs+=lnInetSec;this.nClientsSecs+=lnClientSec;this.nEventsSecs+=lnEventSec;this.nPageskBytes+=lnPageBytes;this.nXMLkBytes+=lnXMLkBytes;var loAppTime=document.getElementById('AppTime');if(loAppTime){loAppTime.innerHTML=this.cCents(this.nAppSecs)+" s";document.getElementById('ServerTime').innerHTML=this.cCents(this.nServerSecs)+" s";document.getElementById('XmitTime').innerHTML=this.cCents(lnInetSec)+" s";document.getElementById('ClientTime').innerHTML=this.cCents(lnClientSec)+" s";document.getElementById('TotalTime').innerHTML=this.cCents(lnEventSec)+" s";document.getElementById('PageWeight').innerHTML=this.cCents(lnPageBytes)+" ko";document.getElementById('ReqWeight').innerHTML=this.cCents(lnXMLkBytes)+" ko";document.getElementById('SavedWeight').innerHTML=Math.round((lnPageBytes-lnXMLkBytes)/lnPageBytes*100).toString()+" %";if(this.nRequests>1){document.getElementById('RequestAverage').style.display='block';document.getElementById('nReqs').innerHTML=this.nRequests.toString();document.getElementById('AppTimeAv').innerHTML=(this.cCents(this.nAppsSecs/this.nRequests)+" s").bold();document.getElementById('ServerTimeAv').innerHTML=(this.cCents(this.nServersSecs/this.nRequests)+" s").bold();document.getElementById('XmitTimeAv').innerHTML=(this.cCents(this.nInetsSecs/this.nRequests)+" s").bold();document.getElementById('ClientTimeAv').innerHTML=(this.cCents(this.nClientsSecs/this.nRequests)+" s").bold();document.getElementById('TotalTimeAv').innerHTML=(this.cCents(this.nEventsSecs/this.nRequests)+" s").bold();document.getElementById('PageWeightAv').innerHTML=(this.cCents(this.nPageskBytes/this.nRequests)+" ko").bold();document.getElementById('ReqWeightAv').innerHTML=(this.cCents(this.nXMLkBytes/this.nRequests)+" ko").bold();document.getElementById('SavedWeightAv').innerHTML=(Math.round((this.nPageskBytes-this.nXMLkBytes)/this.nPageskBytes*100).toString()+" %").bold();};var loServerStatus=document.getElementById('ServerStatus');if(this.cServerStatus&&loServerStatus){loServerStatus.innerHTML=this.cServerStatus;document.getElementById('onglet_affec_apagsel_page1_typecial').style.display='none';};document.getElementById('Tech').style.display='block';if(!this.lRePlay){document.getElementById('nReplay').innerHTML=this.aRequests.length.toString();};if(this.nRequests==5){Effect.Appear('Replay',{from:0});}};return this.cCents(lnEventSec)+' s '+'(Internet '+this.cCents(lnInetSec)+' s'+', application '+this.cCents(this.nAppSecs)+' s'+', serveur '+this.cCents(this.nServerSecs)+' s'+', navigateur '+this.cCents(lnClientSec)+' s'+')';},nCents:function(tn){return(Math.round(tn*100)/100);},cCents:function(tn){var lcResult=this.nCents(tn).toString();var lnPoint=lcResult.lastIndexOf('.');if(lnPoint==-1){lcResult+='.00';}else{lnPoint=lcResult.length-1-lnPoint;switch(lnPoint){case 0:lcResult+='00';break;case 1:lcResult+='0';break;}};return lcResult;},DOMEltDocPos:function(el){var x=el.offsetLeft;var y=el.offsetTop;if(el.offsetParent!=null){var pos=this.DOMEltDocPos(el.offsetParent);x+=pos.x;y+=pos.y;};return{x:x,y:y};},DOMEltPosIn:function(el,id){var x=20,y=20,llResult=Boolean(el);if(llResult){var oIn=document.getElementById(id);llResult=Boolean(oIn);if(llResult){var pos=this.DOMEltDocPos(el);var posIn=this.DOMEltDocPos(oIn);x=pos.x-posIn.x;y=pos.y-posIn.y;}};return{x:x,y:y};},DOMEltListenerAdd:function(obj,eventName,listener){var llResult=Boolean(obj.attachEvent);if(llResult){obj.attachEvent("on"+eventName,listener);}else{llResult=Boolean(obj.addEventListener);if(llResult){obj.addEventListener(eventName,listener,false);}};return llResult;},DOMEltListenerRemove:function(obj,eventName,listener){var llResult=false;llResult=Boolean(obj.detachEvent);if(llResult){obj.detachEvent("on"+eventName,listener);}else{llResult=Boolean(obj.removeEventListener);if(llResult){obj.removeEventListener(eventName,listener,false);}};return llResult;},pgf:{aStyles:function(){var result=['marginTop','marginRight','marginBottom','marginLeft','borderTopColor','borderTopStyle','borderTopWidth','borderRightColor','borderRightStyle','borderRightWidth','borderBottomColor','borderBottomStyle','borderBottomWidth','borderLeftColor','borderLeftStyle','borderLeftWidth','paddingTop','paddingRight','paddingBottom','paddingLeft','top','height','cursor','fontSize','fontWeight','fontStyle'];return this.lFullStyle?result.concat(['color','backgroundColor']):result;},oTabTop:function(tabin){var id,page,result;result=$(tabin);while(true){id=result.id;page=this.aPages.find(function(page){return id===page.id+'_tab';});if(page){break;}else{result=$(result.parentNode);if(!result){break;}}};return result;},oTab:function(page){var id=$(page).id;return this.aTabs.find(function(tab){return id===tab.id.substr(0,tab.id.length-'_tab'.length);});},oPage:function(tab){var id=$(tab).id;return this.aPages.find(function(page){return id===page.id+'_tab';});},nPage:function(page,vfp){return this.aPages.indexOf(page)+(vfp?1:0);},styleSet:function(toDest,toSrceStyle){var loDestStyle=toDest.style;this.aStyles().each(function(style){loDestStyle[style]=toSrceStyle[style];});},pageEnable:function(page,disable){page=$(page);page.disabled=Boolean(disable);this.pageStyleSet(page);},pageStyleSet:function(page){var active=page.lActive,tab=this.oTab(page);this.styleSet(tab,active?this.oStyleTabActive:this.oStyleTabInactive);this.styleSet(page,active?this.oStylePageActive:this.oStylePageInactive);},lPageEffectUser:true,lPageEffectServer:true,pageActivate:function(page,user){page=$(page);this.aPages.each(function(oPage){var llActive=oPage===page;if(oPage.lActive!=llActive){oPage.lActive=llActive;this.pageStyleSet(oPage);if(Prototype.Browser.IE6||user?!this.lPageEffectUser:!this.lPageEffectServer){oPage.setStyle({display:(llActive?'block':'none')})}else{if(llActive){oPage.appear({from:0});}else{oPage.fade();}}};if(false&&llActive&&Prototype.Browser.IE){var laChildren=oPage.childElements();if(laChildren.length>0){var loChild,lnChild,lnChildren=laChildren.length,loChildSelect,lnTabIndexMin=32767;for(lnChild=0;lnChild<lnChildren;lnChild++){loChild=laChildren[lnChild];if(loChild.tabIndex&&parseInt(loChild.tabIndex,10)>0&&parseInt(loChild.tabIndex,10)<lnTabIndexMin&&(loChild.focus||loChild.select)&&(loChild.style.display?!loChild.style.display==='none':true)){lnTabIndexMin=parseInt(loChild.tabIndex,10);loChildSelect=loChild;}};if(loChildSelect){if(loChildSelect.select){loChildSelect.select();};if(loChildSelect.focus){loChildSelect.focus();}}}}},this);},tabClick:function(event){var tab=this.oTabTop(Event.element(event)),page=this.oPage(tab);if(!page.disabled&&!page.lActive){this.pageActivate(page,true);if(page.lActivateSend){IntuiCat.PropChange(event,this.id,'activepage',this.nPage(page,true));}}},tabHover:function(tab,hover){tab=this.oTabTop(tab);if(tab&&tab.parentNode==this&&!this.oPage(tab).lActive){var _cursor=tab.style.cursor;this.styleSet(tab,hover?this.oStyleTabActive:this.oStyleTabInactive);tab.style.cursor=_cursor;}},tabIn:function(event){return this.tabHover(this.oTabTop(Event.element(event)),true);},tabOut:function(event){return this.tabHover(this.oTabTop(Event.element(event)),false);},getStyleN:function(el,style){el=$(el);var result=parseInt(el.getStyle(style),10);return result||0;},tabsJustify:function(){var cStyles=['marginLeft','marginRight','borderLeftWidth','borderRightWidth','paddingLeft','paddingRight'],aStyles=[],aWidths=[],outerWidth=0,innerWidth=0;this.aTabs.each(function(tab,itab){aStyles[itab]={};cStyles.each(function(style){aStyles[itab][style]=tab.style[style];});outerWidth=outerWidth+this.getStyleN(tab,'marginLeft')+this.getStyleN(tab,'marginRight')+this.getStyleN(tab,'borderLeftWidth')+this.getStyleN(tab,'borderRightWidth')+this.getStyleN(tab,'paddingLeft')+this.getStyleN(tab,'paddingRight');tab.setStyle({marginLeft:'0px',marginRight:'0px',borderLeftWidth:'0px',borderRightWidth:'0px',paddingLeft:'0px',paddingRight:'0px',width:Prototype.Browser.IE6?'0':'auto'});aWidths[itab]=tab.getWidth();innerWidth=innerWidth+aWidths[itab];},this);var abs=this.aTabs[0].getStyle('position')==='absolute';var left=abs?this.getStyleN(this,'paddingLeft'):0;var top=abs?this.getStyleN(this,'paddingTop'):0;var width=this.getStyleN(this,'width')-outerWidth-innerWidth;var blank=parseInt(width/this.aTabs.length,10);var rest=width%this.aTabs.length;this.aTabs.each(function(tab,itab){cStyles.each(function(style){tab.style[style]=aStyles[itab][style];});if(abs&&parseInt(tab.getStyle('top'))==0){tab.setStyle({top:top+'px'});};width=aWidths[itab]+blank+((itab==this.aTabs.length-1)?rest:0);tab.setStyle({left:left+'px',width:width+'px'});left=left+tab.getWidth();},this);}},pgfMake:function(tcPgfID,tcPageActiveID,tlFullStyle,taPagesDisabled,tlTabsJustifyNot){var loPgf=$(tcPgfID),llResult=Boolean(loPgf);if(llResult){var laChildren=loPgf.childElements(),lnChildren=laChildren.length;llResult=lnChildren>0;if(llResult){Object.extend(loPgf,{lFullStyle:Boolean(tlFullStyle),aTabs:[],aPages:[],oStyleTabActive:{},oStylePageActive:{},oStyleTabInactive:{},oStylePageInactive:{}});Object.extend(loPgf,this.pgf);laChildren.each(function(child){var childID=child.id;llResult=childID&&childID.startsWith(this.id);if(llResult){if(childID.endsWith('_tab')){this.aTabs[this.aTabs.length]=child;}else{this.aPages[this.aPages.length]=child;}}else{throw $break;}},loPgf);if(llResult){loPgf.aPages.each(function(page){page.disabled=false;var tab=this.oTab(page),active=page.id===tcPageActiveID;if(active){this.aStyles().each(function(style){this.oStylePageActive[style]=page.style[style];this.oStyleTabActive[style]=tab.style[style];},this);}else{this.aStyles().each(function(style){this.oStylePageInactive[style]=page.style[style];this.oStyleTabInactive[style]=tab.style[style];},this);};page.lActive=active;page.setStyle({display:(active?'block':'none')});},loPgf);loPgf.aTabs.each(function(tab){tab.observe('mouseover',loPgf.tabIn.bindAsEventListener(loPgf)).observe('mouseout',loPgf.tabOut.bindAsEventListener(loPgf)).observe('click',loPgf.tabClick.bindAsEventListener(loPgf))});if(!tlTabsJustifyNot){loPgf.tabsJustify.bind(loPgf).defer();};if(taPagesDisabled){taPagesDisabled.each(function(page){this.pageEnable(page,true);},loPgf);}}}};return llResult;},ASMake:function(tcInputID,tnCarsMin,tnDelay){var loInput=$(tcInputID);var llResult=loInput&&loInput.type.toLowerCase()==="text";if(llResult){loInput.lAutoSuggest=true;loInput.nCarsMin=(tnCarsMin>0)?tnCarsMin:4;loInput.nDelay=(tnDelay>0)?tnDelay/1000:.3;loInput.value='';loInput.observe('keyup',function(event,oIntuiCat){if(this.nTO){window.clearTimeout(this.nTO);};event.stop();var lnKeyCode=event.keyCode;if(this.id!==undefined&&(lnKeyCode==Event.KEY_BACKSPACE||lnKeyCode==Event.KEY_DELETE||lnKeyCode==32||lnKeyCode>=47&&lnKeyCode<=111||lnKeyCode>=124)){var nCars=this.value.length;if(nCars==0||nCars>=this.nCarsMin&&nCars<this.nCarsMin+4){this.nTO=oIntuiCat.ServerRequest.bind(oIntuiCat).delay(this.nDelay,"DOMEvent~&Event=change&ObjAddr="+this.id,this,this.value);}}}.bindAsEventListener(loInput,this));};return llResult;},spnMake:function(tcID,tnInc,tnHigh,tnLow,tlDisabled,tlLocal){var loSpn=$(tcID),loTxt=$(tcID+'_txt'),loBtnUp=$(tcID+'_up'),loBtnDown=$(tcID+'_down'),llResult=Boolean(loSpn)&&Boolean(loTxt)&&Boolean(loBtnUp)&&Boolean(loBtnDown);if(llResult){Object.extend(loSpn,{disabled:Boolean(tlDisabled),local:Boolean(tlLocal),oTxt:loTxt,nInc:(typeof tnInc==='number')?Math.abs(tnInc):1,nHigh:(typeof tnHigh==='number')?tnHigh:100000,nLow:(typeof tnLow==='number')?tnLow:-100000,inc:function(lUp){var lResult=!this.disabled;if(lResult){var lnValue=parseInt(this.oTxt.value,10)+(lUp?1:-1)*this.nInc;lResult=lnValue<=this.nHigh&&lnValue>=this.nLow;if(lResult)this.oTxt.value=lnValue.toString();};return lResult;}});var mDown=function(event,oIntuiCat,lUp){if(!oIntuiCat.lRequest){var oSpn=this.parentNode.parentNode;this.nInt=oSpn.inc(lUp)?window.setInterval(oSpn.inc.bind(oSpn,lUp),300):0;}};var mUp=function(event,oIntuiCat){if(this.nInt!=0){window.clearInterval(this.nInt);var oSpn=this.parentNode.parentNode;if(oSpn.local){oSpn.onchange(event);}else{oIntuiCat.ServerRequest("DOMEvent~&Event=change&ObjAddr="+oSpn.id,oSpn,parseInt(oSpn.oTxt.value,10));}}};loBtnUp.setStyle({cursor:'pointer'});loBtnUp.observe('mousedown',mDown.bindAsEventListener(loBtnUp,this,true));loBtnUp.observe('mouseup',mUp.bindAsEventListener(loBtnUp,this));loBtnDown.setStyle({cursor:'pointer'});loBtnDown.observe("mousedown",mDown.bindAsEventListener(loBtnDown,this,false));loBtnDown.observe("mouseup",mUp.bindAsEventListener(loBtnDown,this));};return llResult;},nInt:function(tu){var lnResult=parseInt(tu,10);return isNaN(lnResult)?0:lnResult;},nPx:function(dim){return(typeof dim==='string'&&dim.strip().toLowerCase().endsWith('px'))?this.nInt(dim):0;},IETransCSSFix:function(to){to=$(to);if(to&&Prototype.Browser.IE&&document.compatMode==='BackCompat'){to.descendants().reject(function(lo){return lo.type||lo.tagName.toLowerCase()==='button';}).each(function(lo){var n=this.nPx(lo.style.width);if(n>0){lo.setStyle({width:n+this.nPx(lo.getStyle('borderLeftWidth'))+this.nPx(lo.getStyle('paddingLeft'))+this.nPx(lo.getStyle('paddingRight'))+this.nPx(lo.getStyle('borderRightWidth'))+'px'});};n=this.nPx(lo.style.height);if(n>0){lo.setStyle({height:n+this.nPx(lo.getStyle('borderTopWidth'))+this.nPx(lo.getStyle('paddingTop'))+this.nPx(lo.getStyle('paddingBottom'))+this.nPx(lo.getStyle('borderBottomWidth'))+'px'});}},this);}},IECheckSizeFix:function(to){if(Prototype.Browser.IE&&to&&to.getElementsByTagName){$A(to.getElementsByTagName('input')).select(function(lo){return lo.type.toLowerCase()==='checkbox';}).each(function(check){$(check).setStyle({width:(check.getWidth()||0)+5+'px',height:(check.getHeight()||0)+5+'px',top:(check.getStyle('top')||0)-2+'px'})});}},IERadioChangeFix:function(to){if(Prototype.Browser.IE&&to){var inputs=to.select('input [type="radio"]');if(inputs){inputs.each(function(input){if(input.onchange&&!input.onclick){input.onclick=input.onchange;input.onchange="";}});}}},selectsSetup:function(){$$('select').each(function(select){if(select.size>1){select.selectedIndex=-1}});},lInit:false,documentInitAnte:function(){},documentInit:function(tcFormID){this.documentInitAnte();this.XBrowserFix(tcFormID);this.dEnd=new Date();if(tcFormID){this.oForm=document.getElementById(tcFormID);this.ServerRequest('MethExec~&MethAddr=InitControlsInet&ObjAddr='+tcFormID,undefined,undefined,true);}else{this.lInit=true;};this.documentInitPost();},documentInitPost:function(){},XBrowserFix:function(tuElt){var loElt=$(tuElt||document.body);this.IETransCSSFix(loElt);this.IERadioChangeFix(loElt);this.inputsSetup(tuElt);},inputsSetup:function(tuElt){tuElt=$(tuElt);if(tuElt){var inputs=tuElt.select('input');if(inputs){inputs.each(function(input){input.observe('focus',(['checkbox','radio'].indexOf(input.type.toLowerCase())>-1)?function(){this.valueOld=this.checked?1:0;}.bindAsEventListener(input):function(){this.valueOld=this.value;this.select();}.bindAsEventListener(input))});var dirKeys=[Event.KEY_TAB,Event.KEY_ESC,Event.KEY_LEFT,Event.KEY_UP,Event.KEY_RIGHT,Event.KEY_DOWN,Event.KEY_HOME,Event.KEY_END,Event.KEY_PAGEUP,Event.KEY_PAGEDOWN];inputs.select(function(input){return['text','password'].include(input.type.toLowerCase());}).each(function(input){input.backgroundColor_=input.getStyle('backgroundColor');input.observe('keypress',function(event){var keyCode=event.keyCode;if(keyCode===Event.KEY_RETURN){this.simulate('change');this.simulate('blur');event.stop();};if(!dirKeys.include(keyCode)){this.setStyle({backgroundColor:this.backgroundColor_});}}.bindAsEventListener(input));});inputs.select(function(input){return['checkbox','radio'].include(input.type.toLowerCase());}).each(function(input){input.observe('keypress',function(event){if(!dirKeys.include(event.keyCode)){this.simulate('change');}}.bindAsEventListener(input));input.observe('click',function(event){this.simulate('change');}.bindAsEventListener(input));});};tuElt.select('.acntud input.atxtu').each(function(input){if(input.onchange){input.onchange='';input.observe('change',function(event,input){var value=input.value;if(value&&parseInt(value,10)>0){if(value.indexOf('/')==-1){input.value=value.substr(0,2)+'/'+value.substr(2,2)+'/'+value.substr(4);};this.DOMEvent(event);}}.bindAsEventListener(this,input));}},this);}},lRePlay:false,nRePlayTO:0,RePlay:function(tnRequest){var lnRequests=this.aRequests.length,llResult=lnRequests>0;if(llResult){if(typeof tnRequest==='number'){llResult=!this.lRequest;if(llResult){this.RequestSend(this.aRequests[tnRequest][0],this.aRequests[tnRequest][1]);}else{this.nRePlayTO=setTimeout('this.RePlay('+tnRequest+')',1000);}}else{tnRequest=-1;};if(llResult){tnRequest++;if(tnRequest==lnRequests){tnRequest=0;};var lnDelay=(tnRequest==0)?.5:Math.min(Math.max(this.aRequests[tnRequest][2],2),6);this.nRePlayTO=this.RePlay(tnRequest).delay(lnDelay);this.lRePlay=true;}};return llResult;},RePlayStop:function(){var llResult=typeof this.nRePlayTO=='number';if(llResult){window.clearTimeout(this.nRePlayTO);};this.lRePlay=false;$('Replay').hide();return llResult;},sliderExtend:function(){if(typeof Control=='object'){Object.extend(Control.Slider.prototype,{minimumOffset:function(){var result=this.options.reversed?this.options.nOffsetEnd:this.options.nOffsetBeg;if(this.isVertical())this.alignY=result;else this.alignX=result;return result;},maximumOffset:function(){var result=this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,"")):(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""));result-=this.options.reversed?this.options.nOffsetBeg:this.options.nOffsetEnd;return result;},oHandle:function(handleIdx){handleIdx=handleIdx>=0?handleIdx:(this.activeHandleIdx>=0?this.activeHandleIdx:0);return this.handles[handleIdx];},onSlide:function(value){var lResult=!this.lRequest;if(lResult)this.labelUpdate(value);return lResult;},handleMove:function(value,handleIdx){var handle=this.oHandle(handleIdx),move=parseInt(this.translateToPx(value),10)-parseInt(handle.getStyle(this.isVertical()?'top':'left'),10),option=this.isVertical()?({y:move}):({x:move});new Effect.Move(handle,option);this.labelMove(value,handleIdx);return this;},labelMove:function(value,handleIdx){if(!this.options.lLabelFixed){var pos=parseInt(this.translateToPx(value),10),handle=this.oHandle(handleIdx);if(this.isVertical()){var nHandleH=parseInt(handle.style.height,10),nMin=parseInt(this.translateToPx(this.allowedValues[this.reversed?(this.allowedValues.length-1):0]),10),nTop=pos-2-parseInt(this.oLabel.style.height,10);nTop=(nTop>=nMin)?nTop:pos+nHandleH+2;this.oLabel.style.top=nTop+'px';}else{var nLabelW=Math.round(parseInt(this.oLabel.style.width,10)/2),nLeft=Math.max(pos-nLabelW,this.alignX);nLeft=Math.min(this.trackLength-this.alignX-nLabelW*2,nLeft);this.oLabel.style.left=nLeft+'px';}};return this;},labelUpdate:function(value){this.oLabel.innerHTML=this.displayValues[value-1];this.oLabel.style.display='block';this.labelMove(value);return this;},displayValues:[],tickSet:function(aTicks,nTickBeg,nTickEnd){this.displayValues=aTicks;this.range=$R(1,aTicks.length);this.allowedValues=$A($R(nTickBeg,nTickEnd));return this;}});}},sldMake:function(cSliderID,cHandleID,cLabelID,lVertical,lReversed,lLabelFixed,lEnabled,nOffsetBeg,nOffsetEnd){var result=new Control.Slider(cHandleID,cSliderID,{axis:lVertical?'vertical':'horizontal',reversed:lReversed,lLabelFixed:lLabelFixed,disabled:!lEnabled,nOffsetBeg:nOffsetBeg,nOffsetEnd:nOffsetEnd,onSlide:function(value,slider){return slider.onSlide(value);},onChange:function(value,slider){if(!this.lRequest){slider.labelUpdate(value);this.ServerRequest("DOMEvent~&Event=CritChange&ObjAddr="+cSliderID,$(cSliderID),value);}}.bind(this)});result.oLabel=$(cLabelID);$(cSliderID).slider=result;return result;},aimgGetSWFUploadOptions:function(){return{debug:false,flash_url:'/awScripts/SWFUpload/swfupload.swf',upload_url:this.wcURL('FileUpload'),file_upload_limit:0,file_queue_limit:1,custom_settings:{progressID:'',cancelID:'',callBackID:'',callBackMethod:''},button_image_url:'/awScripts/SWFUpload/images/aimgGet.png',button_width:'16',button_height:'16',swfupload_loaded_handler:function(){if(this.customSettings.progressID){this.customSettings.progress=$(this.customSettings.progressID);if(this.customSettings.progress)this.customSettings.progress.nWidthMax=$(this.customSettings.progress.parentNode).getWidth()-parseInt(this.customSettings.progress.getStyle('left'),10);}},file_queued_handler:Prototype.emptyFunction,file_queue_error_handler:Prototype.emptyFunction,file_dialog_complete_handler:function(file){this.startUpload();},upload_start_handler:function(file){this.customSettings.progress.setStyle({background:'green',width:0}).update('&nbsp;').show().title='&nbsp;';IntuiCat.WaitPic(true,this.customSettings.progress);this.success=false;},upload_progress_handler:function(file,bytes,bytesTot){if(this.customSettings.progress)this.customSettings.progress.setStyle({width:parseInt((bytes/bytesTot)*this.customSettings.progress.nWidthMax,10)+'px'});},upload_error_handler:function(file,error,message){var user,debug;switch(error){case this.UPLOAD_ERROR.HTTP_ERROR:user="Erreur de transmission";debug="Erreur HTTP";break;case this.UPLOAD_ERROR.IO_ERROR:user="Erreur lors de la lecture du fichier";debug="Server (IO) Error";break;case this.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:user="Dépassement du nombre de fichiers autorisé";debug="Upload Limit Exceeded";break;case this.UPLOAD_ERROR.FILE_VALIDATION_FAILED:user="La transmission de ce fichier n\"est pas autorisée";debug="File Validation Failed";break;case this.UPLOAD_ERROR.FILE_CANCELLED:user="Transmission abandonnée";if(this.getStats().files_queued===0&&this.customSettings.cancelID){$(this.customSettings.cancelID).disabled=true;};break;case this.UPLOAD_ERROR.UPLOAD_STOPPED:user="Transmission arrêtée";break;case this.UPLOAD_ERROR.SECURITY_ERROR:user="Opération interdite par les règles de sécurité";debug="Security Error";break;case this.UPLOAD_ERROR.UPLOAD_FAILED:user="Erreur de transmission";debug="Erreur HTTP";break;default:user="Erreur inattendue";debug="Erreur non gérée "+error;break;};if(user){if(this.customSettings.progress)this.customSettings.progress.setStyle({background:'red',right:0}).update(user).show();else Dialog.alert(user,{width:300});};if(debug)this.debug("Erreur: "+debug+", fichier: "+file.name+", taille: "+file.size+", message: "+message);},upload_success_handler:function(file,data,responseReceived){var error=!responseReceived?"Le serveur n'a pas répondu dans le délai imparti":(data.startsWith('/!\\')?"Erreur du serveur : "+data:null);if(error){if(this.customSettings.progress)this.customSettings.progress.update(error).setStyle({width:this.customSettings.progress.nWidthMax+'px',background:'red'}).show().title=error;else Dialog.alert(error,{width:300});}else{this.success=true;IntuiCat.MethExec(this.customSettings.progress,this.customSettings.callBackID,this.customSettings.callBackMethod,data,false);if(this.customSettings.progress)this.customSettings.progress.hide();}},upload_complete_handler:function(){if(!this.success)IntuiCat.WaitPic.delay(.5,false);}}},tinyMCEsetup:function(ids){if(tinyMCE&&ids)tinyMCE.init({language:'fr',mode:'exact',elements:ids,skin:'o2k7',theme:'advanced',plugins:'fullscreen,paste',theme_advanced_toolbar_location:'top',theme_advanced_toolbar_align:'left',theme_advanced_containers:'buttons1',theme_advanced_buttons1:'bold,italic,underline,strikethrough,|,justifyleft,justifycenter,|,formatselect,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,hr,removeformat,|,sub,sup,|,pasteword,charmap,fullscreen',theme_advanced_buttons2:'',theme_advanced_buttons3:'',gecko_spellcheck:true,content_css:'cp.css',body_class:'content',entity_encoding:'numeric',apply_source_formatting:false,valid_elements:"@[id|class|title|dir<ltr?rtl|lang|xml::lang]"+",a[tabindex|name|!href|target=_blank|title]"+",-p,-strong/b,-em/i,-strike,-u,-sub,-sup,-ol[type|compact],-ul[type|compact],-li,br"+",-span,-code,-samp,-pre,-address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],bdo"+",-dd,-dl,-dt,-dfn,-blockquote,-q[cite],-cite,-abbr,-acronym,-kbd,-del[datetime|cite],-ins[datetime|cite]"+",img[longdesc|src|alt=image|title|width|height]"+",-table[border=0|cellspacing|cellpadding|summary],-caption,tbody,thead,tfoot"+",-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor]"+",#td[colspan|rowspan|scope]"+",#th[colspan|rowspan|scope]"+""+""+""+""+""+""+""+"",setup:function(ed){ed.onChange.add(function(ed){var ebx=$(ed.id);if(ebx&&ebx.tagName.toLowerCase()==='textarea'){ebx.value=ed.getContent();if(false&&ed.lChanged){IntuiCat.ValueUpdate(ebx);}else{IntuiCat.DOMEvent_send(ebx,'change');ed.lChanged=true;}}});ed.onLoadContent.add(function(ed){ed.lChanged=false;});}});},cCRLF:String.fromCharCode(13,10),oXHR:Ajax.getTransport(),lBrowserOK:null,effectDuration:1.5,initialize:function(){this.sliderExtend();Object.extend(Effect.DefaultOptions,{duration:this.effectDuration,fps:15,delay:0});if(Windows)Windows.maxZIndex=10;this.lBrowserOK=Boolean(this.oXHR);if(!this.lBrowserOK){this.BrowserKO();}}};IntuiCat.initialize();var DOMEvent=IntuiCat.DOMEvent.bind(IntuiCat);var ModalChoice=function(){var args=$A(arguments);args.push(true);return IntuiCat.ModalChoice.apply(IntuiCat,args);}

