var INCLUDE_VER="$Revision: 1.168 $";var iSCROLLER_WIDTH;var sTOOLTIP_DIV_ID="tooltip";var msOnLoadFunctionList=new Array();var bLoaded=false;var sDbg;var bAdmin;var sAccueil;String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");};String.prototype.count=function(s1){return(this.length-this.replace(new RegExp(s1,"g"),"").length)/s1.length;};String.prototype.escapeJS=function(p_sActiveQuote){if(p_sActiveQuote=='"'){p_sActiveQuote='"';}var re=new RegExp("([\\\\"+p_sActiveQuote+"])","g");return this.replace(re,"\\$1");};String.prototype.supprCR=function(p_sCRReplace){return this.replace(/\r|\n|\\n/g,(p_sCRReplace||""));};String.prototype.removeItemFromList=function(p_cSep,p_sItem){var ms=this.split(p_cSep);var sNewList="";for(var i=0;i<ms.length;i++){if(ms[i]==p_sItem){continue;}sNewList+=ms[i]+p_cSep;}return sNewList==""?sNewList:sNewList.substring(0,sNewList.length-1);};String.prototype.addItemToList=function(p_cSep,p_sItem){var ms=this.split(p_cSep);for(var i=0;i<ms.length;i++){if(ms[i]==p_sItem){return this;}}var sNewList=(""==this)?p_sItem:this+p_cSep+p_sItem;return sNewList;};String.prototype.getWidth=function(p_msStyleObject){var test=document.createElement("spanSW");document.body.appendChild(test);test.style.visibility="hidden";if(p_msStyleObject){for(var i in p_msStyleObject){test.style[i]=p_msStyleObject[i];}}test.innerHTML=this;var w=test.offsetWidth;document.body.removeChild(test);return w;};function isDef(){return(arguments.length>0&&typeof window[arguments[0]]!="undefined");}function getClassName(obj){if(typeof(obj)!="object"||obj===null){return false;}if(obj._class){return obj._class;}var msRes=/(\w+)\(/.exec(obj.constructor.toString());if(!msRes){msRes=/\[([\w ]+)\]/.exec(obj.constructor.toString());}return msRes[1];}function $O2(element,p_oContainer,p_sTag){var oElem;do{if(oElem){element=oElem.id;delete oElem;}if(p_oContainer){oElem=p_oContainer.findChildById(element,p_sTag);}else{if(isDef("oCC")&&oCC){oElem=oCC.findChildById(element,p_sTag);}}if(!oElem){oElem=$(element);}if(!oElem){return;}oElem=$(oElem);}while(!oElem.isValid());return oElem;}function checkVersion(p_sSrcName,p_sExpectedVersion){var v;var sFileName=p_sSrcName;if(sFileName.match(/\/.*/)){sFileName=new RegExp("/.*/([a-zA-Z0-9_]*)(.js)?").exec(sFileName)[1];}try{v=eval(sFileName.toUpperCase()+"_VER");}catch(e){}var sExpectedVersion="$"+"Revision: "+p_sExpectedVersion+" $";if(v!=sExpectedVersion){var sPath=p_sSrcName;if(!sPath.match(/\/.*/)){sPath="/com/js/"+sPath;}var sMsg="Attention un fichier n'est pas à jour !\n\n";if(sDbg){sMsg+="("+p_sSrcName+".js : version '"+v+"' au lieu de '"+p_sExpectedVersion+"') \n\n";}sMsg+=" MERCI DE VIDER LE CACHE (menu 'Outils / Effacer mes traces') ET/OU DE RECHARGER LA PAGE (touche F5).";alert(sMsg);}}function windowOnLoad(p_oCont){var oWin=p_oCont&&p_oCont.document?p_oCont:window;var bIsIframe=(oWin.frameElement!=null);if(bIsIframe&&this!=oWin){oWin.windowOnLoad(p_oCont);return;}var msTbl=p_oCont?p_oCont.msOnLoadFunctionList:msOnLoadFunctionList;if(msTbl){for(var i=0,l=msTbl.length;i<l;i++){var sScript=msTbl[i];try{eval(sScript);}catch(e){var sMsg="windowOnLoad["+(p_oCont?p_oCont.id:"-")+"] : Failed to execute script.\n"+O2Exception.errorToStr(e)+"\n\n Executing script : "+sScript;O2Exception.recordError(sMsg);if(bAdmin&&copy_clip){copy_clip(sMsg);}throw e;}}}if(p_oCont&&p_oCont.setAttribute){p_oCont.setAttribute(ODYCont.sATTR_LOADED,"true");}else{bLoaded=true;}}function addOnLoad(p_sExpr,p_sContId){if(!p_sContId){throw'addOnLoad : target container id mandatory ! Use "_XXX" for a frame named XXX.\n'+p_sExpr;}if(!p_sContId.startsWith("_")){var oCont=findContainerById(p_sContId);if(!oCont.msOnLoadFunctionList){oCont.msOnLoadFunctionList=new Array();}oCont.msOnLoadFunctionList.push(p_sExpr);}else{msOnLoadFunctionList.push(p_sExpr);}}function initCC(p_sTS){oCC=$(p_sTS).getContainer();oCC["ts"]=p_sTS;}function getCurrentScript(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1];}function makeDev(p_oLink){var sCurrentUrl=this;var sPrefix;if(sCurrentUrl.match("https?://dev")){sPrefix="dev";}else{if(sCurrentUrl.match("https?://test")){sPrefix="test";}else{return;}}var sProt="http://";if(!p_oLink.href.match(sProt+".*")){return;}var sRef=p_oLink.href.substring(sProt.length);if(sRef.match(sPrefix+"..*")){return;}if(sRef.match("www..*")){sRef=sRef.substring(4);}p_oLink.href=sProt+sPrefix+"."+sRef;}function setCookie(name,value,days){var expire=new Date();expire.setTime(expire.getTime()+(24*60*60*1000)*days);document.cookie=name+"="+escape(value)+"; expires="+expire.toGMTString();}function getCookie(name){var startIndex=document.cookie.indexOf(name);if(startIndex!=-1){var endIndex=document.cookie.indexOf(";",startIndex);if(endIndex==-1){endIndex=document.cookie.length;}return unescape(document.cookie.substring(startIndex+name.length+1,endIndex));}else{return null;}}function deleteCookie(name){var exp=new Date();exp.setTime(exp.getTime()-100000);var cval=getCookie(name);document.cookie=name+"="+cval+"; expires="+exp.toGMTString();}function getOverlibDiv(e,p_bCreateIfNotExist){var oCaller=e?e.target:null;var oDivParent=oCaller?oCaller.getContainer():document.body;var oDiv=oDivParent.findChildById(sTOOLTIP_DIV_ID);if(p_bCreateIfNotExist&&!oDiv){oDiv=document.createElement("div");Element.extend(oDiv);oDiv.id=sTOOLTIP_DIV_ID;oDivParent.appendChild(oDiv);oDiv.listenTo("click",function(e){hideOverlib(this,e);},false);if(true||p_bPersistent){oDiv.listenTo("mouseout",ndDiv,false);}else{delete oDiv.onmouseout;}oDiv.hide();}return oDiv;}function overlib(e,p_sMsg,p_bPersistent,p_sCssStyle){var oCaller=e?e.target:null;if(!oCaller){oCaller=e.srcElement;}Element.extend(oCaller);var oDiv=getOverlibDiv(e,true);if(oDiv.visible()){return hideOverlib(oDiv,e);}oDiv.innerHTML=p_sMsg;oDiv.className=p_sCssStyle?p_sCssStyle:"overlib";var sInputId;if(oCaller){try{sInputId=oCaller.getAttribute("inputId");}catch(e){sInputId=oCaller.parentNode.getAttribute("inputId");}}if(oCaller.getAttribute&&oCaller.getAttribute("inputId")){var oInput=oCaller.findBrotherById(oCaller.getAttribute("inputId"));if(oInput.type!="hidden"){oCaller=oInput;}}var oCont=oDiv.getContainer();oDiv.show();oDiv["containerZindex"]=oCont.style.zIndex;if(e.target){oCont.style.zIndex=oDiv.getStyle("zIndex");}else{oCont.style.zIndex=oDiv.style.zIndex;}if(oCaller){var oTmpcont=oCaller.getContainer();var offset=oCaller.offsetFromIncludingScroll(oCont);var oMaxContX=oCont;var iOffsetFromMaxX=0;while(oMaxContX&&oMaxContX.getStyle("overflow-x")=="visible"){iOffsetFromMaxX+=oMaxContX.offsetLeft;oMaxContX=oMaxContX.getContainer();}var iXMin=oMaxContX?-iOffsetFromMaxX:oCont.clientWidth;var iXMax=oMaxContX?oMaxContX.clientWidth-iOffsetFromMaxX:oCont.clientWidth;var oMaxContY=oCont;var iOffsetFromMaxY=0;while(oMaxContY&&oMaxContY.getStyle("overflow-y")=="visible"){iOffsetFromMaxY+=oMaxContY.offsetTop;oMaxContY=oMaxContY.getContainer();}var iYMin=oMaxContY?-iOffsetFromMaxY:oCont.clientHeight;var iYMax=oMaxContY?oMaxContY.clientHeight-iOffsetFromMaxY:oCont.clientHeight;var iMargin=-2;var iScrollTop=0,ii=0;do{iScrollTop+=oTmpcont.scrollTop;oTmpcont=oTmpcont.getContainer();ii++;}while(oTmpcont&&oTmpcont.tagName!="BODY"&&oTmpcont!=oCont&&ii<15);var iLeft=offset[0];var iWidth=oDiv.getDimensions().width;if((iLeft+iWidth)>(iXMax-iMargin)){iLeft=iXMax-iWidth;}if(iLeft<(iXMin+iMargin)){iLeft=0+iMargin;}var iTop=offset[1]+iMargin+oCaller.getHeight();var iHeight=oDiv.getDimensions().height;if((iTop+iHeight)>(iYMax-iMargin)){iTop=offset[1]-iHeight-iMargin;}oDiv.style.left=iLeft+"px";oDiv.style.top=iTop+"px";}oDiv["persist"]=p_bPersistent?true:false;}function hideOverlib(p_oDiv,e){var oDiv=p_oDiv?p_oDiv:getOverlibDiv(e,false);if(!oDiv){return;}oDiv.hide();oDiv.getContainer().style.zIndex=oDiv["containerZindex"];}function nd(e){var oDiv=getOverlibDiv(e,false);if(!oDiv){return;}var eLeavedObject=e.currentTarget;Position.prepare();if(e&&Position.withinIncludingScrolloffsets(oDiv,e.clientX,e.clientY)){return;}if(!(oDiv.getAttribute&&oDiv["persist"])||eLeavedObject==oDiv){hideOverlib(oDiv,e);}}function ndDiv(e){var oDiv=getOverlibDiv(e,false);var oNewOver=e.explicitOriginalTarget;if(oNewOver==oDiv||findParentByTagName(oNewOver,"div")==oDiv){return;}hideOverlib(oDiv,e);}function findParentByTagName(p_oNode,p_sTagNamePattern){if(null==p_oNode){return null;}var oElt=p_oNode;if(oElt.nodeName=="#text"){oElt=oElt.parentNode;}return $(oElt).findParentByTagName(p_sTagNamePattern);}function findChildById(p_oParentNode,p_sId,p_sTagName,p_bInRecusion){var oElt=p_oParentNode;if(oElt.documentElement){oElt=documentElement;}else{if(oElt.frames){oElt=oElt.document.documentElement;}}return oElt.findChildById(p_sId,p_sTagName);}function isContainer(p_oNode){return ODYCont.isContainer(p_oNode);}function findContainer(p_oNode){return ODYCont.findContainer(p_oNode);}function findContainee(p_oContainer,p_sNamePattern){if(p_oContainer.document||p_oContainer.tagName=="FRAMESET"){return findChildFrame(p_oContainer,p_sNamePattern);}try{var reg=new RegExp(p_sNamePattern,"g");for(var i=0,vChildren=p_oContainer.childNodes,l=vChildren.length;i<l;i++){var oChild=vChildren[i];if(oChild&&oChild.tagName=="DIV"&&ODYCont.isContainer(oChild)&&oChild.id.match(reg)){return oChild;}}(p_oContainer.select("div")||[]).each(function(oDiv){if(oDiv&&ODYCont.isContainer(oDiv)&&oDiv.id.match(reg)){return oDiv;}});}catch(e){alert("findContainee: "+p_oContainer+", "+e);}return null;}function findChildFrame(p_oParent,p_sNamePattern){var oParent=p_oParent;if(oParent.ownerDocument){oParent=oParent.ownerDocument;}if(oParent.defaultView){oParent=oParent.defaultView;}if(!oParent.frames){return;}var reg=new RegExp(p_sNamePattern,"g");for(var i=0,fl=oParent.frames.length;i<fl;i++){var oFrm=oParent.frames[i];if(oFrm.name.match(reg)){return oFrm;}}for(var i=0,fl=oParent.frames.length;i<fl;i++){var oFrm=findChildFrame(oParent.frames[i],p_sNamePattern);if(oFrm){return oFrm;}}return;}function findContainerById(p_sNameOrId,p_oRoot){if(p_sNameOrId=="parent"||p_sNameOrId=="_parent"){var oCaller=findFunctionCallerObject(findContainerById);var oCont=findContainer(oCaller);oCont=findContainer(oCont);}else{if(p_sNameOrId=="fiche.parent"){var oCaller=findFunctionCallerObject(findContainerById);var oCont=oCaller.getContainer().getContainer();oCont=getDivFiche(oCont);}else{oCont=findFrameOrElementById(p_sNameOrId,p_oRoot);}}if(oCont&&!ODYCont.isContainer(oCont)){throw"'"+p_sNameOrId+"' was found but is not identified as a container !";}return oCont;}function findFrameOrElementById(p_sNameOrId,p_oRoot){var oRoot=p_oRoot?p_oRoot:window;var oFrm=findChildFrame(oRoot,p_sNameOrId);if(oFrm){return oFrm.document.body;}var oDom=oRoot.tagName?oRoot.findChildById(p_sNameOrId):oRoot.document.getElementById(p_sNameOrId);if(oDom){return oDom;}if(oRoot.frames){for(var i=0,fl=oRoot.frames.length;i<fl;i++){var oFrm=oRoot.frames[i];oDom=findFrameOrElementById(p_sNameOrId,oFrm);if(oDom){return oDom;}}}return null;}Object.extend(Event,{retrieve:function(p_oFunction){var ev=window.event;if(ev){return ev;}try{var i=0;var oCaller=p_oFunction?p_oFunction.caller:arguments.callee;while(true&&i<20){i++;if(!oCaller){break;}if(oCaller.arguments&&oCaller.arguments[0]&&oCaller.arguments[0].originalTarget){return oCaller.arguments[0];}if(oCaller==oCaller.caller){break;}oCaller=oCaller.caller;}}catch(e){}return null;}});function findFunctionCallerObject(p_oFunction){var oCaller=p_oFunction?p_oFunction.caller:arguments.callee;var i=0;var oCal=window.event&&Event.element(window.event);if(oCal){return oCal;}try{while(true&&i<20){i++;if(!oCaller){break;}if(oCaller.arguments&&oCaller.arguments[0]&&oCaller.arguments[0].originalTarget){oCal=oCaller.arguments[0].originalTarget;if(!getClassName(oCal).match(/.*HTML.*/)){oCal=null;}break;}if(oCaller==oCaller.caller){break;}oCaller=oCaller.caller;}}catch(e){}return oCal;}function getElementLeft(eElement){if(!eElement&&this){eElement=this;}var DL_bIE=document.all?true:false;var nLeftPos=eElement.offsetLeft;var eParElement=eElement.offsetParent;while(eParElement!=null){if(DL_bIE){if((eParElement.tagName!="TABLE")&&(eParElement.tagName!="BODY")){nLeftPos+=eParElement.clientLeft;}}else{if(eParElement.tagName=="TABLE"){var nParBorder=parseInt(eParElement.border);if(isNaN(nParBorder)){var nParFrame=eParElement.getAttribute("frame");if(nParFrame!=null){nLeftPos+=1;}}else{if(nParBorder>0){nLeftPos+=nParBorder;}}}}nLeftPos+=eParElement.offsetLeft;eParElement=eParElement.offsetParent;}return nLeftPos;}function getElementTop(eElement){if(!eElement&&this){eElement=this;}var DL_bIE=document.all?true:false;var nTopPos=eElement.offsetTop;var eParElement=eElement.offsetParent;while(eParElement!=null&&!isContainer(eParElement)){if(DL_bIE){if((eParElement.tagName!="TABLE")&&(eParElement.tagName!="BODY")){nTopPos+=eParElement.clientTop;}}else{if(eParElement.tagName=="TABLE"){var nParBorder=parseInt(eParElement.border);if(isNaN(nParBorder)){var nParFrame=eParElement.getAttribute("frame");if(nParFrame!=null){nTopPos+=1;}}else{if(nParBorder>0){nTopPos+=nParBorder;}}}}nTopPos+=eParElement.offsetTop;eParElement=eParElement.offsetParent;}return nTopPos;}function showInputInfo(p_oInput){var s="DisplayItem ["+p_oInput.getDisplayItemId()+" - "+p_oInput.name+"]"+", Group ["+p_oInput.getAttribute("groupId")+"]"+", Tab ["+p_oInput.getAttribute("tabId")+"]"+", Display ["+p_oInput.getAttribute("dispId")+"]"+", tabIdx="+p_oInput.tabIndex+", Attribute ["+p_oInput.getAttributeId()+" - "+p_oInput.getAttribute("attributeName")+"]"+" : originValue="+p_oInput.getAttribute("originValue")+" : value="+p_oInput.value+", type="+p_oInput.type+", filter="+p_oInput.getAttribute("filter")+", cond="+p_oInput.getAttribute("cond")+", readonly="+(null!=p_oInput.getAttribute("readonly"));if("select-one"==p_oInput.type){s+=", nboptions="+p_oInput.options.length;s+=" :\n";for(var j=0;j<p_oInput.options.length;j++){s+="     "+p_oInput.options[j].value+" - "+p_oInput.options[j].text+"\n";}}if(p_oInput.oMask){s+=", mask="+p_oInput.oMask;}alert(s);}function getInputValue(p_oInput){if(!p_oInput){return;}if(p_oInput.length){for(var i=0;i<p_oInput.length;i++){if(p_oInput[i].checked){return p_oInput[i].value;}}}else{return p_oInput.value;}}function isArray(){if(typeof arguments[0]!="object"){return false;}var criterion=arguments[0].constructor.toString().match(/array/i);return(criterion!=null);}function addUrlParam(p_sUrl,p_sParam,p_sValue,p_bReplaceIfExist){var bParamExist=(null!=p_sUrl.match("(\\?|&)"+p_sParam+"="));if(bParamExist&&!p_bReplaceIfExist){return p_sUrl;}if(!bParamExist){return(p_sUrl+(-1==p_sUrl.indexOf("?")?"?":"&")+p_sParam+"="+escape(p_sValue));}var reg=new RegExp("((\\?|&)"+p_sParam+"=)[\\w\\.]*($|&)","g");return p_sUrl.replace(reg,"$1"+p_sValue+"$3");}function getUrlParam(p_sUrl,p_sParam,p_sValueIfNotPresent){var reg=new RegExp("(\\?|&)"+p_sParam+"=([\\w\\.]*)($|&)","g");var result=reg.exec(p_sUrl);var bParamExist=(null!=result);if(!bParamExist){return p_sValueIfNotPresent;}return result[2];}function isCssStylesheetLoaded(p_sUrl){var sCss=escape(p_sUrl);var vLinks=oCC.ownerDocument.styleSheets;var theCss;for(var i=0,l=vLinks.length;i<l;i++){var oLink=vLinks[i];if(!oLink.href||oLink.href.indexOf(sCss)==-1){continue;}theCss=oLink;break;}try{theCss.cssRules;return true;}catch(e){return false;}}function addCssStylesheet(p_sCss,p_sMedia,p_sVersion){var sCss=escape(p_sCss);if(p_sVersion){sCss=addUrlParam(sCss,"ver",p_sVersion,true);}var oHeadElt=document.getElementsByTagName("head")[0];var vLinks=oHeadElt.getElementsByTagName("link");for(var i=0,l=vLinks.length;i<l;i++){var oLink=vLinks[i];if(oLink.href&&oLink.href.indexOf(sCss)!=-1){return;}}if(document.createStyleSheet){document.createStyleSheet(p_sCss);}else{var newSS=document.createElement("link");newSS.rel="stylesheet";newSS.type="text/css";if(p_sMedia){newSS.media=p_sMedia;}newSS.href=sCss;oHeadElt.appendChild(newSS);}}function reloadCSS(p_sUrl,p_sVersion){var sUrl=escape(p_sUrl);var oHeadElt=document.getElementsByTagName("head")[0];var oCSS;(oHeadElt.select("link")||[]).each(function(oLink){if(!oLink||!oLink.href||""==oLink.href||oLink.href.indexOf(sUrl)==-1){return;}oCSS=oLink;});if(oCSS){var sMedia=oCSS.media;oHeadElt.removeChild(oCSS);addCssStylesheet(p_sUrl,sMedia,p_sVersion);}}function addJS(p_sUrl,p_sOnLoadExpr,p_sVersion){var sUrl=p_sUrl.indexOf("://")==-1?escape(p_sUrl):p_sUrl;if(p_sVersion){sUrl=addUrlParam(sUrl,"ver",p_sVersion,true);}var oHeadElt=document.getElementsByTagName("head")[0];var bExist=false;(oHeadElt.select("script")||[]).each(function(oScript){if(oScript&&oScript.src&&oScript.src.indexOf(sUrl)!=-1){bExist=true;}});if(bExist){return;}var newJS=document.createElement("script");newJS.src=sUrl;newJS.type="text/javascript";if(p_sOnLoadExpr){newJS.onload=function(){eval(p_sOnLoadExpr);};}oHeadElt.appendChild(newJS);}function reloadJS(p_sUrl,p_sVersion){var sUrl=escape(p_sUrl);var oHeadElt=document.getElementsByTagName("head")[0];var oS;(oHeadElt.select("script")||[]).each(function(oScript){if(!oScript||!oScript.src||""==oScript.src||oScript.src.indexOf(sUrl)==-1){return;}oS=oScript;});if(oS){oHeadElt.removeChild(oS);addJS(p_sUrl,null,p_sVersion);}}function addCssStyle(p_oElem,p_sStyle){var sStyle=p_oElem.className;var sNewStyle=(sStyle||"").addItemToList(" ",p_sStyle);p_oElem.className=sNewStyle;return sNewStyle!=sStyle;}function removeCssStyle(p_oElem,p_sStyle){var sStyle=p_oElem.className;var sNewStyle=(sStyle||"").removeItemFromList(" ",p_sStyle);p_oElem.className=sNewStyle;return sNewStyle!=sStyle;}function decodeFrameDesig(p_oCallee,p_sFrmDesig){var oTgt=$O2(p_sFrmDesig);if(oTgt){return oTgt;}var oCont=p_oCallee?findContainer(p_oCallee):null;if(!p_sFrmDesig){oTgt=oCont;}if("parent"==p_sFrmDesig||"_parent"==p_sFrmDesig){if(null==oCont){throw"Can't navigate to 'parent' container inside a callback";}oTgt=findContainer(oCont);p_sFrmDesig=null;}else{if("fiche.parent"==p_sFrmDesig){if(null==oCont){throw"Can't navigate to 'fiche.parent' container inside a callback";}oTgt=oCont.getContainer().getDivFiche();p_sFrmDesig=null;}else{if("fiche"==p_sFrmDesig){if(null==oCont){throw"Can't navigate to 'fiche' container inside a callback";}oTgt=oCont.getDivFiche();p_sFrmDesig=null;}}}return oTgt;}function checkedNavigateIfNoError(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,p_sFollowingExpr,p_oOF){try{if(!ODYForm.checkUnsavedModif()){return false;}}catch(e){if(isDef("sDbg")){alert(e);}}var oCont=$O2(p_oFrmIdOrObj);if(oCont){oCont.showLoading();}return navigateIfNoError(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,p_sFollowingExpr,p_oOF);}function navigateIfNoError(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,p_sFollowingExprOrStep,p_oOF){var oRep=navigate(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,"ifNoError");var sClass=getClassName(oRep);if(oRep&&sClass.indexOf("DOMElement")!=-1){var vErrList=oRep.selectNodeSet("//errorl/formError[@level='ERROR']");if(!vErrList||vErrList.length==0){vErrList=oRep.selectNodeSet("//data/error");}var bHasError=(vErrList.length>0);var vWarningList=oRep.selectNodeSet("//errorl/formError[@level='WARNING']");var bHasWarning=(vWarningList.length>0);var vMsgList=oRep.selectNodeSet("//errorl/formError");var bHasMsg=bHasError||(vMsgList.length>0);}var sFollowing=p_sFollowingExprOrStep;if(/^\d+(:[\w_]*)?$/.test(sFollowing)){var ms=String(sFollowing).split(/:/);var iStep=ms[0];var sFrm=(/.*:$/.test(sFollowing))?"":ms[1];if(null==sFrm){sFrm=p_oFrmIdOrObj;}sFollowing="navigate('"+p_sUrl+"',"+iStep+",'"+sFrm+"')";}if(bHasMsg){var sFollow=bHasError?null:sFollowing;var oCont;if(p_oOF){oCont=p_oOF.getContainer();p_oOF.setRunningResponse(oRep);}if(!oCont){var oCallee=findFunctionCallerObject();oCont=oCallee?oCallee.getContainer():null;}if(!oCont){oCont=$O2("edi");}if(!oCont){oCont=window.document.body;}if(!oCont){if(bAdmin){alert("navigateIfNoError : pas de container trouvé : window.body="+window.document.body+".");}return false;}ODYForm.doShowErrors(ODYForm.buildErrorsArray(oRep,p_oOF),oCont,sFollow);return false;}if(p_sFollowingExprOrStep&&oRep){try{eval(sFollowing);}catch(e){if(bAdmin){alert(e);}throw e;}}return oRep;}function checkedNavigate(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,p_bNoDisplay){try{if(!ODYForm.checkUnsavedModif()){return false;}}catch(e){if(isDef("sDbg")){alert(e);}}return navigate(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,p_bNoDisplay);}function navigate(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,p_bNoDisplay){var oTgt;var sFrm;var bNavIfNoErr=("ifNoError"==p_bNoDisplay);var bNoDisplay=p_bNoDisplay;if(bNavIfNoErr){bNoDisplay=p_oFrmIdOrObj&&p_oFrmIdOrObj.match(/js:.*/);}try{var bNewWin=false;if(typeof(p_oFrmIdOrObj)=="object"&&p_oFrmIdOrObj!=null){oTgt=p_oFrmIdOrObj;}else{sFrm=p_oFrmIdOrObj;var sFrmFromUrl=getUrlParam(p_sUrl,"frm");if(!sFrm&&sFrmFromUrl){sFrm=sFrmFromUrl;}var oTgt=document.getElementById(sFrm);if(!sFrm){oTgt=window;}if(!oTgt&&("parent"==sFrm||"_parent"==sFrm||"fiche.parent"==sFrm)){var oCallee=findFunctionCallerObject();oTgt=decodeFrameDesig(oCallee,sFrm);sFrm=null;}if(!bNoDisplay){var oParent=window;while(!oTgt&&oParent!=oParent.parent){oParent=oParent.parent;oTgt=oParent.document.getElementById(sFrm);if(!oTgt){oTgt=findChildFrame(oParent,sFrm);}}if(!oTgt){bNewWin=true;}}else{if(oTgt){sFrm=oTgt.id;}if(sFrm.length<3||sFrm.substring(0,3)!="js:"){sFrm="js:"+sFrm;}}}var sUrl=p_sUrl;if(oTgt&&oTgt.contentWindow){oTgt=oTgt.contentWindow;}var bTgtIsWindow=(oTgt&&typeof(oTgt.status)=="string");if(!bNoDisplay){if(!bTgtIsWindow){if(!sFrm){sFrm=oTgt.id;}if(!sFrm){sFrm=oTgt.name;}}sUrl=addUrlParam(sUrl,"frm",sFrm,true);}if(p_iStep!=0&&!p_iStep){p_iStep=getUrlParam(p_sUrl,"step");}if(bNoDisplay||bNavIfNoErr){var oResult=sendRequest(sUrl,p_iStep,sFrm,p_sSubmit,null);if(!bNavIfNoErr){return oResult;}if(oResult==false){return oResult;}try{var xDoc=getDocElement(oResult);if(xDoc){return xDoc;}}catch(e){}}if(bNewWin){oTgt=window.open("/com/blank.htm",p_oFrmIdOrObj);bTgtIsWindow=true;}var oNav=new ODYNavigation(oTgt,p_iStep,sUrl,p_sSubmit);ODYNavigation.record(oNav);if(bNavIfNoErr){doDisplayInId(oTgt,oResult);if(typeof(oResult)=="string"&&oResult.indexOf('id="errorPage"')!=-1){return false;}}else{if(bTgtIsWindow){if(-1!=p_iStep){sUrl=addUrlParam(sUrl,"step",p_iStep,true);}if(p_sSubmit){throw"Submitted data not handled when not in div";}oTgt.document.location.href=sUrl;}else{display(oTgt,p_iStep,sUrl,p_sSubmit);}}}catch(e){if(bAdmin){alert(e);}}return oTgt;}function navigateWithProgress(p_sUrl,p_iStep,p_oFrmIdOrObj,p_sSubmit,p_sFollowingExpr){if(!p_oFrmIdOrObj){throw"navigateWithProgress : IllegalArgument : Pas de frame indiquée : p_oFrmIdOrObj='"+p_oFrmIdOrObj+"'";}if(!p_iStep){throw"navigateWithProgress : IllegalArgument : Pas de step indiqué : p_iStep='"+p_iStep+"'";}var sFrm;if(typeof(p_oFrmIdOrObj)=="object"){sFrm=p_oFrmIdOrObj.id;}else{sFrm=p_oFrmIdOrObj;var oTgt=document.getElementById(sFrm);var oCallee=findFunctionCallerObject();if(!oTgt&&("parent"==sFrm||"_parent"==sFrm||"fiche.parent"==sFrm)){oTgt=decodeFrameDesig(oCallee,sFrm);sFrm=null;}}var sUrl=p_sUrl;if(!sFrm){sFrm=oTgt.id;}if(!sFrm){sFrm=oTgt.name;}sUrl=addUrlParam(sUrl,"frm",sFrm,true);updateProgress(sFrm,3000,sUrl,p_iStep,p_sSubmit,p_sFollowingExpr.escapeJS("'"));return oTgt;}function updateProgress(p_sSpanId,p_iReloadIntervalMs,p_sUrl,p_iStep,p_sSubmit,p_sFollowingExpr){var oSpan=$O2(p_sSpanId);if(!oSpan){return;}if(!p_sUrl){p_sUrl="/requester/request.svt";}if(!p_iStep){p_iStep="31";}var sUrl=addUrlParam(p_sUrl,"ns","1");var sExpr="displayProgress(sResponse,'"+p_sSpanId+"',"+p_iReloadIntervalMs+",'"+sUrl+"','"+p_iStep+"','"+p_sSubmit+"','"+p_sFollowingExpr+"')";if(p_sSpanId.indexOf("prog_")==0){p_sSpanId=oSpan.getContainer().id;}try{sendRequest(p_sUrl,p_iStep,p_sSpanId,p_sSubmit,sExpr);}catch(e){throw e;}}function displayProgress(p_sXml,p_sSpanId,p_iReloadIntervalMs,p_sUrl,p_iStep,p_sSubmit,p_sFollowingExpr){var oSpan=$O2(p_sSpanId);if(!oSpan){return;}var xDoc=getDocElement(p_sXml);var vErrList=xDoc.selectNodeSet("//errorl/formError[@level='ERROR']");if(vErrList&&vErrList.length>0){ODYForm.doShowErrors(ODYForm.buildErrorsArray(xDoc,null),oSpan,null);return;}var sIndicSN=p_sSpanId.substring(5);var xProg=xDoc.selectNodeSet("//indicator[@sn='"+sIndicSN+"']/progress").item(0);if(null==xProg){xProg=xDoc.selectNodeSet("//actionProgress/progress").item(0);}if(null==xProg){if(p_sSpanId.indexOf("prog_")==0){if(oSpan&&oSpan.isValid()){oSpan.getContainer().reload();}return;}var xCount=xDoc.selectNodeSet("//indicator[@sn='"+sIndicSN+"']/count").item(0);if(null==xCount){xCount=xDoc.selectNodeSet("//actionProgress/count").item(0);}if(null==xCount){return;}var iNbEnregOk=xCount.getAttribute("nbEnregOk");var oMsgDiv="Tout s'est bien passé : "+iNbEnregOk+" enregistrement(s) traité(s)";ODYForm.doShowEndAction(oSpan,oMsgDiv,eval(p_sFollowingExpr));return;}var iCur=xProg.getAttribute("cur");var iTot=xProg.getAttribute("tot");var iProg=Math.round(xProg.getFirstChild().getNodeValue()*100)/100;var sPanInnerHtml=iCur+" / "+iTot+" ("+iProg+"%) (<a href=\"#\" onclick=\"eval(getContainer().getAttribute('reloadCmd').replace(/30/,'32'))\">stop</a>)"+'&#160;<img src="/portail/img/indicator_tiny_red.gif" alt="Working..."/>';if(p_sSpanId.indexOf("prog_")==0){oSpan.innerHTML=sPanInnerHtml;}else{ODYForm.doShowWaiting(oSpan,sPanInnerHtml);}var iInt=p_iReloadIntervalMs;if(p_iReloadIntervalMs&&iInt<1000){iInt=1000;}if(p_sSpanId.indexOf("prog_")==0){if(p_iReloadIntervalMs){updateProgress.delay((p_iReloadIntervalMs/1000),p_sSpanId,p_iReloadIntervalMs,p_sUrl,p_iStep,p_sSubmit,p_sFollowingExpr.replace(/'/g,"\\'"));}}else{if(p_iReloadIntervalMs){updateProgress.delay(2,p_sSpanId,p_iReloadIntervalMs,p_sUrl,p_iStep,p_sSubmit,p_sFollowingExpr.replace(/'/g,"\\'"));}}}function showAlert(p_sAlertMsg,p_sTimeBeforeRestart){var oDiv=$O2("msgsystem");if(!oDiv){return;}var sMsg=p_sAlertMsg;if(p_sTimeBeforeRestart){sMsg+=p_sTimeBeforeRestart;}oDiv.findChildById("contenumsg","div").innerHTML=sMsg;oDiv.style.display="block";}function navWithIndicator(p_oClickedButton,p_sExpr){if(p_oClickedButton.clicked==1){alert("Merci de patienter quelques instants, votre demande est en cours de traitement.");return false;}p_oClickedButton.clicked=1;var oCancelButton=p_oClickedButton.findBrotherById("stop","a");if(oCancelButton){oCancelButton.style.display="none";}$O2("indicator").style.display="";var sFunc="doNavWithIndicator('"+p_oClickedButton.id+"','"+String(p_sExpr).escapeJS("'")+"')";setTimeout(sFunc,100);return false;}function doNavWithIndicator(p_sClickedButtonId,p_sExpr){try{var ev=Event.retrieve(doNavWithIndicator);eval(p_sExpr);}catch(e){if(bAdmin){alert(e);}throw e;}finally{var oBtn=$O2(p_sClickedButtonId);if(oBtn){oBtn.clicked=0;}var oIndic=$O2("indicator");if(oIndic){oIndic.style.display="none";}}}ODYNavigation=function(oTgt,p_iStep,sUrl,p_sSubmit){this.m_iTS=new Date().getTime();this.m_iIdx;this.m_oTargetContainer=oTgt;this.m_iStep=p_iStep;this.m_sUrl=sUrl;this.m_sSubmit=p_sSubmit;this.m_bValid=true;};ODYNavigation.maxHistory=50;ODYNavigation.record=function(p_oNav,p_bIsRewind){var sFrm=p_oNav.m_oTargetContainer.id;if(sFrm&&sFrm.indexOf("task_contenu")!=-1){return;}var oPrev=ODYNavigation.getHistory(1);p_oNav.m_iIdx=oPrev?oPrev.m_iIdx+1:0;var moHist=ODYNavigation.prototype.history;moHist.push(p_oNav);if(moHist.length>ODYNavigation.maxHistory){moHist.splice(0,1);}if(!p_bIsRewind){ODYNavigation.pushIfRequired(p_oNav);}};ODYNavigation.pushIfRequired=function(p_oNav){var bIsEdit=p_oNav.m_sUrl.indexOf("/edit.svt")==0;var bIsSearch=p_oNav.m_sUrl.indexOf("/query.svt")==0;var iStep=p_oNav.m_iStep;if(!p_oNav.m_oTargetContainer||!p_oNav.m_oTargetContainer.id){return;}var sFrm=p_oNav.m_oTargetContainer.id;if((bIsEdit&&(iStep==6||iStep==40||iStep==70||iStep==71||iStep==75||iStep==85||iStep==98||iStep==99))||(bIsSearch&&(iStep==30||iStep==70))||sFrm.indexOf("wizard")!=-1||sFrm.indexOf("if_")==0||sFrm.indexOf("ifa_")==0||sFrm.indexOf("annuaire")==0||sFrm.indexOf("task_contenu")!=-1){return;}if(bIsEdit&&iStep==25){p_oNav.m_iStep=10;p_oNav.m_bValid=false;}var moStack=ODYNavigation.prototype.stack;moStack.push(p_oNav);if(moStack.length>ODYNavigation.maxHistory){moStack.splice(0,1);}};ODYNavigation.setIdOfLastEntity=function(p_iId,p_iETId){var moStack=ODYNavigation.prototype.stack;var oEditionNav=moStack[moStack.length-1];if(oEditionNav.m_bValid){return;}oEditionNav.m_sUrl+="&eid="+p_iId+"&etid="+p_iETId;oEditionNav.m_bValid=true;};ODYNavigation.contextBack=function(p_bIsSaveAction){var moStack=ODYNavigation.prototype.stack;var oCurNav=moStack.pop();var bIsEdit=oCurNav.m_sUrl.indexOf("/edit.svt")==0;var bIsSearch=oCurNav.m_sUrl.indexOf("/query.svt")==0;var iStep=oCurNav.m_iStep;var sFrm=oCurNav.m_oTargetContainer.id;if(p_bIsSaveAction&&bIsEdit&&95==iStep){moStack.pop();}var oTargetNav=moStack[moStack.length-1];while(!oTargetNav||!oTargetNav.m_bValid){if(!oTargetNav){oTargetNav=new ODYNavigation();oTargetNav.m_oTargetContainer=oCurNav.m_oTargetContainer;oTargetNav.m_iStep=0;oTargetNav.m_sUrl=sAccueil;break;}moStack.pop();oTargetNav=moStack[moStack.length-1];}var oCurCont=oCurNav.m_oTargetContainer;var oTargetCont=oTargetNav.m_oTargetContainer;ODYNavigation.record(oTargetNav,true);if(oCurCont==oTargetCont){return oTargetNav.display();}else{oCurNav.m_oTargetContainer.hide();}return oTargetNav;};ODYNavigation.findContextByContainer=function(p_oCont){var moStack=ODYNavigation.prototype.stack;for(var i=moStack.length-1;i>=0;i--){if(moStack[i].m_oTargetContainer==p_oCont){return moStack[i];}}};ODYNavigation.back=function(p_iStepBack){var oCurNav=ODYNavigation.prototype.history.pop();if(!oCurNav){history.back();return;}var iStepBack=p_iStepBack?p_iStepBack:1;for(var i=0;i<iStepBack;i++){var oTargetNav=ODYNavigation.prototype.history.pop();}var oCurCont=oCurNav.m_oTargetContainer;var oTargetCont=oTargetNav.m_oTargetContainer;if(oCurCont==oTargetCont){return oTargetNav.display();}else{oCurNav.m_oTargetContainer.hide();}return oTargetNav;};ODYNavigation.getHistory=function(p_iStepBack){if(!ODYNavigation.prototype.history||ODYNavigation.prototype.history.length<p_iStepBack){return;}return ODYNavigation.prototype.history[ODYNavigation.prototype.history.length-p_iStepBack];};ODYNavigation.prototype={history:[],stack:[],display:function(){display(this.m_oTargetContainer,this.m_iStep,this.m_sUrl,this.m_sSubmit);return this.m_oTargetContainer;}};ODYContPosition=function(p_iLeft,p_iTop,p_iWidth,p_iHeight){this.m_iLeft=p_iLeft&&typeof(p_iLeft)!="number"?p_iLeft.replace(/px/,""):p_iLeft;this.m_iTop=p_iTop&&typeof(p_iTop)!="number"?p_iTop.replace(/px/,""):p_iTop;this.m_iWidth=p_iWidth&&typeof(p_iWidth)!="number"?p_iWidth.replace(/px/,""):p_iWidth;this.m_iHeight=p_iHeight&&typeof(p_iHeight)!="number"?p_iHeight.replace(/px/,""):p_iHeight;};ODYContPosition.HIDDEN=new ODYContPosition(0,0,0,0);ODYContPosition.prototype.apply=function(p_oDOMElt){p_oDOMElt.style.width=this.m_iWidth+"px";p_oDOMElt.style.height=this.m_iHeight+"px";p_oDOMElt.style.left=this.m_iLeft+"px";p_oDOMElt.style.top=this.m_iTop+"px";};var ODYCont=new Object();ODYCont.sATTR_CONT="container";ODYCont.sATTR_LOADED="bLoaded";ODYCont.create=function(p_sId){var oDiv=document.createElement("div");ODYCont.makeCont(oDiv);oDiv.id=p_sId;oDiv.name=p_sId;return oDiv;};ODYCont.makeCont=function(oDiv){Object.extend(oDiv,ODYContUtils);return oDiv;};ODYCont.isContainer=function(p_oDOMCont){if(p_oDOMCont.m_bContainer){return true;}if(p_oDOMCont.tagName=="BODY"){return true;}if(p_oDOMCont.getAttribute&&p_oDOMCont.getAttribute(ODYCont.sATTR_CONT)=="true"){return true;}return false;};ODYCont.findContainer=ODYCont.findContainerOfElement=function(p_oNode){var oCont=p_oNode;if(oCont.tagName=="HTML"||oCont.tagName=="BODY"){oCont=oCont.ownerDocument;}if(oCont.nodeName=="#document"){oCont=(null!=oCont.defaultView)?oCont.defaultView:oCont.parentWindow;}if(oCont.parent){if(oCont.parent!=oCont){return $(oCont.parent.document.body);}else{return null;}}while(oCont){oCont=findParentByTagName(oCont,"DIV|BODY");if(!oCont){return;}if(oCont.documentElement){return $(oCont.body);}if(oCont.tagName=="HTML"){return $(oCont.lastChild);}if(ODYCont.isContainer(oCont)){return $(oCont);}}return null;};ODYCont.findContainerByTs=function(p_iTS){var oTs=$O2(p_iTS);if(!oTs){return null;}return oTs.getContainer();};var ODYContUtils={m_bContainer:true,getParentContainer:function(){return ODYCont.findContainer(this);},hide:function(){this.style.display="none";var moConts=this.findChildContainerByPattern(".*");for(var i=0,l=moConts.length;i<l;i++){var oDiv=moConts[i];if(oDiv.id&&oDiv.isContainer()){oDiv.style.visibility="";}}},showContainer:function(p_sStyle,p_iZIndex){var sStyle=p_sStyle?p_sStyle:"block";this.style.visibility="visible";this.style.display=sStyle;var moConts=this.findChildContainerByPattern(".*");for(var i=0,l=moConts.length;i<l;i++){var oDiv=moConts[i];if(oDiv.id&&oDiv.isContainer()&&oDiv.id!="alerte"&&!oDiv.id.match(/calt_.*/)){oDiv.show();}}},minimize:function(){this.m_oMinimized.apply(this);this.m_bMinimized=true;},initMaxSize:function(p_oDOMViewport){var sPosiStyle=p_oDOMViewport.getStyle("position");this.m_oMaximized=new ODYContPosition(sPosiStyle=="absolute"?0:p_oDOMViewport.offsetLeft,sPosiStyle=="absolute"?0:getElementTop(p_oDOMViewport),p_oDOMViewport.clientWidth-1,p_oDOMViewport.clientHeight);},maximize:function(){if(!this.m_oMaximized){this.initMaxSize(this.getParentContainer());}this.m_oMaximized.apply(this);this.m_bMinimized=false;},isContainer:function(){return ODYCont.isContainer(this);},isLoaded:function(){if(this.tagName=="DIV"){return"true"==this.getAttribute(ODYCont.sATTR_LOADED);}else{return"true"==this.bLoaded;}},setLoading:function(p_sMsg){var oFondDiv=ODYForm.getFondGrisDiv(this);if(oFondDiv){oFondDiv.show();}addCssStyle(this,"loading");this.style.cursor="wait";if(this.tagName=="DIV"){this.setAttribute(ODYCont.sATTR_LOADED,"false");}else{this.bLoaded="false";}},unsetLoading:function(){removeCssStyle(this,"loading");var oFondDiv=ODYForm.getFondGrisDiv(this);oFondDiv.hide();this.style.cursor="auto";if(this.tagName=="DIV"){this.removeAttribute(ODYCont.sATTR_LOADED);}else{delete this.bLoaded;}},setLoaded:function(){removeCssStyle(this,"loading");this.style.cursor="auto";if(this.tagName=="DIV"){this.setAttribute(ODYCont.sATTR_LOADED,"true");}else{this.bLoaded="true";}},isLoading:function(){if(this.tagName=="DIV"){return"false"==this.getAttribute(ODYCont.sATTR_LOADED);}else{return"false"==this.bLoaded;}},reload:function(p_iDelay){var sCmd=this.getAttribute("reloadCmd");if(p_iDelay){window.setTimeout(sCmd,p_iDelay);}else{eval(sCmd);}},showLoading:function(){this.setLoading();if("edi"==this.id&&!this.visible()){this.show();}var sHTML='<center style="position:relative;top:40%">En cours de chargement<br>'+'<img src="/com/img/progressbar_green.gif"></center>';if(false){sHTML+='<div id="oClock"></div><script language="javascript">clock("",new Date());<\/script>';}this.innerHTML=sHTML;},findChildContainerByPattern:function(p_sPattern){var reg=new RegExp(p_sPattern,"gi");var moDivs=this.getElementsByTagName("div");for(var i=0,matchingDivs=[],length=moDivs.length;i<length;i++){var oDiv=moDivs[i];if(oDiv.id&&oDiv.m_bContainer&&oDiv.id.match(reg)){matchingDivs.push(Element.extend(oDiv));}}return matchingDivs;},createSubContainer:function(p_sId,p_sCSS,p_sLoadedState,p_sStyle){var oDiv=ODYCont.create(p_sId);if(p_sCSS){oDiv.className=p_sCSS;}if(p_sStyle){oDiv.setStyle(p_sStyle);}var zi=this.style.zIndex;if(zi){oDiv.style.zIndex=zi*1+5;}if(p_sLoadedState){oDiv.setAttribute(ODYCont.sATTR_LOADED,p_sLoadedState);}else{oDiv.removeAttribute(ODYCont.sATTR_LOADED);}if(this.contentDocument){this.contentDocument.body.appendChild(oDiv);}else{this.appendChild(oDiv);}return oDiv;},getDivFiche:function(){var oDivFiche=this["fiche"];if(oDivFiche&&oDivFiche.isValid()){return oDivFiche;}oDivFiche=document.createElement("div");this["fiche"]=oDivFiche;var sTS=this["ts"];var sId="fiche."+sTS;oDivFiche.setAttribute("class","fiche");oDivFiche.setAttribute("id",sId);this.appendChild(oDivFiche);ODYCont.makeCont(oDivFiche);return oDivFiche;},showFiche:function(p_sUrl,p_iStep){var oFiche=this.getDivFiche();oFiche.show();oFiche.maximize();navigate(p_sUrl,p_iStep,oFiche);},hideFiche:function(p_bRefreshParent){var oFiche=this.getDivFiche();oFiche.hide();if(p_bRefreshParent){var sOwner=oFiche.getAttribute("owner");if(sOwner){if(oDoc.getElementById("pbShow"+sOwner)){oDoc.getElementById("pbShow"+sOwner).onclick();}}else{this.reload();}}var oMainCont=this;var oFrmBut=oMainCont.findChildContainerByPattern("(.*)?but(.*)?")[0];if(oFrmBut){if(!oFrmBut.visible()){oFrmBut.maximize();}var oFrmTabs=oMainCont.findChildContainerByPattern("(.*)?tabs(.*)?|edit")[0];if(oFrmTabs&&!oFrmTabs.visible()){oFrmTabs.maximize();}}}};function doBreak(p_oArg){var a=p_oArg;}function clock(p_sClockId,p_iBaseTime){var MyClock=new Date()-new Date(p_iBaseTime);var hours=MyClock.getHours();var minutes=MyClock.getMinutes();var seconds=MyClock.getSeconds();var sHour=hours+" h "+minutes+" : "+seconds;document.getElementById(p_sClockId).innerHTML=sHour;setTimeout("clock('"+p_sClockId+"','"+p_iBaseTime+"')",500);}function getScrollerWidth(){if(iSCROLLER_WIDTH){return iSCROLLER_WIDTH;}var scr=document.createElement("div");scr.style.position="absolute";scr.style.top="-1000px";scr.style.left="-1000px";scr.style.width="100px";scr.style.height="50px";scr.style.overflow="hidden";var inn=document.createElement("div");inn.style.width="100%";inn.style.height="200px";scr.appendChild(inn);document.body.appendChild(scr);var wNoScroll=inn.offsetWidth;scr.style.overflow="auto";var wScroll=inn.offsetWidth;document.body.removeChild(document.body.lastChild);iSCROLLER_WIDTH=(wNoScroll-wScroll);return iSCROLLER_WIDTH;}function o2Cal(p_oAnchor,p_sInputName){var oInput=p_oAnchor.findBrotherById(p_sInputName);var oCal=getCalendar("cal"+p_sInputName);if(oCal.displayType=="date"||oCal.displayType=="week-end"){oCal.select(oInput,"imgCal"+p_sInputName,"dd/MM/yyyy");}else{if(oCal.displayType=="month"){oCal.select(oInput,"imgCal"+p_sInputName,"MM/yyyy");}else{oCal.showCalendar("imgCal"+p_sInputName);}}}function getCal(p_oElt){return p_oElt.getContainer()["oCal"];}var DOM_VER="$Revision: 1.26 $";var ElementUtils={isValid:function(element){var oDoc=element.ownerDocument;var oParent=element;while(oParent.parentNode){oParent=oParent.parentNode;}return(oParent==oDoc);},getContainer:function(element){return ODYCont.findContainer(element);},findDirectChildById:function(element,p_sId){return findDirectChildByExpr("#"+p_sId);},findDirectChildByExpr:function(element,p_sExpr){return element.childElements().find(function(s){return s.match(p_sExpr);});},findChildById:function(element,p_sId,p_sTagName,p_bInRecusion){if(p_sId==element.id){return $(element);}var oNode=element;var oDoc=oNode.ownerDocument;var oFirstFound=oDoc.getElementById(p_sId);if(!oFirstFound){return;}var oParent=oFirstFound;do{oParent=oParent.parentNode;if(oParent==oNode){return $(oFirstFound);}}while(oParent!=oDoc);var bRecursive=!p_sTagName;var nodes=p_sTagName?oNode.getElementsByTagName(p_sTagName):oNode.childNodes;var oResult;for(var i=0,l=nodes.length;i<l;i++){var oDOM=nodes[i];if(oDOM.nodeType!=1){continue;}if(oDOM.id==p_sId){oResult=oDOM;break;}}if(Prototype.Browser.IE){return $O2(oResult);}if(!oResult&&bRecursive){for(var i=0,l=nodes.length;i<l;i++){var oDOM=nodes[i];if(oDOM.nodeType!=1){continue;}var oDOMc=oDOM.findChildById(p_sId,p_sTagName,true);if(oDOMc){oResult=oDOMc;break;}}}return $O2(oResult);},findBrotherById:function(element,p_sId,p_sTag){return element.getContainer().findChildById(p_sId,p_sTag,true);},findParentById:function(element,p_sId){var oDOM=element;while(oDOM.parentNode&&oDOM.parentNode!=oDOM){oDOM=oDOM.parentNode;if(oDOM.id&&oDOM.id==p_sId){return oDOM;}}return;},findParentByTagName:function(element,p_sTagNamePattern){var reg=new RegExp(p_sTagNamePattern,"gi");var oDOM=element;while(oDOM.parentNode&&oDOM.parentNode!=oDOM){oDOM=oDOM.parentNode;if(oDOM.tagName&&oDOM.tagName.match(reg)){return oDOM;}}return;},findBrotherByDispiId:function(element,p_sId){var oNode=element.getContainer();return oNode.findChildByDispiId(p_sId);},findChildByDispiId:function(element,p_sId,p_sTag){var nodes=p_sTag?element.getElementsByTagName(p_sTag):element.childNodes;var oResult;for(var i=0,l=nodes.length;i<l;i++){var oDOM=nodes[i];if(oDOM.nodeType!=1){continue;}if(oDOM.getDisplayItemId()==p_sId){return oDOM;}var oDOMc=oDOM.findChildByDispiId(p_sId,p_sTag);if(oDOMc){return oDOMc;}}return;},getAttributeId:function(element){return element.getAttribute("attributeId");},getAttributeName:function(element){return element.getAttribute("attributename");},getDataItemId:function(element){return element.getAttribute("dataItemId");},getDisplayId:function(element){return element.getAttribute("dispId");},getDisplayItemId:function(element){return element.getAttribute("dispiId");},getCondition:function(element){return element.getAttribute("cond");},getLinketETId:function(element){return element.getAttribute("linkETId");},getLastSearched:function(element){return element.getAttribute("lastSearched");},setLastSearched:function(element,p_s){return element.setAttribute("lastSearched",p_s);},listenTo:function(element,name,observer,useCapture){if(!element.listeners){element.listeners=[];}element.listeners.push([name,observer,useCapture]);Event.observe(element,name,observer);},removeListeners:function(element,name){if(!element.listeners){return;}var moList=[];for(var i=0,l=element.listeners.length;i<l;i++){var moL=element.listeners[i];if(moL[0]!=name){moList.push(moL);continue;}var observer=moL[1];Event.stopObserving(element,name,observer);}element.listeners=moList.length>0?moList:false;},clearListeners:function(element){if(!element.listeners){return;}for(var i=0,l=element.listeners.length;i<l;i++){var moL=element.listeners[i];var name=moL[0];var observer=moL[1];Event.stopObserving(element,name,observer);}element.listeners=false;},show:function(element,p_sStyle,p_iZIndex){var oE=$O2(element);var sStyle=p_sStyle?p_sStyle:"block";if(p_sStyle||oE.getStyle("display")=="none"){oE.style.display=sStyle;}if(p_iZIndex){element.style.zIndex=p_iZIndex;}if(element.m_bContainer){element.showContainer(p_sStyle,p_iZIndex);}return element;},offsetFrom:function(element,ancestor){var valueT=0,valueL=0;var oAncestorOffset=ancestor.cumulativeOffset();var oEltOffset=element.viewportOffset();return Element._returnOffset(oEltOffset.left-oAncestorOffset.left,oEltOffset.top-oAncestorOffset.top);},offsetFromIncludingScroll:function(element,ancestor){var oEltOffset=element.offsetFrom(ancestor);return Element._returnOffset(oEltOffset.left+ancestor.scrollLeft,oEltOffset.top+ancestor.scrollTop);},scrollToShowOnTop:function(element){var oE=$O2(element);var oScrollable=oE.parentNode;var sScrolableStyle=oE.ownerDocument.defaultView.getComputedStyle(oScrollable,null)["overflowY"];while(oScrollable&&oScrollable!=oScrollable.parentNode&&sScrolableStyle!="auto"&&sScrolableStyle!="scroll"){oScrollable=oScrollable.parentNode;sScrolableStyle=oE.ownerDocument.defaultView.getComputedStyle(oScrollable,null)["overflowY"];}var iScrollTop=oE.offsetTop-oScrollable.offsetTop;if(iScrollTop>(oScrollable.scrollHeight-oScrollable.clientHeight)){var xLastElt=oScrollable.lastChild;while(!xLastElt.tagName||!xLastElt.visible()){xLastElt=xLastElt.previousSibling;}var iMB=xLastElt.style.marginBottom?parseInt(xLastElt.style.marginBottom):0;xLastElt.style.marginBottom=(iMB+(oScrollable.clientHeight-(oScrollable.scrollHeight-iScrollTop)))+"px";}oScrollable.scrollTop=(oE.offsetTop-oScrollable.offsetTop);return element;}};Element.addMethods(ElementUtils);O2Exception=function(p_sMsg){this.m_sMsg=p_sMsg;};O2Exception.sREDIRECT_MSG="Vous allez être redirigé vers la page d'accueil.";O2Exception.iMaxErrorNb=20;O2Exception.msErrorStack=new Array();O2Exception.recordError=function(p_sErrMsg){if(O2Exception.msErrorStack.length>O2Exception.iMaxErrorNb){O2Exception.msErrorStack.shift();}O2Exception.msErrorStack.push(p_sErrMsg);};O2Exception.errorToStr=function(p_oErr){if(!p_oErr){return"";}return"Error : "+"\n\t Class = "+(getClassName(p_oErr)||"<not an object>")+"\n\t Code  = "+(p_oErr.code||"-")+"\n\t Msg    = "+p_oErr+"\n\t Stack  = "+(p_oErr.stack||"-");};O2Exception.showErrorStack=function(p_sErrMsg){var s="Error stack ("+O2Exception.msErrorStack.length+" errors) :\n";var i=0;O2Exception.msErrorStack.each(function(p_s){s+="\n"+i+"/\t"+p_s;i++;});alert(s);};O2Exception.prototype.display=function(){alert(this.m_sMsg+"\n\n"+O2Exception.sREDIRECT_MSG);navigate(sAccueil,0,"home");return false;};function displayError(p_oElem,p_sMsg){var oCont=p_oElem;if(!ODYCont.isContainer(oCont)){oCont=oCont.getContainer();}var oAlertDiv=oCont.findChildById("alerte");oAlertDiv.findChildById("titreErreur","div").style.display="";oAlertDiv.findChildById("titreValidation","div").style.display="none";var oBtnDiv=oAlertDiv.findChildById("btnChoix","div");oBtnDiv.style.display="none";var oMsgDiv=oAlertDiv.findChildById("msgContent","div");oMsgDiv.style.display="";var sHTML="";var oFondDiv=oCont.findChildById("fondGris","div");var sPrevTab="";oAlertDiv.findChildById("titre","div").innerHTML="Erreur système";sHTML+=p_sMsg;oMsgDiv.innerHTML=sHTML;oAlertDiv.show();oFondDiv.show();}var O2CONTROLS_VER="$Revision: 1.42 $";var O2=new Object();O2.Autocompleter=Class.create();Object.extend(Object.extend(O2.Autocompleter.prototype,Ajax.Autocompleter.prototype),{initialize:function(p_sNameSuffix,p_sTS,url,options){this.nameSuffix=p_sNameSuffix;this.ts=p_sTS;var sFullSuffix=this.nameSuffix+(this.ts?"."+this.ts:"");this.baseInitialize("autoSearch"+sFullSuffix,"autoSearchList"+sFullSuffix,options);this.mainDiv=$O2("autocpl"+sFullSuffix);this.choice=this.mainDiv.findChildById("choice"+sFullSuffix,"span");this.hdLibValue=this.mainDiv.findChildById("autolib"+sFullSuffix,"input");this.editButton=this.mainDiv.findChildById("editBut"+sFullSuffix,"input");this.oInput=this.mainDiv.findChildById(this.nameSuffix,"input");this.divRech=this.mainDiv.findChildById("rech"+sFullSuffix,"div");this.oInput["autocomplete"]=this;this.options.autoSelect=this.options.autoSelect||true;this.options.asynchronous=true;this.options.method="get";this.options.onComplete=this.onComplete.bind(this);this.options.onHide=this.onHide.bind(this);this.options.onShow=this.onShow.bind(this);this.options.callback=this.callback.bind(this);this.options.updateElement=this.updateElement.bind(this);this.options.afterUpdateElement=this.afterUpdateElement.bind(this);this.options.defaultParams=this.options.parameters||"step=52&frm=js";this.options.baseTag=this.options.baseTag||"e";this.options.onException=function(element,e){alert(e);};this.url=url;this.choice.listenTo("click",this.showDebug.bindAsEventListener(this));this.choice.listenTo("click",this.showHide.bindAsEventListener(this));if(this.editButton){this.editButton.listenTo("click",function(event){this.switchToEditMode();Event.stop(event);return false;}.bindAsEventListener(this));}this.element.listenTo("click",this.showDebug.bindAsEventListener(this));this.element.listenTo("click",function(event){if(Element.getStyle(this.update,"display")=="none"){this.show();this.active=true;}else{this.hide();this.active=false;}}.bindAsEventListener(this));this.element.listenTo("focus",function(event){var sBaseVal=this.element.getAttribute("baseValue").replace(/"/g,"");if(this.element.value==this.element.getAttribute("voidValue")){this.element.value=sBaseVal;}this.element.enterValue=this.element.value;this.setCursor(sBaseVal);}.bindAsEventListener(this));this.options.elementOnBlur=function(event){var sBaseVal=this.element.getAttribute("baseValue").replace(/"/g,"");if(this.element.value==sBaseVal||this.element.value==""){this.element.value=this.element.getAttribute("voidValue");}else{if(this.element.value==this.element.enterValue&&""!=this.oInput.value){this.switchToStaleMode();}}}.bind(this);this.element.listenTo("blur",this.options.elementOnBlur.bindAsEventListener(this));},onHide:function(element,update){update.hide();},onShow:function(element,update){if(!update.hasChildNodes()){return;}update.style.position="absolute";update.show();var oDivH=$O2("home");if((update.offsetFrom(oDivH)[1])>oDivH.clientHeight){update.style.top=(update.style.top-update.clientHeight)+"px";}return;},setCursor:function(p_sBaseVal){window.setTimeout(function(){var iStart=p_sBaseVal?p_sBaseVal.length:0;var iEnd=this.element.value?this.element.value.length:0;this.element.setSelectionRange(iStart,iEnd);}.bind(this),50);},showDebug:function(event){if(event&&event.ctrlKey){showInputInfo(this.oInput);Event.stop(event);}},showHide:function(event){if(Element.getStyle(this.update,"display")=="none"){this.show();}else{this.hide();}},startIndicator:function(){if(this.options.indicator){$O2(this.options.indicator).show("inline");}},stopIndicator:function(){if(this.options.indicator&&$O2(this.options.indicator)){$O2(this.options.indicator).hide();}},switchToEditMode:function(){this.choice.style.display="none";this.editButton.style.display="none";this.divRech.style.display="inline";this.element.activate();this.hasFocus=true;},switchToStaleMode:function(p_xSelectedNode){this.divRech.style.display="none";this.choice.style.display="inline";this.editButton.style.display=this.options.readonly?"none":"inline";this.hasFocus=false;if(p_xSelectedNode){this.choice.firstChild.textContent=p_xSelectedNode.textContent;}},updateElement:function(p_xSelectedNode){if(p_xSelectedNode){this.switchToStaleMode(p_xSelectedNode);}if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,p_xSelectedNode);}},afterUpdateElement:function(p_oSearchInput,p_xSelectedNode){var hdInput=this.oInput;if(p_xSelectedNode){hdInput.value=p_xSelectedNode.id;hdInput.setAttribute("oDataNode",p_xSelectedNode.getAttribute("oDataNode"));if("t_108"==hdInput.id){ODYForm.doShowMessageAgency({oTargetContainer:$O2("edi").getDivFiche(),xDataNode:loadXML(p_xSelectedNode.getAttribute("oDataNode"))});}if(this.hdLibValue){this.hdLibValue.value=p_xSelectedNode.innerHTML;}}else{hdInput.value=null;hdInput.removeAttribute("oDataNode");if(this.hdLibValue){this.hdLibValue.value=null;}}if(hdInput.onchange){hdInput.onchange(document.createEvent("HTMLEvents"));}if(hdInput.onblur){hdInput.onblur(p_xSelectedNode);}},callback:function(p_oInput,p_sQueryString){var oReg=new RegExp("{(\\d+)}");var sFilterCriter=this.options.filterCriteria;if(sFilterCriter){var oRes=oReg.exec(this.options.filterCriteria);if(oRes){var iMasterInputDispiId=oRes[1];var oMasterI=p_oInput.form[ODYForm.sET_SN].getInputByDisplayItemId(iMasterInputDispiId);var sActiveValue=oMasterI.getAttribute("activeValue");var sValue=oMasterI.getAttribute("value");sFilterCriter=sFilterCriter.replace(oRes[0],(sActiveValue.length>0?sActiveValue:sValue));}}return"q="+(this.options.etId?"etid="+this.options.etId:"disp.sn="+this.options.dispSN)+(this.options.etIds?"|etids="+this.options.etIds:"")+(sFilterCriter?"|"+sFilterCriter:"")+"|o=js"+(this.options.attrId?"|"+encodeURIComponent(this.options.attrId)+"`sw`"+p_sQueryString.substring(1):"");},reset:function(event){this.oInput.value="";this.element.enterValue=null;this.element.value=this.element.getAttribute("voidValue");this.choice.firstChild.textContent="";this.switchToEditMode();},onComplete:function(request,p_xList){var oDoc=request?getDocElement(request.responseText):null;var oList=oDoc?oDoc.selectNodeSet("//"+this.options.baseTag+"l/"+this.options.baseTag):p_xList;var sResponse;var bAutoSel=this.options.autoSelect;if(!oList||oList.length==0){if(this.oInput.sMsg_noChoice){sResponse='<ul><li style="white-space: nowrap">'+this.oInput.sMsg_noChoice+"</li></ul>";}else{sResponse="<span><span>[pas de résultat]</span></span>";}this.options.autoSelect=false;}else{sResponse="<ul>";for(var i=0,iL=oList.length;i<iL;i++){var oTmpNode=oList.item(i);sResponse+='<li style="white-space: nowrap" id="'+oTmpNode.getAttribute("id")+'" oDataNode="'+(oTmpNode+"").replace(/'|"/g,"&quot;").replace(/\n/g," ")+'">'+builEntityLibFromNode(oTmpNode)+"</li>";}sResponse+="</ul>";}this.updateChoices(sResponse);this.options.autoSelect=bAutoSel;}});O2.DoubleList=Class.create();O2.DoubleList.findByInputName=function(p_sInputName,p_oContainer){var oInput=$O2(p_sInputName,p_oContainer);return oInput[sDBL_LIST_PREFIX];};O2.DoubleList.prototype={initialize:function(p_sInputName,p_sItemClass,p_msInitialList){this.m_eMainContainer=$O2(sDBL_LIST_PREFIX+"_"+p_sInputName);this.m_eInput=$O2(p_sInputName);this.m_sItemClass=p_sItemClass;this.m_eMainContainer[sDBL_LIST_PREFIX]=this;this.m_eInput[sDBL_LIST_PREFIX]=this;this.m_eList=this.m_eMainContainer.findChildById(sDBL_LIST_PREFIX+"2_"+p_sInputName,"DIV");this.m_eSearchList=this.m_eMainContainer.findChildById(sDBL_LIST_PREFIX+"1_"+p_sInputName,"DIV");if(p_msInitialList){for(var i=0,l=p_msInitialList.length;i<l;i+=2){this.createItem(2,p_msInitialList[i],p_msInitialList[i+1]);}}this.createSortable(1);this.createSortable(2);},getList:function(p_iIdx){var oList=p_iIdx==1?this.m_eSearchList:this.m_eList;return oList;},getItemClass:function(){return this.m_sItemClass;}};ODYDoubleList=function(p_sInputName,p_sItemClass,p_msInitialList){this.m_eMainContainer=$O2(sDBL_LIST_PREFIX+"_"+p_sInputName);this.m_eInput=$O2(p_sInputName);this.m_sItemClass=p_sItemClass;this.m_eMainContainer[sDBL_LIST_PREFIX]=this;this.m_eInput[sDBL_LIST_PREFIX]=this;this.m_eList=this.m_eMainContainer.findChildById(sDBL_LIST_PREFIX+"2_"+p_sInputName,"DIV");this.m_eSearchList=this.m_eMainContainer.findChildById(sDBL_LIST_PREFIX+"1_"+p_sInputName,"DIV");if(p_msInitialList){for(var i=0,l=p_msInitialList.length;i<l;i+=2){this.createItem(2,p_msInitialList[i],p_msInitialList[i+1]);}}this.createSortable(1);this.createSortable(2);};ODYDoubleList.findByInputName=function(p_sInputName,p_oContainer){var oInput=$O2(p_sInputName,p_oContainer);return oInput[sDBL_LIST_PREFIX];};ODYDoubleList.prototype.getList=function(p_iIdx){var oList=p_iIdx==1?this.m_eSearchList:this.m_eList;return oList;};ODYDoubleList.prototype.getItemClass=function(){return this.m_sItemClass;};ODYDoubleList.prototype.getLength=function(p_iIdx){var oList=this.getList(p_iIdx);var iL=0;if(oList.childNodes){iL=oList.childNodes.length;}return iL;};ODYDoubleList.prototype.updateCount=function(){if(!this.m_eCountSpan){this.m_eCountSpan=this.m_eMainContainer.findChildById("count");}this.m_eCountSpan.innerHTML=this.getLength(2);};ODYDoubleList.prototype.showMsg=function(p_sMsgId){this.m_eMainContainer.findChildById(p_sMsgId).style.display="block";};ODYDoubleList.prototype.hideMsg=function(p_sMsgId){this.m_eMainContainer.findChildById(p_sMsgId).style.display="none";};ODYDoubleList.prototype.createItem=function(p_iIdx,p_sValId,p_sValLib){var oList=this.getList(p_iIdx);var oDiv=document.createElement("div");var sId=sDRAG_PREFIX+p_sValId;var sHtml='<img id="add" onclick="parentNode[sDBL_LIST_PREFIX].transfertItem(parentNode)" src="/portail/img/max.gif">'+p_sValLib+'<img id="del" onclick="parentNode[sDBL_LIST_PREFIX].removeItem(2,parentNode)" src="/portail/img/min.gif">';oDiv.innerHTML=sHtml;oDiv.setAttribute("class",this.getItemClass());oDiv.setAttribute("id",sId);oDiv.listenTo("mousedown",function(event){this.style.cursor="-moz-grabbing";},false);oDiv.listenTo("mouseup",function(event){this.style.cursor="-moz-grab";},false);this.addItem(p_iIdx,oDiv);};ODYDoubleList.prototype.containItem=function(p_iIdx,p_sValId){var oList=this.getList(p_iIdx);var sId=p_sValId.match(sDRAG_PREFIX+".*")?p_sValId:sDRAG_PREFIX+p_sValId;for(var i=0,vChild=oList.childNodes,l=vChild.length;i<l;i++){if(sId==vChild[i].id){return true;}}return false;};ODYDoubleList.prototype.addItem=function(p_iIdx,p_eDraggableDiv){var oList=this.getList(p_iIdx);if(oList.childNodes){var oNext;var sTxt=p_eDraggableDiv.textContent;for(var i=0,vChild=oList.childNodes,l=vChild.length;i<l;i++){var oDiv=vChild[i];if(sTxt>oDiv.textContent){continue;}oNext=oDiv;break;}oList.insertBefore(p_eDraggableDiv,oNext);}else{oList.appendChild(p_eDraggableDiv);}var oDrag=new Draggable(p_eDraggableDiv,{revert:true});oDrag[sDBL_LIST_PREFIX]=this;p_eDraggableDiv[sDBL_LIST_PREFIX]=this;p_eDraggableDiv["drag"]=oDrag;if(p_iIdx==2){this.addValue(p_eDraggableDiv);}else{if(!oList["isShown"]){this.showHide();}if(this.getLength(1)==1){this.showMsg("msgWhenSingleChoice");}else{this.hideMsg("msgWhenSingleChoice");}}};ODYDoubleList.prototype.removeItem=function(p_iIdx,p_eDraggableDiv){var oList=this.getList(p_iIdx);var oDrag=p_eDraggableDiv["drag"];delete p_eDraggableDiv;oList.removeChild(p_eDraggableDiv);oDrag.destroy();if(p_iIdx==2){this.removeValue(p_eDraggableDiv);if(!this.containItem(1,p_eDraggableDiv.id)){this.addItem(1,p_eDraggableDiv);}}};ODYDoubleList.prototype.transfertItem=function(p_eDraggableDiv){if(!this.containItem(2,p_eDraggableDiv.id)){this.removeItem(1,p_eDraggableDiv);this.addItem(2,p_eDraggableDiv);}};ODYDoubleList.prototype.transfertFirstItem=function(){var oList=this.getList(1);var oDiv=oList.firstChild;if(!oDiv){return;}this.transfertItem(oDiv);};ODYDoubleList.prototype.clearList=function(p_iIdx){var oList=this.getList(p_iIdx);while(oList.firstChild){var oDiv=oList.firstChild;this.removeItem(p_iIdx,oDiv);}};ODYDoubleList.prototype.addValue=function(p_eDraggableDiv){var sValId=p_eDraggableDiv.id.substring(sDRAG_PREFIX.length);this.m_eInput.value=(this.m_eInput.value||"").addItemToList(ODYForm.sVALUE_SEP,sValId);this.updateCount();};ODYDoubleList.prototype.removeValue=function(p_eDraggableDiv){var sValId=p_eDraggableDiv.id.substring(sDRAG_PREFIX.length);this.m_eInput.value=(this.m_eInput.value||"").removeItemFromList(ODYForm.sVALUE_SEP,sValId);this.updateCount();};ODYDoubleList.prototype.createSortable=function(p_iIdx){var sInputName=this.m_eInput.id;var msOptions={dropOnEmpty:true,containment:[sDBL_LIST_PREFIX+"1_"+sInputName,sDBL_LIST_PREFIX+"2_"+sInputName],constraint:true,onDrop:function(p_eDraggableDiv,p_oDroppable){var oDblList=p_eDraggableDiv[sDBL_LIST_PREFIX];if(p_iIdx==1){oDblList.removeValue(p_eDraggableDiv);}else{oDblList.addValue(p_eDraggableDiv);}}};if(2==p_iIdx){msOptions["handle"]="handle";}Sortable.create(sDBL_LIST_PREFIX+p_iIdx+"_"+sInputName,msOptions);};ODYDoubleList.prototype.showHide=function(){var oList=this.getList(1);var oContainer=oList.parentNode;var oImg=this.m_eMainContainer.findChildById("onglet_img");if(oContainer.style.display=="block"){oContainer.style.display="none";oImg.src="/com/images/fleche-grise-right.png";this.showMsg("msgWhenClosed");oList["isShown"]=false;}else{oContainer.style.display="block";oImg.src="/com/images/fleche-grise-left.png";this.hideMsg("msgWhenClosed");oList["isShown"]=true;}};ODYDoubleList.showHideFromLink=function(p_oElem){var oCont=p_oElem.parentNode;while(oCont!=oCont.parentNode&&!(oCont.className=="mdblconteneur"||oCont.className=="mdblconteneur_large")){oCont=oCont.parentNode;}oCont[sDBL_LIST_PREFIX].showHide();};var ODYFORM_VER="$Revision: 1.154 $";var bFORCE_ONE_STAGE=false;var sCONFIRM_MSG_DIV="msgConfirmSave";var sFORM_INPUT_PREFIX="t_";var sPARAMFORM_INPUT_PREFIX="param_";var sFORM_DEL_FLAG_PREFIX="d_";var sINPUT_ENT_EID="hdent.eid";var sMAIN_FORM_NAME_PREFIX="frmMainInput";var sTAB_FORM_NAME_PREFIX="frmInput";var sATTR_ATTRIBUTE_ID="attr";var sPARAM_ATTRIBUTE_ID="aid";var sPARAM_QRESULT_ID="qrid";var sATTR_MAIN_ENT_ID="mainEntId";var sPARAM_MAIN_ENT_ID="mainEntId";ODYFormRegistry=function(){if(ODYFormRegistry.caller!=ODYFormRegistry.getInstance){throw new Error("ODYFormRegistry is a singleton : call 'getInstance'.");}this.m_hForm=new Hash();};ODYFormRegistry.__instance__=null;ODYFormRegistry.register=function(p_oODYForm){var oOFR=ODYFormRegistry.getInstance();oOFR.m_hForm.set(p_oODYForm.m_sName,p_oODYForm);};ODYFormRegistry.getValidOrCreateODYForm=function(p_sName,p_sDisplayId,p_iTS,p_oCont){var oOF=ODYFormRegistry.getODYFormByFormName(p_sName);if(!oOF||!oOF.isValid()){oOF=new ODYForm(p_sName,p_sDisplayId,p_iTS,p_oCont);}else{oOF.initDOMForm(p_sName,p_iTS,p_oCont);}return oOF;};ODYFormRegistry.getODYFormByFormName=function(p_s){var oOFR=ODYFormRegistry.getInstance();var oOF=oOFR.m_hForm.get(p_s);return oOF;};ODYFormRegistry.getODYFormByDisplayId=function(p_iDispId){var oOFR=ODYFormRegistry.getInstance();var oFound;oOFR.m_hForm.values().each(function(oOF){if(oFound||oOF.m_iDisplayId!=p_iDispId){return;}oFound=oOF;});return oFound;};ODYFormRegistry.getODYFormByEntityId=function(p_iEntiId){var oOFR=ODYFormRegistry.getInstance();var oFound;oOFR.m_hForm.values().each(function(oOF){if(oFound||oOF.m_iEntityId!=p_iEntiId){return;}oFound=oOF;});return oFound;};ODYFormRegistry.getODYFormBySubFormName=function(p_s){var oOFR=ODYFormRegistry.getInstance();var oFound;oOFR.m_hForm.values().each(function(oOF){if(oFound||!oOF.m_moTab){return;}oOF.m_moTab.each(function(oOFT){if(oFound){return;}if(oOFT.m_oDOMForm&&oOFT.m_oDOMForm.id==p_s){oFound=oOF;}});});return oFound;};ODYFormRegistry.showForms=function(){alert(ODYFormRegistry.getInstance().toString());};ODYFormRegistry.getInstance=function(){if(this.__instance__==null){this.__instance__=new ODYFormRegistry();}return this.__instance__;};ODYFormRegistry.makeForm=function(p_oForm){Object.extend(p_oForm,ODYForm);return p_oForm;};ODYFormRegistry.prototype.toString=function(){var s="";var i=0;var oOFR=ODYFormRegistry.getInstance();oOFR.m_hForm.values().each(function(oOF){s+=oOF.toString()+"\n\n";i++;});s=i+" forms :\n"+"------------\n"+s;return s;};ODYForm=function(p_sName,p_sDisplayId,p_iTS,p_oCont){this.m_sName=p_sName;this.m_iDisplayId=p_sDisplayId;this.initDOMForm(p_sName,p_iTS,p_oCont);this.m_moTab=null;this.m_bReadOnly=false;this.m_iStep=null;this.m_iStep1=300;this.m_iStep2=301;this.m_iStep3=null;this.m_sTargetFrm=null;this.m_sFollowing=null;this.m_iEntityId=null;this.m_iETId=null;this.m_oConfig={"to_disable":["Submit","Reset"],"alert":1};this.m_msField=null;this.m_msDoublonFields=null;ODYFormRegistry.register(this);this.m_hAdditionalParam=null;};ODYForm.sVALUE_SEP=";";ODYForm.sET_SN="ODYForm";ODYForm.sFOND_GRIS_DIV_ID="fondGris";ODYForm.sACTION_FORM_DIV_ID="actionFormDiv";ODYForm.displayEntity=function(p){var oOF=ODYFormRegistry.getODYFormByEntityId(p.iEntityId);var sTgt=oOF?oOF.getMainContainer().id:"_parent";navigate("/edit.svt",p.iStep||10,sTgt,"id="+p.iEntityId+"&amp;etid="+p.iETId+"&amp;o=fi&amp;oid="+p.iOrigineId);};ODYForm.displayParentEntity=function(p){var oOF=p.oCaller.getContainer()[ODYForm.sET_SN];ODYForm.displayEntity({iStep:p.iStep,iEntityId:oOF.m_iParentPersonId,iETId:oOF.m_iParentPersonETId,iOrigineId:oOF.m_iEntityId});};ODYForm.showTab=function(oMC,p_iNb,p_iTabsSpanId){var oTabCont=oMC.findChildContainerByPattern(".*tabs.*")[0];var oButCont=oMC.findChildContainerByPattern(".*but.*")[0];oTabCont.setAttribute("iVisibleTabIndex",p_iNb);var bIsWizard=oButCont.id.indexOf("wizard")!=-1;var vChildren=oMC.childNodes;for(var i=0,l=vChildren.length;i<l;i++){var oDiv=vChildren[i];if(!oDiv){continue;}if(oDiv.tagName!="DIV"||!oDiv.id||oDiv.id.indexOf("frame")==-1){continue;}if(oDiv.id.match(new RegExp(".*_"+p_iNb+"(\\.\\d+)?$"))){oDiv.show();if(!oDiv.isLoaded()&&oDiv.src){display(oDiv,bIsWizard?60:0,oDiv.src);}}else{oDiv.hide();}}var oTbl=oTabCont.findChildById(p_iTabsSpanId);for(var i=1;i<=oTbl.getAttribute("tabCount");i++){var oTab=oTbl.findChildById("tab"+i);if(p_iNb==i){addCssStyle(oTab,sCssClassTabSelected);removeCssStyle(oTab,sCssClassTabDeselected);}else{addCssStyle(oTab,sCssClassTabDeselected);removeCssStyle(oTab,sCssClassTabSelected);}}};ODYForm.buildErrorsArray=function(p_oXmlDoc,p_oOF){if(typeof(p_oXmlDoc)=="string"){p_oXmlDoc=getDocElement(p_oXmlDoc);}var vErrList=p_oXmlDoc.selectNodeSet("//errorl/formError");var moErrorList=new Array();if(vErrList.length>0){for(var i=0,l=vErrList.length;i<l;i++){var xError=vErrList.item(i);var iDispiId=xError.getAttribute("dispiid");var iEntiId=xError.getAttribute("ed_id");var iAttrId=xError.getAttribute("aid");var oFrameElem=p_oOF?p_oOF.getInputByDisplayItemId(iDispiId,iAttrId,iEntiId):null;var oError=new OInputError(oFrameElem);if(oFrameElem){var oFrameForm=oFrameElem.form;var oLibElem=oFrameForm.findChildById("lib"+oFrameElem.id,"input");var oElem=oLibElem?oLibElem:oFrameElem;var sCurrentValue=getCurrentValue(oFrameElem);var sCurrentText=getCurrentText(oFrameElem);oError.m_sValue=sCurrentValue;oError.m_sText=sCurrentText;oError.m_sTabName=oFrameElem.m_oTab?oFrameElem.m_oTab.m_sLib:"";var labSpan=oFrameForm.findChildById("lab_"+iDispiId,"span");if(labSpan){oError.m_sFieldName=labSpan.innerHTML;}}oError.m_sLevel=xError.getAttribute("level");var xJavaError=xError.getElementsByTagName("error").item(0);var xMsg=xError.getElementsByTagName("message").item(0);var xEnt=xError.getElementsByTagName("e");if(xEnt&&xEnt.item(0)){oError.m_iEntityId=xEnt.item(0).getAttribute("id");oError.m_sEntityDesignation=xEnt.item(0).getElementsByTagName("name").item(0);}var xCause=xError.getElementsByTagName("cause").item(0);if(xMsg&&xMsg.getFirstChild()){oError.m_sMsg=xMsg.getFirstChild().getNodeValue();}else{if(xCause&&xCause.getFirstChild()){oError.m_sMsg=xCause.getFirstChild().getNodeValue();}else{oError.m_sMsg=xJavaError.getElementsByTagName("type").item(0).getFirstChild().getNodeValue();+"<br>"+xJavaError.getElementsByTagName("stack").item(0).getFirstChild().getNodeValue();}}moErrorList.push(oError);}}else{vErrList=p_oXmlDoc.selectNodeSet("//data/error");if(vErrList.length>0){var xError=vErrList.item(0);var oError=new OInputError(oElem);oError.m_sType="system";oError.m_sLevel="ERROR";oError.m_sTabName="Une erreur s'est produite : ";var xMsg=xError.getElementsByTagName("message").item(0);var xCause=xError.getElementsByTagName("cause").item(0);if(xMsg&&xMsg.getFirstChild()){oError.m_sFieldName=xMsg.getFirstChild().getNodeValue();}else{if(xCause&&xCause.getFirstChild()){oError.m_sFieldName=xCause.getFirstChild().getNodeValue();}}oError.m_sMsg=xError.getElementsByTagName("stack").item(0).getFirstChild().getNodeValue();moErrorList.push(oError);}}return moErrorList;};ODYForm.getFondGrisDiv=function(p_oParentFrm){var oDiv=p_oParentFrm.findDirectChildByExpr("div#"+ODYForm.sFOND_GRIS_DIV_ID);if(!oDiv){oDiv=p_oParentFrm.findChildById(ODYForm.sFOND_GRIS_DIV_ID);}if(!oDiv||oDiv.getContainer()!=p_oParentFrm){oDiv=document.createElement("div");oDiv.id=ODYForm.sFOND_GRIS_DIV_ID;p_oParentFrm.appendChild(oDiv);}return $O2(oDiv);};ODYForm.getAlertDiv=function(p_oParentFrm,p_sDivName){var nodes=p_oParentFrm.childNodes;var oAlertDiv=null;var sDivId=p_sDivName?p_sDivName:"alerte";for(var i=0,l=nodes.length;i<l;i++){var oDOM=nodes[i];if(oDOM.nodeType==1&&oDOM.id==sDivId){oAlertDiv=oDOM;break;}}if(!oAlertDiv||oAlertDiv.getContainer()!=p_oParentFrm){oAlertDiv=document.createElement("div");oAlertDiv.id=sDivId;oAlertDiv.className="alerte";ODYCont.makeCont(oAlertDiv);p_oParentFrm.appendChild(oAlertDiv);oAlertDiv=$O2(oAlertDiv);oAlertDiv.innerHTML='<div id="titre-alerte">'+'  <div id="titreErreur">'+"    <a onclick=\"hideErrors(window.event||arguments[0],'"+sDivId+'\')" href="#"><img id="close" align="right" src="/com/img/picto/cross.png"/></a>'+'    <div id="titre">Erreur de saisie</div>'+"  </div>"+'  <div id="titreValidation">Traitement</div>'+"</div>"+'<div id="msg-alerte">'+'  <div id="msgContent"></div>'+'  <div id="btnChoix" class="btnChoix">'+'    <span class="btnOuiNon"><a id="continue">Continuer</a></span>'+'    <span class="btnOuiNon"><a id="stop" onclick="hideErrors(window.event||arguments[0],\''+sDivId+"')\">Annuler</a></span>"+'    <span class="btnOuiNon"><a id="saveAndContinue">Enregistrer et continuer</a></span>'+'    <span class="btnOuiNon"><a id="discardAndContinue">Continuer sans enregistrer</a></span>'+'    <span class="btnOuiNon"><a id="back" onclick="hideErrors(window.event||arguments[0],\''+sDivId+"')\">Retour<br/>à la fiche</a></span>"+"  </div>"+'  <center><img id="indicator" style="display:none" src="/com/img/progress.gif" alt="Working..." /></center>'+"</div>";}return oAlertDiv;};ODYForm.getQuizzDiv=function(p_oParentFrm,p_sDivName){var nodes=p_oParentFrm.childNodes;var oAlertDiv=null;var sDivId=p_sDivName?p_sDivName:"quizz";oAlertDiv=document.createElement("div");oAlertDiv.id=sDivId;oAlertDiv.className="quizz";ODYCont.makeCont(oAlertDiv);p_oParentFrm.appendChild(oAlertDiv);oAlertDiv=$O2(oAlertDiv);oAlertDiv.innerHTML='<div id="msg-alerte">'+'  <div id="msgContent"></div>'+'  <div id="btnChoix" class="btnChoix">'+"</div>";return oAlertDiv;};ODYForm.getParentFrmForAlertDiv=function(p_oCont){var oButFrm=p_oCont;if(oButFrm.id.indexOf("ifa_")==0){var oParentFrm=oButFrm;}else{if("edi"==oButFrm.id){var oParentFrm=oButFrm;}else{if(ODYForm.sACTION_FORM_DIV_ID==oButFrm.id){var oParentFrm=oButFrm;}else{var oParentFrm=oButFrm.getContainer()?oButFrm.getContainer():oButFrm;}}}return $O2(oParentFrm);};ODYForm.doShowAlertDivButtonsForErrors=function(p_moErrorList,p_oAlertDiv,p_sFollowingExpr){var oBtnDiv=p_oAlertDiv.findChildById("btnChoix","div");var oPbContinue=oBtnDiv.findChildById("continue","a");this.doShowAlertDivButtons(oBtnDiv);var iAfficheCrAutoControl=0;var iLevelErrorCount=0;var iLevelInfoCount=0;var iLevelWarningCount=0;var iRefresh=0;if(null!=p_moErrorList){for(var i=0,l=p_moErrorList.length;i<l;i++){var oError=p_moErrorList[i];if("ERROR"==oError.m_sLevel){iLevelErrorCount++;}else{if("INFO"==oError.m_sLevel){iLevelInfoCount++;if(oError.m_sMsg.indexOf("-----")!=-1){iAfficheCrAutoControl=1;}}else{if("WARNING"==oError.m_sLevel){iLevelWarningCount++;}else{if("REFRESH"==oError.m_sLevel){iRefresh++;iLevelErrorCount++;}}}}}}else{iLevelErrorCount=0;iLevelInfoCount=1;iLevelWarningCount=0;}if(iLevelErrorCount==0){var sFollowing=p_sFollowingExpr;if(iLevelInfoCount>0&&iLevelWarningCount==0){if(!sFollowing){sFollowing="ODYNavigation.contextBack()";}oBtnDiv.findChildById("stop","a").style.display=(p_sFollowingExpr?"":"none");p_oAlertDiv.findChildById("close","img").style.display="none";}if(sFollowing){if(iAfficheCrAutoControl==1){var sMsg="J'engage ma responsabilité sur les informations du message affiché précédemment";oPbContinue.listenTo("click",new Function("e","if (confirm('"+sMsg.escapeJS("'")+"')) return navWithIndicator(this,'"+sFollowing.escapeJS("'")+"')"),false);}else{oPbContinue.listenTo("click",new Function("e","return navWithIndicator(this,'"+sFollowing.escapeJS("'")+"')"),false);}oPbContinue.style.visibility="";}else{oPbContinue.style.visibility="hidden";}}else{oPbContinue.style.visibility="hidden";}oBtnDiv.style.visibility="";return oBtnDiv;};ODYForm.onActionFormContinue=function(e,p_sExpr){var oODYF=ODYFormRegistry.getODYFormByFormName("actionForm");oODYF.validate();if(oODYF.moErrorList.length>0){oODYF.doShowErrors();return false;}var sSubmitData=formData2QueryString(oODYF.m_oDOMForm);eval(p_sExpr);return false;};ODYForm.doShowAlertDivButtons=function(p_oBtnDiv){p_oBtnDiv.style.display="";var oPbContinue=p_oBtnDiv.findChildById("continue","a");oPbContinue.clearListeners();oPbContinue.style.display="";oPbContinue.style.visibility="";var oPbStop=p_oBtnDiv.findChildById("stop","a");oPbStop.clearListeners();oPbStop.style.display="";oPbStop.style.visibility="";p_oBtnDiv.findChildById("saveAndContinue","a").style.display="none";p_oBtnDiv.findChildById("discardAndContinue","a").style.display="none";p_oBtnDiv.findChildById("back","a").style.display="none";};ODYForm.doShowErrors=function(p_moErrorList,p_oCont,p_sFollowingExpr){if(!p_moErrorList.length>0){return;}var oParentFrm=this.getParentFrmForAlertDiv(p_oCont);if(!oParentFrm.visible()){throw"doShowErrors : parent frame '"+oParentFrm.id+"' is not visible.";}var oAlertDiv=ODYForm.getAlertDiv(oParentFrm);oAlertDiv.findChildById("titreErreur","div").style.display="";oAlertDiv.findChildById("titreValidation","div").style.display="none";var iRefresh=0;for(var i=0,l=p_moErrorList.length;i<l;i++){var oError=p_moErrorList[i];if("REFRESH"==oError.m_sLevel){iRefresh++;}}if(iRefresh>0){p_oCont.getContainer().reload();oParentFrm=$O2("edi");oAlertDiv=ODYForm.getAlertDiv(oParentFrm);oAlertDiv.findChildById("titreErreur","div").style.display="";oAlertDiv.findChildById("titreValidation","div").style.display="none";}var sFollowingExpr=p_sFollowingExpr;if(sFollowingExpr&&sFollowingExpr.indexOf("oRep")!=-1){sFollowingExpr=sFollowingExpr.replace(/oRep = /,"");sFollowingExpr=sFollowingExpr.replace(/oRep/,"null");}this.doShowAlertDivButtonsForErrors(p_moErrorList,oAlertDiv,sFollowingExpr);var oMsgDiv=oAlertDiv.findChildById("msgContent","div");oMsgDiv.style.visibility="";var sHTML="";var oFondDiv=ODYForm.getFondGrisDiv(oParentFrm);var sPrevTab="";for(var i=0,l=p_moErrorList.length;i<l;i++){var oError=p_moErrorList[i];oAlertDiv.findChildById("titre","div").innerHTML=("system"==oError.m_sType)?"Erreur système":"Attention !";sHTML+=oError.buildHTML(sPrevTab);sPrevTab=oError.m_sTabName;if(oError.m_oInput){removeCssStyle(oError.m_oInput,"mandatory");addCssStyle(oError.m_oInput,"hasError");oError.m_oInput.focus();}}oMsgDiv.innerHTML=sHTML;ODYForm.showAndCenterAlert(oParentFrm,oFondDiv,oAlertDiv);};ODYForm.doShowActionForm=function(p){var oParentFrm=this.getParentFrmForAlertDiv(p.oCont);var oAlertDiv=ODYForm.getAlertDiv(oParentFrm,ODYForm.sACTION_FORM_DIV_ID);var oAlertTitle=oAlertDiv.findChildById("titre","div");if(p.sFormTitle){oAlertTitle.innerHTML=p.sFormTitle;}oAlertTitle.style.display="";oAlertDiv.findChildById("titreValidation","div").style.display="none";var oMsgDiv=oAlertDiv.findChildById("msgContent","div");oMsgDiv.style.visibility="";var sHTML=p.sHTML?p.sHTML:"";if(sHTML!=""){sHTML='<form name="'+p.sFormName+'" id="'+p.sFormName+'">'+sHTML;sHTML+="</form>";}var oFondDiv=ODYForm.getFondGrisDiv(oParentFrm);if(oMsgDiv){oMsgDiv.innerHTML=sHTML;var oOF=ODYFormRegistry.getValidOrCreateODYForm(p.sFormName,null,null,oAlertDiv);var vElement=oOF.m_oDOMForm.elements;for(i=0;i<vElement.length;i++){var oElement=vElement[i];if(oElement.type=="select-one"){processList(oElement.getAttribute("id"),oElement.getAttribute("src"),oElement.getAttribute("current"));}var iDataType=oElement.getAttribute("dataTypeId");var iDispiType=oElement.getAttribute("dispitypeid");if(iDataType==3){var sInputName=oElement.getAttribute("name");var sCalName="oCal"+sInputName;var sCalendarDiv="<div id=cal"+sInputName+' class="actionFormCalendar"></div>'+'<img src="/com/popcalendar/cal.gif" id="imgCal'+sInputName+'" onclick=\'o2Cal(this,"'+sInputName+"\"); return false;' />";var sScript="{ var "+sCalName+' = new CalendarPopup("cal'+sInputName+'");'+sCalName+".setYearSelectStartOffset(100);"+sCalName+".showNavigationDropdowns();"+sCalName+".showYearNavigation();}";var oTd=findParentByTagName(oElement,"td");oTd.innerHTML+=sCalendarDiv;eval(sScript);}else{if(iDispiType==20){var sSfx=oElement.id;var oAC=new O2.Autocompleter(sSfx,null,"/query.svt",{dispSN:"AGENCE_AUTOCOMPLETE",attrId:111,minChars:4,indicator:"indicator"+sSfx});$O2("autocpl"+sSfx)["autocompl"]=oAC;if(oAC.oInput.value){oAC.switchToStaleMode();if(oAC.hdLibValue.value){oAC.choice.firstChild.textContent=oAC.hdLibValue.value;}}else{oAC.reset();}}}}}ODYForm.doShowButtonAlertDivForActionForm(oAlertDiv,p.sAction,p.iEntId,p.oCont,p.iMultiToRefresh,p.sFollowing,oParentFrm.id,p.sFollowingSecondStep);ODYForm.showAndCenterAlert(oParentFrm,oFondDiv,oAlertDiv);};ODYForm.doShowButtonAlertDivForActionForm=function(p_oAlertDiv,p_sAction,p_iEntId,p_oCont,p_iMultiToRefresh,p_sFollowing,p_sFrame,p_sFollowingNotActionPre){var oBtnDiv=p_oAlertDiv.findChildById("btnChoix","div");oBtnDiv.style.visibility="";var oPbContinue=oBtnDiv.findChildById("continue","a");this.doShowAlertDivButtons(oBtnDiv);var sActionToDo="";if(p_sFollowingNotActionPre){sActionToDo=p_sFollowingNotActionPre;}else{var sFollowing=String(p_sFollowing||"")+";hideErrors(null, "+p_oAlertDiv.id+' );alert("Opération terminée.")';sActionToDo="doActionWithPre({sFrm:'"+p_sFrame+"',sAction:'"+p_sAction+"',iEntId:"+p_iEntId+",sSubmitData: sSubmitData"+",sFollowingExpr:'"+(p_iMultiToRefresh?'refreshMulti($O2("'+p_oCont.id+'"),'+p_iMultiToRefresh+")":sFollowing.escapeJS("'"))+"', bWithProgress:false, sContId:"+p_oAlertDiv.id+"})";}var sAction="ODYForm.onActionFormContinue(ev, '"+sActionToDo.escapeJS("'")+"')";var oNewFunction=new Function("e","return navWithIndicator(this,'"+sAction.escapeJS("'")+"')");oPbContinue.listenTo("click",oNewFunction,false);oPbContinue.style.visibility="";};ODYForm.showAndCenterAlert=function(p_oParentFrm,p_oFondDiv,p_oAlertDiv,p){var oMsgDiv=p_oAlertDiv.findChildById(((p&&p.sContentDivId)||"msgContent"),"div");p_oAlertDiv.style.height="";oMsgDiv.style.height="";p_oAlertDiv.show();p_oFondDiv.show();var iBottom=0+p_oAlertDiv.offsetTop+p_oAlertDiv.scrollHeight;var iMultiHeight=p_oParentFrm.clientHeight;var iMultiScrollTop=p_oParentFrm.scrollTop;var oTitleDiv=p_oAlertDiv.findChildById("titre-alerte","div");var oBtnDiv=p_oAlertDiv.findChildById("btnChoix","div");var oStopBtn=oBtnDiv.findChildById("stop","a");if(iMultiHeight<iBottom){if(iMultiHeight<p_oAlertDiv.clientHeight){p_oAlertDiv.style.top="0px";if(iMultiHeight>450){p_oAlertDiv.style.height=(iMultiHeight-6)+"px";p_oAlertDiv.style.overflowY="hidden";oMsgDiv.style.top=(oTitleDiv.offsetHeight-10)+"px";oMsgDiv.style.height=(iMultiHeight-oTitleDiv.offsetHeight-80)+"px";oBtnDiv.style.bottom=(iMultiHeight-10)+"px";oMsgDiv.style.overflowY="auto";}else{p_oParentFrm.style.overflowY="auto";}}}oMsgDiv.show();p_oAlertDiv.style.top=(iMultiScrollTop+(iMultiHeight-p_oAlertDiv.scrollHeight)/2)+"px";};ODYForm.checkUnsavedModif=function(){var oOFR=ODYFormRegistry.getInstance();var oModifedOF;oOFR.m_hForm.values().each(function(oOF){if(!oOF.isValid()||oOF.isSearchForm()||!oOF.getMainContainer().visible()){return;}if(oOF.countModifiedFields()==0){return;}oModifedOF=oOF;throw $break;});if(oModifedOF){var oError=new OInputError();oError.m_sMsg="Des modifications n'ont pas été enregistrées.<br>"+"Quittez d'abord le formulaire avec l'un des boutons 'Retour' ou 'Enregistrer'.<br><br>";oError.m_sLevel="ERROR";ODYForm.doShowErrors([oError],oModifedOF.getContainer());return false;}return true;};ODYForm.prototype.re=new Array();ODYForm.prototype.re[3]=/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/;ODYForm.prototype.re[4]=/^(\d{1,2})(\:(\d{1,2}))?(\:(\d{1,2}))?$/;ODYForm.prototype.re[8]=/^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/;ODYForm.prototype.re_alpha=/^[a-zA-Z\.\-]*$/;ODYForm.prototype.re_alphanum=/^\w+$/;ODYForm.prototype.re_unsigned=/^\d+$/;ODYForm.prototype.re[2]=/^[\+\-]?[\d\s]*$/;ODYForm.prototype.re[5]=/^([A-Z]{1,2}[1-9]{1,2}( w)*)|([\dAB]{4,5})$/;ODYForm.prototype.re[6]=/^[\+\-]?[\d\s]*\.?\d*$/;ODYForm.prototype.re[15]=ODYForm.prototype.re[6];ODYForm.prototype.re[7]=/^\d{2}(\d|[A-Z])\d{5}$/;ODYForm.prototype.re[9]=/^[\d\s]+$/;ODYForm.prototype.re[12]=/^\d{2}([0-9]|[A-Z]){4,5}$/;ODYForm.prototype.re[17]=/^\d+$/;ODYForm.prototype.initDOMForm=function(p_sName,p_iTS,p_oCont){var oCont=p_oCont;if(!oCont){oCont=p_iTS?ODYCont.findContainerByTs(""+p_iTS):oCC;}this.m_oDOMForm=oCont.findChildById(p_sName,"form");if(!this.m_oDOMForm){throw"DOM object form '"+p_sName+"' not found in window '"+oCont.id+"' !";}this.m_oDOMForm[ODYForm.sET_SN]=this;oCont[ODYForm.sET_SN]=this;this.m_moFields=this.m_oDOMForm.getElements();this.m_moFields.sort(function(a,b){return a.tabIndex>b.tabIndex?1:-1;});};ODYForm.prototype.setStepFrame=function(p_iStep,p_sFrm){this.m_iStep=p_iStep;this.m_sTargetFrm=p_sFrm;};ODYForm.prototype.addTab=function(p_iTabId,p_sTabLib){if(null==this.m_moTab){this.m_moTab=new Array();}var oOFT=null;for(var i=0,l=this.m_moTab.length;i<l;i++){if(this.m_moTab[i].m_iId==p_iTabId){oOFT=this.m_moTab[i];}}if(null==oOFT){oOFT=new ODYFormTab(p_iTabId,p_sTabLib);this.m_moTab.push(oOFT);oOFT.m_iIndex=this.m_moTab.length;}oOFT.m_oParentODYForm=this;};ODYForm.prototype.registerSubForm=function(p_iTabId,p_sTS){var oOFT=this.getTabById(p_iTabId);var oMainCont=this.getMainContainer();oOFT.m_oDOMForm=oMainCont.findChildById(sTAB_FORM_NAME_PREFIX+p_iTabId,"form");if(!oOFT.m_oDOMForm){throw"SubForm '"+(sTAB_FORM_NAME_PREFIX+p_iTabId)+"' not found."+"Current are :"+oOFT.toString();}oOFT.m_oCont=oOFT.m_oDOMForm.getContainer();oOFT.m_oCont[ODYForm.sET_SN]=this;oOFT.m_oDOMForm[ODYForm.sET_SN]=this;return oOFT;};ODYForm.prototype.getTabById=function(p_iTabId){if(!this.m_moTab){return;}for(var i=0,l=this.m_moTab.length;i<l;i++){if(this.m_moTab[i].m_iId==p_iTabId){return this.m_moTab[i];}}return;};ODYForm.prototype.getEntityId=function(){var oForm=this.m_oDOMForm;if(!oForm["hdent.id"]){return;}return oForm["hdent.id"].value;};ODYForm.prototype.setEntityId=function(p_iId){var oForm=this.m_oDOMForm;if(!oForm["hdent.id"]){return;}oForm["hdent.id"].value=p_iId;};ODYForm.prototype.setRunningResponse=function(p_oRep){this.m_oRunningResp=p_oRep;};ODYForm.prototype.getRunningResponse=function(){return this.m_oRunningResp;};ODYForm.prototype.getEntityEditionId=function(){var oForm=this.m_oDOMForm;if(!oForm["hdent.eid"]){return;}return oForm["hdent.eid"].value;};ODYForm.prototype.isEntityNew=function(){return this.getEntityId()=="";};ODYForm.prototype.getDisplayMode=function(){var oIDM=this.m_oDOMForm["hddisp.mode"];return oIDM?oIDM.value:null;};ODYForm.prototype.getDisplayId=function(){var oForm=this.m_oDOMForm;return oForm["hddisp.id"].value;};ODYForm.prototype.getFormAction=function(){var sUrl=this.m_oDOMForm.elements["action"]?this.m_oDOMForm.elements["action"].value:this.m_oDOMForm.action;return sUrl;};ODYForm.prototype.isSearchForm=function(){var sMode=this.getDisplayMode();if(sMode){return(sMode.indexOf("RECH_")==0);}return(!this.m_moTab);};ODYForm.prototype.isValid=function(){var oForm=this.m_oDOMForm;if(oForm&&oForm.isValid()){return true;}if(!this.m_moTab){return false;}for(var i=0,l=this.m_moTab.length;i<l;i++){var oOFT=this.m_moTab[i];if(oOFT.m_oDOMForm&&oOFT.m_oDOMForm.isValid()){return true;}}return false;};ODYForm.prototype.addError=function(p_oVisibleFrameElem,p_sCurValue,p_sCurText,p_sTabName,p_sFieldLabel,p_sMsg,p_sLevel){if(!this.moErrorList){this.moErrorList=new Array();}var oError=new OInputError(p_oVisibleFrameElem);oError.m_sValue=p_sCurValue;oError.m_sText=p_sCurText;oError.m_sTabName=p_sTabName;oError.m_sFieldName=p_sFieldLabel;oError.m_sMsg=p_sMsg;oError.m_sLevel=p_sLevel;this.moErrorList.push(oError);};ODYForm.prototype.getInputByDisplayItemId=function(p_iDispiId,p_iAttrId,p_iEntiId){if(this.isSearchForm()){if(null==this.m_oDOMForm){return;}var oInput=Form.getElements(this.m_oDOMForm).find(function(element){return element.getDisplayItemId()==p_iDispiId;});if(!oInput){return;}return oInput;}if(this.m_moTab){for(var i=0,l=this.m_moTab.length;i<l;i++){var oOFT=this.m_moTab[i];var oInput=oOFT.getInputByDisplayItemId(p_iDispiId);if(oInput){return oInput;}}}else{oInput=this.m_oDOMForm[sFORM_INPUT_PREFIX+p_iAttrId+"_"+p_iEntiId];if(!oInput){oInput=this.m_oDOMForm[sFORM_INPUT_PREFIX+p_iAttrId];}return oInput;}};ODYForm.prototype.getInputByAttributeSn=function(p_sAttrSn){if(this.isSearchForm()){if(null==this.m_oDOMForm){return;}var oInput=Form.getElements(this.m_oDOMForm).find(function(element){return(element.getAttributeName()==p_sAttrSn);});if(!oInput){return;}return oInput;}for(var i=0,l=this.m_moTab.length;i<l;i++){var oOFT=this.m_moTab[i];var oInput=oOFT.getInputByAttributeSn(p_sAttrSn);if(oInput){return oInput;}}};ODYForm.prototype.addParam=function(p_sParam,p_sValue,p_bNoOverwrite){if(null==this.m_hAdditionalParam){this.m_hAdditionalParam=new Object();}if(p_bNoOverwrite&&this.m_hAdditionalParam[p_sParam]){throw"param '"+p_sParam+"' already exists with value '"+this.m_hAdditionalParam[p_sParam]+"'";}this.m_hAdditionalParam[p_sParam]=p_sValue;};ODYForm.prototype.getContainer=function(){return this.m_oDOMForm?this.m_oDOMForm.getContainer():null;};ODYForm.prototype.getMainContainer=function(){var oCont=this.getContainer();return oCont?oCont.getContainer():null;};ODYForm.prototype.getButtonFrame=function(){var oButCont=this.getMainContainer().findChildContainerByPattern(".*but.*")[0];return oButCont;};ODYForm.prototype.loadTab=function(p_iTabId){var oOFT=this.getTabById(p_iTabId);if(!oOFT){throw"Tab with id '"+p_iTabId+"' not found";}return oOFT.load();};ODYForm.prototype.moveFocus=function(p_oCurentInput,p_iRowJump,e){var iCurIdx=this.m_moFields.indexOf(p_oCurentInput);var iCurTabIdx=p_oCurentInput.tabIndex;var iBaseTabIdx,ii=0;while(!iBaseTabIdx){iBaseTabIdx=this.m_moFields[ii].tabIndex;ii++;}iBaseTabIdx=iBaseTabIdx-(iBaseTabIdx%p_iRowJump);var iMaxTabIdx=this.m_moFields[this.m_moFields.length-1].tabIndex;var oNewInput;switch(e.keyCode){case 37:do{iCurIdx=iCurIdx>0?iCurIdx-1:this.m_moFields.length-1;oNewInput=this.m_moFields[iCurIdx];}while(oNewInput.type=="hidden"||oNewInput.readOnly);break;case 38:if(iCurTabIdx<(iBaseTabIdx+p_iRowJump)){}else{iCurTabIdx-=p_iRowJump;}oNewInput=this.m_moFields.find(function(p){return(p.tabIndex==iCurTabIdx);});break;case 39:do{iCurIdx=iCurIdx<this.m_moFields.length-1?iCurIdx+1:0;oNewInput=this.m_moFields[iCurIdx];}while(oNewInput.type=="hidden"||oNewInput.readOnly);break;case 40:iCurTabIdx+=p_iRowJump;if(iCurTabIdx>iMaxTabIdx){}oNewInput=this.m_moFields.find(function(p){return(p.tabIndex==iCurTabIdx);});break;default:return true;}if(oNewInput){oNewInput.focus();}return false;};ODYForm.prototype.toString=function(){var s=this.m_sName+" - form["+(this.m_oDOMForm?this.m_oDOMForm.id:"-")+"]";var sTabs="\n   ";if(!this.isSearchForm()){sTabs+="Tabs=[";this.m_moTab.each(function(value,index){sTabs+=value.m_sLib+",";});sTabs=sTabs.substring(0,sTabs.length-1)+"]";}else{sTabs+="<no tabs>";}s+=sTabs+"\n   m_msDoublonFields="+this.m_msDoublonFields;return s;};ODYForm.prototype.validate=function(){this.moErrorList=new Array();this.moFileList=new Array();var oForm=this.m_oDOMForm;for(var j=0,l=oForm.elements.length;j<l;j++){var elem=oForm.elements[j];if(null==elem){continue;}var sValue=null==elem.value?null:elem.value.trim();var sName=elem.name;var sDataItemTypeSn=elem.getAttribute("dataItemTypeSn");if(!sName||(sName.indexOf(sFORM_INPUT_PREFIX)!=0&&sName.indexOf(sPARAMFORM_INPUT_PREFIX)!=0)){continue;}var ms=sName.split("_");if(ms.length>2){var sEntityEdId=ms[2];}var oDelChk=oForm.elements[sFORM_DEL_FLAG_PREFIX+sEntityEdId];var bDeletion=(oDelChk&&oDelChk.checked);if(bDeletion){continue;}if("editing_area"==sDataItemTypeSn){var oEditor=FCKeditorAPI.GetInstance(sName);sValue=oEditor.GetXHTML(true);elem.value=sValue;}else{if("select_checkable"==sDataItemTypeSn){sValue=getCurrentValueMSC(elem.id,";");}}var sMsg=null;var sId=elem.id;if(""==sValue&&sId.substr(sId.length-1,1)!="_"){if(elem.getAttribute("mandatory")=="true"){sMsg="Ce champ est obligatoire";sValue="";}}else{var iDataTypeId=elem.getAttribute("dataTypeId");if("upload"==sDataItemTypeSn){this.moFileList.push(elem.id);}else{var re=ODYForm.prototype.re[iDataTypeId];var oOptInput=oForm["opt_"+sName];if((!oOptInput||"ex"==oOptInput.value)&&re){if(!re.test(sValue)){sMsg="Le format de ce champ est invalide";}else{if(3==iDataTypeId){if(RegExp.$1>31||RegExp.$2>12){sMsg="Le format de date est invalide";}var dt_test=new Date(RegExp.$3,Number(RegExp.$2-1),RegExp.$1);if(dt_test.getMonth()!=Number(RegExp.$2-1)){sMsg="Date incohérente : ce jour n'existe pas dans ce mois";}}else{if(4==iDataTypeId){if(RegExp.$1>23||RegExp.$2>59||RegExp.$3>59){sMsg="Le format de l'heure est invalide";}}}}}}}if(sMsg){this.addError(elem.visible()?elem:null,sValue,sValue,elem.getAttribute("tabLabel"),elem.getAttribute("dispiLabel"),sMsg);}}};ODYForm.prototype.isOneStage=function(){return bFORCE_ONE_STAGE||this.isSearchForm()||this.m_iStep==5||this.m_oDOMForm.id.indexOf("param")==0;};ODYForm.prototype.validateAndSubmit=function(p_oMainDiv,p_sFollowing,p_bNoDisplay){var iNow=new Date().getTime();if(this.lastSubmitTime){if((iNow-this.lastSubmitTime)<1000){if(bAdmin){alert("En cours de traitement...");}return false;}}if(this.m_bReadOnly&&this.m_iStep!=4){alert("Cette fiche ne peut être enregistrée. Merci de contacter l'équipe technique pour décrire le problème.");return false;}this.lastSubmitTime=iNow;var sTarget=this.findTarget();this.validate();if(this.moErrorList.length>0){this.doShowErrors();return false;}var bNoDisplay=p_bNoDisplay;if(this.m_oDOMForm.id!="choix"&&this.m_oDOMForm.id!="cvtheque"){bNoDisplay=true;}var oTargetContainer=findContainerById(sTarget);var bInDiv=sTarget.indexOf("js")==0||(null!=oTargetContainer&&oTargetContainer.tagName=="DIV");if(bInDiv||bNoDisplay){if(sTarget.match(".*parent")){sTarget=oTargetContainer.id;}if(oTargetContainer){var sWaitingMsg=this.isSearchForm()?"Recherche en cours ...":"Enregistrement en cours ...";ODYForm.doShowWaiting(oTargetContainer,sWaitingMsg);}var sUrl=this.getFormAction();var sSubmit=formData2QueryString(this.m_oDOMForm);if(sTarget){sSubmit=sSubmit.replace(/(^|&)frm=.*?(&|$)/,"$1");}if(this.m_hAdditionalParam){for(var sParam in this.m_hAdditionalParam){sSubmit+=(sSubmit!=""?"&":"")+sParam+"="+escape(this.m_hAdditionalParam[sParam]);}}if(bNoDisplay){sTarget="js:"+sTarget;}if(this.isOneStage()){if(this.m_iStep3){var sFollowing="'js:navigate(\\'"+sUrl+"\\', "+this.m_iStep3+", \\'"+this.findTarget()+"\\')'";var sSuccessExpr="sendForm2('"+this.m_sName+"',oRep,"+sFollowing+","+p_bNoDisplay+")";var oResult=navigateIfNoError(sUrl,this.m_iStep,sTarget,sSubmit,sSuccessExpr,this);}else{var oResult=navigate(sUrl,this.m_iStep,sTarget,sSubmit,bNoDisplay);}}else{var sFollowing=p_sFollowing?"'"+p_sFollowing.replace(/'/g,"\\'")+"'":p_oMainDiv.id.match("ifa_.*")?"'js:exitMultiFicheFromId("+p_oMainDiv.id+")'":(this.m_iStep3?"'navigate(\\'"+sUrl+"\\', "+this.m_iStep3+", \\'"+this.findTarget()+"\\')'":"null");var sResultExpr="navigateIfNoError('"+sUrl+"', "+this.m_iStep2+", '"+sTarget+"','"+sSubmit+"', null, ODYFormRegistry.getODYFormByFormName('"+this.m_sName+"'))";var sSuccessExpr="oRep = sendForm2('"+this.m_sName+"',"+sResultExpr+","+sFollowing+","+p_bNoDisplay+")";var oResult=navigateIfNoError(sUrl,this.m_iStep,sTarget,sSubmit,sSuccessExpr,this);}return oResult;}else{if(this.m_iStep&&this.m_iStep>=0){this.m_oDOMForm.elements["step"].value=this.m_iStep;}if(sTarget){this.m_oDOMForm.elements["frm"].value=sTarget;}if(this.m_sFollowing){this.m_oDOMForm.elements["hdfollowing"].value=this.m_sFollowing;}this.m_oDOMForm.submit();return true;}return false;};ODYForm.prototype.findTarget=function(){var sTarget=this.m_sTargetFrm;if(!sTarget){sTarget=this.m_oDOMForm.elements["frm"].value;}if((!sTarget||""==sTarget)&&this.m_oDOMForm.target){sTarget=this.m_oDOMForm.target;}if(sTarget){var oTgt=decodeFrameDesig(findFunctionCallerObject(),sTarget);if(oTgt&&oTgt.id){sTarget=oTgt.id;}}this.m_sTargetFrm=sTarget;return sTarget;};function onSendAction(p_oMainFormElem,p_oFrameElem){var sValue=getCurrentValue(p_oFrameElem);p_oMainFormElem.value=sValue;}ODYForm.prototype.send=function(p_iStep,p_sFrm,p_sFollowing,p_bNoDisplay){if(!this.isSearchForm()){var sMsg=this.checkMulti();if(sMsg){alert(sMsg);return false;}var iProcessed=this.scanForm(onSendAction,"alert('Le chargement n'est pas terminé. Merci de patienter.')");if(-1==iProcessed){return false;}}else{var oForm=this.m_oDOMForm;for(j=0;j<oForm.elements.length;j++){var elem=oForm.elements[j];if(null==elem){continue;}var sType=elem.type;if(sType!="hidden"&&sType!="checkbox"){continue;}if(elem.getAttribute){if(sType=="hidden"){var sRef=elem.getAttribute("ref");if(sRef){elem.value=oForm.elements["n_"+sRef].value;}}var sOption=elem.getAttribute("option");if(sOption){alert("query : sOption="+sOption);elem.value=sOption;}}}}var oMainDiv=this.getMainContainer();if(oMainDiv.getAttribute(sATTR_MAIN_ENT_ID)){this.addParam(sPARAM_MAIN_ENT_ID,oMainDiv.getAttribute(sATTR_MAIN_ENT_ID));this.addParam(sPARAM_ATTRIBUTE_ID,oMainDiv.getAttribute(sATTR_ATTRIBUTE_ID));}if(p_sFrm){this.m_sTargetFrm=p_sFrm;}this.findTarget();var iNaturalStep=this.m_oDOMForm.elements["step"].value;if(!this.m_iStep){this.m_iStep=iNaturalStep;}if(p_iStep){this.m_iStep=p_iStep;}if(!this.m_iStep){this.m_iStep=this.m_iStep1;}var bNoDisplay=p_bNoDisplay;if(this.m_oDOMForm.id!="choix"&&this.m_oDOMForm.id!="cvtheque"){bNoDisplay=true;}var oResult=this.validateAndSubmit(oMainDiv,p_sFollowing,p_bNoDisplay);if(false==oResult){return;}if(this.isOneStage()){return this.sendStage2(oResult,p_sFollowing,p_bNoDisplay);}var sTarget=this.findTarget();var oTargetContainer=findContainerById(sTarget);if(oTargetContainer){ODYForm.doHideWaiting(oTargetContainer);}return oResult;};ODYForm.prototype.sendStage2=function(p_oResult,p_sFollowing,p_bNoDisplay){if(p_oResult==false){return false;}var bNoDisplay=p_bNoDisplay;if(this.m_oDOMForm.id!="choix"&&this.m_oDOMForm.id!="cvtheque"){bNoDisplay=true;}var oTargetContainer=findContainerById(this.findTarget());if(oTargetContainer){var sWaitingMsg=this.isSearchForm()?"Recherche en cours ...":"Enregistrement en cours ...";ODYForm.doShowWaiting(oTargetContainer,sWaitingMsg);}var xResult;try{if(typeof(p_oResult)=="string"){xResult=getDocElement(p_oResult);}else{if(getClassName(p_oResult).indexOf("DOMElement")!=-1){xResult=p_oResult;}}}catch(e){}var bHasError=false;if(xResult){var vErrList=xResult.selectNodeSet("//errorl/formError");if(!vErrList||vErrList.length==0){vErrList=xResult.selectNodeSet("//data/error");}var bHasError=(vErrList.length>0);var vMsgList=xResult.selectNodeSet("//errorl/formError");var bHasMsg=bHasError||(vMsgList.length>0);}if(bHasError){var oMainDiv=this.getMainContainer();if(oMainDiv.id.match("ifa_.*")){this.showErrors(p_oResult,"exitMultiFicheFromId("+oMainDiv.id+")");}else{this.showErrors(p_oResult);}return false;}else{if(this.moFileList&&this.moFileList.length>0){for(var k=0,l=this.m_moTab.length;k<l;k++){moTab=this.m_moTab[k];var vFile=Form.getInputs(moTab.m_oDOMForm.id,"file");if(!vFile||vFile.length==0){continue;}moTab.m_oDOMForm.encoding="multipart/form-data";moTab.m_oDOMForm.target="uplaodResult";moTab.m_oDOMForm.elements["step"].value=26;moTab.m_oDOMForm.submit();}}}if(xResult){var oDivMsg=$O2(sCONFIRM_MSG_DIV);try{var iEntId;var iQRId;if(this.isSearchForm()){var xQR=xResult.selectNodeSet("//data/qr");if(xQR){xQR=xQR.item(0);}if(xQR){iQRId=xQR.getAttribute("histoTime");}}else{var xEnt=xResult.selectNodeSet("//data/e").item(0);iEntId=xEnt.getAttribute("id");var iEntETId=xEnt.getAttribute("type_id");ODYNavigation.setIdOfLastEntity(iEntId,iEntETId);if(oDivMsg){var sEntityName=xEnt.selectNodeSet("name").item(0).getFirstChild().getNodeValue();}}}catch(e){}if(oDivMsg&&iEntId&&""!=iEntId){oDivMsg.innerHTML=(sEntityName?sEntityName+" : ":"")+"Enregistrement OK";oDivMsg.show("inline");setTimeout(function(){$O2(sCONFIRM_MSG_DIV).hide();},10000);}}if(!bNoDisplay){return true;}if(p_bNoDisplay){this.locallyCommit(iEntId,iEntETId);}if(p_sFollowing){if(p_sFollowing.indexOf("js:")==0){eval(p_sFollowing.substring(3));}else{navigate(p_sFollowing,null,null,null,p_bNoDisplay);}}else{if(!p_bNoDisplay){if(this.isSearchForm()){navigate(addUrlParam("/query.svt",sPARAM_QRESULT_ID,iQRId),10,this.m_sTargetFrm);}else{ODYNavigation.contextBack(true);}}else{var sTarget=this.findTarget();var oTargetContainer=findContainerById(sTarget);ODYForm.doHideWaiting(oTargetContainer);}}return p_oResult;};ODYForm.prototype.showErrors=function(p_oXmlDoc,p_sFollowingExpr){this.moErrorList=ODYForm.buildErrorsArray(p_oXmlDoc,this);this.doShowErrors(p_sFollowingExpr);};ODYForm.prototype.doShowErrors=function(p_sFollowingExpr){return ODYForm.doShowErrors(this.moErrorList,this.getContainer(),p_sFollowingExpr);};ODYForm.doShowWaitingAction=function(p_oTargetContainer){var sMsg="Traitement en cours";return ODYForm.doShowWaiting(p_oTargetContainer,sMsg);};ODYForm.doShowMessageAgency=function(p){var sMsg=p.sHTML;if(p.xDataNode){var xValSet=p.xDataNode.selectNodeSet("avl/av[@asn='agce_message']/val");if(1==xValSet.length){sMsg=xValSet.item(0).getFirstChild().getNodeValue();}}if(!sMsg||sMsg.length==0){return;}var oParentFrm=this.getParentFrmForAlertDiv(p.oTargetContainer);var oAlertDiv=ODYForm.getAlertDiv(oParentFrm);oAlertDiv.findChildById("titreErreur","div").style.display="";oAlertDiv.findChildById("titreValidation","div").style.display="none";var oBtnDiv=this.doShowAlertDivButtonsForErrors(null,oAlertDiv,p.sFollowingExpr);var oPbStop=oBtnDiv.findChildById("stop","a");oBtnDiv.style.visibility="hidden";oPbStop.style.visibility="hidden";var oMsgDiv=oAlertDiv.findChildById("msgContent","div");oMsgDiv.style.visibility="";var oFondDiv=ODYForm.getFondGrisDiv(oParentFrm);var sPrevTab="";oAlertDiv.findChildById("titre","div").innerHTML="ATTENTION: message agence";oMsgDiv.innerHTML=sMsg;ODYForm.showAndCenterAlert(oParentFrm,oFondDiv,oAlertDiv);oAlertDiv.findChildById("close","img").style.display="";};ODYForm.doShowEndAction=function(p_oTargetContainer,p_sHTML,p_sFollowingExpr){var oParentFrm=this.getParentFrmForAlertDiv(p_oTargetContainer);var oAlertDiv=ODYForm.getAlertDiv(oParentFrm);oAlertDiv.findChildById("titreErreur","div").style.display="";oAlertDiv.findChildById("titreValidation","div").style.display="none";var oBtnDiv=this.doShowAlertDivButtonsForErrors(null,oAlertDiv,p_sFollowingExpr);var oPbStop=oBtnDiv.findChildById("stop","a");oPbStop.style.visibility="hidden";var oMsgDiv=oAlertDiv.findChildById("msgContent","div");oMsgDiv.style.visibility="";var oFondDiv=ODYForm.getFondGrisDiv(oParentFrm);var sPrevTab="";oAlertDiv.findChildById("titre","div").innerHTML="Résultat de traitement";oMsgDiv.innerHTML=p_sHTML;ODYForm.showAndCenterAlert(oParentFrm,oFondDiv,oAlertDiv);};ODYForm.doShowWaiting=function(p_oTargetContainer,p_sMsg){var oAlertParentFrm=p_oTargetContainer;var oAlertDiv=ODYForm.getAlertDiv(oAlertParentFrm);oAlertDiv.findChildById("titreErreur","div").hide();oAlertDiv.findChildById("titreValidation","div").show();var oBtnDiv=oAlertDiv.findChildById("btnChoix","div");oBtnDiv.hide();var oMsgDiv=oAlertDiv.findChildById("msgContent","div");oMsgDiv.innerHTML=p_sMsg;oMsgDiv.show();var oFondDiv=ODYForm.getFondGrisDiv(oAlertParentFrm);ODYForm.showAndCenterAlert(oAlertParentFrm,oFondDiv,oAlertDiv);};ODYForm.doHideWaiting=function(p_oTargetContainer){var oAlertParentFrm=p_oTargetContainer;var oAlertActionFormDiv=ODYForm.getAlertDiv(oAlertParentFrm,ODYForm.sACTION_FORM_DIV_ID);var oMsgActionFormDiv=oAlertActionFormDiv.findChildById("msgContent","div");var oAlertDiv=ODYForm.getAlertDiv(oAlertParentFrm);var oMsgDiv=oAlertDiv.findChildById("msgContent","div");var oFondDiv=ODYForm.getFondGrisDiv(oAlertParentFrm);oMsgDiv.hide();oAlertDiv.hide();oMsgActionFormDiv.hide();oAlertActionFormDiv.hide();oFondDiv.hide();};ODYForm.prototype.showActionForm=function(p){p.oCont=this.getContainer();return ODYForm.doShowActionForm(p);};ODYForm.prototype.doShowValidation=function(p_sFollowingUrl,p_sFollowingExpr,p_bInLine,p_oClickedLink){var oButFrm=findContainer(this.m_oDOMForm);var oParentFrm=oButFrm.getContainer();var oTabsFrm=findContainee(oParentFrm,".*tabs.*");var oFirstTab=findContainee(oParentFrm,".*frame(_\\d+)?_1(\\.\\d+)?$");var oAlertDiv=ODYForm.getAlertDiv(oParentFrm);var oFondDiv=ODYForm.getFondGrisDiv(oParentFrm);oAlertDiv.findChildById("titreErreur","div").style.display="none";oAlertDiv.findChildById("titreValidation","div").show();var oBtnDiv=oAlertDiv.findChildById("btnChoix","div");oBtnDiv.style.display="";oBtnDiv.style.visibility="";var oMsgDiv=oAlertDiv.findChildById("msgContent","div");oMsgDiv.show();var sHTML='Des modifications ont été apportées sur la fiche en cours :<br/><div id="msgListeModif"><ul>';for(var i=0,l=this.m_msModified.length;i<l;i++){sHTML+="<li>"+this.m_msModified[i];}oMsgDiv.innerHTML=sHTML+"</ul></div>";oBtnDiv.findChildById("continue","a").style.display="none";oBtnDiv.findChildById("stop","a").style.display="none";var oPbSave=oBtnDiv.findChildById("saveAndContinue","a");var oPbDiscard=oBtnDiv.findChildById("discardAndContinue","a");var oPbBack=oBtnDiv.findChildById("back","a");oPbSave.style.display="";oPbSave.style.visibility="";oPbDiscard.style.display="";oPbDiscard.style.visibility="";oPbBack.style.display="";oPbBack.style.visibility="";oPbSave.clearListeners();var sAction="hideErrors(window.event||e,"+oAlertDiv.id+");";var sFollowing=(p_sFollowingExpr&&p_sFollowingExpr!="")?"js:"+p_sFollowingExpr.replace(/return false/g,""):(p_bInLine?'navigate("'+p_sFollowingUrl+'")':p_sFollowingUrl);sAction+="sendForm("+this.m_iDisplayId+',null,null,"'+sFollowing+'", '+p_bInLine+")";sAction+=";return false;";var bIsCancel=sAction.indexOf("cancel(")!=-1||(p_oClickedLink&&p_oClickedLink.id.match(/pbCancel.*/));if(bIsCancel){oPbSave.style.visibility="hidden";}else{oPbSave.listenTo("click",new Function("e",sAction),false);oPbSave.style.visibility="";}oPbDiscard.clearListeners();var sAction="hideErrors((window.event||e),"+oAlertDiv.id+");"+(p_sFollowingExpr&&p_sFollowingExpr!=""?p_sFollowingExpr:'navigate("'+p_sFollowingUrl+'"); return false;');if(!bIsCancel&&!this.getEntityId()){oPbDiscard.style.visibility="hidden";}else{oPbDiscard.listenTo("click",new Function("e",sAction),false);oPbDiscard.style.visibility="";}ODYForm.showAndCenterAlert(oParentFrm,oFondDiv,oAlertDiv);};ODYForm.prototype.scanForm=function(p_sFuncName,p_sOnNotLoaded){var iProcessed=0;var oMainForm=this.m_oDOMForm;var oMainContainer=this.getMainContainer();var sTS=oMainContainer["ts"];if(!this.m_moTab){return 0;}for(var i=0,tl=this.m_moTab.length;i<tl;i++){if(!this.m_oDOMForm.isValid()){return 0;}var oOFT=this.m_moTab[i];var oTabContainer=findContainee(oMainContainer,"^frame_"+(i+1)+"(\\."+sTS+")?$");if(!oTabContainer){var iDispiId=oMainContainer.id.substring(4);oTabContainer=findContainee(oMainContainer,"^wizardm_frame_"+iDispiId+"_"+(i+1)+"(\\."+sTS+")?$");}if(!oTabContainer){oTabContainer=findContainee(oMainContainer,"^fiche_frame_"+(i+1)+"(\\."+sTS+")?$");}if(!oTabContainer||!oTabContainer.isLoaded()){if(oTabContainer&&oTabContainer.isLoading()){eval(p_sOnNotLoaded);return -1;}else{continue;}}var oForm=oOFT.m_oDOMForm;for(var j=0,l=oForm.elements.length;j<l;j++){var elem=oForm.elements[j];if(elem.name.substring(0,2)=="pb"||elem.name.substring(0,3)=="lib"||elem.name.substring(0,2)=="hd"){continue;}if((elem.type=="radio")&&!elem.checked){continue;}var mainElem=oMainForm.elements[elem.name];if(null==elem||null==mainElem){if(sDbg){sDbg+="from elem '"+elem.name+"' : found in validating form : "+mainElem;}continue;}if(p_sFuncName){var oFunc=typeof(p_sFuncName)=="function"?p_sFuncName:eval(p_sFuncName);oFunc.call(this,mainElem,elem,oOFT.m_sLib);}iProcessed++;}}return iProcessed;};ODYForm.prototype.checkModified=function(e,p_oClickedButton,p_sFollowingUrl,p_sFollowingExpr,p_bInLine){var sMsg=this.checkMulti();if(sMsg){alert(sMsg);return false;}var iModified=this.countModifiedFields();var bCheckIsNew=(p_oClickedButton&&p_oClickedButton.id&&p_oClickedButton.parentNode.id.indexOf("wiz_but_ifa_")==0);if(iModified==0&&bCheckIsNew&&this.isEntityNew()){this.m_iModified=1;this.m_msModified.push("L'entité n'a pas été sauvegardée.");iModified=1;}if(iModified>0){if(p_sFollowingUrl||p_sFollowingExpr){this.doShowValidation(p_sFollowingUrl,p_sFollowingExpr,p_bInLine,p_oClickedButton);return false;}else{var s="Des modifications n'ont pas été sauvegardées :";for(var i=0;i<this.m_msModified.length;i++){s+="\n - "+this.m_msModified[i];}s+="\nContinuer malgré tout ?";if(!confirm(s)){return false;}}}else{if(this.isEntityNew()&&p_oClickedButton.id.indexOf("pbCancel")==-1){this.validate();if(this.moErrorList.length>0){this.doShowErrors();return false;}}var sAction=p_sFollowingExpr&&p_sFollowingExpr!=""?p_sFollowingExpr:'navigate("'+p_sFollowingUrl+'")';var oFunc=new Function("e",sAction);oFunc.apply(p_oClickedButton,[e]);}return true;};ODYForm.prototype.checkMulti=function(){if(!this.m_moTab){return 0;}if(!this.m_oDOMForm.isValid()){return 0;}var sMsg;this.m_moTab.each(function(oOFT){if(!oOFT.m_oDOMForm){return;}var moMulti=oOFT.m_oDOMForm.parentNode.select("div[id^=ifa_]")||[];moMulti.each(function(oDiv){if(oDiv.select("a[id^=pbSave]").length!=0){var sLabId=oDiv.id.replace("ifa_","lab_");var oLab=$O2(sLabId,oOFT.m_oDOMForm);sMsg=(sMsg?sMsg+"\n":"")+"  - '"+(oLab?oLab.textContent:oDiv.id)+"'";}});});if(sMsg){sMsg="Attention données non enregistrés dans le(s) cadre(s) :\n\n"+sMsg+"\n\n\n Merci de retourner à l'affichage de la liste dans chacun de ce(s) cadre(s), en enregistrant ou annulant les modifications";}return sMsg;};ODYForm.prototype.countModifiedFields=function(){this.m_iModified=0;var sMode=this.getDisplayMode();if(sMode&&sMode=="VISU"){return this.m_iModified;}this.m_msModified=new Array();var iProcessed=this.scanForm("countModifiedFieldsAction","alert((oFrame ? oFrame.name + ' : ' : '') + 'La fiche n\\'est pas entierement chargee.')");return iProcessed==-1?-1:this.m_iModified;};function countModifiedFieldsAction(p_oMainFormElem,p_oFrameElem,p_sTabName){var sCurrentValue=getCurrentValue(p_oFrameElem).trim();var sOriginValue=getOriginValue(p_oFrameElem).trim();sOriginValue=sOriginValue.replace(/\r\n/g,"\n");if(sCurrentValue.indexOf(ODYForm.sVALUE_SEP,0)>-1){sCurrentValue=sCurrentValue.split(ODYForm.sVALUE_SEP).sort().join(ODYForm.sVALUE_SEP);}if(sOriginValue.indexOf(ODYForm.sVALUE_SEP,0)>-1){sOriginValue=sOriginValue.split(ODYForm.sVALUE_SEP).sort().join(ODYForm.sVALUE_SEP);}var bModified=(sCurrentValue!=sOriginValue);if(bModified){var sLabel=getInputLabel(p_oFrameElem);if(sOriginValue.length>15){sOriginValue=sOriginValue.substring(0,15)+"[...]";}if(sCurrentValue.length>15){sCurrentValue=sCurrentValue.substring(0,15)+"[...]";}sLabel+=" ('"+sOriginValue+"' => '"+sCurrentValue+"')";this.m_msModified.push(sLabel);this.m_iModified++;}}ODYForm.prototype.locallyCommit=function(p_iEntId,p_iETId){this.m_iModified=0;this.m_msModified=new Array();if(this.isEntityNew()&&p_iEntId){this.setEntityId(p_iEntId);}var iProcessed=this.scanForm(function(p_oMainFormElem,p_oFrameElem,p_sTabName){var sCurrentValue=getCurrentValue(p_oFrameElem);var sOriginValue=getOriginValue(p_oFrameElem);sOriginValue=sOriginValue.replace(/\r\n/g,"\n");var bModified=(sCurrentValue!=sOriginValue);if(!bModified){return;}setOriginValue(p_oFrameElem,sCurrentValue);this.m_iModified++;},"alert(oFrame.name + ' : La fiche n\\'est pas entierement chargee.')");return iProcessed==-1?-1:this.m_iModified;};ODYFormTab=function(p_iId,p_sLib){this.m_iId=p_iId;this.m_sLib=p_sLib;this.m_oParentODYForm=null;this.m_oDOMForm=null;this.m_oCont=null;this.m_iIndex=null;};ODYFormTab.sSPAN_ID_PREFIX="tabs_";ODYFormTab.prototype.getInputByDisplayItemId=function(p_iDispiId){if(null==this.m_oDOMForm){return;}var oInput=Form.getElements(this.m_oDOMForm).find(function(element){return element.getDisplayItemId()==p_iDispiId;});if(!oInput){return;}oInput.m_oTab=this;return oInput;};ODYFormTab.prototype.getInputByAttributeSn=function(p_sAttrSn){if(null==this.m_oDOMForm){return;}var oInput=Form.getElements(this.m_oDOMForm).find(function(element){return element.getAttributeName()==p_sAttrSn;});if(!oInput){return;}if(oInput.id.match("libt_.*")){oInput=this.m_oDOMForm.findChildById(oInput.id.substring(3));}oInput.m_oTab=this;return oInput;};ODYFormTab.prototype.load=function(){var vChildren=this.m_oParentODYForm.getMainContainer().childNodes;for(var i=0,l=vChildren.length;i<l;i++){var oDiv=vChildren[i];if(!oDiv){continue;}if(oDiv.tagName!="DIV"||!oDiv.id||oDiv.id.indexOf("frame")==-1){continue;}if(oDiv.id.match(new RegExp(".*_"+(this.m_iIndex+1)+"(\\.\\d+)?$"))){if(!oDiv.isLoaded()&&oDiv.src){display(oDiv,this.m_oParentODYForm.m_bIsWizard?60:0,oDiv.src);}return true;}}return false;};OInputError=function(p_oInput){this.m_oInput=p_oInput;this.m_sType="input";this.m_sMsg=null;this.m_sValue=null;this.m_sText=null;this.m_iEntityId=null;this.m_sEntityDesignation=null;this.m_sTabName=null;this.m_sFieldName=null;this.m_sLevel=null;this.m_sHTML='<div class="msg-alerte">      <img src="/com/images/alert/#level#.png" align="left" onClick="this.nextSibling.toggle()"/><span       style="font:11px lighter;color:black;display:none;">[#desi#]</span>      <span class="msg">#fieldvalue#&#160;&#160;&#160;#msg#      </span>    </div>';};OInputError.prototype.buildHTML=function(p_sPreviousTabName){var s=this.m_sHTML;s=s.replace(/#level#/,this.m_sLevel?this.m_sLevel.toLowerCase():"error");if(this.m_sTabName&&p_sPreviousTabName!=this.m_sTabName){s='<span class="catMsg">'+this.m_sTabName+"</span>"+s;}var sFieldNameAndValue="";if(this.m_sFieldName){sFieldNameAndValue+='<span class="grasViolet">'+this.m_sFieldName+"</span>";if(this.m_sValue){sFieldNameAndValue+="&#160;";}}if(this.m_sValue){sFieldNameAndValue+='<input type="text" class="hasError" size="'+(this.m_sText.length)+'" value="'+this.m_sText+'">';}if(this.m_sFieldName||this.m_sValue){sFieldNameAndValue+="<br>";}s=s.replace(/#fieldvalue#/,sFieldNameAndValue);var sMsg=this.m_sMsg;if(this.m_sType=="system"){sMsg="<a href=\"#\" onclick=\"this.findBrotherById('errDetails','textarea').show();this.hide()\">( details ... )</a>"+'<textarea id="errDetails" cols="50" rows="7">'+sMsg+"</textarea>";}s=s.replace(/#msg#/,sMsg);var sDesi="";if(this.m_sEntityDesignation){sDesi=this.m_iEntityId+"-"+this.m_sEntityDesignation;}s=s.replace(/#desi#/,sDesi);return s;};function doAction(p_oClicked,p_oEvent,p_sActionExpr){var oAlertDiv=Event.element(e);while(oAlertDiv.parentNode&&(oAlertDiv.id!="alerte")){oAlertDiv=oAlertDiv.parentNode;}oAlertDiv.hide();var oCont=oAlertDiv.getContainer();if(!oCont){return;}var oFondDiv=ODYForm.getFondGrisDiv(oCont);if(oFondDiv){oFondDiv.hide();}return false;}function hideErrors(e,p_sAlertDivId){if(p_sAlertDivId&&typeof(p_sAlertDivId)!="string"){p_sAlertDivId=p_sAlertDivId.id;}var sDivId=p_sAlertDivId?p_sAlertDivId:"alerte";var oAlertDiv=e?Event.element(e):$O2(p_sAlertDivId);while(oAlertDiv.parentNode&&oAlertDiv.id!=sDivId){oAlertDiv=oAlertDiv.parentNode;}oAlertDiv.hide();var oCont=oAlertDiv.getContainer();if(!oCont){return;}var oFondDiv=ODYForm.getFondGrisDiv(oCont);if(oFondDiv){oFondDiv.hide();}}function addClass(classCollectionStr,newClass){if(classCollectionStr){if(classCollectionStr.indexOf("|"+newClass+"|")<0){classCollectionStr+=newClass+"|";}}else{classCollectionStr="|"+newClass+"|";}return classCollectionStr;}DOMException=function(code){this._class=addClass(this._class,"DOMException");this.code=code;};DOMException.INDEX_SIZE_ERR=1;DOMException.DOMSTRING_SIZE_ERR=2;DOMException.HIERARCHY_REQUEST_ERR=3;DOMException.WRONG_DOCUMENT_ERR=4;DOMException.INVALID_CHARACTER_ERR=5;DOMException.NO_DATA_ALLOWED_ERR=6;DOMException.NO_MODIFICATION_ALLOWED_ERR=7;DOMException.NOT_FOUND_ERR=8;DOMException.NOT_SUPPORTED_ERR=9;DOMException.INUSE_ATTRIBUTE_ERR=10;DOMException.INVALID_STATE_ERR=11;DOMException.SYNTAX_ERR=12;DOMException.INVALID_MODIFICATION_ERR=13;DOMException.NAMESPACE_ERR=14;DOMException.INVALID_ACCESS_ERR=15;DOMImplementation=function(){this._class=addClass(this._class,"DOMImplementation");this._p=null;this.preserveWhiteSpace=false;this.namespaceAware=true;this.errorChecking=true;};DOMImplementation.prototype.escapeString=function DOMNode__escapeString(str){return __escapeString(str);};DOMImplementation.prototype.unescapeString=function DOMNode__unescapeString(str){return __unescapeString(str);};DOMImplementation.prototype.hasFeature=function DOMImplementation_hasFeature(feature,version){var ret=false;if(feature.toLowerCase()=="xml"){ret=(!version||(version=="1.0")||(version=="2.0"));}else{if(feature.toLowerCase()=="core"){ret=(!version||(version=="2.0"));}}return ret;};DOMImplementation.prototype.loadXML=function DOMImplementation_loadXML(xmlStr){var parser;try{parser=new XMLP(xmlStr);}catch(e){alert("Error Creating the SAX Parser. Did you include xmlsax.js or tinyxmlsax.js in your web page?\nThe SAX parser is needed to populate XML for <SCRIPT>'s W3C DOM Parser with data.");}var doc=new DOMDocument(this);this._parseLoop(doc,parser);doc._parseComplete=true;return doc;};DOMImplementation.prototype.translateErrCode=function DOMImplementation_translateErrCode(code){var msg="";switch(code){case DOMException.INDEX_SIZE_ERR:msg="INDEX_SIZE_ERR: Index out of bounds";break;case DOMException.DOMSTRING_SIZE_ERR:msg="DOMSTRING_SIZE_ERR: The resulting string is too long to fit in a DOMString";break;case DOMException.HIERARCHY_REQUEST_ERR:msg="HIERARCHY_REQUEST_ERR: The Node can not be inserted at this location";break;case DOMException.WRONG_DOCUMENT_ERR:msg="WRONG_DOCUMENT_ERR: The source and the destination Documents are not the same";break;case DOMException.INVALID_CHARACTER_ERR:msg="INVALID_CHARACTER_ERR: The string contains an invalid character";break;case DOMException.NO_DATA_ALLOWED_ERR:msg="NO_DATA_ALLOWED_ERR: This Node / NodeList does not support data";break;case DOMException.NO_MODIFICATION_ALLOWED_ERR:msg="NO_MODIFICATION_ALLOWED_ERR: This object cannot be modified";break;case DOMException.NOT_FOUND_ERR:msg="NOT_FOUND_ERR: The item cannot be found";break;case DOMException.NOT_SUPPORTED_ERR:msg="NOT_SUPPORTED_ERR: This implementation does not support function";break;case DOMException.INUSE_ATTRIBUTE_ERR:msg="INUSE_ATTRIBUTE_ERR: The Attribute has already been assigned to another Element";break;case DOMException.INVALID_STATE_ERR:msg="INVALID_STATE_ERR: The object is no longer usable";break;case DOMException.SYNTAX_ERR:msg="SYNTAX_ERR: Syntax error";break;case DOMException.INVALID_MODIFICATION_ERR:msg="INVALID_MODIFICATION_ERR: Cannot change the type of the object";break;case DOMException.NAMESPACE_ERR:msg="NAMESPACE_ERR: The namespace declaration is incorrect";break;case DOMException.INVALID_ACCESS_ERR:msg="INVALID_ACCESS_ERR: The object does not support this function";break;default:msg="UNKNOWN: Unknown Exception Code ("+code+")";}return msg;};DOMImplementation.prototype._parseLoop=function DOMImplementation__parseLoop(doc,p){var iEvt,iNode,iAttr,strName;iNodeParent=doc;var el_close_count=0;var entitiesList=new Array();var textNodesList=new Array();if(this.namespaceAware){var iNS=doc.createNamespace("");iNS.setValue("http://www.w3.org/2000/xmlns/");doc._namespaces.setNamedItem(iNS);}while(true){iEvt=p.next();if(iEvt==XMLP._ELM_B){var pName=p.getName();pName=trim(pName,true,true);if(!this.namespaceAware){iNode=doc.createElement(p.getName());for(var i=0;i<p.getAttributeCount();i++){strName=p.getAttributeName(i);iAttr=iNode.getAttributeNode(strName);if(!iAttr){iAttr=doc.createAttribute(strName);}iAttr.setValue(p.getAttributeValue(i));iNode.setAttributeNode(iAttr);}}else{iNode=doc.createElementNS("",p.getName());iNode._namespaces=iNodeParent._namespaces._cloneNodes(iNode);for(var i=0;i<p.getAttributeCount();i++){strName=p.getAttributeName(i);if(this._isNamespaceDeclaration(strName)){var namespaceDec=this._parseNSName(strName);if(strName!="xmlns"){iNS=doc.createNamespace(strName);}else{iNS=doc.createNamespace("");}iNS.setValue(p.getAttributeValue(i));iNode._namespaces.setNamedItem(iNS);}else{iAttr=iNode.getAttributeNode(strName);if(!iAttr){iAttr=doc.createAttributeNS("",strName);}iAttr.setValue(p.getAttributeValue(i));iNode.setAttributeNodeNS(iAttr);if(this._isIdDeclaration(strName)){iNode.id=p.getAttributeValue(i);}}}if(iNode._namespaces.getNamedItem(iNode.prefix)){iNode.namespaceURI=iNode._namespaces.getNamedItem(iNode.prefix).value;}for(var i=0;i<iNode.attributes.length;i++){if(iNode.attributes.item(i).prefix!=""){if(iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix)){iNode.attributes.item(i).namespaceURI=iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix).value;}}}}if(iNodeParent.nodeType==DOMNode.DOCUMENT_NODE){iNodeParent.documentElement=iNode;}iNodeParent.appendChild(iNode);iNodeParent=iNode;}else{if(iEvt==XMLP._ELM_E){iNodeParent=iNodeParent.parentNode;}else{if(iEvt==XMLP._ELM_EMP){pName=p.getName();pName=trim(pName,true,true);if(!this.namespaceAware){iNode=doc.createElement(pName);for(var i=0;i<p.getAttributeCount();i++){strName=p.getAttributeName(i);iAttr=iNode.getAttributeNode(strName);if(!iAttr){iAttr=doc.createAttribute(strName);}iAttr.setValue(p.getAttributeValue(i));iNode.setAttributeNode(iAttr);}}else{iNode=doc.createElementNS("",p.getName());iNode._namespaces=iNodeParent._namespaces._cloneNodes(iNode);for(var i=0;i<p.getAttributeCount();i++){strName=p.getAttributeName(i);if(this._isNamespaceDeclaration(strName)){var namespaceDec=this._parseNSName(strName);if(strName!="xmlns"){iNS=doc.createNamespace(strName);}else{iNS=doc.createNamespace("");}iNS.setValue(p.getAttributeValue(i));iNode._namespaces.setNamedItem(iNS);}else{iAttr=iNode.getAttributeNode(strName);if(!iAttr){iAttr=doc.createAttributeNS("",strName);}iAttr.setValue(p.getAttributeValue(i));iNode.setAttributeNodeNS(iAttr);if(this._isIdDeclaration(strName)){iNode.id=p.getAttributeValue(i);}}}if(iNode._namespaces.getNamedItem(iNode.prefix)){iNode.namespaceURI=iNode._namespaces.getNamedItem(iNode.prefix).value;}for(var i=0;i<iNode.attributes.length;i++){if(iNode.attributes.item(i).prefix!=""){if(iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix)){iNode.attributes.item(i).namespaceURI=iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix).value;}}}}if(iNodeParent.nodeType==DOMNode.DOCUMENT_NODE){iNodeParent.documentElement=iNode;}iNodeParent.appendChild(iNode);}else{if(iEvt==XMLP._TEXT||iEvt==XMLP._ENTITY){var pContent=p.getContent().substring(p.getContentBegin(),p.getContentEnd());if(!this.preserveWhiteSpace){if(trim(pContent,true,true)==""){pContent="";}}if(pContent.length>0){var textNode=doc.createTextNode(pContent);iNodeParent.appendChild(textNode);if(iEvt==XMLP._ENTITY){entitiesList[entitiesList.length]=textNode;}else{textNodesList[textNodesList.length]=textNode;}}}else{if(iEvt==XMLP._PI){iNodeParent.appendChild(doc.createProcessingInstruction(p.getName(),p.getContent().substring(p.getContentBegin(),p.getContentEnd())));}else{if(iEvt==XMLP._CDATA){pContent=p.getContent().substring(p.getContentBegin(),p.getContentEnd());if(!this.preserveWhiteSpace){pContent=trim(pContent,true,true);pContent.replace(/ +/g," ");}if(pContent.length>0){iNodeParent.appendChild(doc.createCDATASection(pContent));}}else{if(iEvt==XMLP._COMMENT){var pContent=p.getContent().substring(p.getContentBegin(),p.getContentEnd());if(!this.preserveWhiteSpace){pContent=trim(pContent,true,true);pContent.replace(/ +/g," ");}if(pContent.length>0){iNodeParent.appendChild(doc.createComment(pContent));}}else{if(iEvt==XMLP._DTD){}else{if(iEvt==XMLP._ERROR){throw (new DOMException(DOMException.SYNTAX_ERR));}else{if(iEvt==XMLP._NONE){if(iNodeParent==doc){break;}else{throw (new DOMException(DOMException.SYNTAX_ERR));}}}}}}}}}}}}var intCount=entitiesList.length;for(intLoop=0;intLoop<intCount;intLoop++){var entity=entitiesList[intLoop];var parentNode=entity.getParentNode();if(parentNode){parentNode.normalize();if(!this.preserveWhiteSpace){var children=parentNode.getChildNodes();var intCount2=children.getLength();for(intLoop2=0;intLoop2<intCount2;intLoop2++){var child=children.item(intLoop2);if(child.getNodeType()==DOMNode.TEXT_NODE){var childData=child.getData();childData=trim(childData,true,true);childData.replace(/ +/g," ");child.setData(childData);}}}}}if(!this.preserveWhiteSpace){var intCount=textNodesList.length;for(intLoop=0;intLoop<intCount;intLoop++){var node=textNodesList[intLoop];if(node.getParentNode()!=null){var nodeData=node.getData();nodeData=trim(nodeData,true,true);nodeData.replace(/ +/g," ");node.setData(nodeData);}}}};DOMImplementation.prototype._isNamespaceDeclaration=function DOMImplementation__isNamespaceDeclaration(attributeName){return(attributeName.indexOf("xmlns")>-1);};DOMImplementation.prototype._isIdDeclaration=function DOMImplementation__isIdDeclaration(attributeName){return(attributeName.toLowerCase()=="id");};DOMImplementation.prototype._isValidName=function DOMImplementation__isValidName(name){return name.match(re_validName);};re_validName=/^[a-zA-Z_:][a-zA-Z0-9\.\-_:]*$/;DOMImplementation.prototype._isValidString=function DOMImplementation__isValidString(name){return(name.search(re_invalidStringChars)<0);};re_invalidStringChars=/\x01|\x02|\x03|\x04|\x05|\x06|\x07|\x08|\x0B|\x0C|\x0E|\x0F|\x10|\x11|\x12|\x13|\x14|\x15|\x16|\x17|\x18|\x19|\x1A|\x1B|\x1C|\x1D|\x1E|\x1F|\x7F/;DOMImplementation.prototype._parseNSName=function DOMImplementation__parseNSName(qualifiedName){var resultNSName=new Object();resultNSName.prefix=qualifiedName;resultNSName.namespaceName="";delimPos=qualifiedName.indexOf(":");if(delimPos>-1){resultNSName.prefix=qualifiedName.substring(0,delimPos);resultNSName.namespaceName=qualifiedName.substring(delimPos+1,qualifiedName.length);}return resultNSName;};DOMImplementation.prototype._parseQName=function DOMImplementation__parseQName(qualifiedName){var resultQName=new Object();resultQName.localName=qualifiedName;resultQName.prefix="";delimPos=qualifiedName.indexOf(":");if(delimPos>-1){resultQName.prefix=qualifiedName.substring(0,delimPos);resultQName.localName=qualifiedName.substring(delimPos+1,qualifiedName.length);}return resultQName;};DOMNodeList=function(ownerDocument,parentNode){this._class=addClass(this._class,"DOMNodeList");this._nodes=new Array();this.length=0;this.parentNode=parentNode;this.ownerDocument=ownerDocument;this._readonly=false;};DOMNodeList.prototype.getLength=function DOMNodeList_getLength(){return this.length;};DOMNodeList.prototype.item=function DOMNodeList_item(index){var ret=null;if((index>=0)&&(index<this._nodes.length)){ret=this._nodes[index];}return ret;};DOMNodeList.prototype._findItemIndex=function DOMNodeList__findItemIndex(id){var ret=-1;if(id>-1){for(var i=0;i<this._nodes.length;i++){if(this._nodes[i]._id==id){ret=i;break;}}}return ret;};DOMNodeList.prototype._insertBefore=function DOMNodeList__insertBefore(newChild,refChildIndex){if((refChildIndex>=0)&&(refChildIndex<this._nodes.length)){var tmpArr=new Array();tmpArr=this._nodes.slice(0,refChildIndex);if(newChild.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){tmpArr=tmpArr.concat(newChild.childNodes._nodes);}else{tmpArr[tmpArr.length]=newChild;}this._nodes=tmpArr.concat(this._nodes.slice(refChildIndex));this.length=this._nodes.length;}};DOMNodeList.prototype._replaceChild=function DOMNodeList__replaceChild(newChild,refChildIndex){var ret=null;if((refChildIndex>=0)&&(refChildIndex<this._nodes.length)){ret=this._nodes[refChildIndex];if(newChild.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){var tmpArr=new Array();tmpArr=this._nodes.slice(0,refChildIndex);tmpArr=tmpArr.concat(newChild.childNodes._nodes);this._nodes=tmpArr.concat(this._nodes.slice(refChildIndex+1));}else{this._nodes[refChildIndex]=newChild;}}return ret;};DOMNodeList.prototype._removeChild=function DOMNodeList__removeChild(refChildIndex){var ret=null;if(refChildIndex>-1){ret=this._nodes[refChildIndex];var tmpArr=new Array();tmpArr=this._nodes.slice(0,refChildIndex);this._nodes=tmpArr.concat(this._nodes.slice(refChildIndex+1));this.length=this._nodes.length;}return ret;};DOMNodeList.prototype._appendChild=function DOMNodeList__appendChild(newChild){if(newChild.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){this._nodes=this._nodes.concat(newChild.childNodes._nodes);}else{this._nodes[this._nodes.length]=newChild;}this.length=this._nodes.length;};DOMNodeList.prototype._cloneNodes=function DOMNodeList__cloneNodes(deep,parentNode){var cloneNodeList=new DOMNodeList(this.ownerDocument,parentNode);for(var i=0;i<this._nodes.length;i++){cloneNodeList._appendChild(this._nodes[i].cloneNode(deep));}return cloneNodeList;};DOMNodeList.prototype.toString=function DOMNodeList_toString(){var ret="";for(var i=0;i<this.length;i++){ret+=this._nodes[i].toString();}return ret;};DOMNamedNodeMap=function(ownerDocument,parentNode){this._class=addClass(this._class,"DOMNamedNodeMap");this.DOMNodeList=DOMNodeList;this.DOMNodeList(ownerDocument,parentNode);};DOMNamedNodeMap.prototype=new DOMNodeList;DOMNamedNodeMap.prototype.getNamedItem=function DOMNamedNodeMap_getNamedItem(name){var ret=null;var itemIndex=this._findNamedItemIndex(name);if(itemIndex>-1){ret=this._nodes[itemIndex];}return ret;};DOMNamedNodeMap.prototype.setNamedItem=function DOMNamedNodeMap_setNamedItem(arg){if(this.ownerDocument.implementation.errorChecking){if(this.ownerDocument!=arg.ownerDocument){throw (new DOMException(DOMException.WRONG_DOCUMENT_ERR));}if(this._readonly||(this.parentNode&&this.parentNode._readonly)){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(arg.ownerElement&&(arg.ownerElement!=this.parentNode)){throw (new DOMException(DOMException.INUSE_ATTRIBUTE_ERR));}}var itemIndex=this._findNamedItemIndex(arg.name);var ret=null;if(itemIndex>-1){ret=this._nodes[itemIndex];if(this.ownerDocument.implementation.errorChecking&&ret._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}else{this._nodes[itemIndex]=arg;}}else{this._nodes[this.length]=arg;}this.length=this._nodes.length;arg.ownerElement=this.parentNode;return ret;};DOMNamedNodeMap.prototype.removeNamedItem=function DOMNamedNodeMap_removeNamedItem(name){var ret=null;if(this.ownerDocument.implementation.errorChecking&&(this._readonly||(this.parentNode&&this.parentNode._readonly))){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}var itemIndex=this._findNamedItemIndex(name);if(this.ownerDocument.implementation.errorChecking&&(itemIndex<0)){throw (new DOMException(DOMException.NOT_FOUND_ERR));}var oldNode=this._nodes[itemIndex];if(this.ownerDocument.implementation.errorChecking&&oldNode._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}return this._removeChild(itemIndex);};DOMNamedNodeMap.prototype.getNamedItemNS=function DOMNamedNodeMap_getNamedItemNS(namespaceURI,localName){var ret=null;var itemIndex=this._findNamedItemNSIndex(namespaceURI,localName);if(itemIndex>-1){ret=this._nodes[itemIndex];}return ret;};DOMNamedNodeMap.prototype.setNamedItemNS=function DOMNamedNodeMap_setNamedItemNS(arg){if(this.ownerDocument.implementation.errorChecking){if(this._readonly||(this.parentNode&&this.parentNode._readonly)){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(this.ownerDocument!=arg.ownerDocument){throw (new DOMException(DOMException.WRONG_DOCUMENT_ERR));}if(arg.ownerElement&&(arg.ownerElement!=this.parentNode)){throw (new DOMException(DOMException.INUSE_ATTRIBUTE_ERR));}}var itemIndex=this._findNamedItemNSIndex(arg.namespaceURI,arg.localName);var ret=null;if(itemIndex>-1){ret=this._nodes[itemIndex];if(this.ownerDocument.implementation.errorChecking&&ret._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}else{this._nodes[itemIndex]=arg;}}else{this._nodes[this.length]=arg;}this.length=this._nodes.length;arg.ownerElement=this.parentNode;return ret;};DOMNamedNodeMap.prototype.removeNamedItemNS=function DOMNamedNodeMap_removeNamedItemNS(namespaceURI,localName){var ret=null;if(this.ownerDocument.implementation.errorChecking&&(this._readonly||(this.parentNode&&this.parentNode._readonly))){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}var itemIndex=this._findNamedItemNSIndex(namespaceURI,localName);if(this.ownerDocument.implementation.errorChecking&&(itemIndex<0)){throw (new DOMException(DOMException.NOT_FOUND_ERR));}var oldNode=this._nodes[itemIndex];if(this.ownerDocument.implementation.errorChecking&&oldNode._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}return this._removeChild(itemIndex);};DOMNamedNodeMap.prototype._findNamedItemIndex=function DOMNamedNodeMap__findNamedItemIndex(name){var ret=-1;for(var i=0;i<this._nodes.length;i++){if(this._nodes[i].name==name){ret=i;break;}}return ret;};DOMNamedNodeMap.prototype._findNamedItemNSIndex=function DOMNamedNodeMap__findNamedItemNSIndex(namespaceURI,localName){var ret=-1;if(localName){for(var i=0;i<this._nodes.length;i++){if((this._nodes[i].namespaceURI==namespaceURI)&&(this._nodes[i].localName==localName)){ret=i;break;}}}return ret;};DOMNamedNodeMap.prototype._hasAttribute=function DOMNamedNodeMap__hasAttribute(name){var ret=false;var itemIndex=this._findNamedItemIndex(name);if(itemIndex>-1){ret=true;}return ret;};DOMNamedNodeMap.prototype._hasAttributeNS=function DOMNamedNodeMap__hasAttributeNS(namespaceURI,localName){var ret=false;var itemIndex=this._findNamedItemNSIndex(namespaceURI,localName);if(itemIndex>-1){ret=true;}return ret;};DOMNamedNodeMap.prototype._cloneNodes=function DOMNamedNodeMap__cloneNodes(parentNode){var cloneNamedNodeMap=new DOMNamedNodeMap(this.ownerDocument,parentNode);for(var i=0;i<this._nodes.length;i++){cloneNamedNodeMap._appendChild(this._nodes[i].cloneNode(false));}return cloneNamedNodeMap;};DOMNamedNodeMap.prototype.toString=function DOMNamedNodeMap_toString(){var ret="";for(var i=0;i<this.length-1;i++){ret+=this._nodes[i].toString()+" ";}if(this.length>0){ret+=this._nodes[this.length-1].toString();}return ret;};DOMNamespaceNodeMap=function(ownerDocument,parentNode){this._class=addClass(this._class,"DOMNamespaceNodeMap");this.DOMNamedNodeMap=DOMNamedNodeMap;this.DOMNamedNodeMap(ownerDocument,parentNode);};DOMNamespaceNodeMap.prototype=new DOMNamedNodeMap;DOMNamespaceNodeMap.prototype._findNamedItemIndex=function DOMNamespaceNodeMap__findNamedItemIndex(localName){var ret=-1;for(var i=0;i<this._nodes.length;i++){if(this._nodes[i].localName==localName){ret=i;break;}}return ret;};DOMNamespaceNodeMap.prototype._cloneNodes=function DOMNamespaceNodeMap__cloneNodes(parentNode){var cloneNamespaceNodeMap=new DOMNamespaceNodeMap(this.ownerDocument,parentNode);for(var i=0;i<this._nodes.length;i++){cloneNamespaceNodeMap._appendChild(this._nodes[i].cloneNode(false));}return cloneNamespaceNodeMap;};DOMNamespaceNodeMap.prototype.toString=function DOMNamespaceNodeMap_toString(){var ret="";for(var ind=0;ind<this._nodes.length;ind++){var ns=null;try{var ns=this.parentNode.parentNode._namespaces.getNamedItem(this._nodes[ind].localName);}catch(e){break;}if(!(ns&&(""+ns.nodeValue==""+this._nodes[ind].nodeValue))){ret+=this._nodes[ind].toString()+" ";}}return ret;};DOMNode=function(ownerDocument){this._class=addClass(this._class,"DOMNode");if(ownerDocument){this._id=ownerDocument._genId();}this.namespaceURI="";this.prefix="";this.localName="";this.nodeName="";this.nodeValue="";this.nodeType=0;this.parentNode=null;this.childNodes=new DOMNodeList(ownerDocument,this);this.firstChild=null;this.lastChild=null;this.previousSibling=null;this.nextSibling=null;this.attributes=new DOMNamedNodeMap(ownerDocument,this);this.ownerDocument=ownerDocument;this._namespaces=new DOMNamespaceNodeMap(ownerDocument,this);this._readonly=false;};DOMNode.ELEMENT_NODE=1;DOMNode.ATTRIBUTE_NODE=2;DOMNode.TEXT_NODE=3;DOMNode.CDATA_SECTION_NODE=4;DOMNode.ENTITY_REFERENCE_NODE=5;DOMNode.ENTITY_NODE=6;DOMNode.PROCESSING_INSTRUCTION_NODE=7;DOMNode.COMMENT_NODE=8;DOMNode.DOCUMENT_NODE=9;DOMNode.DOCUMENT_TYPE_NODE=10;DOMNode.DOCUMENT_FRAGMENT_NODE=11;DOMNode.NOTATION_NODE=12;DOMNode.NAMESPACE_NODE=13;DOMNode.prototype.hasAttributes=function DOMNode_hasAttributes(){if(this.attributes.length==0){return false;}else{return true;}};DOMNode.prototype.getNodeName=function DOMNode_getNodeName(){return this.nodeName;};DOMNode.prototype.getNodeValue=function DOMNode_getNodeValue(){return this.nodeValue;};DOMNode.prototype.setNodeValue=function DOMNode_setNodeValue(nodeValue){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}this.nodeValue=nodeValue;};DOMNode.prototype.getNodeType=function DOMNode_getNodeType(){return this.nodeType;};DOMNode.prototype.getParentNode=function DOMNode_getParentNode(){return this.parentNode;};DOMNode.prototype.getChildNodes=function DOMNode_getChildNodes(){return this.childNodes;};DOMNode.prototype.getFirstChild=function DOMNode_getFirstChild(){return this.firstChild;};DOMNode.prototype.getLastChild=function DOMNode_getLastChild(){return this.lastChild;};DOMNode.prototype.getPreviousSibling=function DOMNode_getPreviousSibling(){return this.previousSibling;};DOMNode.prototype.getNextSibling=function DOMNode_getNextSibling(){return this.nextSibling;};DOMNode.prototype.getAttributes=function DOMNode_getAttributes(){return this.attributes;};DOMNode.prototype.getOwnerDocument=function DOMNode_getOwnerDocument(){return this.ownerDocument;};DOMNode.prototype.getNamespaceURI=function DOMNode_getNamespaceURI(){return this.namespaceURI;};DOMNode.prototype.getPrefix=function DOMNode_getPrefix(){return this.prefix;};DOMNode.prototype.setPrefix=function DOMNode_setPrefix(prefix){if(this.ownerDocument.implementation.errorChecking){if(this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(!this.ownerDocument.implementation._isValidName(prefix)){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}if(!this.ownerDocument._isValidNamespace(this.namespaceURI,prefix+":"+this.localName)){throw (new DOMException(DOMException.NAMESPACE_ERR));}if((prefix=="xmlns")&&(this.namespaceURI!="http://www.w3.org/2000/xmlns/")){throw (new DOMException(DOMException.NAMESPACE_ERR));}if((prefix=="")&&(this.localName=="xmlns")){throw (new DOMException(DOMException.NAMESPACE_ERR));}}this.prefix=prefix;if(this.prefix!=""){this.nodeName=this.prefix+":"+this.localName;}else{this.nodeName=this.localName;}};DOMNode.prototype.getLocalName=function DOMNode_getLocalName(){return this.localName;};DOMNode.prototype.insertBefore=function DOMNode_insertBefore(newChild,refChild){var prevNode;if(this.ownerDocument.implementation.errorChecking){if(this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(this.ownerDocument!=newChild.ownerDocument){throw (new DOMException(DOMException.WRONG_DOCUMENT_ERR));}if(this._isAncestor(newChild)){throw (new DOMException(DOMException.HIERARCHY_REQUEST_ERR));}}if(refChild){var itemIndex=this.childNodes._findItemIndex(refChild._id);if(this.ownerDocument.implementation.errorChecking&&(itemIndex<0)){throw (new DOMException(DOMException.NOT_FOUND_ERR));}var newChildParent=newChild.parentNode;if(newChildParent){newChildParent.removeChild(newChild);}this.childNodes._insertBefore(newChild,this.childNodes._findItemIndex(refChild._id));prevNode=refChild.previousSibling;if(newChild.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(newChild.childNodes._nodes.length>0){for(var ind=0;ind<newChild.childNodes._nodes.length;ind++){newChild.childNodes._nodes[ind].parentNode=this;}refChild.previousSibling=newChild.childNodes._nodes[newChild.childNodes._nodes.length-1];}}else{newChild.parentNode=this;refChild.previousSibling=newChild;}}else{prevNode=this.lastChild;this.appendChild(newChild);}if(newChild.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(newChild.childNodes._nodes.length>0){if(prevNode){prevNode.nextSibling=newChild.childNodes._nodes[0];}else{this.firstChild=newChild.childNodes._nodes[0];}newChild.childNodes._nodes[0].previousSibling=prevNode;newChild.childNodes._nodes[newChild.childNodes._nodes.length-1].nextSibling=refChild;}}else{if(prevNode){prevNode.nextSibling=newChild;}else{this.firstChild=newChild;}newChild.previousSibling=prevNode;newChild.nextSibling=refChild;}return newChild;};DOMNode.prototype.replaceChild=function DOMNode_replaceChild(newChild,oldChild){var ret=null;if(this.ownerDocument.implementation.errorChecking){if(this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(this.ownerDocument!=newChild.ownerDocument){throw (new DOMException(DOMException.WRONG_DOCUMENT_ERR));}if(this._isAncestor(newChild)){throw (new DOMException(DOMException.HIERARCHY_REQUEST_ERR));}}var index=this.childNodes._findItemIndex(oldChild._id);if(this.ownerDocument.implementation.errorChecking&&(index<0)){throw (new DOMException(DOMException.NOT_FOUND_ERR));}var newChildParent=newChild.parentNode;if(newChildParent){newChildParent.removeChild(newChild);}ret=this.childNodes._replaceChild(newChild,index);if(newChild.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(newChild.childNodes._nodes.length>0){for(var ind=0;ind<newChild.childNodes._nodes.length;ind++){newChild.childNodes._nodes[ind].parentNode=this;}if(oldChild.previousSibling){oldChild.previousSibling.nextSibling=newChild.childNodes._nodes[0];}else{this.firstChild=newChild.childNodes._nodes[0];}if(oldChild.nextSibling){oldChild.nextSibling.previousSibling=newChild;}else{this.lastChild=newChild.childNodes._nodes[newChild.childNodes._nodes.length-1];}newChild.childNodes._nodes[0].previousSibling=oldChild.previousSibling;newChild.childNodes._nodes[newChild.childNodes._nodes.length-1].nextSibling=oldChild.nextSibling;}}else{newChild.parentNode=this;if(oldChild.previousSibling){oldChild.previousSibling.nextSibling=newChild;}else{this.firstChild=newChild;}if(oldChild.nextSibling){oldChild.nextSibling.previousSibling=newChild;}else{this.lastChild=newChild;}newChild.previousSibling=oldChild.previousSibling;newChild.nextSibling=oldChild.nextSibling;}return ret;};DOMNode.prototype.removeChild=function DOMNode_removeChild(oldChild){if(this.ownerDocument.implementation.errorChecking&&(this._readonly||oldChild._readonly)){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}var itemIndex=this.childNodes._findItemIndex(oldChild._id);if(this.ownerDocument.implementation.errorChecking&&(itemIndex<0)){throw (new DOMException(DOMException.NOT_FOUND_ERR));}this.childNodes._removeChild(itemIndex);oldChild.parentNode=null;if(oldChild.previousSibling){oldChild.previousSibling.nextSibling=oldChild.nextSibling;}else{this.firstChild=oldChild.nextSibling;}if(oldChild.nextSibling){oldChild.nextSibling.previousSibling=oldChild.previousSibling;}else{this.lastChild=oldChild.previousSibling;}oldChild.previousSibling=null;oldChild.nextSibling=null;return oldChild;};DOMNode.prototype.appendChild=function DOMNode_appendChild(newChild){if(this.ownerDocument.implementation.errorChecking){if(this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(this.ownerDocument!=newChild.ownerDocument){throw (new DOMException(DOMException.WRONG_DOCUMENT_ERR));}if(this._isAncestor(newChild)){throw (new DOMException(DOMException.HIERARCHY_REQUEST_ERR));}}var newChildParent=newChild.parentNode;if(newChildParent){newChildParent.removeChild(newChild);}this.childNodes._appendChild(newChild);if(newChild.nodeType==DOMNode.DOCUMENT_FRAGMENT_NODE){if(newChild.childNodes._nodes.length>0){for(var ind=0;ind<newChild.childNodes._nodes.length;ind++){newChild.childNodes._nodes[ind].parentNode=this;}if(this.lastChild){this.lastChild.nextSibling=newChild.childNodes._nodes[0];newChild.childNodes._nodes[0].previousSibling=this.lastChild;this.lastChild=newChild.childNodes._nodes[newChild.childNodes._nodes.length-1];}else{this.lastChild=newChild.childNodes._nodes[newChild.childNodes._nodes.length-1];this.firstChild=newChild.childNodes._nodes[0];}}}else{newChild.parentNode=this;if(this.lastChild){this.lastChild.nextSibling=newChild;newChild.previousSibling=this.lastChild;this.lastChild=newChild;}else{this.lastChild=newChild;this.firstChild=newChild;}}return newChild;};DOMNode.prototype.hasChildNodes=function DOMNode_hasChildNodes(){return(this.childNodes.length>0);};DOMNode.prototype.cloneNode=function DOMNode_cloneNode(deep){try{return this.ownerDocument.importNode(this,deep);}catch(e){return null;}};DOMNode.prototype.normalize=function DOMNode_normalize(){var inode;var nodesToRemove=new DOMNodeList();if(this.nodeType==DOMNode.ELEMENT_NODE||this.nodeType==DOMNode.DOCUMENT_NODE){var adjacentTextNode=null;for(var i=0;i<this.childNodes.length;i++){inode=this.childNodes.item(i);if(inode.nodeType==DOMNode.TEXT_NODE){if(inode.length<1){nodesToRemove._appendChild(inode);}else{if(adjacentTextNode){adjacentTextNode.appendData(inode.data);nodesToRemove._appendChild(inode);}else{adjacentTextNode=inode;}}}else{adjacentTextNode=null;inode.normalize();}}for(var i=0;i<nodesToRemove.length;i++){inode=nodesToRemove.item(i);inode.parentNode.removeChild(inode);}}};DOMNode.prototype.isSupported=function DOMNode_isSupported(feature,version){return this.ownerDocument.implementation.hasFeature(feature,version);};DOMNode.prototype.getElementsByTagName=function DOMNode_getElementsByTagName(tagname){return this._getElementsByTagNameRecursive(tagname,new DOMNodeList(this.ownerDocument));};DOMNode.prototype._getElementsByTagNameRecursive=function DOMNode__getElementsByTagNameRecursive(tagname,nodeList){if(this.nodeType==DOMNode.ELEMENT_NODE||this.nodeType==DOMNode.DOCUMENT_NODE){if((this.nodeName==tagname)||(tagname=="*")){nodeList._appendChild(this);}for(var i=0;i<this.childNodes.length;i++){nodeList=this.childNodes.item(i)._getElementsByTagNameRecursive(tagname,nodeList);}}return nodeList;};DOMNode.prototype.getXML=function DOMNode_getXML(){return this.toString();};DOMNode.prototype.getElementsByTagNameNS=function DOMNode_getElementsByTagNameNS(namespaceURI,localName){return this._getElementsByTagNameNSRecursive(namespaceURI,localName,new DOMNodeList(this.ownerDocument));};DOMNode.prototype._getElementsByTagNameNSRecursive=function DOMNode__getElementsByTagNameNSRecursive(namespaceURI,localName,nodeList){if(this.nodeType==DOMNode.ELEMENT_NODE||this.nodeType==DOMNode.DOCUMENT_NODE){if(((this.namespaceURI==namespaceURI)||(namespaceURI=="*"))&&((this.localName==localName)||(localName=="*"))){nodeList._appendChild(this);}for(var i=0;i<this.childNodes.length;i++){nodeList=this.childNodes.item(i)._getElementsByTagNameNSRecursive(namespaceURI,localName,nodeList);}}return nodeList;};DOMNode.prototype._isAncestor=function DOMNode__isAncestor(node){return((this==node)||((this.parentNode)&&(this.parentNode._isAncestor(node))));};DOMNode.prototype.importNode=function DOMNode_importNode(importedNode,deep){var importNode;this.getOwnerDocument()._performingImportNodeOperation=true;try{if(importedNode.nodeType==DOMNode.ELEMENT_NODE){if(!this.ownerDocument.implementation.namespaceAware){importNode=this.ownerDocument.createElement(importedNode.tagName);for(var i=0;i<importedNode.attributes.length;i++){importNode.setAttribute(importedNode.attributes.item(i).name,importedNode.attributes.item(i).value);}}else{importNode=this.ownerDocument.createElementNS(importedNode.namespaceURI,importedNode.nodeName);for(var i=0;i<importedNode.attributes.length;i++){importNode.setAttributeNS(importedNode.attributes.item(i).namespaceURI,importedNode.attributes.item(i).name,importedNode.attributes.item(i).value);}for(var i=0;i<importedNode._namespaces.length;i++){importNode._namespaces._nodes[i]=this.ownerDocument.createNamespace(importedNode._namespaces.item(i).localName);importNode._namespaces._nodes[i].setValue(importedNode._namespaces.item(i).value);}}}else{if(importedNode.nodeType==DOMNode.ATTRIBUTE_NODE){if(!this.ownerDocument.implementation.namespaceAware){importNode=this.ownerDocument.createAttribute(importedNode.name);}else{importNode=this.ownerDocument.createAttributeNS(importedNode.namespaceURI,importedNode.nodeName);for(var i=0;i<importedNode._namespaces.length;i++){importNode._namespaces._nodes[i]=this.ownerDocument.createNamespace(importedNode._namespaces.item(i).localName);importNode._namespaces._nodes[i].setValue(importedNode._namespaces.item(i).value);}}importNode.setValue(importedNode.value);}else{if(importedNode.nodeType==DOMNode.DOCUMENT_FRAGMENT){importNode=this.ownerDocument.createDocumentFragment();}else{if(importedNode.nodeType==DOMNode.NAMESPACE_NODE){importNode=this.ownerDocument.createNamespace(importedNode.nodeName);importNode.setValue(importedNode.value);}else{if(importedNode.nodeType==DOMNode.TEXT_NODE){importNode=this.ownerDocument.createTextNode(importedNode.data);}else{if(importedNode.nodeType==DOMNode.CDATA_SECTION_NODE){importNode=this.ownerDocument.createCDATASection(importedNode.data);}else{if(importedNode.nodeType==DOMNode.PROCESSING_INSTRUCTION_NODE){importNode=this.ownerDocument.createProcessingInstruction(importedNode.target,importedNode.data);}else{if(importedNode.nodeType==DOMNode.COMMENT_NODE){importNode=this.ownerDocument.createComment(importedNode.data);}else{throw (new DOMException(DOMException.NOT_SUPPORTED_ERR));}}}}}}}}if(deep){for(var i=0;i<importedNode.childNodes.length;i++){importNode.appendChild(this.ownerDocument.importNode(importedNode.childNodes.item(i),true));}}this.getOwnerDocument()._performingImportNodeOperation=false;return importNode;}catch(eAny){this.getOwnerDocument()._performingImportNodeOperation=false;throw eAny;}};DOMNode.prototype.__escapeString=function DOMNode__escapeString(str){return __escapeString(str);};DOMNode.prototype.__unescapeString=function DOMNode__unescapeString(str){return __unescapeString(str);};DOMDocument=function(implementation){this._class=addClass(this._class,"DOMDocument");this.DOMNode=DOMNode;this.DOMNode(this);this.doctype=null;this.implementation=implementation;this.documentElement=null;this.all=new Array();this.nodeName="#document";this.nodeType=DOMNode.DOCUMENT_NODE;this._id=0;this._lastId=0;this._parseComplete=false;this.ownerDocument=this;this._performingImportNodeOperation=false;};DOMDocument.prototype=new DOMNode;DOMDocument.prototype.getDoctype=function DOMDocument_getDoctype(){return this.doctype;};DOMDocument.prototype.getImplementation=function DOMDocument_implementation(){return this.implementation;};DOMDocument.prototype.getDocumentElement=function DOMDocument_getDocumentElement(){return this.documentElement;};DOMDocument.prototype.createElement=function DOMDocument_createElement(tagName){if(this.ownerDocument.implementation.errorChecking&&(!this.ownerDocument.implementation._isValidName(tagName))){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}var node=new DOMElement(this);node.tagName=tagName;node.nodeName=tagName;this.all[this.all.length]=node;return node;};DOMDocument.prototype.createDocumentFragment=function DOMDocument_createDocumentFragment(){var node=new DOMDocumentFragment(this);return node;};DOMDocument.prototype.createTextNode=function DOMDocument_createTextNode(data){var node=new DOMText(this);node.data=data;node.nodeValue=data;node.length=data.length;return node;};DOMDocument.prototype.createComment=function DOMDocument_createComment(data){var node=new DOMComment(this);node.data=data;node.nodeValue=data;node.length=data.length;return node;};DOMDocument.prototype.createCDATASection=function DOMDocument_createCDATASection(data){var node=new DOMCDATASection(this);node.data=data;node.nodeValue=data;node.length=data.length;return node;};DOMDocument.prototype.createProcessingInstruction=function DOMDocument_createProcessingInstruction(target,data){if(this.ownerDocument.implementation.errorChecking&&(!this.implementation._isValidName(target))){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}var node=new DOMProcessingInstruction(this);node.target=target;node.nodeName=target;node.data=data;node.nodeValue=data;node.length=data.length;return node;};DOMDocument.prototype.createAttribute=function DOMDocument_createAttribute(name){if(this.ownerDocument.implementation.errorChecking&&(!this.ownerDocument.implementation._isValidName(name))){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}var node=new DOMAttr(this);node.name=name;node.nodeName=name;return node;};DOMDocument.prototype.createElementNS=function DOMDocument_createElementNS(namespaceURI,qualifiedName){if(this.ownerDocument.implementation.errorChecking){if(!this.ownerDocument._isValidNamespace(namespaceURI,qualifiedName)){throw (new DOMException(DOMException.NAMESPACE_ERR));}if(!this.ownerDocument.implementation._isValidName(qualifiedName)){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}}var node=new DOMElement(this);var qname=this.implementation._parseQName(qualifiedName);node.nodeName=qualifiedName;node.namespaceURI=namespaceURI;node.prefix=qname.prefix;node.localName=qname.localName;node.tagName=qualifiedName;this.all[this.all.length]=node;return node;};DOMDocument.prototype.createAttributeNS=function DOMDocument_createAttributeNS(namespaceURI,qualifiedName){if(this.ownerDocument.implementation.errorChecking){if(!this.ownerDocument._isValidNamespace(namespaceURI,qualifiedName,true)){throw (new DOMException(DOMException.NAMESPACE_ERR));}if(!this.ownerDocument.implementation._isValidName(qualifiedName)){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}}var node=new DOMAttr(this);var qname=this.implementation._parseQName(qualifiedName);node.nodeName=qualifiedName;node.namespaceURI=namespaceURI;node.prefix=qname.prefix;node.localName=qname.localName;node.name=qualifiedName;node.nodeValue="";return node;};DOMDocument.prototype.createNamespace=function DOMDocument_createNamespace(qualifiedName){var node=new DOMNamespace(this);var qname=this.implementation._parseQName(qualifiedName);node.nodeName=qualifiedName;node.prefix=qname.prefix;node.localName=qname.localName;node.name=qualifiedName;node.nodeValue="";return node;};DOMDocument.prototype.getElementById=function DOMDocument_getElementById(elementId){retNode=null;for(var i=0;i<this.all.length;i++){var node=this.all[i];if((node.id==elementId)&&(node._isAncestor(node.ownerDocument.documentElement))){retNode=node;break;}}return retNode;};DOMDocument.prototype._genId=function DOMDocument__genId(){this._lastId+=1;return this._lastId;};DOMDocument.prototype._isValidNamespace=function DOMDocument__isValidNamespace(namespaceURI,qualifiedName,isAttribute){if(this._performingImportNodeOperation==true){return true;}var valid=true;var qName=this.implementation._parseQName(qualifiedName);if(this._parseComplete==true){if(qName.localName.indexOf(":")>-1){valid=false;}if((valid)&&(!isAttribute)){if(!namespaceURI){valid=false;}}if((valid)&&(qName.prefix=="")){valid=false;}}if((valid)&&(qName.prefix=="xml")&&(namespaceURI!="http://www.w3.org/XML/1998/namespace")){valid=false;}return valid;};DOMDocument.prototype.toString=function DOMDocument_toString(){return""+this.childNodes;};DOMElement=function(ownerDocument){this._class=addClass(this._class,"DOMElement");this.DOMNode=DOMNode;this.DOMNode(ownerDocument);this.tagName="";this.id="";this.nodeType=DOMNode.ELEMENT_NODE;};DOMElement.prototype=new DOMNode;DOMElement.prototype.getTagName=function DOMElement_getTagName(){return this.tagName;};DOMElement.prototype.getAttribute=function DOMElement_getAttribute(name){var ret="";var attr=this.attributes.getNamedItem(name);if(attr){ret=attr.value;}return ret;};DOMElement.prototype.setAttribute=function DOMElement_setAttribute(name,value){var attr=this.attributes.getNamedItem(name);if(!attr){attr=this.ownerDocument.createAttribute(name);}var value=new String(value);if(this.ownerDocument.implementation.errorChecking){if(attr._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(!this.ownerDocument.implementation._isValidString(value)){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}}if(this.ownerDocument.implementation._isIdDeclaration(name)){this.id=value;}attr.value=value;attr.nodeValue=value;if(value.length>0){attr.specified=true;}else{attr.specified=false;}this.attributes.setNamedItem(attr);};DOMElement.prototype.removeAttribute=function DOMElement_removeAttribute(name){return this.attributes.removeNamedItem(name);};DOMElement.prototype.getAttributeNode=function DOMElement_getAttributeNode(name){return this.attributes.getNamedItem(name);};DOMElement.prototype.setAttributeNode=function DOMElement_setAttributeNode(newAttr){if(this.ownerDocument.implementation._isIdDeclaration(newAttr.name)){this.id=newAttr.value;}return this.attributes.setNamedItem(newAttr);};DOMElement.prototype.removeAttributeNode=function DOMElement_removeAttributeNode(oldAttr){if(this.ownerDocument.implementation.errorChecking&&oldAttr._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}var itemIndex=this.attributes._findItemIndex(oldAttr._id);if(this.ownerDocument.implementation.errorChecking&&(itemIndex<0)){throw (new DOMException(DOMException.NOT_FOUND_ERR));}return this.attributes._removeChild(itemIndex);};DOMElement.prototype.getAttributeNS=function DOMElement_getAttributeNS(namespaceURI,localName){var ret="";var attr=this.attributes.getNamedItemNS(namespaceURI,localName);if(attr){ret=attr.value;}return ret;};DOMElement.prototype.setAttributeNS=function DOMElement_setAttributeNS(namespaceURI,qualifiedName,value){var attr=this.attributes.getNamedItem(namespaceURI,qualifiedName);if(!attr){attr=this.ownerDocument.createAttributeNS(namespaceURI,qualifiedName);}var value=new String(value);if(this.ownerDocument.implementation.errorChecking){if(attr._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(!this.ownerDocument._isValidNamespace(namespaceURI,qualifiedName)){throw (new DOMException(DOMException.NAMESPACE_ERR));}if(!this.ownerDocument.implementation._isValidString(value)){throw (new DOMException(DOMException.INVALID_CHARACTER_ERR));}}if(this.ownerDocument.implementation._isIdDeclaration(name)){this.id=value;}attr.value=value;attr.nodeValue=value;if(value.length>0){attr.specified=true;}else{attr.specified=false;}this.attributes.setNamedItemNS(attr);};DOMElement.prototype.removeAttributeNS=function DOMElement_removeAttributeNS(namespaceURI,localName){return this.attributes.removeNamedItemNS(namespaceURI,localName);};DOMElement.prototype.getAttributeNodeNS=function DOMElement_getAttributeNodeNS(namespaceURI,localName){return this.attributes.getNamedItemNS(namespaceURI,localName);};DOMElement.prototype.setAttributeNodeNS=function DOMElement_setAttributeNodeNS(newAttr){if((newAttr.prefix=="")&&this.ownerDocument.implementation._isIdDeclaration(newAttr.name)){this.id=newAttr.value;}return this.attributes.setNamedItemNS(newAttr);};DOMElement.prototype.hasAttribute=function DOMElement_hasAttribute(name){return this.attributes._hasAttribute(name);};DOMElement.prototype.hasAttributeNS=function DOMElement_hasAttributeNS(namespaceURI,localName){return this.attributes._hasAttributeNS(namespaceURI,localName);};DOMElement.prototype.toString=function DOMElement_toString(){var ret="";var ns=this._namespaces.toString();if(ns.length>0){ns=" "+ns;}var attrs=this.attributes.toString();if(attrs.length>0){attrs=" "+attrs;}ret+="<"+this.nodeName+ns+attrs+">";ret+=this.childNodes.toString();ret+="</"+this.nodeName+">";return ret;};DOMAttr=function(ownerDocument){this._class=addClass(this._class,"DOMAttr");this.DOMNode=DOMNode;this.DOMNode(ownerDocument);this.name="";this.specified=false;this.value="";this.nodeType=DOMNode.ATTRIBUTE_NODE;this.ownerElement=null;this.childNodes=null;this.attributes=null;};DOMAttr.prototype=new DOMNode;DOMAttr.prototype.getName=function DOMAttr_getName(){return this.nodeName;};DOMAttr.prototype.getSpecified=function DOMAttr_getSpecified(){return this.specified;};DOMAttr.prototype.getValue=function DOMAttr_getValue(){return this.nodeValue;};DOMAttr.prototype.setValue=function DOMAttr_setValue(value){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}this.setNodeValue(value);};DOMAttr.prototype.setNodeValue=function DOMAttr_setNodeValue(value){this.nodeValue=new String(value);this.value=this.nodeValue;this.specified=(this.value.length>0);};DOMAttr.prototype.toString=function DOMAttr_toString(){var ret="";ret+=this.nodeName+'="'+this.__escapeString(this.nodeValue)+'"';return ret;};DOMAttr.prototype.getOwnerElement=function(){return this.ownerElement;};DOMNamespace=function(ownerDocument){this._class=addClass(this._class,"DOMNamespace");this.DOMNode=DOMNode;this.DOMNode(ownerDocument);this.name="";this.specified=false;this.value="";this.nodeType=DOMNode.NAMESPACE_NODE;};DOMNamespace.prototype=new DOMNode;DOMNamespace.prototype.getValue=function DOMNamespace_getValue(){return this.nodeValue;};DOMNamespace.prototype.setValue=function DOMNamespace_setValue(value){this.nodeValue=new String(value);this.value=this.nodeValue;};DOMNamespace.prototype.toString=function DOMNamespace_toString(){var ret="";if(this.nodeName!=""){ret+=this.nodeName+'="'+this.__escapeString(this.nodeValue)+'"';}else{ret+='xmlns="'+this.__escapeString(this.nodeValue)+'"';}return ret;};DOMCharacterData=function(ownerDocument){this._class=addClass(this._class,"DOMCharacterData");this.DOMNode=DOMNode;this.DOMNode(ownerDocument);this.data="";this.length=0;};DOMCharacterData.prototype=new DOMNode;DOMCharacterData.prototype.getData=function DOMCharacterData_getData(){return this.nodeValue;};DOMCharacterData.prototype.setData=function DOMCharacterData_setData(data){this.setNodeValue(data);};DOMCharacterData.prototype.setNodeValue=function DOMCharacterData_setNodeValue(data){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}this.nodeValue=new String(data);this.data=this.nodeValue;this.length=this.nodeValue.length;};DOMCharacterData.prototype.getLength=function DOMCharacterData_getLength(){return this.nodeValue.length;};DOMCharacterData.prototype.substringData=function DOMCharacterData_substringData(offset,count){var ret=null;if(this.data){if(this.ownerDocument.implementation.errorChecking&&((offset<0)||(offset>this.data.length)||(count<0))){throw (new DOMException(DOMException.INDEX_SIZE_ERR));}if(!count){ret=this.data.substring(offset);}else{ret=this.data.substring(offset,offset+count);}}return ret;};DOMCharacterData.prototype.appendData=function DOMCharacterData_appendData(arg){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}this.setData(""+this.data+arg);};DOMCharacterData.prototype.insertData=function DOMCharacterData_insertData(offset,arg){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(this.data){if(this.ownerDocument.implementation.errorChecking&&((offset<0)||(offset>this.data.length))){throw (new DOMException(DOMException.INDEX_SIZE_ERR));}this.setData(this.data.substring(0,offset).concat(arg,this.data.substring(offset)));}else{if(this.ownerDocument.implementation.errorChecking&&(offset!=0)){throw (new DOMException(DOMException.INDEX_SIZE_ERR));}this.setData(arg);}};DOMCharacterData.prototype.deleteData=function DOMCharacterData_deleteData(offset,count){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(this.data){if(this.ownerDocument.implementation.errorChecking&&((offset<0)||(offset>this.data.length)||(count<0))){throw (new DOMException(DOMException.INDEX_SIZE_ERR));}if(!count||(offset+count)>this.data.length){this.setData(this.data.substring(0,offset));}else{this.setData(this.data.substring(0,offset).concat(this.data.substring(offset+count)));}}};DOMCharacterData.prototype.replaceData=function DOMCharacterData_replaceData(offset,count,arg){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if(this.data){if(this.ownerDocument.implementation.errorChecking&&((offset<0)||(offset>this.data.length)||(count<0))){throw (new DOMException(DOMException.INDEX_SIZE_ERR));}this.setData(this.data.substring(0,offset).concat(arg,this.data.substring(offset+count)));}else{this.setData(arg);}};DOMText=function(ownerDocument){this._class=addClass(this._class,"DOMText");this.DOMCharacterData=DOMCharacterData;this.DOMCharacterData(ownerDocument);this.nodeName="#text";this.nodeType=DOMNode.TEXT_NODE;};DOMText.prototype=new DOMCharacterData;DOMText.prototype.splitText=function DOMText_splitText(offset){var data,inode;if(this.ownerDocument.implementation.errorChecking){if(this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if((offset<0)||(offset>this.data.length)){throw (new DOMException(DOMException.INDEX_SIZE_ERR));}}if(this.parentNode){data=this.substringData(offset);inode=this.ownerDocument.createTextNode(data);if(this.nextSibling){this.parentNode.insertBefore(inode,this.nextSibling);}else{this.parentNode.appendChild(inode);}this.deleteData(offset);}return inode;};DOMText.prototype.toString=function DOMText_toString(){return this.__escapeString(""+this.nodeValue);};DOMCDATASection=function(ownerDocument){this._class=addClass(this._class,"DOMCDATASection");this.DOMCharacterData=DOMCharacterData;this.DOMCharacterData(ownerDocument);this.nodeName="#cdata-section";this.nodeType=DOMNode.CDATA_SECTION_NODE;};DOMCDATASection.prototype=new DOMCharacterData;DOMCDATASection.prototype.splitText=function DOMCDATASection_splitText(offset){var data,inode;if(this.ownerDocument.implementation.errorChecking){if(this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}if((offset<0)||(offset>this.data.length)){throw (new DOMException(DOMException.INDEX_SIZE_ERR));}}if(this.parentNode){data=this.substringData(offset);inode=this.ownerDocument.createCDATASection(data);if(this.nextSibling){this.parentNode.insertBefore(inode,this.nextSibling);}else{this.parentNode.appendChild(inode);}this.deleteData(offset);}return inode;};DOMCDATASection.prototype.toString=function DOMCDATASection_toString(){var ret="";ret+="<![CDATA["+this.nodeValue+"]]>";return ret;};DOMComment=function(ownerDocument){this._class=addClass(this._class,"DOMComment");this.DOMCharacterData=DOMCharacterData;this.DOMCharacterData(ownerDocument);this.nodeName="#comment";this.nodeType=DOMNode.COMMENT_NODE;};DOMComment.prototype=new DOMCharacterData;DOMComment.prototype.toString=function DOMComment_toString(){var ret="";ret+="<!--"+this.nodeValue+"-->";return ret;};DOMProcessingInstruction=function(ownerDocument){this._class=addClass(this._class,"DOMProcessingInstruction");this.DOMNode=DOMNode;this.DOMNode(ownerDocument);this.target="";this.data="";this.nodeType=DOMNode.PROCESSING_INSTRUCTION_NODE;};DOMProcessingInstruction.prototype=new DOMNode;DOMProcessingInstruction.prototype.getTarget=function DOMProcessingInstruction_getTarget(){return this.nodeName;};DOMProcessingInstruction.prototype.getData=function DOMProcessingInstruction_getData(){return this.nodeValue;};DOMProcessingInstruction.prototype.setData=function DOMProcessingInstruction_setData(data){this.setNodeValue(data);};DOMProcessingInstruction.prototype.setNodeValue=function DOMProcessingInstruction_setNodeValue(data){if(this.ownerDocument.implementation.errorChecking&&this._readonly){throw (new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR));}this.nodeValue=new String(data);this.data=this.nodeValue;};DOMProcessingInstruction.prototype.toString=function DOMProcessingInstruction_toString(){var ret="";ret+="<?"+this.nodeName+" "+this.nodeValue+" ?>";return ret;};DOMDocumentFragment=function(ownerDocument){this._class=addClass(this._class,"DOMDocumentFragment");this.DOMNode=DOMNode;this.DOMNode(ownerDocument);this.nodeName="#document-fragment";this.nodeType=DOMNode.DOCUMENT_FRAGMENT_NODE;};DOMDocumentFragment.prototype=new DOMNode;DOMDocumentFragment.prototype.toString=function DOMDocumentFragment_toString(){var xml="";var intCount=this.getChildNodes().getLength();for(intLoop=0;intLoop<intCount;intLoop++){xml+=this.getChildNodes().item(intLoop).toString();}return xml;};DOMDocumentType=function(){alert("DOMDocumentType.constructor(): Not Implemented");};DOMEntity=function(){alert("DOMEntity.constructor(): Not Implemented");};DOMEntityReference=function(){alert("DOMEntityReference.constructor(): Not Implemented");};DOMNotation=function(){alert("DOMNotation.constructor(): Not Implemented");};Strings=new Object();Strings.WHITESPACE=" \t\n\r";Strings.QUOTES="\"'";Strings.isEmpty=function Strings_isEmpty(strD){return(strD==null)||(strD.length==0);};Strings.indexOfNonWhitespace=function Strings_indexOfNonWhitespace(strD,iB,iE){if(Strings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;for(var i=iB;i<iE;i++){if(Strings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i;}}return -1;};Strings.lastIndexOfNonWhitespace=function Strings_lastIndexOfNonWhitespace(strD,iB,iE){if(Strings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;for(var i=iE-1;i>=iB;i--){if(Strings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i;}}return -1;};Strings.indexOfWhitespace=function Strings_indexOfWhitespace(strD,iB,iE){if(Strings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;for(var i=iB;i<iE;i++){if(Strings.WHITESPACE.indexOf(strD.charAt(i))!=-1){return i;}}return -1;};Strings.replace=function Strings_replace(strD,iB,iE,strF,strR){if(Strings.isEmpty(strD)){return"";}iB=iB||0;iE=iE||strD.length;return strD.substring(iB,iE).split(strF).join(strR);};Strings.getLineNumber=function Strings_getLineNumber(strD,iP){if(Strings.isEmpty(strD)){return -1;}iP=iP||strD.length;return strD.substring(0,iP).split("\n").length;};Strings.getColumnNumber=function Strings_getColumnNumber(strD,iP){if(Strings.isEmpty(strD)){return -1;}iP=iP||strD.length;var arrD=strD.substring(0,iP).split("\n");var strLine=arrD[arrD.length-1];arrD.length--;var iLinePos=arrD.join("\n").length;return iP-iLinePos;};StringBuffer=function(){this._a=new Array();};StringBuffer.prototype.append=function StringBuffer_append(d){this._a[this._a.length]=d;};StringBuffer.prototype.toString=function StringBuffer_toString(){return this._a.join("");};var whitespace="\n\r\t ";XMLP=function(strXML){strXML=SAXStrings.replace(strXML,null,null,"\r\n","\n");strXML=SAXStrings.replace(strXML,null,null,"\r","\n");this.m_xml=strXML;this.m_iP=0;this.m_iState=XMLP._STATE_PROLOG;this.m_stack=new Stack();this._clearAttributes();};XMLP._NONE=0;XMLP._ELM_B=1;XMLP._ELM_E=2;XMLP._ELM_EMP=3;XMLP._ATT=4;XMLP._TEXT=5;XMLP._ENTITY=6;XMLP._PI=7;XMLP._CDATA=8;XMLP._COMMENT=9;XMLP._DTD=10;XMLP._ERROR=11;XMLP._CONT_XML=0;XMLP._CONT_ALT=1;XMLP._ATT_NAME=0;XMLP._ATT_VAL=1;XMLP._STATE_PROLOG=1;XMLP._STATE_DOCUMENT=2;XMLP._STATE_MISC=3;XMLP._errs=new Array();XMLP._errs[XMLP.ERR_CLOSE_PI=0]="PI: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_DTD=1]="DTD: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_COMMENT=2]="Comment: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_CDATA=3]="CDATA: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_ELM=4]="Element: missing closing sequence";XMLP._errs[XMLP.ERR_CLOSE_ENTITY=5]="Entity: missing closing sequence";XMLP._errs[XMLP.ERR_PI_TARGET=6]="PI: target is required";XMLP._errs[XMLP.ERR_ELM_EMPTY=7]="Element: cannot be both empty and closing";XMLP._errs[XMLP.ERR_ELM_NAME=8]='Element: name must immediatly follow "<"';XMLP._errs[XMLP.ERR_ELM_LT_NAME=9]='Element: "<" not allowed in element names';XMLP._errs[XMLP.ERR_ATT_VALUES=10]="Attribute: values are required and must be in quotes";XMLP._errs[XMLP.ERR_ATT_LT_NAME=11]='Element: "<" not allowed in attribute names';XMLP._errs[XMLP.ERR_ATT_LT_VALUE=12]='Attribute: "<" not allowed in attribute values';XMLP._errs[XMLP.ERR_ATT_DUP=13]="Attribute: duplicate attributes not allowed";XMLP._errs[XMLP.ERR_ENTITY_UNKNOWN=14]="Entity: unknown entity";XMLP._errs[XMLP.ERR_INFINITELOOP=15]="Infininte loop";XMLP._errs[XMLP.ERR_DOC_STRUCTURE=16]="Document: only comments, processing instructions, or whitespace allowed outside of document element";XMLP._errs[XMLP.ERR_ELM_NESTING=17]="Element: must be nested correctly";XMLP.prototype._addAttribute=function(name,value){this.m_atts[this.m_atts.length]=new Array(name,value);};XMLP.prototype._checkStructure=function(iEvent){if(XMLP._STATE_PROLOG==this.m_iState){if((XMLP._TEXT==iEvent)||(XMLP._ENTITY==iEvent)){if(SAXStrings.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd())!=-1){return this._setErr(XMLP.ERR_DOC_STRUCTURE);}}if((XMLP._ELM_B==iEvent)||(XMLP._ELM_EMP==iEvent)){this.m_iState=XMLP._STATE_DOCUMENT;}}if(XMLP._STATE_DOCUMENT==this.m_iState){if((XMLP._ELM_B==iEvent)||(XMLP._ELM_EMP==iEvent)){this.m_stack.push(this.getName());}if((XMLP._ELM_E==iEvent)||(XMLP._ELM_EMP==iEvent)){var strTop=this.m_stack.pop();if((strTop==null)||(strTop!=this.getName())){return this._setErr(XMLP.ERR_ELM_NESTING);}}if(this.m_stack.count()==0){this.m_iState=XMLP._STATE_MISC;return iEvent;}}if(XMLP._STATE_MISC==this.m_iState){if((XMLP._ELM_B==iEvent)||(XMLP._ELM_E==iEvent)||(XMLP._ELM_EMP==iEvent)||(XMLP.EVT_DTD==iEvent)){return this._setErr(XMLP.ERR_DOC_STRUCTURE);}if((XMLP._TEXT==iEvent)||(XMLP._ENTITY==iEvent)){if(SAXStrings.indexOfNonWhitespace(this.getContent(),this.getContentBegin(),this.getContentEnd())!=-1){return this._setErr(XMLP.ERR_DOC_STRUCTURE);}}}return iEvent;};XMLP.prototype._clearAttributes=function(){this.m_atts=new Array();};XMLP.prototype._findAttributeIndex=function(name){for(var i=0;i<this.m_atts.length;i++){if(this.m_atts[i][XMLP._ATT_NAME]==name){return i;}}return -1;};XMLP.prototype.getAttributeCount=function(){return this.m_atts?this.m_atts.length:0;};XMLP.prototype.getAttributeName=function(index){return((index<0)||(index>=this.m_atts.length))?null:this.m_atts[index][XMLP._ATT_NAME];};XMLP.prototype.getAttributeValue=function(index){return((index<0)||(index>=this.m_atts.length))?null:__unescapeString(this.m_atts[index][XMLP._ATT_VAL]);};XMLP.prototype.getAttributeValueByName=function(name){return this.getAttributeValue(this._findAttributeIndex(name));};XMLP.prototype.getColumnNumber=function(){return SAXStrings.getColumnNumber(this.m_xml,this.m_iP);};XMLP.prototype.getContent=function(){return(this.m_cSrc==XMLP._CONT_XML)?this.m_xml:this.m_cAlt;};XMLP.prototype.getContentBegin=function(){return this.m_cB;};XMLP.prototype.getContentEnd=function(){return this.m_cE;};XMLP.prototype.getLineNumber=function(){return SAXStrings.getLineNumber(this.m_xml,this.m_iP);};XMLP.prototype.getName=function(){return this.m_name;};XMLP.prototype.next=function(){return this._checkStructure(this._parse());};XMLP.prototype._parse=function(){if(this.m_iP==this.m_xml.length){return XMLP._NONE;}if(this.m_iP==this.m_xml.indexOf("<?",this.m_iP)){return this._parsePI(this.m_iP+2);}else{if(this.m_iP==this.m_xml.indexOf("<!DOCTYPE",this.m_iP)){return this._parseDTD(this.m_iP+9);}else{if(this.m_iP==this.m_xml.indexOf("<!--",this.m_iP)){return this._parseComment(this.m_iP+4);}else{if(this.m_iP==this.m_xml.indexOf("<![CDATA[",this.m_iP)){return this._parseCDATA(this.m_iP+9);}else{if(this.m_iP==this.m_xml.indexOf("<",this.m_iP)){return this._parseElement(this.m_iP+1);}else{if(this.m_iP==this.m_xml.indexOf("&",this.m_iP)){return this._parseEntity(this.m_iP+1);}else{return this._parseText(this.m_iP);}}}}}}};XMLP.prototype._parseAttribute=function(iB,iE){var iNB,iNE,iEq,iVB,iVE;var cQuote,strN,strV;this.m_cAlt="";iNB=SAXStrings.indexOfNonWhitespace(this.m_xml,iB,iE);if((iNB==-1)||(iNB>=iE)){return iNB;}iEq=this.m_xml.indexOf("=",iNB);if((iEq==-1)||(iEq>iE)){return this._setErr(XMLP.ERR_ATT_VALUES);}iNE=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,iNB,iEq);iVB=SAXStrings.indexOfNonWhitespace(this.m_xml,iEq+1,iE);if((iVB==-1)||(iVB>iE)){return this._setErr(XMLP.ERR_ATT_VALUES);}cQuote=this.m_xml.charAt(iVB);if(SAXStrings.QUOTES.indexOf(cQuote)==-1){return this._setErr(XMLP.ERR_ATT_VALUES);}iVE=this.m_xml.indexOf(cQuote,iVB+1);if((iVE==-1)||(iVE>iE)){return this._setErr(XMLP.ERR_ATT_VALUES);}strN=this.m_xml.substring(iNB,iNE+1);strV=this.m_xml.substring(iVB+1,iVE);if(strN.indexOf("<")!=-1){return this._setErr(XMLP.ERR_ATT_LT_NAME);}if(strV.indexOf("<")!=-1){return this._setErr(XMLP.ERR_ATT_LT_VALUE);}strV=SAXStrings.replace(strV,null,null,"\n"," ");strV=SAXStrings.replace(strV,null,null,"\t"," ");iRet=this._replaceEntities(strV);if(iRet==XMLP._ERROR){return iRet;}strV=this.m_cAlt;if(this._findAttributeIndex(strN)==-1){this._addAttribute(strN,strV);}else{return this._setErr(XMLP.ERR_ATT_DUP);}this.m_iP=iVE+2;return XMLP._ATT;};XMLP.prototype._parseCDATA=function(iB){var iE=this.m_xml.indexOf("]]>",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_CDATA);}this._setContent(XMLP._CONT_XML,iB,iE);this.m_iP=iE+3;return XMLP._CDATA;};XMLP.prototype._parseComment=function(iB){var iE=this.m_xml.indexOf("-"+"->",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_COMMENT);}this._setContent(XMLP._CONT_XML,iB,iE);this.m_iP=iE+3;return XMLP._COMMENT;};XMLP.prototype._parseDTD=function(iB){var iE,strClose,iInt,iLast;iE=this.m_xml.indexOf(">",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_DTD);}iInt=this.m_xml.indexOf("[",iB);strClose=((iInt!=-1)&&(iInt<iE))?"]>":">";while(true){if(iE==iLast){return this._setErr(XMLP.ERR_INFINITELOOP);}iLast=iE;iE=this.m_xml.indexOf(strClose,iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_DTD);}if(this.m_xml.substring(iE-1,iE+2)!="]]>"){break;}}this.m_iP=iE+strClose.length;return XMLP._DTD;};XMLP.prototype._parseElement=function(iB){var iE,iDE,iNE,iRet;var iType,strN,iLast;iDE=iE=this.m_xml.indexOf(">",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_ELM);}if(this.m_xml.charAt(iB)=="/"){iType=XMLP._ELM_E;iB++;}else{iType=XMLP._ELM_B;}if(this.m_xml.charAt(iE-1)=="/"){if(iType==XMLP._ELM_E){return this._setErr(XMLP.ERR_ELM_EMPTY);}iType=XMLP._ELM_EMP;iDE--;}iDE=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,iB,iDE);if(iE-iB!=1){if(SAXStrings.indexOfNonWhitespace(this.m_xml,iB,iDE)!=iB){return this._setErr(XMLP.ERR_ELM_NAME);}}this._clearAttributes();iNE=SAXStrings.indexOfWhitespace(this.m_xml,iB,iDE);if(iNE==-1){iNE=iDE+1;}else{this.m_iP=iNE;while(this.m_iP<iDE){if(this.m_iP==iLast){return this._setErr(XMLP.ERR_INFINITELOOP);}iLast=this.m_iP;iRet=this._parseAttribute(this.m_iP,iDE);if(iRet==XMLP._ERROR){return iRet;}}}strN=this.m_xml.substring(iB,iNE);if(strN.indexOf("<")!=-1){return this._setErr(XMLP.ERR_ELM_LT_NAME);}this.m_name=strN;this.m_iP=iE+1;return iType;};XMLP.prototype._parseEntity=function(iB){var iE=this.m_xml.indexOf(";",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_ENTITY);}this.m_iP=iE+1;return this._replaceEntity(this.m_xml,iB,iE);};XMLP.prototype._parsePI=function(iB){var iE,iTB,iTE,iCB,iCE;iE=this.m_xml.indexOf("?>",iB);if(iE==-1){return this._setErr(XMLP.ERR_CLOSE_PI);}iTB=SAXStrings.indexOfNonWhitespace(this.m_xml,iB,iE);if(iTB==-1){return this._setErr(XMLP.ERR_PI_TARGET);}iTE=SAXStrings.indexOfWhitespace(this.m_xml,iTB,iE);if(iTE==-1){iTE=iE;}iCB=SAXStrings.indexOfNonWhitespace(this.m_xml,iTE,iE);if(iCB==-1){iCB=iE;}iCE=SAXStrings.lastIndexOfNonWhitespace(this.m_xml,iCB,iE);if(iCE==-1){iCE=iE-1;}this.m_name=this.m_xml.substring(iTB,iTE);this._setContent(XMLP._CONT_XML,iCB,iCE+1);this.m_iP=iE+2;return XMLP._PI;};XMLP.prototype._parseText=function(iB){var iE,iEE;iE=this.m_xml.indexOf("<",iB);if(iE==-1){iE=this.m_xml.length;}iEE=this.m_xml.indexOf("&",iB);if((iEE!=-1)&&(iEE<=iE)){iE=iEE;}this._setContent(XMLP._CONT_XML,iB,iE);this.m_iP=iE;return XMLP._TEXT;};XMLP.prototype._replaceEntities=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return"";}iB=iB||0;iE=iE||strD.length;var iEB,iEE,strRet="";iEB=strD.indexOf("&",iB);iEE=iB;while((iEB>0)&&(iEB<iE)){strRet+=strD.substring(iEE,iEB);iEE=strD.indexOf(";",iEB)+1;if((iEE==0)||(iEE>iE)){return this._setErr(XMLP.ERR_CLOSE_ENTITY);}iRet=this._replaceEntity(strD,iEB+1,iEE-1);if(iRet==XMLP._ERROR){return iRet;}strRet+=this.m_cAlt;iEB=strD.indexOf("&",iEE);}if(iEE!=iE){strRet+=strD.substring(iEE,iE);}this._setContent(XMLP._CONT_ALT,strRet);return XMLP._ENTITY;};XMLP.prototype._replaceEntity=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;switch(strD.substring(iB,iE)){case"amp":strEnt="&";break;case"lt":strEnt="<";break;case"gt":strEnt=">";break;case"apos":strEnt="'";break;case"quot":strEnt='"';break;default:if(strD.charAt(iB)=="#"){strEnt=String.fromCharCode(parseInt(strD.substring(iB+1,iE)));}else{return this._setErr(XMLP.ERR_ENTITY_UNKNOWN);}break;}this._setContent(XMLP._CONT_ALT,strEnt);return XMLP._ENTITY;};XMLP.prototype._setContent=function(iSrc){var args=arguments;if(XMLP._CONT_XML==iSrc){this.m_cAlt=null;this.m_cB=args[1];this.m_cE=args[2];}else{this.m_cAlt=args[1];this.m_cB=0;this.m_cE=args[1].length;}this.m_cSrc=iSrc;};XMLP.prototype._setErr=function(iErr){var strErr=XMLP._errs[iErr];this.m_cAlt=strErr;this.m_cB=0;this.m_cE=strErr.length;this.m_cSrc=XMLP._CONT_ALT;return XMLP._ERROR;};SAXDriver=function(){this.m_hndDoc=null;this.m_hndErr=null;this.m_hndLex=null;};SAXDriver.DOC_B=1;SAXDriver.DOC_E=2;SAXDriver.ELM_B=3;SAXDriver.ELM_E=4;SAXDriver.CHARS=5;SAXDriver.PI=6;SAXDriver.CD_B=7;SAXDriver.CD_E=8;SAXDriver.CMNT=9;SAXDriver.DTD_B=10;SAXDriver.DTD_E=11;SAXDriver.prototype.parse=function(strD){var parser=new XMLP(strD);if(this.m_hndDoc&&this.m_hndDoc.setDocumentLocator){this.m_hndDoc.setDocumentLocator(this);}this.m_parser=parser;this.m_bErr=false;if(!this.m_bErr){this._fireEvent(SAXDriver.DOC_B);}this._parseLoop();if(!this.m_bErr){this._fireEvent(SAXDriver.DOC_E);}this.m_xml=null;this.m_iP=0;};SAXDriver.prototype.setDocumentHandler=function(hnd){this.m_hndDoc=hnd;};SAXDriver.prototype.setErrorHandler=function(hnd){this.m_hndErr=hnd;};SAXDriver.prototype.setLexicalHandler=function(hnd){this.m_hndLex=hnd;};SAXDriver.prototype.getColumnNumber=function(){return this.m_parser.getColumnNumber();};SAXDriver.prototype.getLineNumber=function(){return this.m_parser.getLineNumber();};SAXDriver.prototype.getMessage=function(){return this.m_strErrMsg;};SAXDriver.prototype.getPublicId=function(){return null;};SAXDriver.prototype.getSystemId=function(){return null;};SAXDriver.prototype.getLength=function(){return this.m_parser.getAttributeCount();};SAXDriver.prototype.getName=function(index){return this.m_parser.getAttributeName(index);};SAXDriver.prototype.getValue=function(index){return this.m_parser.getAttributeValue(index);};SAXDriver.prototype.getValueByName=function(name){return this.m_parser.getAttributeValueByName(name);};SAXDriver.prototype._fireError=function(strMsg){this.m_strErrMsg=strMsg;this.m_bErr=true;if(this.m_hndErr&&this.m_hndErr.fatalError){this.m_hndErr.fatalError(this);}};SAXDriver.prototype._fireEvent=function(iEvt){var hnd,func,args=arguments,iLen=args.length-1;if(this.m_bErr){return;}if(SAXDriver.DOC_B==iEvt){func="startDocument";hnd=this.m_hndDoc;}else{if(SAXDriver.DOC_E==iEvt){func="endDocument";hnd=this.m_hndDoc;}else{if(SAXDriver.ELM_B==iEvt){func="startElement";hnd=this.m_hndDoc;}else{if(SAXDriver.ELM_E==iEvt){func="endElement";hnd=this.m_hndDoc;}else{if(SAXDriver.CHARS==iEvt){func="characters";hnd=this.m_hndDoc;}else{if(SAXDriver.PI==iEvt){func="processingInstruction";hnd=this.m_hndDoc;}else{if(SAXDriver.CD_B==iEvt){func="startCDATA";hnd=this.m_hndLex;}else{if(SAXDriver.CD_E==iEvt){func="endCDATA";hnd=this.m_hndLex;}else{if(SAXDriver.CMNT==iEvt){func="comment";hnd=this.m_hndLex;}}}}}}}}}if(hnd&&hnd[func]){if(0==iLen){hnd[func]();}else{if(1==iLen){hnd[func](args[1]);}else{if(2==iLen){hnd[func](args[1],args[2]);}else{if(3==iLen){hnd[func](args[1],args[2],args[3]);}}}}}};SAXDriver.prototype._parseLoop=function(parser){var iEvent,parser;parser=this.m_parser;while(!this.m_bErr){iEvent=parser.next();if(iEvent==XMLP._ELM_B){this._fireEvent(SAXDriver.ELM_B,parser.getName(),this);}else{if(iEvent==XMLP._ELM_E){this._fireEvent(SAXDriver.ELM_E,parser.getName());}else{if(iEvent==XMLP._ELM_EMP){this._fireEvent(SAXDriver.ELM_B,parser.getName(),this);this._fireEvent(SAXDriver.ELM_E,parser.getName());}else{if(iEvent==XMLP._TEXT){this._fireEvent(SAXDriver.CHARS,parser.getContent(),parser.getContentBegin(),parser.getContentEnd()-parser.getContentBegin());}else{if(iEvent==XMLP._ENTITY){this._fireEvent(SAXDriver.CHARS,parser.getContent(),parser.getContentBegin(),parser.getContentEnd()-parser.getContentBegin());}else{if(iEvent==XMLP._PI){this._fireEvent(SAXDriver.PI,parser.getName(),parser.getContent().substring(parser.getContentBegin(),parser.getContentEnd()));}else{if(iEvent==XMLP._CDATA){this._fireEvent(SAXDriver.CD_B);this._fireEvent(SAXDriver.CHARS,parser.getContent(),parser.getContentBegin(),parser.getContentEnd()-parser.getContentBegin());this._fireEvent(SAXDriver.CD_E);}else{if(iEvent==XMLP._COMMENT){this._fireEvent(SAXDriver.CMNT,parser.getContent(),parser.getContentBegin(),parser.getContentEnd()-parser.getContentBegin());}else{if(iEvent==XMLP._DTD){}else{if(iEvent==XMLP._ERROR){this._fireError(parser.getContent());}else{if(iEvent==XMLP._NONE){return;}}}}}}}}}}}}};SAXStrings=function(){};SAXStrings.WHITESPACE=" \t\n\r";SAXStrings.QUOTES="\"'";SAXStrings.getColumnNumber=function(strD,iP){if(SAXStrings.isEmpty(strD)){return -1;}iP=iP||strD.length;var arrD=strD.substring(0,iP).split("\n");var strLine=arrD[arrD.length-1];arrD.length--;var iLinePos=arrD.join("\n").length;return iP-iLinePos;};SAXStrings.getLineNumber=function(strD,iP){if(SAXStrings.isEmpty(strD)){return -1;}iP=iP||strD.length;return strD.substring(0,iP).split("\n").length;};SAXStrings.indexOfNonWhitespace=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;for(var i=iB;i<iE;i++){if(SAXStrings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i;}}return -1;};SAXStrings.indexOfWhitespace=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;for(var i=iB;i<iE;i++){if(SAXStrings.WHITESPACE.indexOf(strD.charAt(i))!=-1){return i;}}return -1;};SAXStrings.isEmpty=function(strD){return(strD==null)||(strD.length==0);};SAXStrings.lastIndexOfNonWhitespace=function(strD,iB,iE){if(SAXStrings.isEmpty(strD)){return -1;}iB=iB||0;iE=iE||strD.length;for(var i=iE-1;i>=iB;i--){if(SAXStrings.WHITESPACE.indexOf(strD.charAt(i))==-1){return i;}}return -1;};SAXStrings.replace=function(strD,iB,iE,strF,strR){if(SAXStrings.isEmpty(strD)){return"";}iB=iB||0;iE=iE||strD.length;return strD.substring(iB,iE).split(strF).join(strR);};Stack=function(){this.m_arr=new Array();};Stack.prototype.clear=function(){this.m_arr=new Array();};Stack.prototype.count=function(){return this.m_arr.length;};Stack.prototype.destroy=function(){this.m_arr=null;};Stack.prototype.peek=function(){if(this.m_arr.length==0){return null;}return this.m_arr[this.m_arr.length-1];};Stack.prototype.pop=function(){if(this.m_arr.length==0){return null;}var o=this.m_arr[this.m_arr.length-1];this.m_arr.length--;return o;};Stack.prototype.push=function(o){this.m_arr[this.m_arr.length]=o;};function isEmpty(str){return(str==null)||(str.length==0);}function trim(trimString,leftTrim,rightTrim){if(isEmpty(trimString)){return"";}if(leftTrim==null){leftTrim=true;}if(rightTrim==null){rightTrim=true;}var left=0;var right=0;var i=0;var k=0;if(leftTrim==true){while((i<trimString.length)&&(whitespace.indexOf(trimString.charAt(i++))!=-1)){left++;}}if(rightTrim==true){k=trimString.length-1;while((k>=left)&&(whitespace.indexOf(trimString.charAt(k--))!=-1)){right++;}}return trimString.substring(left,trimString.length-right);}function __escapeString(str){var escAmpRegEx=/&/g;var escLtRegEx=/</g;var escGtRegEx=/>/g;var quotRegEx=/"/g;var aposRegEx=/'/g;str=str.replace(escAmpRegEx,"&amp;");str=str.replace(escLtRegEx,"&lt;");str=str.replace(escGtRegEx,"&gt;");str=str.replace(quotRegEx,"&quot;");str=str.replace(aposRegEx,"&apos;");return str;}function __unescapeString(str){var escAmpRegEx=/&amp;/g;var escLtRegEx=/&lt;/g;var escGtRegEx=/&gt;/g;var quotRegEx=/&quot;/g;var aposRegEx=/&apos;/g;str=str.replace(escAmpRegEx,"&");str=str.replace(escLtRegEx,"<");str=str.replace(escGtRegEx,">");str=str.replace(quotRegEx,'"');str=str.replace(aposRegEx,"'");return str;}DOMNode.NODE_TYPE_TEST=1;DOMNode.NODE_NAME_TEST=2;DOMNode.ANCESTOR_AXIS=1;DOMNode.ANCESTOR_OR_SELF_AXIS=2;DOMNode.ATTRIBUTE_AXIS=3;DOMNode.CHILD_AXIS=4;DOMNode.DESCENDANT_AXIS=5;DOMNode.DESCENDANT_OR_SELF_AXIS=6;DOMNode.FOLLOWING_AXIS=7;DOMNode.FOLLOWING_SIBLING_AXIS=8;DOMNode.NAMESPACE_AXIS=9;DOMNode.PARENT_AXIS=10;DOMNode.PRECEDING_AXIS=11;DOMNode.PRECEDING_SIBLING_AXIS=12;DOMNode.SELF_AXIS=13;DOMNode.ROOT_AXIS=14;DOMNode.prototype.getStringValue=function(){var thisBranch=this._getDescendantOrSelfAxis();var textNodes=thisBranch.getTypedItems(DOMNode.TEXT_NODE);var stringValue="";if(textNodes.length>0){stringValue+=textNodes.item(0).nodeValue;for(var i=1;i<textNodes.length;i++){stringValue+=" "+textNodes.item(i).nodeValue;}}return stringValue;};DOMNode.prototype._filterByAttributeExistance=function(expr,containerNodeSet){try{if(expr.indexOf("*")<0){var attributeName=expr.substr(1,expr.length);var attribute=this.getAttributes().getNamedItem(attributeName);if(attribute!=null){return true;}else{return false;}}else{if(this.getAttributes().getLength()>0){return true;}else{return false;}}}catch(e){return false;}};DOMNode.prototype._filterByAttributeValue=function(expr,containerNodeSet){try{var nameStart=expr.indexOf("@")+1;var equalsStart=expr.indexOf("=");var attributeName=expr.substr(nameStart,expr.indexOf("=",nameStart)-1);var valueTesting=expr.substr(equalsStart+1,expr.length);if(valueTesting.charAt(0)=='"'||valueTesting.charAt(0)=="'"){valueTesting=valueTesting.substr(1,valueTesting.length);}if(valueTesting.charAt(valueTesting.length-1)=='"'||valueTesting.charAt(valueTesting.length-1)=="'"){valueTesting=valueTesting.substr(0,valueTesting.length-1);}var attribute=this.getAttributes().getNamedItem(attributeName);if(attribute.getValue()==valueTesting){return true;}else{return false;}}catch(e){return false;}};DOMNode.prototype._filterByAttribute=function(expr,containerNodeSet){if(expr=="@*"){return this._filterByAttributeExistance(expr,containerNodeSet);}if(expr.indexOf("=")<0){return this._filterByAttributeExistance(expr,containerNodeSet);}return this._filterByAttributeValue(expr,containerNodeSet);};DOMNode.prototype._filterByNot=function(expr,containerNodeSet){expr=expr.substr(4,expr.length);var endNotLocation=this._findExpressionEnd(expr,"(",")");expr=expr.substr(0,endNotLocation);return !this._filter(expr,containerNodeSet);};DOMNode.prototype._findExpressionEnd=function(expression,startCharacter,endCharacter){var startCharacterNum=0;var endExpressionLocation=0;var intCount=expression.length;for(intLoop=0;intLoop<intCount;intLoop++){var character=expression.charAt(intLoop);switch(character){case startCharacter:startCharacterNum++;break;case endCharacter:if(startCharacterNum==0){endExpressionLocation=intLoop;}else{startCharacterNum--;}break;}if(endExpressionLocation!=0){break;}}return endExpressionLocation;};DOMNode.prototype._filterByLocation=function(expr,containerNodeSet){var item=0+expr-1;if(this==containerNodeSet.item(item)){return true;}else{return false;}};DOMNode.prototype._filterByLast=function(expr,containerNodeSet){if(this==containerNodeSet.item(containerNodeSet.length-1)){return true;}else{return false;}};DOMNode.prototype._filterByCount=function(expr,containerNodeSet){var countStart=expr.indexOf("=")+1;var countStr=expr.substr(countStart,expr.length);var countInt=parseInt(countStr);expr=expr.substr(6,expr.length);expr=expr.substr(0,this._findExpressionEnd(expr,"(",")"));if(expr=="*"){return false;}var tmpNodeSet=this.selectNodeSet(expr);var tmpNodeSetLength=tmpNodeSet.length;if(tmpNodeSetLength==countInt){return true;}else{return false;}};DOMNode.prototype._filterByName=function(expr,containerNodeSet){var equalLocation=expr.indexOf("=");var quoteChar=expr.charAt(equalLocation+1);var name="";for(intLoop=equalLocation+2;intLoop<expr.length;intLoop++){if(expr.charAt(intLoop)==quoteChar){break;}else{name+=expr.charAt(intLoop);}}if(this.getNodeName()==name){return true;}else{return false;}};DOMNode.prototype._filterByPosition=function(expr,containerNodeSet){var equalsLocation=expr.indexOf("=");var tmpPos=expr.substr(equalsLocation+1,expr.length);if(tmpPos.indexOf("last()")==0){if(this==containerNodeSet.item(containerNodeSet.length-1)){return true;}else{return false;}}var intCount=tmpPos.length;var positionStr="";for(intLoop=0;intLoop<intCount;intLoop++){if(isNaN(positionStr+tmpPos.charAt(intLoop))==false){positionStr+=tmpPos.charAt(intLoop);}else{break;}}var positionInt=parseInt(positionStr)-1;if(this==containerNodeSet.item(positionInt)){return true;}else{return false;}};DOMNode.prototype._filter=function(expr,containerNodeSet){expr=trim(expr,true,true);if(expr.indexOf("not(")==0){return this._filterByNot(expr,containerNodeSet);}if(expr.indexOf("count(")==0){return this._filterByCount(expr,containerNodeSet);}if(expr.indexOf("name(")==0){return this._filterByName(expr,containerNodeSet);}if(expr.indexOf("position(")==0){return this._filterByPosition(expr,containerNodeSet);}if(expr.indexOf("@")>-1){return this._filterByAttribute(expr,containerNodeSet);}if(isNaN(expr)==false){return this._filterByLocation(expr,containerNodeSet);}if(expr=="last()"){return this._filterByLast(expr,containerNodeSet);}};DOMNode.prototype._getAxis=function(axisConst){if(axisConst==DOMNode.ANCESTOR_AXIS){return this._getAncestorAxis();}else{if(axisConst==DOMNode.ANCESTOR_OR_SELF_AXIS){return this._getAncestorOrSelfAxis();}else{if(axisConst==DOMNode.ATTRIBUTE_AXIS){return this._getAttributeAxis();}else{if(axisConst==DOMNode.CHILD_AXIS){return this._getChildAxis();}else{if(axisConst==DOMNode.DESCENDANT_AXIS){return this._getDescendantAxis();}else{if(axisConst==DOMNode.DESCENDANT_OR_SELF_AXIS){return this._getDescendantOrSelfAxis();}else{if(axisConst==DOMNode.FOLLOWING_AXIS){return this._getFollowingAxis();}else{if(axisConst==DOMNode.FOLLOWING_SIBLING_AXIS){return this._getFollowingSiblingAxis();}else{if(axisConst==DOMNode.NAMESPACE_AXIS){return this._getNamespaceAxis();}else{if(axisConst==DOMNode.PARENT_AXIS){return this._getParentAxis();}else{if(axisConst==DOMNode.PRECEDING_AXIS){return this._getPrecedingAxis();}else{if(axisConst==DOMNode.PRECEDING_SIBLING_AXIS){return this._getPrecedingSiblingAxis();}else{if(axisConst==DOMNode.SELF_AXIS){return this._getSelfAxis();}else{if(axisConst==DOMNode.ROOT_AXIS){return this._getRootAxis();}else{alert("Error in DOMNode._getAxis: Attempted to get unknown axis type "+axisConst);return null;}}}}}}}}}}}}}}};DOMNode.prototype._getAncestorAxis=function(){var parentNode=this.parentNode;if(parentNode.nodeType!=DOMNode.DOCUMENT_NODE){return this.parentNode._getAncestorOrSelfAxis();}else{return new XPATHNodeSet(this.ownerDocument,this.parentNode,null);}};DOMNode.prototype._getAncestorOrSelfAxis=function(){return this._getSelfAxis().union(this._getAncestorAxis());};DOMNode.prototype._getAttributeAxis=function(){return new XPATHNodeSet(this.ownerDocument,this.parentNode,this.attributes);};DOMNode.prototype._getChildAxis=function(){return new XPATHNodeSet(this.ownerDocument,this.parentNode,this.childNodes);};DOMNode.prototype._getDescendantAxis=function(){var descendantNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);for(var i=0;i<this.childNodes.length;i++){descendantNodeSet.union(this.childNodes.item(i)._getDescendantOrSelfAxis());}return descendantNodeSet;};DOMNode.prototype._getReversedDescendantAxis=function(){var descendantNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);for(var i=this.childNodes.length-1;i>=0;i--){descendantNodeSet.union(this.childNodes.item(i)._getReversedDescendantOrSelfAxis());}return descendantNodeSet;};DOMNode.prototype._getDescendantOrSelfAxis=function(){return this._getSelfAxis().union(this._getDescendantAxis());};DOMNode.prototype._getReversedDescendantOrSelfAxis=function(){return this._getSelfAxis().union(this._getReversedDescendantAxis());};DOMNode.prototype._getFollowingAxis=function(){var followingNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);if(this.nextSibling){followingNodeSet._appendChild(this.nextSibling);followingNodeSet.union(this.nextSibling._getDescendantAxis());followingNodeSet.union(this.nextSibling._getFollowingAxis());}return followingNodeSet;};DOMNode.prototype._getFollowingSiblingAxis=function(){var followingSiblingNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);if(this.nextSibling){followingSiblingNodeSet._appendChild(this.nextSibling);followingSiblingNodeSet.union(this.nextSibling._getFollowingSiblingAxis());}return followingSiblingNodeSet;};DOMNode.prototype._getParentAxis=function(){var parentNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);var parentNode=this.parentNode;if(parentNode){parentNodeSet._appendChild(parentNode);}return parentNodeSet;};DOMNode.prototype._getPrecedingAxis=function(){var precedingNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);if(this.previousSibling){precedingNodeSet.union(this.previousSibling._getReversedDescendantAxis());precedingNodeSet._appendChild(this.previousSibling);precedingNodeSet.union(this.previousSibling._getPrecedingAxis());}return precedingNodeSet;};DOMNode.prototype._getPrecedingSiblingAxis=function(){var precedingSiblingNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);if(this.previousSibling){precedingSiblingNodeSet._appendChild(this.previousSibling);precedingSiblingNodeSet.union(this.previousSibling._getPrecedingSiblingAxis());}return precedingSiblingNodeSet;};DOMNode.prototype._getSelfAxis=function(){var selfNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);selfNodeSet._appendChild(this);return selfNodeSet;};DOMNode.prototype._getRootAxis=function(){var rootNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode,null);rootNodeSet._appendChild(this.documentElement);return rootNodeSet;};DOMNode.prototype.selectNodeSet=function(locationPath){locationPath=locationPath.replace(/^\//g,"root::");var result;try{result=this.selectNodeSet_recursive(locationPath);return result;}catch(e){return null;}};DOMNode.prototype.selectNodeSet_recursive=function(locationPath){var locationSteps=locationPath.split("/");var candidateNodeSet;var resultNodeSet=new XPATHNodeSet(this.ownerDocument,this.parentNode);if(locationSteps.length>0){var stepStr=locationSteps[0];locationSteps=__removeFirstArrayElement(locationSteps);var stepObj=this._parseStep(stepStr);var axisStr=stepObj.axis;var nodeTestStr=stepObj.nodeTest;var predicateListStr=stepObj.predicateList;var axisType=this._parseAxis(axisStr);var nodeTestObj=this._parseNodeTest(nodeTestStr);var nodeTestType=nodeTestObj.type;var nodeTestValue=nodeTestObj.value;candidateNodeSet=this._getAxis(axisType);if(nodeTestType==DOMNode.NODE_TYPE_TEST){candidateNodeSet=candidateNodeSet.getTypedItems(nodeTestValue);}else{if(nodeTestType==DOMNode.NODE_NAME_TEST){candidateNodeSet=candidateNodeSet.getNamedItems(nodeTestValue);}}var predicateList=this._parsePredicates(predicateListStr);for(var i=0;i<predicateList.length;i++){candidateNodeSet=candidateNodeSet.filter(predicateList[i]);}if(locationSteps.length>0){var remainingLocationPath=locationSteps.join("/");candidateNodeSet=candidateNodeSet.selectNodeSet_recursive(remainingLocationPath);}}return candidateNodeSet;};DOMNode.prototype._nodeTypeIs=function(node,type){return(node.nodeType==type);};DOMNode.prototype._nodeNameIs=function(node,name){return(node.nodeName==name);};DOMNode.prototype._parseStep=function(step){var resultStep=new Object();resultStep.axis="";var nodeTestStartInd=0;var axisEndInd=step.indexOf("::");if(axisEndInd>-1){resultStep.axis=step.substring(0,axisEndInd);nodeTestStartInd=axisEndInd+2;}resultStep.predicateList="";var predicateStartInd=step.indexOf("[");if(predicateStartInd>-1){resultStep.predicateList=step.substring(predicateStartInd);resultStep.nodeTest=step.substring(nodeTestStartInd,predicateStartInd);}else{resultStep.nodeTest=step.substring(nodeTestStartInd);}if(resultStep.nodeTest.indexOf("@")==0){resultStep.axis="attribute";resultStep.nodeTest=resultStep.nodeTest.substring(1);}if(resultStep.nodeTest.length==0){resultStep.axis="descendant-or-self";}if(resultStep.nodeTest==".."){resultStep.axis="parent";resultStep.nodeTest="node()";}if(resultStep.nodeTest=="."){resultStep.axis="self";resultStep.nodeTest="node()";}return resultStep;};DOMNode.prototype._parseAxis=function(axisStr){var returnAxisType=DOMNode.CHILD_AXIS;if(axisStr=="ancestor"){returnAxisType=DOMNode.ANCESTOR_AXIS;}else{if(axisStr=="ancestor-or-self"){returnAxisType=DOMNode.ANCESTOR_OR_SELF_AXIS;}else{if(axisStr=="attribute"){returnAxisType=DOMNode.ATTRIBUTE_AXIS;}else{if(axisStr=="child"){returnAxisType=DOMNode.CHILD_AXIS;}else{if(axisStr=="descendant"){returnAxisType=DOMNode.DESCENDANT_AXIS;}else{if(axisStr=="descendant-or-self"){returnAxisType=DOMNode.DESCENDANT_OR_SELF_AXIS;}else{if(axisStr=="following"){returnAxisType=DOMNode.FOLLOWING_AXIS;}else{if(axisStr=="following-sibling"){returnAxisType=DOMNode.FOLLOWING_SIBLING_AXIS;}else{if(axisStr=="namespace"){returnAxisType=DOMNode.NAMESPACE_AXIS;}else{if(axisStr=="parent"){returnAxisType=DOMNode.PARENT_AXIS;}else{if(axisStr=="preceding"){returnAxisType=DOMNode.PRECEDING_AXIS;}else{if(axisStr=="preceding-sibling"){returnAxisType=DOMNode.PRECEDING_SIBLING_AXIS;}else{if(axisStr=="self"){returnAxisType=DOMNode.SELF_AXIS;}else{if(axisStr=="root"){returnAxisType=DOMNode.ROOT_AXIS;}}}}}}}}}}}}}}return returnAxisType;};DOMNode.prototype._parseNodeTest=function(nodeTestStr){var returnNodeTestObj=new Object();if(nodeTestStr.length==0){returnNodeTestObj.type=DOMNode.NODE_TYPE_TEST;returnNodeTestObj.value="node";}else{var funInd=nodeTestStr.indexOf("(");if(funInd>-1){returnNodeTestObj.type=DOMNode.NODE_TYPE_TEST;returnNodeTestObj.value=nodeTestStr.substring(0,funInd);}else{returnNodeTestObj.type=DOMNode.NODE_NAME_TEST;returnNodeTestObj.value=nodeTestStr;}}return returnNodeTestObj;};DOMNode.prototype._parsePredicates=function(predicateListStr){var returnPredicateArray=new Array();if(predicateListStr.length>0){var firstOpenBracket=predicateListStr.indexOf("[");var lastCloseBracket=predicateListStr.lastIndexOf("]");predicateListStr=predicateListStr.substring(firstOpenBracket+1,lastCloseBracket);returnPredicateArray=predicateListStr.split("][");}return returnPredicateArray;};XPATHNodeSet=function(ownerDocument,parentNode,nodeList){this.DOMNodeList=DOMNodeList;this.DOMNodeList(ownerDocument,parentNode);if(nodeList){for(var i=0;i<nodeList.length;i++){this._appendChild(nodeList.item(i));}}};XPATHNodeSet.prototype=new DOMNodeList();XPATHNodeSet.prototype.selectNodeSet_recursive=function(xpath){var selectedNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){var candidateNode=this.item(i);selectedNodeSet.union(candidateNode.selectNodeSet_recursive(xpath));}return selectedNodeSet;};XPATHNodeSet.prototype.getNamedItems=function(nodeName){var namedItemsNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){var candidateNode=this.item(i);if((nodeName=="*")||(candidateNode.nodeName==nodeName)){namedItemsNodeSet._appendChild(candidateNode);}}return namedItemsNodeSet;};XPATHNodeSet.prototype.getTypedItems=function(nodeType){var typedItemsNodeSet=new XPATHNodeSet(this.ownerDocument);var nodeTypeId;if(nodeType.toLowerCase()=="node"){nodeTypeId=0;}else{if(nodeType.toLowerCase()=="text"){nodeTypeId=DOMNode.TEXT_NODE;}else{if(nodeType.toLowerCase()=="comment"){nodeTypeId=DOMNode.COMMENT_NODE;}else{if(nodeType.toLowerCase()=="processing-instruction"){nodeTypeId=DOMNode.PROCESSING_INSTRUCTION_NODE;}}}}for(var i=0;i<this.length;i++){var candidateNode=this.item(i);if((nodeTypeId==0)||(candidateNode.nodeType==nodeTypeId)){typedItemsNodeSet._appendChild(candidateNode);}}return typedItemsNodeSet;};XPATHNodeSet.prototype._getAxis=function(axisConst){if(axisConst==DOMNode.ANCESTOR_AXIS){return this._getAncestorAxis();}else{if(axisConst==DOMNode.ANCESTOR_OR_SELF_AXIS){return this._getAncestorOrSelfAxis();}else{if(axisConst==DOMNode.ATTRIBUTE_AXIS){return this._getAttributeAxis();}else{if(axisConst==DOMNode.CHILD_AXIS){return this._getChildAxis();}else{if(axisConst==DOMNode.DESCENDANT_AXIS){return this._getDescendantAxis();}else{if(axisConst==DOMNode.DESCENDANT_OR_SELF_AXIS){return this._getDescendantOrSelfAxis();}else{if(axisConst==DOMNode.FOLLOWING_AXIS){return this._getFollowingAxis();}else{if(axisConst==DOMNode.FOLLOWING_SIBLING_AXIS){return this._getFollowingSiblingAxis();}else{if(axisConst==DOMNode.NAMESPACE_AXIS){return this._getNamespaceAxis();}else{if(axisConst==DOMNode.PARENT_AXIS){return this._getParentAxis();}else{if(axisConst==DOMNode.PRECEDING_AXIS){return this._getPrecedingAxis();}else{if(axisConst==DOMNode.PRECEDING_SIBLING_AXIS){return this._getPrecedingSiblingAxis();}else{if(axisConst==DOMNode.SELF_AXIS){return this._getSelfAxis();}else{if(axisConst==DOMNode.ROOT_AXIS){return this._getRootAxis();}else{alert("Error in XPATHNodeSet._getAxis: Attempted to get unknown axis type "+axisConst);return null;}}}}}}}}}}}}}}};XPATHNodeSet.prototype._getAncestorAxis=function(){var ancestorAxisNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){ancestorAxisNodeSet.union(this.item(i)._getDescendantAxis());}};XPATHNodeSet.prototype._getAncestorOrSelfAxis=function(){var ancestorOrSelfAxisNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){ancestorOrSelfAxisNodeSet.union(this.item(i)._getAncestorOrSelfAxis());}};XPATHNodeSet.prototype._getAttributeAxis=function(){var attributeAxisNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){attributeAxisNodeSet.union(this.item(i)._getAttributeAxis());}};XPATHNodeSet.prototype._getChildAxis=function(){var childNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){childNodeSet.union(this.item(i)._getChildAxis());}};XPATHNodeSet.prototype._getDescendantAxis=function(){var descendantNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){descendantNodeSet.union(this.item(i)._getDescendantAxis());}};XPATHNodeSet.prototype._getReversedDescendantAxis=function(){var descendantNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=this.length-1;i>=0;i--){descendantNodeSet.union(this.item(i)._getReversedDescendantAxis());}};XPATHNodeSet.prototype._getDescendantOrSelfAxis=function(){var descendantOrSelfNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){descendantOrSelfNodeSet.union(this.item(i)._getDescendantOrSelfAxis());}};XPATHNodeSet.prototype._getFollowingAxis=function(){var followingNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){followingNodeSet.union(this.item(i)._getFollowingAxis());}};XPATHNodeSet.prototype._getFollowingSiblingAxis=function(){var followingSibilingNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){followingSibilingNodeSet.union(this.item(i)._getFollowingSiblingAxis());}};XPATHNodeSet.prototype._getParentAxis=function(){var parentNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){parentNodeSet.union(this.item(i)._getParentAxis());}};XPATHNodeSet.prototype._getPrecedingAxis=function(){var precedingNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){precedingNodeSet.union(this.item(i)._getPrecedingAxis());}};XPATHNodeSet.prototype._getPrecedingSiblingAxis=function(){var precedingSiblingNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){precedingSiblingNodeSet.union(this.item(i)._getPrecedingSiblingAxis());}};XPATHNodeSet.prototype._getSelfAxis=function(){var selfNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){selfNodeSet.union(this.item(i)._getSelfAxis());}};XPATHNodeSet.prototype.union=function(nodeSet){for(var i=0;i<nodeSet.length;i++){this._appendChild(nodeSet.item(i));}return this;};XPATHNodeSet.prototype._getContainingNodeSet=function(){return this;};XPATHNodeSet.prototype.getLength=function(){return this.length;};XPATHNodeSet.prototype.filter=function(expressionStr){var matchingNodeSet=new XPATHNodeSet(this.ownerDocument);for(var i=0;i<this.length;i++){if(this.item(i)._filter(expressionStr,this)){matchingNodeSet._appendChild(this.item(i));}}return matchingNodeSet;};function __removeFirstArrayElement(oldArray){var newArray=new Array();try{for(intLoop=1;intLoop<oldArray.length;intLoop++){newArray[newArray.length]=oldArray[intLoop];}}catch(e){}return newArray;}var XML_VER="$Revision: 1.105 $";function getTechFrm(){return top.document.documentElement.findChildById("tech","div");}function loadXML(p_sXml){var oDI=new DOMImplementation();oDI.namespaceAware=false;var oDom=oDI.loadXML(p_sXml);var oDomTree=oDom.getDocumentElement();return oDomTree;}function getDocElement(p_sXml){try{var oDI=new DOMImplementation();oDI.namespaceAware=false;var oDom=oDI.loadXML(p_sXml);var oDomTree=oDom.getDocumentElement().getElementsByTagName("Document").item(0);return oDomTree;}catch(e){if(bAdmin){if(copy_clip){copy_clip(p_sXml);}}throw e;}}function builEntityLibFromNode(p_oNode){var sLib="";var msSns=["nomfamille","prenom","nom_societe","enseigne","prescr_ville","date_debut","date_fin","partner_nom","num_ordre_mission","mission_date_debut","mission_date_fin","mission_com"];var msLibs=new Array(msSns.length);var oValSet=p_oNode.selectNodeSet("avl/av");for(var ii=0,iiL=oValSet.getLength();ii<iiL;ii++){var oTmpNode=oValSet.item(ii);var sAttrSn=oTmpNode.getAttribute("asn");for(var j=0;j<msSns.length;j++){if(sAttrSn==msSns[j]){var sLibAttr="";if(sAttrSn=="date_debut"){sLibAttr="contrat du ";}if(sAttrSn=="date_fin"){sLibAttr="au ";}if(sAttrSn=="mission_date_debut"){sLibAttr="mission du ";}if(sAttrSn=="mission_date_fin"){sLibAttr="au ";}sLibAttr+=oTmpNode.getFirstChild().getFirstChild().getNodeValue();msLibs[j]=sLibAttr;}}}for(var j=0;j<msLibs.length;j++){if(!msLibs[j]){continue;}if(sLib!=""){sLib+=" ";}sLib+=msLibs[j];}if(sLib==""&&p_oNode.getElementsByTagName("name").length>0){sLib+=p_oNode.getElementsByTagName("name").item(0).getFirstChild().getNodeValue();if(p_oNode.getAttribute("cp")){sLib+=" ["+p_oNode.getAttribute("cp")+"]";}}return sLib;}function retrieveHttpParamValue(oDomTree,p_sParam){var oParList=oDomTree.getElementsByTagName("params").item(0).getElementsByTagName("httpParams").item(0).getElementsByTagName("param");var oInput;for(j=0;j<oParList.getLength();j++){var oDOMNode=oParList.item(j);if(oDOMNode.getAttribute("name")==p_sParam){return oDOMNode.getFirstChild().getNodeValue();}}return null;}function retrieveElementFromHttpParam(oDomTree){var s=retrieveHttpParamValue(oDomTree,"inputId");return document.getElementById(s);}function retrieveDataItemIdFromHttpParam(oDomTree){return retrieveHttpParamValue(oDomTree,"DIId");}function buildArrayFromXml(p_xDomTree){var xDI=p_xDomTree;while(xDI.tagName!="di"){xDI=xDI.firstChild;}var sTypeEnum="ev";if(xDI.getAttribute("ext_table_name")){sTypeEnum=xDI.getAttribute("ext_table_name");}var oList=xDI.getElementsByTagName("evl").item(0).getElementsByTagName(sTypeEnum);var msList=new Array();msList.iDIId=xDI.getAttribute("id");msList.sDISn=xDI.getAttribute("sn");var bByIdx=false;for(var j=0,l=oList.getLength();j<l;j++){var oDOMNode=oList.item(j);var sVal=oDOMNode.getAttribute("id");if(sVal==0||sVal==""){continue;}var sLib="lib non défini";if(oDOMNode.getElementsByTagName("l").item(0)){sLib=oDOMNode.getElementsByTagName("l").item(0).getFirstChild().getNodeValue();}else{if(oDOMNode.getElementsByTagName("name").item(0)){sLib=oDOMNode.getElementsByTagName("name").item(0).getFirstChild().getNodeValue();}}var oVal=new ListItem(sVal,sLib);msList[j]=oVal;oVal.setAllowed(oDOMNode.getAttribute("allowed")=="1");oVal.setDisabled(oDOMNode.getAttribute("disabled")=="true");oVal.setOrderIdx(oDOMNode.getAttribute("index"));oVal.setParentId(oDOMNode.getAttribute("parentid"));oVal.setDivaId(oDOMNode.getAttribute("divaid"));if(!bByIdx&&oVal.getOrderIdx()){bByIdx=true;}}if(bByIdx){msList.sort(sortByIndex);}else{msList.sort(sortByValue);}return msList;}function sortByValue(x1,x2){return(x1.getLabel().replace(/[éèê]/,"e").toUpperCase()>x2.getLabel().replace(/[éèê]/,"e").toUpperCase())?1:-1;}function sortByIndex(x1,x2){return((x1.getOrderIdx()*1)>(x2.getOrderIdx()*1))?1:-1;}ListItem=Class.create();ListItem.prototype={m_iId:null,m_sLabel:null,m_bAllowed:null,m_bDisabled:null,m_iOrderIdx:null,m_iParentId:null,m_iDivaId:null,initialize:function(p_iId,p_sLib){this.m_iId=p_iId;this.m_sLabel=p_sLib;},getId:function(){return this.m_iId;},getLabel:function(){return this.m_sLabel;},setAllowed:function(p){this.m_bAllowed=p;},isAllowed:function(){return this.m_bAllowed;},setOrderIdx:function(p){this.m_iOrderIdx=p;},getOrderIdx:function(){return this.m_iOrderIdx;},setParentId:function(p){this.m_iParentId=p;},getParentId:function(){return this.m_iParentId;},setDivaId:function(p){this.m_iDivaId=p;},getDivaId:function(){return this.m_iDivaId;},isDisabled:function(){return this.m_bDisabled;},setDisabled:function(p){this.m_bDisabled=p;}};function fillCombo(p,p_oInput,p_sCurrentValue,p_sContainerId,p_sFilterValue,p_sType){var msList;var oInput=p_oInput;if(typeof(oInput)!="object"){if(p_sContainerId){var oCont=$O2(p_sContainerId);if(!oCont){return;}}oInput=p_sContainerId?oCont.findChildById(p_oInput):document.getElementById(p_oInput);}if(!oInput){throw"fillCombo: input '"+p_oInput+"', type '"+(typeof p_oInput)+"', not found in container '"+p_sContainerId+"'";}if(typeof(p)=="object"){msList=p;}else{var oDoc=getDocElement(p);var iDIId=retrieveDataItemIdFromHttpParam(oDoc);msList=buildArrayFromXml(oDoc);msDIList[iDIId]=msList;}var bFilter=oInput.getAttribute&&"true"==oInput.getAttribute("filter");var sCurValue=p_sCurrentValue?ODYForm.sVALUE_SEP+p_sCurrentValue+ODYForm.sVALUE_SEP:null;var bIsValueSelected=false;for(var j=0;j<oInput.options.length;j++){var oOpt=oInput.options[j];if(!sCurValue||!sCurValue.match(ODYForm.sVALUE_SEP+oOpt.value+ODYForm.sVALUE_SEP)){continue;}if(!bIsValueSelected){oInput.options[0].selected=false;}oOpt.selected=true;bIsValueSelected=true;}var iInsertIdx=0;var bHasdoublon=false;var msFilteredList=new Array();for(var j=0,l=msList.length;j<l;j++){var oLI=msList[j];if(bFilter&&!oLI.isAllowed()){continue;}if(p_sFilterValue!=null&&String(oLI.getParentId())!=String(p_sFilterValue)){continue;}var bFound=false;for(var i=0;i<msFilteredList.length;i++){var oLIT=msFilteredList[i];if(parseInt(oLIT.getId())==parseInt(oLI.getId())){bFound=true;bHasdoublon=true;break;}}if(bFound){continue;}msFilteredList[iInsertIdx]=oLI;iInsertIdx++;}if(bHasdoublon){msFilteredList.sort(sortByValue);}var iMaxOptWidth=0;var iLimitWidth=oInput.getContainer().clientWidth/3;for(var j=0,l=msFilteredList.length;j<l;j++){var oLI=msFilteredList[j];var oOpt=new Option(oLI.getLabel());oOpt.value=oLI.getId();oOpt["oLI"]=oLI;if(sCurValue&&sCurValue.match(ODYForm.sVALUE_SEP+oOpt.value+ODYForm.sVALUE_SEP)){if(!bIsValueSelected){oInput.options[0].selected=false;}oOpt.selected=true;bIsValueSelected=true;}var oLibInput=oInput.findBrotherById("lib"+oInput.id);if(!oLibInput){oLibInput=oInput;}var sDispSN=oLibInput.getAttribute("dispSN");if(oLI.isDisabled()&&sDispSN&&sDispSN.lastIndexOf("_RECH")==-1&&sDispSN.lastIndexOf("_ETAT")==-1&&sDispSN!="REQUEST"){oOpt.disabled=true;if(oOpt.style){oOpt.style.color="#AAAAAA";}}else{if(oOpt.style){oOpt.style.color="#000000";}}if(bAdmin&&!oInput.options){alert(oInput.id+" - "+oInput.tagName+" - "+findContainer(oInput).id);}oInput.options[oInput.options.length]=oOpt;var oTextNode=oOpt.childNodes[0];var iWidth=oTextNode.nodeValue.getWidth();if(iWidth>iMaxOptWidth){iMaxOptWidth=(iWidth>iLimitWidth)?iLimitWidth:iWidth;}}if("select-multiple"==oInput.type&&oInput.clientWidth<(iMaxOptWidth+17)){oInput.style.width=(iMaxOptWidth+17)+"px";}var oEmptyOpt=oInput.findChildById("emptyOption","OPTION");if(!oEmptyOpt){var oOpt=new Option("-- --");oOpt.id="emptyOption";oOpt.value="";oInput.options[0]=oOpt;if(!bIsValueSelected){oInput.selectedIndex=0;}}if(oInput.options[0]&&oInput.options[0].id=="loading"){oInput.options[0]=null;}if(bIsValueSelected&&oInput.onchange){oInput.onchange();}removeCssStyle(oInput,"loading");if(p_sType=="select_checkable"){var sName=oInput.getAttribute("attributename");test=new MultipleSelectCheckbox("test");test.addGlobalSwitch("<b>Tous</b>","__global",false);test.create(oInput.name,oInput,"MSC"+oInput.name,"MSCselect_"+oInput.name);}oInput.setAttribute(ODYCont.sATTR_LOADED,"true");}function processList(p_sElemId,p_sSrcId,p_sCurrentValue,p_sFilterValue,p_sType){var oInput=$O2(p_sElemId);if(bAdmin&&!oInput){alert("Input '"+p_sElemId+"' not found");}if(bAdmin&&"select-one"!=oInput.type&&"select-multiple"!=oInput.type){alert("Input '"+p_sElemId+"' is not a combo but : "+oInput.type);}if(p_sFilterValue!=null){oInput.options.length=0;}var sCondition=oInput.getCondition();if(sCondition&&sCondition.indexOf("filter=")==0&&(!p_sFilterValue||""==p_sFilterValue)){if(p_sCurrentValue){oInput.value=p_sCurrentValue;}return;}addCssStyle(oInput,"loading");oInput.setAttribute(ODYCont.sATTR_LOADED,"false");var moOpt=oInput.options;var iNbr=moOpt.length;if(iNbr>0){moOpt[iNbr]=new Option("void");for(var j=iNbr;j>0;j=j-1){var oOpt=moOpt[j-1];var oNewOpt=new Option(oOpt.text);oNewOpt.value=oOpt.value;oNewOpt.id=oOpt.id;oNewOpt.selected=oOpt.selected;moOpt[j-1]=new Option("void");moOpt[j]=oNewOpt;}}var iInsertIdx=0;var oOpt=new Option("Chargement en cours ...");oOpt.id="loading";oOpt.value="-9";oInput.options[iInsertIdx]=oOpt;oInput.selectedIndex=iInsertIdx;var msList=msDIList[p_sSrcId];var oLibInput=oInput.findBrotherById("lib"+oInput.id);if(!oLibInput){oLibInput=oInput;}var sCriteria=oLibInput.getCondition();var bAddCriteria=0;if(sCriteria&&sCriteria.lastIndexOf("mainEntId")!=-1){bAddCriteria=1;}if(null==msList||!msList||bAddCriteria){var oContainer=findContainer(oInput);if(oContainer&&"alerte"==oContainer.id){oContainer=oContainer.getContainer();}var sContId=oContainer&&oContainer.id?oContainer.id:null;if(bAddCriteria){var oIFAcont=oContainer;if(!oIFAcont.id.match("ifa_.*")){oIFAcont=oIFAcont.getContainer();}var oReg2=new RegExp("\\{mainEntId\\}","g");sCriteria=sCriteria.replace(oReg2,oIFAcont.getAttribute("mainEntId"));sCriteria="&filter="+encodeURI(sCriteria);}else{sCriteria="";}var sPostData="DIId="+p_sSrcId+"&inputId="+encodeURI(oInput.id)+sCriteria;var sExpr="fillCombo(sResponse,'"+oInput.id+"',"+(p_sCurrentValue?"'"+p_sCurrentValue+"'":"null")+",'"+sContId+"'"+","+(p_sFilterValue?"'"+p_sFilterValue+"'":"null")+",'"+p_sType+"')";sendRequest("/loader.svt",10,"tech",sPostData,sExpr);}else{fillCombo(msList,oInput,p_sCurrentValue,null,p_sFilterValue,p_sType);}}function processDblList(p_sElemId,p_sSrcId,p_sCurrentValue){var oInput=document.getElementById(p_sElemId);if(bAdmin&&!oInput){alert("Input '"+p_sElemId+"' not found");}var oList1=document.getElementById("dblList1_"+p_sElemId);var oList2=document.getElementById("dblList2_"+p_sElemId);addCssStyle(oList1,"loading");addCssStyle(oList2,"loading");oInput.setAttribute(ODYCont.sATTR_LOADED,"false");var msList=msDIList[p_sSrcId];if(null==msList||!msList){var oContainer=findContainer(oInput);var sContId=oContainer&&oContainer.id?"'"+oContainer.id+"'":"null";sendRequest("/loader.svt",10,"tech","DIId="+p_sSrcId+"&inputId="+encodeURI(p_sElemId),"fillDblList(sResponse,'"+p_sElemId+"',"+(p_sCurrentValue?"'"+p_sCurrentValue+"'":"null")+","+sContId+")");}else{fillDblList(msList,oInput,p_sCurrentValue);}}function fillDblList(p,p_oInput,p_sDefaultValue,p_sContainerId){var msList;var oInput;if(typeof(p)=="object"){msList=p;oInput=p_oInput;}else{var oDoc=getDocElement(p);msList=buildArrayFromXml(oDoc);msDIList[retrieveDataItemIdFromHttpParam(oDoc)]=msList;oInput=p_sContainerId?document.getElementById(p_sContainerId).findChildById(p_oInput):document.getElementById(p_oInput);}var bFilter=oInput.getAttribute&&"true"==oInput.getAttribute("filter");var oList1=document.getElementById("dblList1_"+oInput.id);var oList2=document.getElementById("dblList2_"+oInput.id);for(var j=0,l=msList.length;j<l;j++){var oLI=msList[j];if(bFilter&&oLI[2]!="1"){continue;}addDblListItem(oList1,oLI[0],oLI[1],oInput);}removeCssStyle(oList1,"loading");removeCssStyle(oList2,"loading");oInput.setAttribute("bLoaded","true");if(arguments.length>=3){oInput.value=arguments[2];}}function createXMLHttpRequest(){var ua;if(window.XMLHttpRequest){try{ua=new XMLHttpRequest();ua.overrideMimeType("text/xml");}catch(e){ua=false;}}else{if(window.ActiveXObject){try{ua=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){ua=false;}}}return ua;}var msRequest=new Array();function sendRequest(p_sUrl,p_iStep,p_sFrm,p_sSubmit,p_sResultExpr){var req=Ajax.getTransport();if(!req){return false;}var bAsyncCall=(typeof p_sResultExpr!="undefined"&&p_sResultExpr!=null);msRequest.push(req);var sUrl=p_sUrl;if(-1!=p_iStep){sUrl=addUrlParam(sUrl,"step",p_iStep,true);}sUrl=addUrlParam(sUrl,"frm",p_sFrm,true);req.open("POST",sUrl,bAsyncCall);req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(!p_sSubmit){p_sSubmit="a=";}req.setRequestHeader("Content-length",p_sSubmit.length);req.setRequestHeader("Connection","close");req.onreadystatechange=function(){if(req.readyState==4){processResponse(req,sUrl,p_sResultExpr);}};req.send(p_sSubmit);if(!bAsyncCall){return processResponse(req,sUrl,p_sResultExpr);}}function processResponse(req,p_sUrl,p_sResultExpr){var ms=new Array();for(var i=0,l=msRequest.length;i<l;i++){if(msRequest[i]!=req){ms.push(msRequest[i]);}}msRequest=ms;var sResponse=req.responseText;switch(req.status){case 404:if(bAdmin){alert("sendRequest : Error "+req.status+" : Not Found. The requested URL "+p_sUrl+" could not be found.");}break;case 500:handleErrFullPage(sResponse);break;default:if(sResponse.indexOf("XXXError:")>-1||sResponse.indexOf("XXXDebug:")>-1){alert(sResponse);}else{if(!p_sResultExpr){return sResponse;}try{eval(p_sResultExpr);return true;}catch(exc){var sMsg="sendRequest["+p_sUrl+"] : Failed to execute script.\n"+O2Exception.errorToStr(exc)+"\n\n Executing script : "+p_sResultExpr;O2Exception.recordError(sMsg);if(bAdmin){alert(sMsg);}}}break;}return false;}function display(p_oContainer,p_iStep,p_sUrl,p_sSubmit,p_bSynchro){displayInId(p_oContainer.id,p_iStep,p_sUrl,p_sSubmit,p_bSynchro);}function displayInId(p_sContainerId,p_iStep,p_sUrl,p_sSubmit,p_bSynchro){var oCont=typeof(p_sContainerId)=="string"?findContainerById(p_sContainerId):p_sContainerId;if(!oCont){return new O2Exception("Le container '"+p_sContainerId+"' n'existe pas.").display();}oCont.showLoading();oCont.setAttribute("reloadCmd","displayInId('"+oCont.id+"', "+p_iStep+",'"+p_sUrl+"'"+(p_sSubmit?",'"+p_sSubmit+"'":"")+")");var sUrl=addUrlParam(p_sUrl,"out","div",false);var sExpr="doDisplayInId('"+oCont.id+"', sResponse)";try{if(p_bSynchro){var sResponse=sendRequest(sUrl,p_iStep,p_sContainerId,p_sSubmit);eval(sExpr);}else{sendRequest(sUrl,p_iStep,p_sContainerId,p_sSubmit,sExpr);}}catch(e){if(oCont){oCont.unsetLoading();}throw e;}}function doDisplayInId(p_sContainerIdOrObj,p_sResponse){var oCont=(typeof p_sContainerIdOrObj=="object")?p_sContainerIdOrObj:findContainerById(p_sContainerIdOrObj);if(!oCont){return;}oCont.msOnLoadFunctionList=new Array();oCont.innerHTML=p_sResponse;oCont.setLoaded();if(sDbg){patchDbgLinks(oCont);}executeJS(oCont);}function executeJS(p_oCont){var vScript=p_oCont.getElementsByTagName("script");for(var i=0,l=vScript.length;i<l;i++){var oScript=vScript[i];if(!oScript){continue;}try{var sScript=oScript.textContent||oScript.text;if(!sScript||sScript.match(/<!--[\s\n\r]*-->/)){continue;}var iIdx=0,iNext=0,sModifiedS="";var re=/[\(\)]/g;while(-1!=(iNext=sScript.indexOf("addOnLoad",iIdx))){iNext=iNext+"addOnLoad".length+1;sModifiedS+=sScript.substring(iIdx,iNext);var iParentCount=1,ii=0;re.lastIndex=iNext;while(iParentCount!=0&&ii<100&&(result=re.exec(sScript))!=null){iParentCount+=(result[0]=="(")?+1:-1;ii++;}var iIdxCloseParent=re.lastIndex;if(iIdxCloseParent<=iNext){throw"erreur";}sModifiedS+=sScript.substring(iNext,iIdxCloseParent-1)+",'"+p_oCont.id+"'"+sScript.substring(iIdxCloseParent-1,iIdxCloseParent);iIdx=iIdxCloseParent+1;}sModifiedS+=sScript.substring(iIdx);eval(sModifiedS);}catch(e){var sMsg="executeJS["+p_oCont.id+"] : Failed to execute script.\n"+O2Exception.errorToStr(e)+"\nexecuting script : "+sModifiedS;O2Exception.recordError(sMsg);if(bAdmin){copy_clip(sMsg);}throw e;}}windowOnLoad(p_oCont);}function handleErrFullPage(strIn){var errorWin;try{errorWin=window.open("","errorWin");errorWin.document.body.innerHTML=strIn;}catch(e){alert("An error occurred, but the error message cannot be"+" displayed because of your browser's pop-up blocker.\n"+"Please allow pop-ups from this Web site.");}}function processSpecialCaractere(p_sChaine){p_sChaine=p_sChaine.replace(/\u20AC/g,"EUR");p_sChaine=p_sChaine.replace(/\u2019/g,"'");p_sChaine=p_sChaine.replace(/\u0153/g,"oe");return p_sChaine;}function formData2QueryString(p_oForm){var submitContent="";var formElem;var lastElemName="";for(var i=0;i<p_oForm.elements.length;i++){formElem=p_oForm.elements[i];switch(formElem.type){case"text":case"hidden":case"password":case"textarea":if(formElem.getAttribute("dataItemTypeSn")=="select_checkable"){var sCurrentValue=getCurrentValue(formElem,";");if(sCurrentValue){submitContent+=formElem.name+"="+escape(sCurrentValue)+"&";}}else{if(formElem.value&&(!formElem.getAttribute("dataTypeId")||formElem.getAttribute("dataItemTypeSn")!="upload")){var sValue=escape(processSpecialCaractere(formElem.value));sValue=sValue.replace(/\+/g,"%2B");submitContent+=(formElem.name+"="+sValue+"&");}}break;case"select-one":if(formElem.value){submitContent+=formElem.name+"="+escape(formElem.value)+"&";}break;case"select-multiple":if(formElem.selectedIndex!=-1){var iNb=0;submitContent+=formElem.name+"=";$A(formElem.options).each(function(oOpt){if(!oOpt.selected){return;}if(iNb>0){submitContent+=ODYForm.sVALUE_SEP;}submitContent+=oOpt.value;iNb++;});submitContent+="&";}break;case"radio":if(formElem.checked){submitContent+=formElem.name+"="+escape(formElem.value)+"&";}break;case"checkbox":if(formElem.checked){if(formElem.name==lastElemName){if(submitContent.lastIndexOf("&")==submitContent.length-1){submitContent=submitContent.substr(0,submitContent.length-1);}submitContent+=","+escape(formElem.value);}else{submitContent+=formElem.name+"="+escape(formElem.value);}submitContent+="&";lastElemName=formElem.name;}break;}}submitContent=submitContent.substr(0,submitContent.length-1);return submitContent;}var re_dt=/^(\d{1,2})\/(\d{1,2})\/(\d{2,4})$/,re_tm=/^(\d{1,2})(\:(\d{1,2}))?$/,a_formats={"alpha":/^[a-zA-Z\.\- ]*$/,"alpha2":/^[a-zA-Zéèêôàçùûî\.\- ]*$/,"alphanum":/^\w+$/,"unsigned":/^\d+$/,"integer":/^[\+\-]?\d*$/,"real":/^[\+\-]?\d*\.?\d*$/,"email":/^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/,"phone":/^(\d\d[\.\s]?){4}\d\d$/,"date":function(s_date){if(!re_dt.test(s_date)){return false;}if(RegExp.$1>31||RegExp.$2>12){return false;}var dt_test=new Date(RegExp.$3,Number(RegExp.$2-1),RegExp.$1);if(dt_test.getMonth()!=Number(RegExp.$2-1)){return false;}return true;},"time":function validate_time(s_time){if(!re_tm.test(s_time)){return false;}if(RegExp.$1>23||RegExp.$2>59||RegExp.$3>59){return false;}return true;}},a_messages=["No form name passed to validator construction routine",'No array of "%form%" form fields passed to validator construction routine','Le formulaire "%form%" n\'a pas été trouvé dans ce document','Incomplete "%n%" form field descriptor entry. "l" attribute is missing','Impossible de trouver le champ "%n%" dans le formulaire "%form%"','Can not find label tag (id="%t%")','Impossible de vérifier la correpondance. Champ "%m%" non trouvé','"%l%" est un champ obligatoire','La valeur de "%l%" doit contenir au moins %mn% caractères','La valeur de  "%l%" ne doit pas dépasser %mx% caractères','"%v%" n\'est pas une valeur valide pour "%l%"','"%l%" doit correspondre à "%ml%"'];function validator(p_sForm,a_fields,o_cfg){this.f_error=validator_error;this.f_alert=o_cfg&&o_cfg.alert?function(s_msg){alert(s_msg);return false;}:function(){return false;};if(!p_sForm){return this.f_alert(this.f_error(0));}if(typeof(p_sForm)=="object"){this.o_form=p_sForm;}else{this.o_form=document.forms[p_sForm];}if(!a_fields||typeof(a_fields)!="object"){return this.f_alert(this.f_error(1));}this.a_fields=a_fields;this.a_2disable=o_cfg&&o_cfg["to_disable"]&&typeof(o_cfg["to_disable"])=="object"?o_cfg["to_disable"]:[];this.exec=validator_exec;}function validator_exec(){var o_form=this.o_form;if(!o_form){return this.f_alert(this.f_error(2));}b_dom=document.body&&document.body.innerHTML;for(var n_key in this.a_fields){this.a_fields[n_key]["n"]=n_key;if(!this.a_fields[n_key]["l"]){return this.f_alert(this.f_error(3,this.a_fields[n_key]));}o_input=o_form.elements[n_key];if(!o_input){return this.f_alert(this.f_error(4,this.a_fields[n_key]));}this.a_fields[n_key].o_input=o_input;}if(b_dom){for(var n_key in this.a_fields){if(this.a_fields[n_key]["t"]){var s_labeltag=this.a_fields[n_key]["t"],e_labeltag=get_element(s_labeltag);if(!e_labeltag){return this.f_alert(this.f_error(5,this.a_fields[n_key]));}this.a_fields[n_key].o_tag=e_labeltag;e_labeltag.className="tfvNormal";}}}var icount=0;for(var n_key in this.a_fields){icount++;var s_value="";o_input=this.a_fields[n_key].o_input;if(o_input.type=="checkbox"){s_value=o_input.checked?o_input.value:"";}else{if(o_input.value){s_value=o_input.value;}else{if(o_input.options){s_value=o_input.selectedIndex>-1?o_input.options[o_input.selectedIndex].value:null;}else{if(o_input.length>0){for(var n_index=0;n_index<o_input.length;n_index++){if(o_input[n_index].checked){s_value=o_input[n_index].value;break;}}}}}}if(null!=s_value){this.a_fields[n_key]["v"]=s_value.replace(/(^\s+)|(\s+$)/g,"");}}var n_errors_count=0,n_another,o_format_check;for(var n_key in this.a_fields){o_format_check=this.a_fields[n_key]["f"]&&a_formats[this.a_fields[n_key]["f"]]?a_formats[this.a_fields[n_key]["f"]]:null;this.a_fields[n_key].n_error=null;if(this.a_fields[n_key]["r"]&&!this.a_fields[n_key]["v"]){this.a_fields[n_key].n_error=1;n_errors_count++;}else{if(this.a_fields[n_key]["mn"]&&String(this.a_fields[n_key]["v"]).length<this.a_fields[n_key]["mn"]){this.a_fields[n_key].n_error=2;n_errors_count++;}else{if(this.a_fields[n_key]["mx"]&&String(this.a_fields[n_key]["v"]).length>this.a_fields[n_key]["mx"]){this.a_fields[n_key].n_error=3;n_errors_count++;}else{if(this.a_fields[n_key]["v"]&&this.a_fields[n_key]["f"]&&((typeof(o_format_check)=="function"&&!o_format_check(this.a_fields[n_key]["v"]))||(typeof(o_format_check)!="function"&&!o_format_check.test(this.a_fields[n_key]["v"])))){this.a_fields[n_key].n_error=4;n_errors_count++;}else{if(this.a_fields[n_key]["m"]){for(var n_key2 in this.a_fields){if(n_key2==this.a_fields[n_key]["m"]){n_another=n_key2;break;}}if(n_another==null){return this.f_alert(this.f_error(6,this.a_fields[n_key]));}if(this.a_fields[n_another]["v"]!=this.a_fields[n_key]["v"]){this.a_fields[n_key]["ml"]=this.a_fields[n_another]["l"];this.a_fields[n_key].n_error=5;n_errors_count++;}}}}}}}var s_alert_message="",e_first_error;if(n_errors_count){for(var n_key in this.a_fields){var n_error_type=this.a_fields[n_key].n_error,s_message="";if(n_error_type){s_message=this.f_error(n_error_type+6,this.a_fields[n_key]);}if(s_message){if(!e_first_error){e_first_error=o_form.elements[n_key];}s_alert_message+=s_message+"\n";if(b_dom&&this.a_fields[n_key].o_tag){this.a_fields[n_key].o_tag.className="tfvHighlight";}}}alert(s_alert_message);if(e_first_error.focus&&e_first_error.type!="hidden"&&!e_first_error.disabled){eval("e_first_error.focus()");}return false;}for(n_key in this.a_2disable){if(o_form.elements[this.a_2disable[n_key]]){o_form.elements[this.a_2disable[n_key]].disabled=true;}}return true;}function validator_error(n_index){var s_=a_messages[n_index],n_i=1,s_key;for(;n_i<arguments.length;n_i++){for(s_key in arguments[n_i]){s_=s_.replace("%"+s_key+"%",arguments[n_i][s_key]);}}s_=s_.replace("%form%",this.o_form.name);return s_;}function get_element(s_id){return(document.all?document.all[s_id]:(document.getElementById?document.getElementById(s_id):null));}var newsContente;var indice;function initVariable(){newsContente=new Array();indice=0;}var sbcolor="";var sspeed=1;var iNbMaxMessage;var sMsg;var indiceMessageCourant;var sSeparator;var oTickerDiv;var iMaxTop;var iMinTop;var resumesspeed=sspeed;var bTimeouSet=false;function startTicker(p_sMaindiv,p_sTickerDiv,p_sSep){sSeparator=p_sSep;var oParentDiv=$O2(p_sMaindiv);indiceMessageCourant=0;sMsg=newsContente[indiceMessageCourant];if(!sMsg){return;}if(sMsg.length=0){sMsg="<center><B>Aucune News</B></center>";}sMsg+=sSeparator;iNbMaxMessage=newsContente.length;oTickerDiv=$O2(p_sTickerDiv);oTickerDiv.innerHTML=sMsg;iMaxTop=0;iMinTop=oParentDiv.clientHeight;oTickerDiv.style.top=(iMaxTop+iMinTop-30)+"px";getFuturMessage();if(!bTimeouSet){ns6slide();bTimeouSet=true;}}function getFuturMessage(){var i=indiceMessageCourant;indiceMessageCourant=(i+1>iNbMaxMessage-1)?0:i+1;sMsg=newsContente[i];while(sMsg.length=0&&indiceMessageCourant<iNbMaxMessage-1){getFuturMessage();}if(sMsg.length>0){sMsg+=sSeparator;}}function ns6slide(){if(parseInt(oTickerDiv.style.top)>=(iMaxTop-oTickerDiv.offsetHeight)){var iTop=parseInt(oTickerDiv.style.top)-sspeed;oTickerDiv.style.top=iTop+"px";setTimeout("ns6slide()",100);}else{getFuturMessage();oTickerDiv.innerHTML=sMsg;oTickerDiv.style.top=(iMinTop-30)+"px";ns6slide();}}var FCKeditor=function(instanceName,width,height,toolbarSet,value){this.InstanceName=instanceName;this.Width=width||"100%";this.Height=height||"200";this.ToolbarSet=toolbarSet||"Default";this.Value=value||"";this.BasePath=FCKeditor.BasePath;this.CheckBrowser=true;this.DisplayErrors=true;this.Config=new Object();this.OnError=null;};FCKeditor.BasePath="/fckeditor/";FCKeditor.MinHeight=200;FCKeditor.MinWidth=750;FCKeditor.prototype.Version="2.6.4";FCKeditor.prototype.VersionBuild="21629";FCKeditor.prototype.Create=function(){document.write(this.CreateHtml());};FCKeditor.prototype.CreateHtml=function(){if(!this.InstanceName||this.InstanceName.length==0){this._ThrowError(701,"You must specify an instance name.");return"";}var sHtml="";if(!this.CheckBrowser||this._IsCompatibleBrowser()){sHtml+='<input type="hidden" id="'+this.InstanceName+'" name="'+this.InstanceName+'" value="'+this._HTMLEncode(this.Value)+'" style="display:none" />';sHtml+=this._GetConfigHtml();sHtml+=this._GetIFrameHtml();}else{var sWidth=this.Width.toString().indexOf("%")>0?this.Width:this.Width+"px";var sHeight=this.Height.toString().indexOf("%")>0?this.Height:this.Height+"px";sHtml+='<textarea name="'+this.InstanceName+'" rows="4" cols="40" style="width:'+sWidth+";height:"+sHeight;if(this.TabIndex){sHtml+='" tabindex="'+this.TabIndex;}sHtml+='">'+this._HTMLEncode(this.Value)+"</textarea>";}return sHtml;};FCKeditor.prototype.ReplaceTextarea=function(){if(document.getElementById(this.InstanceName+"___Frame")){return;}if(!this.CheckBrowser||this._IsCompatibleBrowser()){var oTextarea=document.getElementById(this.InstanceName);var colElementsByName=document.getElementsByName(this.InstanceName);var i=0;while(oTextarea||i==0){if(oTextarea&&oTextarea.tagName.toLowerCase()=="textarea"){break;}oTextarea=colElementsByName[i++];}if(!oTextarea){alert('Error: The TEXTAREA with id or name set to "'+this.InstanceName+'" was not found');return;}oTextarea.style.display="none";if(oTextarea.tabIndex){this.TabIndex=oTextarea.tabIndex;}this._InsertHtmlBefore(this._GetConfigHtml(),oTextarea);this._InsertHtmlBefore(this._GetIFrameHtml(),oTextarea);}};FCKeditor.prototype._InsertHtmlBefore=function(html,element){if(element.insertAdjacentHTML){element.insertAdjacentHTML("beforeBegin",html);}else{var oRange=document.createRange();oRange.setStartBefore(element);var oFragment=oRange.createContextualFragment(html);element.parentNode.insertBefore(oFragment,element);}};FCKeditor.prototype._GetConfigHtml=function(){var sConfig="";for(var o in this.Config){if(sConfig.length>0){sConfig+="&amp;";}sConfig+=encodeURIComponent(o)+"="+encodeURIComponent(this.Config[o]);}return'<input type="hidden" id="'+this.InstanceName+'___Config" value="'+sConfig+'" style="display:none" />';};FCKeditor.prototype._GetIFrameHtml=function(){var sFile="fckeditor.html";try{if((/fcksource=true/i).test(window.top.location.search)){sFile="fckeditor.original.html";}}catch(e){}var sLink=this.BasePath+"editor/"+sFile+"?InstanceName="+encodeURIComponent(this.InstanceName);if(this.ToolbarSet){sLink+="&amp;Toolbar="+this.ToolbarSet;}var html='<iframe id="'+this.InstanceName+'___Frame" src="'+sLink+'" width="'+this.Width+'" height="'+this.Height;if(this.TabIndex){html+='" tabindex="'+this.TabIndex;}html+='" frameborder="0" scrolling="no"></iframe>';return html;};FCKeditor.prototype._IsCompatibleBrowser=function(){return FCKeditor_IsCompatibleBrowser();};FCKeditor.prototype._ThrowError=function(errorNumber,errorDescription){this.ErrorNumber=errorNumber;this.ErrorDescription=errorDescription;if(this.DisplayErrors){document.write('<div style="COLOR: #ff0000">');document.write("[ FCKeditor Error "+this.ErrorNumber+": "+this.ErrorDescription+" ]");document.write("</div>");}if(typeof(this.OnError)=="function"){this.OnError(this,errorNumber,errorDescription);}};FCKeditor.prototype._HTMLEncode=function(text){if(typeof(text)!="string"){text=text.toString();}text=text.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return text;};(function(){var textareaToEditor=function(textarea){var editor=new FCKeditor(textarea.name);editor.Width=Math.max(textarea.offsetWidth,FCKeditor.MinWidth);editor.Height=Math.max(textarea.offsetHeight,FCKeditor.MinHeight);return editor;};FCKeditor.ReplaceAllTextareas=function(){var textareas=document.getElementsByTagName("textarea");for(var i=0;i<textareas.length;i++){var editor=null;var textarea=textareas[i];var name=textarea.name;if(!name||name.length==0){continue;}if(typeof arguments[0]=="string"){var classRegex=new RegExp("(?:^| )"+arguments[0]+"(?:$| )");if(!classRegex.test(textarea.className)){continue;}}else{if(typeof arguments[0]=="function"){editor=textareaToEditor(textarea);if(arguments[0](textarea,editor)===false){continue;}}}if(!editor){editor=textareaToEditor(textarea);}editor.ReplaceTextarea();}};})();function FCKeditor_IsCompatibleBrowser(){var sAgent=navigator.userAgent.toLowerCase();if(
/*@cc_on!@*/
false&&sAgent.indexOf("mac")==-1){var sBrowserVersion=navigator.appVersion.match(/MSIE (.\..)/)[1];return(sBrowserVersion>=5.5);}if(navigator.product=="Gecko"&&navigator.productSub>=20030210&&!(typeof(opera)=="object"&&opera.postError)){return true;}if(window.opera&&window.opera.version&&parseFloat(window.opera.version())>=9.5){return true;}if(sAgent.indexOf(" adobeair/")!=-1){return(sAgent.match(/ adobeair\/(\d+)/)[1]>=1);}if(sAgent.indexOf(" applewebkit/")!=-1){return(sAgent.match(/ applewebkit\/(\d+)/)[1]>=522);}return false;}var MSC={sPREFIX:"MSCselect_",sGLOBAL_CODE:"__global"};function initMSC(p_sSelectID,p_sGlobalLabel){var oInput=$O2(p_sSelectID);var oOptLoad=$O2("loading");if(oOptLoad){window.setTimeout("initMSC('"+p_sSelectID+"', '"+p_sGlobalLabel+"')",200);return;}var sName=oInput.name;var oMSC=new MultipleSelectCheckbox("sel_depts");oMSC.URLSeparator=";";oMSC.visualSeparator=", ";if(p_sGlobalLabel){oMSC.addGlobalSwitch(p_sGlobalLabel,MSC.sGLOBAL_CODE,false);}oMSC.create(sName,oInput,MSC.sPREFIX+p_sSelectID,MSC.sPREFIX+p_sSelectID);}function getCurrentValueMSC(p_oId){return $(MSC.sPREFIX+p_oId).value;}MultipleSelectCheck_Controller={current:null,_s_openLock:false,init:function(){Event.observe(document,"mousedown",function(){if(MultipleSelectCheck_Controller.current!=null&&!MultipleSelectCheck_Controller._s_openLock){window.setTimeout("MultipleSelectCheck_Controller.documentClick()",100);}MultipleSelectCheck_Controller._s_openLock=false;});},documentClick:function(){if(this.current!=null){this.current.documentClick();}},openStart:function(){this._s_openLock=true;if(this.current!=null){this.current.close();}}};function MultipleSelectCheckbox(objName){this.objName=objName;this.htmlSelectName=null;this.htmlSelectId=null;this.htmlMSCName=null;this.htmlMSCId=null;this.MSCoptionsKeys=Array();this.MSCoptions=Array();this.globalSwitch=null;this.globalSwitchValue=null;this.URLSeparator=",";this.visualSeparator=",";this._s_opened=false;this._s_clicked=false;this.updateMSCinput=function(){tmp=Array();tmp2=Array();var optionsCollection=$(this.htmlMSCId+"_optionsContainer").getElementsByTagName("input");var allChecked=true;var noneChecked=true;for(i=0;i<optionsCollection.length;i++){currentInput=optionsCollection.item(i);if(currentInput.checked){noneChecked=false;if(currentInput.getAttribute("value")){tmpValue=currentInput.getAttribute("value");tmp.push(tmpValue);if(tmpValue!=this.globalSwitchValue){tmp2.push(this.MSCoptions[tmpValue]);}}}else{if(currentInput.getAttribute("value")&&currentInput.getAttribute("value")!=this.globalSwitchValue){allChecked=false;}}}this.globalSwitchChecked=allChecked;if(this.globalSwitch!=null){$(this.htmlMSCId+"_globalSwitch").checked=this.globalSwitchChecked;}$(this.htmlMSCId).value=tmp.join(this.URLSeparator);if(this.globalSwitch!=null&&this.globalSwitchChecked){tmpHTML=this.globalSwitch;}else{tmpHTML=tmp2.join(this.visualSeparator);}var oDiv=$(this.htmlMSCId+"_selectedView");var oSpan=oDiv.firstChild;if(oSpan){delete (oSpan);oDiv.removeChild(oSpan);}oSpan=document.createElement("span");oSpan.innerHTML=tmpHTML;oDiv.appendChild(oSpan);};this.addGlobalSwitch=function(label,value,checked){this.globalSwitch=label;this.globalSwitchValue=value;this.globalSwitchChecked=checked;};this.doGlobalSwitch=function(){var state=$(this.htmlMSCId+"_globalSwitch").checked;this.globalSwitchChecked=state;var optionsCollection=$(this.htmlMSCId+"_optionsContainer").getElementsByTagName("input");for(i=0;i<optionsCollection.length;i++){currentInput=optionsCollection.item(i);if(currentInput.getAttribute("value")){currentInput.checked=state;}}this.updateMSCinput();};this.create=function(htmlSelectName,htmlSelectObject,htmlMSCName,htmlMSCId){this.htmlSelectName=htmlSelectObject.name;this.htmlSelectId=htmlSelectObject.id;this.htmlMSCName=htmlMSCName;this.htmlMSCId=htmlMSCId;var html="";var htmlOptions="";var width=htmlSelectObject.getWidth()+15;var optionsCollection=htmlSelectObject.getElementsByTagName("option");var ie6_hover=document.all?"onmouseover=\"Element.addClassName(this,'hover');\" onmouseout=\"Element.removeClassName(this,'hover')\" ":"";var sMSCCtrlId=htmlMSCId+"_select";for(i=0;i<optionsCollection.length;i++){currentOption=optionsCollection.item(i);if(!currentOption.getAttribute("value")){continue;}var iW=currentOption.clientWidth;if(0==iW){iW=currentOption.parentNode.scrollWidth;}if(width<(iW+20)){width=iW+20;}}for(i=0;i<optionsCollection.length;i++){currentOption=optionsCollection.item(i);currentValue=currentOption.getAttribute("value");if(!currentValue){continue;}currentChecked=currentOption.selected;currentId=htmlMSCId+"_"+i;this.MSCoptionsKeys[currentValue]=currentValue;this.MSCoptions[currentValue]=currentOption.firstChild.data;htmlOptions+='<div class="MCP_option" '+ie6_hover+">"+'<input type="checkbox" id="'+currentId+'" value="'+currentValue+'" '+(currentChecked?' checked="checked" ':"")+"onclick=\"$O2('"+sMSCCtrlId+"')['oMSC'].updateMSCinput();\" "+" />"+'<label style="width:'+(width-20)+'px" '+"onclick=\"$('"+currentId+"').checked =!$('"+currentId+"').checked; "+"$O2('"+sMSCCtrlId+"')['oMSC'].updateMSCinput();\">"+currentOption.firstChild.data+"</label>"+"<br>"+"</div>";}if(this.globalSwitch!==null){var tmpOnclick="$O2('"+sMSCCtrlId+"')['oMSC'].doGlobalSwitch();";htmlOptions='<div class="MCP_option global" '+ie6_hover+">"+'<input type="checkbox" id="'+htmlMSCId+'_globalSwitch"'+' onclick="'+tmpOnclick+'" '+(this.globalSwitchChecked?' checked="checked" ':"")+(this.globalSwitchValue?' value="'+this.globalSwitchValue+'" ':"")+" />"+'<label style="width:'+(width-20)+'px" '+"onclick=\"$('"+htmlMSCId+"_globalSwitch').checked = !$('"+htmlMSCId+"_globalSwitch').checked;"+tmpOnclick+'">'+this.globalSwitch+"</label>"+'<div style="clear:both;"></div>'+"</div>"+htmlOptions;}html+='<div class="MCP_control" style="width:'+width+'px" id="'+sMSCCtrlId+'"  onmousedown="$O2(\''+sMSCCtrlId+"')['oMSC'].toggle()\">"+'  <div class="toggle"></div>'+'  <div style="padding:1px 3px;"><label>Choisissez</label></div>'+'  <div style="clear:both"></div>'+"</div>";html+='<div class="MCP_optionsContainer" id="'+htmlMSCId+'_optionsContainer" style="width:'+(width+22)+'px" onmousedown="$O2(\''+sMSCCtrlId+"')['oMSC']._s_clicked=true;\">";html+=htmlOptions;html+="</div>";html+='<div style="clear:both"></div>';html+='<div class="MCP_selectedView" id="'+htmlMSCId+'_selectedView"></div>';html+='<input type="hidden" id="'+htmlMSCId+'" name="'+htmlMSCName+'" value="" />';var oSpan=document.createElement("span");oSpan.innerHTML=html;htmlSelectObject.parentNode.insertBefore(oSpan,htmlSelectObject);htmlSelectObject.style.display="none";htmlSelectObject.disabled=true;$O2(sMSCCtrlId)["oMSC"]=this;if(this.globalSwitchChecked){this.doGlobalSwitch();}this.updateMSCinput();};this.toggle=function(){if(this._s_opened){this.close();}else{this.open();}};this.open=function(){MultipleSelectCheck_Controller.openStart();$(this.htmlMSCId+"_optionsContainer").style.display="block";MultipleSelectCheck_Controller.current=this;this._s_opened=true;};this.close=function(){$(this.htmlMSCId+"_optionsContainer").style.display="none";MultipleSelectCheck_Controller.current=null;this._s_opened=false;this.updateMSCinput();};this.documentClick=function(){if(!this._s_clicked){this.close();}this._s_clicked=false;};}Event.observe(window,"load",function(){MultipleSelectCheck_Controller.init();});