
Object.extend(Prototype.Browser,{IE6:Prototype.Browser.IE&&!window.XMLHttpRequest});var IntuiCat={DOMEvent:function(event,value,id){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){if(id){var id_=eventSrce.id;eventSrce.id=id;};llResult=this.EventRequest('DOMEvent',event,eventSrce,value,id);if(id)eventSrce.id=id_;}}else this.BrowserKO();if(event)event.stop();}else this.BrowserKO();return llResult;},EventRequest:function(method,event,element,value,id){var lcTag=element.tagName.toLowerCase(),eventType=(event.type||event).toLowerCase(),llResult=true;if(typeof value==='undefined'){switch(lcTag){case 'select':if(element.multiple&&element.options.length>0){value='';$A(element.options).each(function(opt,idx){value=value+(opt.selected?(','+idx):'');});value=value.substr(1);}else{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;element.checked=value==1;}else if(lcType==='radio'){value=parseInt(element.value,10);element=element.parentNode;}else if(eventType=='keyup'){value=event.keyCode;eventType='keypress';}else{value=element.value;};break;case 'textarea':value=element.value;break;}};id=id||element.id;if(lcTag=='input'&&['blur','change'].include(eventType)){var lDate=this.inputTextDateSelector&&element.match(this.inputTextDateSelector),dateValue=lDate?this.parseDate(value):null;llResult=!lDate||dateValue===''||dateValue instanceof Date;if(llResult){var valueOld=element.valueOld,typeOld=typeof valueOld;llResult=(this.lastKey===Event.KEY_RETURN&&this.inputAlwaysBlurOnReturn)||typeOld==='undefined'||typeOld==='string'&&typeof element.value==='string'&&value.toUpperCase()!==element.valueOld.toUpperCase()||value!==valueOld;if(lDate&&valueOld&&this.parseDate(valueOld).toString()===dateValue.toString())element.value=valueOld;else element.valueOld=value;if(id.endsWith('_txt'))id=id.substr(0,id.length-4);}};if(llResult){if(!id){element=element.up('[id]');if(element)id=element.id;};this.parameters['nButton']=typeof event.button==='undefined'?0:(event.button===0?1:(event.button===2?2:4));this.parameters['nShift']=1*(event.shiftKey?1:0)+2*(event.ctrlKey?1:0)+4*(event.altKey?1:0);if(eventType=='click')eventType=Event.isRightClick(event)?'rightclick':(Event.isMiddleClick(event)?'middleclick':eventType);var url=method+"~"+"&Event="+eventType+"&ObjAddr="+id;this.ServerRequest(url,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);},gridEvent:function(event,grid,value,id){if(event&&event.type&&event.type.toLowerCase()!=='keypress')Event.extend(event).stop();this.EventRequest('gridEvent',event,grid,value,id);},gridEditEvent:function(event,grid,value,id){if(event&&event.type&&event.type.toLowerCase()!=='keypress')Event.extend(event).stop();this.EventRequest('gridEditEvent',event,grid,value,id);return 0;},gridMethod:function(method,grid,value,id){id=id||grid.id;var url="gridMethod~&MethAddr="+method+"&ObjAddr="+id;return this.ServerRequest(url,grid,value);},MethExec:function(event,id,method,value,VScompat){var llResult=this.lBrowserOK;if(llResult){var eventSrce=event?(Object.isElement(event)?event:this.oEventSrce(this.oEvent(event))):null;var url=(VScompat?"Dialog":"MethExec")+"~"+"&MethAddr="+method+"&ObjAddr="+id;this.ServerRequest(url,eventSrce,value);if(event&&event.stop)event.stop();}else{this.BrowserKO();};return llResult;},FormDisplay:function(event,tcForm,cParms,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;cParms=cParms||null;this.ServerRequest('AJAXformDisplay~&cForm='+tcForm,eventSrce,cParms);}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'}).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=$('WGridRowsMax');if(loWGridRecs)tcRequest+="&nWGridRowsMax="+loWGridRecs.value;if(document.body.id){tcRequest+="&Form="+document.body.id;this.oForm=$('form');}else if(element&&element.id){var sep=element.id.indexOf('-');sep=(sep>0)?sep:element.id.indexOf('_');this.oForm=(sep>0)?$(element.id.substr(0,sep)):null;};lInit=Boolean(lInit)||this.lInit;this.lInit=false;tcRequest+="&PageInit="+(lInit?'true':'')+"&UserID="+this.cUserID;if(this.aRequests.length<20)this.aRequests.push([tcRequest,element,this.dRequest-this.dEnd]);this.RequestSend(tcRequest,element,value,lInit);},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;},RequestSend_sDate:function(date){var result='{^ '+date.getFullYear()+'/'+(date.getMonth()+1)+'/'+date.getDate();if(date.getHours()>0||date.getMinutes()>0||date.getSeconds()>0||date.getMilliseconds()>0)result=result+' '+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds();return result+String.fromCharCode(125);},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{if(this.oForm)this.oForm.setOpacity(1);this.WaitState(true,element);this.dRequest=new Date();if(value!==undefined){var type=typeof value;if(type==='object')type=(value instanceof Array)?'array':(value instanceof Date?'date':type);this.parameters['Value']=value===null?'null':(['object','array'].include(type)?Object.toJSON(value):(type==='date'?this.RequestSend_sDate(value):value.toString()));this.parameters['ValueType']=type;tcRequest+="&Value="+escape(this.parameters['Value'].truncate(60))+"&ValueType="+type;this.parameters['lastKey']=this.lastKey;};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)||this.oObject;this.lastKey=0;}},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),nRequestTOsecs:0,localURL:window.location.href.toLowerCase().startsWith('http://localhost/')||window.location.href.toLowerCase().startsWith('http://192.168.'),nRequestTO:0,WaitState:function(tlWait,element){this.lRequest=tlWait;this.nRequestTOsecs=this.localURL?this.requestTimeoutDev:this.requestTimeoutProd;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,nWaitPicTO:0,WaitPic:function(show,element){if(this.oWaitPic){this.oWaitPic.hide();window.clearTimeout(this.nWaitPicTO);};if(show&&this.requestWaitPic){this.oWaitPic=$('waitpic')||(this.oForm?$(this.oForm.id+'-'+'waitpic')||$(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});};if(this.requestWaitPicDelay>0)this.nWaitPicTO=Element.show.delay(this.requestWaitPicDelay,this.oWaitPic);else this.oWaitPic.show();}};if(this.oForm&&this.requestFormOpacity>0&&this.requestFormOpacity<1){if(show){this.oForm._opacity=this.oForm.getOpacity();this.oForm.setOpacity(this.requestFormOpacity);}else this.oForm.setOpacity(this.oForm._opacity||1);}},ServerMute:function(){this.Error((this.langFR?"L'application n'a pas répondu dans le délai imparti de":"Application did not respond within the expected delay of")+" "+this.nRequestTOsecs.toString()+" "+(this.langFR?"secondes.":"seconds."));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((this.langFR?'Erreur de protocole HTTP : ':'HTTP protocol error: ')+(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((this.langFR?"Le DOM construit à partir du XML reçu du serveur n'a aucun noeud enfant":"DOM built on server's response has no child node")+this.cCRLF+lcXML);}else this.Error((this.langFR?"Le XML reçu du serveur n'a pas pu être converti en DOM":"XML received from server could not be converted into DOM")+this.cCRLF+lcXML);}else this.Error(this.langFR?"Le serveur a retourné une réponse XML vide.":"Server returned an empty XML response.");},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((this.langFR?"L'interprétation du document XML a rencontré une erreur :":"An error occurred while interpreting WML DOM document:")+this.cCRLF+lcError);return llResult;},cUserID:'',cServerStatus:'',nServerSecs:0,nAppSecs:0,DOMRead:function(toDOM){var llResult=true;var loIntuiCat=this.oDOMEltChild(toDOM,'IntuiCat');llResult=Boolean(loIntuiCat);if(llResult){loIntuiCat.normalize();var loError=this.oDOMEltChild(loIntuiCat,'ServerError');llResult=!Boolean(loError);if(llResult){this.aDOMEltChildren(loIntuiCat,'HTMLDialog').each(function(loDialog){var llDialog=this.DialogShow(loDialog);if(!llDialog){this.Error((this.langFR?"Échec de l'affichage du dialogue modal :":"Modal dialog cannot be displayed:")+' '+this.oDOMEltChild(loDialog,'DivID').firstChild.nodeValue);};llResult=llResult&&llDialog;}.bind(this));if(llResult){var script=this.oDOMEltChild(loIntuiCat,'script');if(script){script=script.firstChild.nodeValue;if(script){eval(script);}};var loProps=this.oDOMEltChild(loIntuiCat,'PCHTML');if(loProps){llResult=this.PageUpdate(loProps);if(!llResult){this.Error(this.langFR?"Échec de la mise à jour de la page":"Page update aborted");}};if(llResult){script=this.oDOMEltChild(loIntuiCat,'script_');if(script){script=script.firstChild.nodeValue;if(script){eval(script);}};var loUserID=this.oDOMEltChild(loIntuiCat,'UserID');this.cUserID=loUserID?loUserID.firstChild.nodeValue:'';var loServerStatus=this.oDOMEltChild(loIntuiCat,'ServerStatus');this.cServerStatus=loServerStatus?loServerStatus.firstChild.nodeValue:'';var loServerSec=this.oDOMEltChild(loIntuiCat,'ServerTime');this.nServerSecs=loServerSec?parseFloat(loServerSec.firstChild.nodeValue):0;var loAppSec=this.oDOMEltChild(loIntuiCat,'AppTime');this.nAppSecs=loAppSec?parseFloat(loAppSec.firstChild.nodeValue):0;var location=this.oDOMEltChild(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(this.langFR?"Le document XML reçu ne comporte aucun élément racine.":"Received XML document contains no root element.");};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){elt=laProp[0].firstChild?$(laProp[0].firstChild.nodeValue):null;llResult=this.PageUpdate_elt(elt,toProps,laProp);}else this.Error((this.langFR?"Quatre déterminants de propriétés attendus au lieu de":"Four property determiners expected instead of")+' '+laProp.length);if(!llResult)break;}}else this.Error(this.langFR?"Le tableau de propriétés est vide.":"Properties array is empty.");return llResult;},PageUpdate_elt_Shell:function(element,property,type,value){},PageUpdate_elt:function(element,toProps,laProp){var llResult=true,lcProp=laProp[1].firstChild?laProp[1].firstChild.nodeValue:'',lcType=laProp[2].firstChild?laProp[2].firstChild.nodeValue.toUpperCase():'',luVal=laProp[3],lcVal;if(element){if(new RegExp('^http(s)*://localhost/').test(window.location.href))this.PageUpdate_elt_Shell(element,lcProp,lcType,luVal);if(lcType=="A"){var loCursor;if(this.aDOMEltChildren(luVal).length===0){lcVal=luVal.firstChild.nodeValue;loCursor=this.oDOMEltChild(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((this.langFR?"Propriété de curseur non supportée :":"Unsupported cursor property:")+' '+lcProp);llResult=false;break;}}else this.Error((this.langFR?"Le curseur nommé":"Cursor named")+' '+lcVal+' '+(this.langFR?"associé à la propriété":"related to property")+' '+lcProp+' '+(this.langFR?"est introuvable dans le document XML.":"cannot be found in XML document."));}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=$(element.id+'_txt');if(element)this.StyleSet(element,lcProp,luVal);}}else this.AttribSet(element,lcProp,luVal);}else with(element){eval(lcVal);}}}else{if(lcProp===''&&lcType===''&&luVal.firstChild)eval(luVal.firstChild.nodeValue);};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 'value':element.valueOld=element.value=tuVal;break;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&&element.options.length>0){if(typeof tuVal==='number'){if(tuVal<element.options.length){var scrollTop=element.scrollTop;element.selectedIndex=tuVal;element.scrollTop=scrollTop;}}else if(typeof tuVal==='string'){var aVal=tuVal.split(',').map(function(val){return parseInt(val,10);});$A(element.options).each(function(opt,idx){opt.selected=aVal.include(idx);});}};break;default:if(!(lcAttrib==='src'&&!tuVal))element[tcAttrib]=tuVal;};if(lcTag==='img'&&lcAttrib==='src'&&tuVal&&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);case 'O':return tcValue.evalJSON();default:return null;}},PageUpdate_SELECT:function(toSelect,toCursor){var lcTag=toSelect.tagName.toLowerCase(),llResult=true;if(lcTag==='select'){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);}}}};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.oDOMEltChild(toDialog,'DivModal');var llModal=loModal&&loModal.firstChild?this.uValue(loModal.firstChild.nodeValue,'B'):false;var loObjAddr=this.oDOMEltChild(toDialog,'ObjAddr');var lcObjAddr=loObjAddr&&loObjAddr.firstChild?loObjAddr.firstChild.nodeValue:'';var loMethod=this.oDOMEltChild(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,lcID);};return llResult;},oObject_:null,oForm_:null,WindowOpen:function(toSrce,tcTitle,tnWidth,tnHeight,tcHTML,tlModal,tcObjAddr,tcMethod,tcID){if(!toSrce||!toSrce.nodeType){var event=this.oEvent(toSrce);toSrce=event?this.oEventSrce(event):toSrce;};var llResult=Boolean(toSrce);if(llResult){tcID='Window_'+(tcID||tcTitle.replace(/\W/g,'_').replace(/_+/g,'_')),loWindow=$(tcID);if(loWindow&&!loWindow.visible()){loWindow.destroy();loWindow=null;};if(loWindow){loWindow.win.toFront();}else{this.oObject_=this.oObject;var loPos=this.DOMEltDocPos(toSrce),VPoffsets=document.viewport.getScrollOffsets(),VPdims=document.viewport.getDimensions(),llCenter=!loPos||tlModal;this.oForm_=this.oForm;loWindow=new Window(tcID,{className:this.windowClass,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()),defer=Function.prototype.defer,nDelay=tcHTML.length/ 1024/ 3*.01;Function.prototype.defer=Function.prototype.delay.curry(nDelay);loContent.setStyle({overflow:'hidden'}).update(tcHTML);Function.prototype.defer=defer;loContent.firstDescendant().oWindow=loWindow;if(event&&event.type&&event.type.toLowerCase()==='mouseover'){toSrce.oWindow=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.oWindow&&!this.oWindow.isVisible())this.oWindow.destroy();this.oWindow=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){this.oObject=this.oObject_||this.oObject;if(this.oObject&&this.oObject.focus)this.oObject.focus();Windows.close(win.getId());this.oForm=this.oForm_;var srce=win.oSrce,parent=srce&&srce.parentNode?$(srce.parentNode):null,cMethod=win.cMethod,cObjAddr=win.cObjAddr,done=false;if(parent&&parent.cTable&&parent.hasClassName('EditImgs')&&value!==null){this.DOMEltUpdate($(parent.parentNode).identify(),parent.cTable,value);done=true;};if(!done&&cMethod)this.MethExec(event,cObjAddr,cMethod,value,VScompat);}},oDOMEltChild:function(toDOMElt,tcChild){var laChildren=this.aDOMEltChildren(toDOMElt,tcChild);if(this.localURL&&laChildren.length>1)window.alert(laChildren.length+' enfant(s) du noeud '+toDOMElt.nodeName+' portent le nom '+tcChild);return(laChildren.length==1)?laChildren[0]:null;},aDOMEltChildren:function(toDOMElt,tcChild){var laResult=[];if(toDOMElt&&toDOMElt.hasChildNodes()){tcChild=tcChild?tcChild.toLowerCase():'';for(var lnChild=0,loChild;lnChild<toDOMElt.childNodes.length;lnChild++){loChild=toDOMElt.childNodes.item(lnChild);if(loChild.nodeType==1&&(!tcChild||loChild.nodeName.toLowerCase()===tcChild)){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,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=$('AppTime');if(loAppTime){loAppTime.update(this.cCents(this.nAppSecs)+" s");$('ServerTime').update(this.cCents(this.nServerSecs)+" s");$('XmitTime').update(this.cCents(lnInetSec)+" s");$('ClientTime').update(this.cCents(lnClientSec)+" s");$('TotalTime').update(this.cCents(lnEventSec)+" s");$('PageWeight').update(this.cCents(lnPageBytes)+" ko");$('ReqWeight').update(this.cCents(lnXMLkBytes)+" ko");$('SavedWeight').update(Math.round((lnPageBytes-lnXMLkBytes)/lnPageBytes*100).toString()+" %");if(this.nRequests>1){$('RequestAverage').style.display='block';$('nReqs').update(this.nRequests.toString());$('AppTimeAv').update((this.cCents(this.nAppsSecs/this.nRequests)+" s").bold());$('ServerTimeAv').update((this.cCents(this.nServersSecs/this.nRequests)+" s").bold());$('XmitTimeAv').update((this.cCents(this.nInetsSecs/this.nRequests)+" s").bold());$('ClientTimeAv').update((this.cCents(this.nClientsSecs/this.nRequests)+" s").bold());$('TotalTimeAv').update((this.cCents(this.nEventsSecs/this.nRequests)+" s").bold());$('PageWeightAv').update((this.cCents(this.nPageskBytes/this.nRequests)+" ko").bold());$('ReqWeightAv').update((this.cCents(this.nXMLkBytes/this.nRequests)+" ko").bold());$('SavedWeightAv').update((Math.round((this.nPageskBytes-this.nXMLkBytes)/this.nPageskBytes*100).toString()+" %").bold());};var loServerStatus=$('ServerStatus');if(this.cServerStatus&&loServerStatus){loServerStatus.update(this.cServerStatus);$('onglet_affec_apagsel_page1_typecial').style.display='none';};$('Tech').style.display='block';if(!this.lRePlay){$('nReplay').update(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'+', server '+this.cCents(this.nServerSecs)+' s'+', browser '+this.cCents(lnClientSec)+' s'+')';},nCents:function(tn){return(Math.round(tn*100)/100);},cCents:function(tn){var lcResult=this.nCents(tn).toString(),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=$(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';});},iPage: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);},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||this.lFullStyle||!(user?this.pageEffectUser:this.pageEffectServer)){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.iPage(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',left=abs?this.getStyleN(this,'paddingLeft'):0,top=abs?this.getStyleN(this,'paddingTop'):0,width=this.getStyleN(this,'width')-outerWidth-innerWidth,blank=parseInt(width/this.aTabs.length,10),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,Object.extend(this.pgf,{pageEffectUser:this.pageEffectUser,pageEffectServer:this.pageEffectServer}));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,oThis){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=oThis.ServerRequest.bind(oThis).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,oThis,lUp){if(!oThis.lRequest){var oSpn=this.parentNode.parentNode;this.nInt=oSpn.inc(lUp)?window.setInterval(oSpn.inc.bind(oSpn,lUp),300):0;}};var mUp=function(event,oThis){if(this.nInt!=0){window.clearInterval(this.nInt);var oSpn=this.parentNode.parentNode;event.stop();if(oSpn.local)oSpn.onchange(event);else oThis.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;},parseDate:function(sdate){var adate=sdate.split('/').map(function(s){return parseInt(s,10).abs();}),length=adate.length;if(length==2||length==3){var year=new Date().getFullYear();if(length==3){if(adate[2]<100){var cent=year-year%100,year2=cent+adate[2];year=year2-(year2-year>this.centuryRollover?100:0);}else year=adate[2];};var dm=this.dateFormat.split('/')[0].toLowerCase().startsWith('d'),month=adate[dm?1:0]-1,day=adate[dm?0:1];return new Date(year,month,day);}else return '';},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.select('input [type="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){to.select('input [type="radio"]').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}});},XBrowserFix:function(tuElt){var loElt=$(tuElt||document.body);this.IETransCSSFix(loElt);this.IERadioChangeFix(loElt);this.inputsSetup(tuElt);$(document.body).observe('keydown',function(event){this.lastKey=event.keyCode;}.bindAsEventListener(this));},documentInitAnte:function(){},lInit:false,lastKey:0,documentInit:function(tcFormID){this.documentInitAnte();this.XBrowserFix(tcFormID);this.dEnd=new Date();if(tcFormID){this.oForm=$(tcFormID);this.ServerRequest('MethExec~&MethAddr=InitControlsInet&ObjAddr='+tcFormID,undefined,undefined,true);}else this.lInit=true;this.documentInitPost();},documentInitPost:function(){},inputsSetup:function(tuElt){tuElt=$(tuElt);if(tuElt){var inputs=tuElt.select('input');if(inputs){var dirKeys=this.dirKeys,ctlKeys=this.ctlKeys;inputs.each(function(input){input.observe('focus',(['checkbox','radio'].include(input.type.toLowerCase()))?function(){this.valueOld=this.checked?1:0;}.bindAsEventListener(input):function(){this.valueOld=this.value;this.select();}.bindAsEventListener(input));});inputs.select(function(input){return['text','password'].include(input.type.toLowerCase());}).each(function(input){if(this.inputTextBackColor&&!input.disabled)input.backgroundColor_=input.getStyle('backgroundColor');input.observe('keyup',function(event,oThis){var keyCode=event.keyCode;if(keyCode===Event.KEY_RETURN){this.lastKey=keyCode;this.simulate('change');this.simulate('blur');if(Prototype.Browser.WebKit)event.stop();}else{if(!dirKeys.include(keyCode)&&this.backgroundColor_)this.setStyle({backgroundColor:this.backgroundColor_});if(this.nTO)window.clearTimeout(this.nTO);if(!ctlKeys.include(keyCode)&&oThis.autoBlurDelay>0&&!input.wlValidAutoNot)this.nTO=Event.simulate.delay(oThis.autoBlurDelay,this,'blur');}}.bindAsEventListener(input,this));},this);inputs.select(function(input){return['checkbox','radio'].include(input.type.toLowerCase());}).each(function(input){input.observe('keyup',function(event){if(!dirKeys.include(event.keyCode))this.simulate('change');}.bindAsEventListener(input));input.observe('click',function(event){this.simulate('change');}.bindAsEventListener(input));});};tuElt.select(this.inputTextDateSelector).each(this.inputDate,this);tuElt.select('select[multiple]').each(function(sel){sel.aSelected=new Array;$A(sel.options).each(function(opt,idx){if(opt.selected)sel.aSelected.push(idx);});});}},inputDate:function(input,reset){if((typeof reset==='boolean')&&reset)input.observe('keypress',Prototype.emptyFunction);else input.observe('keypress',function(event,input){if(!this.dirKeys.include(event.keyCode)){if(input.selectionEnd&&input.selectionStart==0&&input.selectionEnd==input.value.length&&event.keyCode!==Event.KEY_RETURN)input.value='';if(this.isDigit(event.charCode)&&input.value.substr(input.value.length-1)!=='/')input.value=input.value+((input.value.length==2||input.value.length==5)?'/':'');else if(this.ctlKeys.include(event.keyCode))return true;else{event.stop();return false;}}}.bindAsEventListener(this,input));},isDigit:function(charCode){return(charCode>=48&&charCode<=57);},DownloadFile:function(url){if(url){var ext=url.substr(url.lastIndexOf('.')+1).toLowerCase();var form=new Element('form',{action:url,method:'get',target:(['txt','csv'].include(ext)?'_blank':'')}).update(new Element('input',{type:'hidden',value:'void'}));document.body.appendChild(form);form.submit();form.remove();}},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.update(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({backgroundImage:'url(/awScripts/progressBarBlue15.jpg)',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.EventRequest('DOMEvent','change',ebx);ed.lChanged=true;}}});ed.onLoadContent.add(function(ed){ed.lChanged=false;});}});},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+"- Microsoft Internet Explorer pour Windows, version 6 ou supérieure"+this.cCRLF+"- Mozilla FireFox pour Mac et Windows, version 1.0.4 ou supérieure"+this.cCRLF+"- Google Chrome version 2 ou supérieure"+this.cCRLF+"- Apple Safari pour Mac et Windows, version 1.2.4 ou supérieure"+this.cCRLF+"- Opera version 9 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>"+(this.langFR?"Désolé, le serveur FoxInCloud a produit une erreur inattendue.":"Sorry, FoxInCloud server produced an unexpected error.")+"<br/>"+(this.langFR?"Veuillez nous en excuser et réessayer ultérieurement.":"We apologize for this discomfort, please try again later.")+"<br/><br/>"+tcError+"</p>";Dialog.alert(tcError,{windowParameters:{width:480,opacity:.95},okLabel:this.langFR?'fermer':'close'})},oEvent:function(event){return Event.extend(event||window.event);},oEventSrce:function(event){return event.target||event.srcElement;},cCRLF:String.fromCharCode(13,10),oXHR:Ajax.getTransport(),lBrowserOK:null,effectDuration:1.5,langFR:false,dirKeys:[Event.KEY_TAB,Event.KEY_ESC,Event.KEY_LEFT,Event.KEY_RIGHT,Event.KEY_UP,Event.KEY_DOWN,Event.KEY_HOME,Event.KEY_END,Event.KEY_PAGEUP,Event.KEY_PAGEDOWN],ctlKeys:[],initialize:function(){var language=navigator.language||navigator.browserLanguage;language=language.substr(0,2).toLowerCase();this.langFR=language==='fr';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();this.ctlKeys=this.dirKeys.concat([Event.KEY_ESC,Event.KEY_BACKSPACE,188,190]);}};IntuiCat.initialize();var FoxInCloud=IntuiCat;Window.keepMultiModalWindow=true;Object.extend(FoxInCloud,{CGI:'bin/wc.dll',requestTimeoutDev:600,requestTimeoutProd:25,windowClass:'mac_os_x',pageEffectUser:true,pageEffectServer:true,inputTextBackColor:true,autoBlurDelay:1.5,gridRowChangeDelay:0.35,requestWaitPic:false,requestWaitPicDelay:.8,requestFormOpacity:.9,inputTextDateSelector:'input.awDate',inputTextDateFormat:'jj/mm/aa',inputAlwaysBlurOnReturn:false,dateFormat:'day/month',centuryRollover:20,gridDateEmpty:'/ /',gridDateTimeEmpty:'/ / ::',junk:'junk'});var DOMEvent=IntuiCat.DOMEvent.bind(IntuiCat);var ModalChoice=function(){var args=$A(arguments);args.push(true);return IntuiCat.ModalChoice.apply(IntuiCat,args);};AW.Formats.Boolean=AW.System.Format.subclass();AW.Formats.Boolean.create=function(){var obj=this.prototype;obj.dataToText=function(data){return '';};obj.dataToValue=function(data){return(data==='true'||data==='1');};obj.textToValue=function(text){return(text==='true'||text==='1');};obj.textToData=function(text){return text;};obj.valueToData=function(value){return value?'true':'false';};obj.valueToText=function(value){return this.dataToText(this.valueToData(value));};};AW.Formats.DateVFP=AW.Formats.Date.subclass();AW.Formats.DateVFP.create=function(){AW.Formats.Date.create.call(this);this.prototype.setErrorText(IntuiCat.gridDateEmpty);};AW.Formats.DateTimeVFP=AW.Formats.Date.subclass();AW.Formats.DateTimeVFP.create=function(){AW.Formats.Date.create.call(this);this.prototype.setErrorText(IntuiCat.gridDateTimeEmpty);};AW.Templates.CheckBoxReadOnly=AW.Templates.CheckBox.subclass();AW.Templates.CheckBoxReadOnly.create=function(){AW.Templates.CheckBox.create.call(this);this.prototype.setEvent("onclick",function(){});};AW.Templates.CheckboxRO=AW.Templates.CheckBoxRO=AW.Templates.CheckBoxReadOnly;AW.Templates.CheckBoxDisabled=AW.Templates.CheckBox.subclass();AW.Templates.CheckBoxDisabled.create=function(){AW.Templates.CheckBox.create.call(this);this.prototype.setEvent("onclick",function(){});this.prototype.setClass('disabled','control');};



