function AjaxTransactionManager(){this.initialize()}AjaxTransactionManager.prototype={ajaxTransactions:null,defaultTransactionName:"defaultTr123",initialize:function(){this.ajaxTransactions=new HashTable();this.addNewTransaction(this.defaultTransactionName)},addNewTransaction:function(A){if(this.ajaxTransactions.containsKey(A)){return false}else{this.ajaxTransactions.put(A,new AjaxTransaction(A))}},getTransaction:function(A){if(this.ajaxTransactions.containsKey(A)){return this.ajaxTransactions.get(A)}else{CW_logger.log(CW_logger.LEVEL_WARNING,"AjaxTransactionManager.getTransaction("+A+"): no transaction correspond to the given identifier, return the default one");this.addNewTransaction(A);return this.ajaxTransactions.get(A)}}};function AjaxTransaction(A){this.identifier=A;this.initialize()}AjaxTransaction.prototype={identifier:null,transactions:null,initialize:function(){this.transactions=new Array()},registerMD5:function(A){this.transactions.push(A)},isLastTransaction:function(A){return this.transactions.last()==A},removeAll:function(){this.transactions.clear()},isValidMD5:function(A){CW_logger.log(CW_logger.LEVEL_INFORMATION,"AjaxTransaction("+this.identifier+").isValidMD5 "+A+" ||content "+this.toString());return(this.transactions.indexOf(A)>=0)},deleteOlderMD5:function(B){if(this.transactions.indexOf(B)>0){var A=false;var C;while(this.transactions.length>0&&!A){C=this.transactions.shift();A=(C==B)}}},deleteMD5:function(A){this.transactions=this.transactions.without(A)},toString:function(){var A="";for(var B=0;B<this.transactions.length;B++){A=A+this.transactions[B]+" ||"}return A}};function RequestResume(D,B,E,A,G,C,F){this.url=D;this.callback=B;this.queryString=E;this.historyEnter=(A!=null);this.historyName=A;this.transactionId=G;this.MD5Sign=C;this.hashTableStore=F}function CW_comwebAjax(){}CW_comwebAjax.prototype={ajaxTransactionManager:new AjaxTransactionManager(),getHost:function(){var A=getUploadWrapper();return A.getHost()},getUploadWrapper:function(){var E=Ajax.getTransport();E.open("GET","/comweb/upload?action=host",false);E.send(null);var A=" CW_comwebAjax.getHost() ";var G;try{if(window.ActiveXObject){var D=new ActiveXObject("Microsoft.XMLDOM");D.async="false";D.loadXML(E.responseText)}else{var F=new DOMParser();var D=F.parseFromString(E.responseText,"text/xml")}G=D.documentElement}catch(C){CW_logger.log(CW_logger.LEVEL_ERROR,"comwebAjax.getHost(), the file is not xmlValid or can't get chilNodes <a href='javascript:openUrl(\""+url+"\")'>"+url+"</a>"+C);return false}var B=new ComwebBean_upload();B.parseXml(G);return B},sendRequest:function(A,E,B,D){var C=this._createQueryString(arguments,4);this._sendRequestQueryString(A,E,B,D,C)},sendRequest:function(A,G,C,F,B,D){if(B!=null&&!(B instanceof Array)){CW_logger.log(CW_logger.LEVEL_ERROR,"you are using deprected sendRequest with parameters as string, you must set request parameters in an Array")}else{var E="";if(B){E=this._createQueryString(B,0)}this._sendRequestQueryString(A,G,C,F,E,D)}},sendRequestForm:function(A,G,C,F,B,D){var E=Form.serialize(B);CW_logger.log(CW_logger.LEVEL_INFORMATION,"sendRequestForm:"+E);this._sendRequestQueryString(A,G,C,F,CW_util.encodeUTF8(E),D)},loadHtml:function(D,B,E,A){var F=Ajax.getTransport();F.open("GET",D,false);F.send(null);var C=false;if(A==true||A=="true"){C=true}return this._onHtmlLoaded(E,B,(new Date()).getTime(),D,F,A)},_onHtmlLoaded:function(J,K,Q,C,F,O){var D="CW_comwebAjax._onHtmlLoaded ";try{var P=(new Date()).getTime();var L=F.responseText;var B=new RegExp("i18n[(]{1,1}[a-zA-Z1-9,.]+[)]{1,1}","g");var N=B.exec2(L);var S=new RegExp("[a-zA-Z1-9.]+","g");var T="";var U=null;for(var M=0;M<N.length;M++){T=new String(N[M]);T=T.substring(5,T.length-1);U=S.exec2(T);if(U.length==1){L=L.replace(N[M],CW_internationalization.getValue(U[0]))}else{if(U.length>1){L=L.replace(N[M],CW_internationalization.getValueParams(U[0],J))}}}var I=(new Date()).getTime();var E=document.getElementById(K);if(!O){E.innerHTML=""}var A=new Insertion.Bottom(E,L);var H=A.getFragment();CW_logger.logTime("_onHtmlLoaded('"+C+"'), server response:"+(P-Q)+" ms , i18n parsing:"+(P-I)+" ms, display:"+((new Date()).getTime()-I)+" ms");var G=E.immediateDescendants();if(G.length>0){return G[G.length-1]}else{return E.lastChild}}catch(R){CW_logger.log(CW_logger.LEVEL_ERROR,"ComwebAjax.loadHtml launch request - url:"+C+" containerId:"+K+" error:"+R);return null}},_sendRequestQueryString:function(C,J,A,I,B,F){if(B==null||B==""){B="lng="+CW_config.langId+"&site.uid="+CW_config.serviceId}else{if(B.indexOf("lng=")<0){B+="&lng="+CW_config.langId+"&site.uid="+CW_config.serviceId}if(B.indexOf("site.uid=")<0){B+="&site.uid="+CW_config.serviceId}}CW_logger.log(CW_logger.LEVEL_INFORMATION,"ComwebAjax.sendRequest - url: "+C+" queryString:"+B);var D=MD5(C+B+CW_config.webappName);C=new String(C);if(CW_config.isProd&&C.indexOf("/comweb/")==0){C=C.replace("/comweb/","/comweb/MD5_"+MD5(B)+"/")}I=D;var E=this.ajaxTransactionManager.getTransaction(I);E.registerMD5(D);var G=new RequestResume(C,J,B,A,E.identifier,D,F);var H=true;if(J=="CW_config.initInternationalization"){H=false}if(!H){CW_logger.log("NOTICE","ComwebAjax.sendRequest - url: "+C+" this url permits to change lang value so set asynchronous request at :"+H)}var K={asynchronous:H,method:"post",encoding:"UTF-8",requestHeaders:["X-Prototype-Version",Prototype.Version],postBody:CW_util.encodeUTF8(B),onComplete:this._onRequestComplete.bind(K,G,(new Date()).getTime())};CW_logger.log(CW_logger.LEVEL_INFORMATION,"ComwebAjax.sendRequest launch request - queryString:"+B);new Ajax.Request(C,K)},_onRequestComplete:function(B,G,F){CW_logger.log(CW_logger.LEVEL_INFORMATION," comwebAjax.onRequestComplete : process the request ("+B.url+" - "+B.queryString+")");var E=CW_comwebAjax.ajaxTransactionManager.getTransaction(B.transactionId);var A=B.url+"?"+B.queryString;if(F.status==200){if(E.isValidMD5(B.MD5Sign)){if(CW_comwebAjax._processXmlResponse(F,B,G)){E.deleteOlderMD5(B.MD5Sign);if(B.historyEnter){var D=B.historyName+"/"+B.callback+"/"+B.url+"/"+(B.queryString);try{CW_logger.log(CW_logger.LEVEL_INFORMATION," comwebAjax.onRequestComplete :  add history url:"+D)}catch(C){CW_logger.log(CW_logger.LEVEL_ERROR," comwebAjax.onRequestComplete : cant add history url:"+D+" error:"+C)}}}else{CW_logger.log(CW_logger.LEVEL_ERROR," comwebAjax.onRequestComplete : while processing xml response");E.deleteMD5(B.MD5Sign)}}else{CW_logger.log("NOTICE","the request ("+A+") is not process because, transaction ("+B.transactionId+") indicates that is not valid")}}else{E.deleteMD5(B.MD5Sign);CW_logger.log(CW_logger.LEVEL_ERROR,"comwebAjax.onRequestComplete() error (status:"+F.status+") on the given url: <a href='javascript:openUrl(\""+A+"\")'>"+A+"</a> headers:"+F.getAllResponseHeaders());return }},_processXmlResponse:function(xhr,requestResume,timeInMillis){var callback=requestResume.callback;var url=requestResume.url;var logIndic="comwebAjax.js: processXmlResponse (callback :"+callback+" ||url:"+url+")";CW_logger.log(CW_logger.LEVEL_INFORMATION,logIndic);var currentTime=(new Date()).getTime();var docxml;var doc;try{CW_logger.log(CW_logger.LEVEL_INFORMATION,logIndic+" try to load xml");if(window.ActiveXObject){var doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(xhr.responseText)}else{var parser=new DOMParser();var doc=parser.parseFromString(xhr.responseText,"text/xml")}docxml=doc.documentElement;CW_logger.log(CW_logger.LEVEL_INFORMATION,logIndic+" xml loaded")}catch(e){CW_logger.log(CW_logger.LEVEL_ERROR,"comwebAjax.(), the file is not xmlValid or can't get chilNodes <a href='javascript:openUrl(\""+url+"\")'>"+url+"</a>"+e);return false}try{var nodeName=docxml.nodeName;var comwebBean=null;try{comwebBean=eval("new ComwebBean_"+nodeName+"();");comwebBean.getName()}catch(e){CW_logger.log(CW_logger.LEVEL_WARNING,"ComwebAjax: can't create the corresponding object: ComwebBean_"+nodeName+", try to set ComwebBean : "+e);try{comwebBean=new ComwebBean()}catch(e){CW_logger.log(CW_logger.LEVEL_ERROR,"ComwebAjax: can't create the corresponding object: ComwebBean :"+e);return false}}try{CW_logger.log(CW_logger.LEVEL_INFORMATION,comwebBean.getName()+" parseXml");comwebBean.parseXml(docxml)}catch(e){CW_logger.log(CW_logger.LEVEL_ERROR,"ComwebAjax: the corresponding object can't parseXML: ComwebBean_"+nodeName+" - <a href='javascript:openUrl(\""+url+"\")'>"+url+"</a> :"+e);return false}CW_logger.log(CW_logger.LEVEL_COMWEB_AJAX,"do the eval with callback  ("+callback+"), given comwebBean:"+comwebBean.name+" ,  receive file: <a href='javascript:openUrl(\""+url+"\")'>"+url+"</a>");try{CW_logger.registerComwebBean(comwebBean,requestResume.callback,requestResume.url+"?"+requestResume.queryString)}catch(e){}var currentTime2=(new Date()).getTime();eval(callback+"(comwebBean,requestResume);");CW_logger.logTime("_processXmlResponse('"+url+"'), server response:"+(currentTime-timeInMillis)+" ms , xml bean parsing:"+(currentTime-currentTime2)+" ms, display:"+((new Date()).getTime()-currentTime2)+" ms")}catch(e){CW_logger.log(CW_logger.LEVEL_ERROR,"can't realise the eval of the callback :"+callback+" : "+CW_util.describeError(e));return false}return true},_createQueryString:function(E,F){var H="";for(var C=F;C<E.length;C++){if(C!=F){H+="&"}var D=E[C];if(D.name!=undefined&&D.value!=undefined){H+=D.name+"="+(D.value)}else{var B=D.indexOf("=");var G=D.substring(0,B);var A=D.substring(B+1);H+=G+"="+escape(A)}}return H},sendRequestRefresh:function(A,C,B){this.sendRequest(A,C,B,"defuatlIdTransaction")}};var CW_comwebAjax=new CW_comwebAjax();var MD5=function(R){function j(G,F){return(G<<F)|(G>>>(32-F))}function i(a,G){var c,F,I,b,H;I=(a&2147483648);b=(G&2147483648);c=(a&1073741824);F=(G&1073741824);H=(a&1073741823)+(G&1073741823);if(c&F){return(H^2147483648^I^b)}if(c|F){if(H&1073741824){return(H^3221225472^I^b)}else{return(H^1073741824^I^b)}}else{return(H^I^b)}}function Q(F,H,G){return(F&H)|((~F)&G)}function P(F,H,G){return(F&G)|(H&(~G))}function O(F,H,G){return(F^H^G)}function M(F,H,G){return(H^(F|(~G)))}function T(H,G,AA,z,F,I,k){H=i(H,i(i(Q(G,AA,z),F),k));return i(j(H,I),G)}function B(H,G,AA,z,F,I,k){H=i(H,i(i(P(G,AA,z),F),k));return i(j(H,I),G)}function f(H,G,AA,z,F,I,k){H=i(H,i(i(O(G,AA,z),F),k));return i(j(H,I),G)}function S(H,G,AA,z,F,I,k){H=i(H,i(i(M(G,AA,z),F),k));return i(j(H,I),G)}function A(a){var d;var I=a.length;var H=I+8;var G=(H-(H%64))/64;var c=(G+1)*16;var k=Array(c-1);var F=0;var b=0;while(b<I){d=(b-(b%4))/4;F=(b%4)*8;k[d]=(k[d]|(a.charCodeAt(b)<<F));b++}d=(b-(b%4))/4;F=(b%4)*8;k[d]=k[d]|(128<<F);k[c-2]=I<<3;k[c-1]=I>>>29;return k}function Z(H){var G="",I="",a,F;for(F=0;F<=3;F++){a=(H>>>(F*8))&255;I="0"+a.toString(16);G=G+I.substr(I.length-2,2)}return G}function h(G){G=G.replace(/\r\n/g,"\n");var F="";for(var I=0;I<G.length;I++){var H=G.charCodeAt(I);if(H<128){F+=String.fromCharCode(H)}else{if((H>127)&&(H<2048)){F+=String.fromCharCode((H>>6)|192);F+=String.fromCharCode((H&63)|128)}else{F+=String.fromCharCode((H>>12)|224);F+=String.fromCharCode(((H>>6)&63)|128);F+=String.fromCharCode((H&63)|128)}}}return F}var e=Array();var o,D,g,U,C,y,w,v,u;var r=7,p=12,m=17,l=22;var Y=5,X=9,W=14,V=20;var N=4,L=11,K=16,J=23;var t=6,s=10,q=15,n=21;R=h(R);e=A(R);y=1732584193;w=4023233417;v=2562383102;u=271733878;for(o=0;o<e.length;o+=16){D=y;g=w;U=v;C=u;y=T(y,w,v,u,e[o+0],r,3614090360);u=T(u,y,w,v,e[o+1],p,3905402710);v=T(v,u,y,w,e[o+2],m,606105819);w=T(w,v,u,y,e[o+3],l,3250441966);y=T(y,w,v,u,e[o+4],r,4118548399);u=T(u,y,w,v,e[o+5],p,1200080426);v=T(v,u,y,w,e[o+6],m,2821735955);w=T(w,v,u,y,e[o+7],l,4249261313);y=T(y,w,v,u,e[o+8],r,1770035416);u=T(u,y,w,v,e[o+9],p,2336552879);v=T(v,u,y,w,e[o+10],m,4294925233);w=T(w,v,u,y,e[o+11],l,2304563134);y=T(y,w,v,u,e[o+12],r,1804603682);u=T(u,y,w,v,e[o+13],p,4254626195);v=T(v,u,y,w,e[o+14],m,2792965006);w=T(w,v,u,y,e[o+15],l,1236535329);y=B(y,w,v,u,e[o+1],Y,4129170786);u=B(u,y,w,v,e[o+6],X,3225465664);v=B(v,u,y,w,e[o+11],W,643717713);w=B(w,v,u,y,e[o+0],V,3921069994);y=B(y,w,v,u,e[o+5],Y,3593408605);u=B(u,y,w,v,e[o+10],X,38016083);v=B(v,u,y,w,e[o+15],W,3634488961);w=B(w,v,u,y,e[o+4],V,3889429448);y=B(y,w,v,u,e[o+9],Y,568446438);u=B(u,y,w,v,e[o+14],X,3275163606);v=B(v,u,y,w,e[o+3],W,4107603335);w=B(w,v,u,y,e[o+8],V,1163531501);y=B(y,w,v,u,e[o+13],Y,2850285829);u=B(u,y,w,v,e[o+2],X,4243563512);v=B(v,u,y,w,e[o+7],W,1735328473);w=B(w,v,u,y,e[o+12],V,2368359562);y=f(y,w,v,u,e[o+5],N,4294588738);u=f(u,y,w,v,e[o+8],L,2272392833);v=f(v,u,y,w,e[o+11],K,1839030562);w=f(w,v,u,y,e[o+14],J,4259657740);y=f(y,w,v,u,e[o+1],N,2763975236);u=f(u,y,w,v,e[o+4],L,1272893353);v=f(v,u,y,w,e[o+7],K,4139469664);w=f(w,v,u,y,e[o+10],J,3200236656);y=f(y,w,v,u,e[o+13],N,681279174);u=f(u,y,w,v,e[o+0],L,3936430074);v=f(v,u,y,w,e[o+3],K,3572445317);w=f(w,v,u,y,e[o+6],J,76029189);y=f(y,w,v,u,e[o+9],N,3654602809);u=f(u,y,w,v,e[o+12],L,3873151461);v=f(v,u,y,w,e[o+15],K,530742520);w=f(w,v,u,y,e[o+2],J,3299628645);y=S(y,w,v,u,e[o+0],t,4096336452);u=S(u,y,w,v,e[o+7],s,1126891415);v=S(v,u,y,w,e[o+14],q,2878612391);w=S(w,v,u,y,e[o+5],n,4237533241);y=S(y,w,v,u,e[o+12],t,1700485571);u=S(u,y,w,v,e[o+3],s,2399980690);v=S(v,u,y,w,e[o+10],q,4293915773);w=S(w,v,u,y,e[o+1],n,2240044497);y=S(y,w,v,u,e[o+8],t,1873313359);u=S(u,y,w,v,e[o+15],s,4264355552);v=S(v,u,y,w,e[o+6],q,2734768916);w=S(w,v,u,y,e[o+13],n,1309151649);y=S(y,w,v,u,e[o+4],t,4149444226);u=S(u,y,w,v,e[o+11],s,3174756917);v=S(v,u,y,w,e[o+2],q,718787259);w=S(w,v,u,y,e[o+9],n,3951481745);y=i(y,D);w=i(w,g);v=i(v,U);u=i(u,C)}var E=Z(y)+Z(w)+Z(v)+Z(u);return E.toLowerCase()};