var evalText="var wolf = {}";try{if(wolf){evalText=""}}catch(e){}eval(evalText);var wflib;function using(sLibraryName,libraryWindow){syncLibraries();var objTemp;if(wflib!=null){libraryWindow=wflib;library=eval("libraryWindow."+sLibraryName)}else{if(libraryWindow==null){libraryWindow=window}var library;wflib=libraryWindow;for(var i=0;i<3;i++){try{library=eval("libraryWindow."+sLibraryName);if(library!=null){break}else{libraryWindow=libraryWindow.parent;wflib=libraryWindow}}catch(e){wflib=window;break}}}if(!library){if(!wflib.libraries){wflib.libraries=new Array()}if(!wflib.libraries[sLibraryName]){wflib.libraries[sLibraryName]=eval("wflib.cls"+sLibraryName+".toString()")}try{eval("wflib."+sLibraryName+" = new wflib.cls"+sLibraryName+"(wflib)")}catch(e){eval("wflib."+sLibraryName+" = new cls"+sLibraryName+"(wflib)")}}}function syncLibraries(){try{if(top.libraries){return}var dialogArguments=window.dialogArguments;if(dialogArguments==null){if(top.opener.dialog){dialogArguments=top.opener.dialog.arguments}}var openerWindowTop=dialogArguments;var workflowContext=dialogArguments;top.libraries=openerWindowTop.libraries;if(!top.libraries){top.libraries=workflowContext.adam.libraries}if(!top.libraries){return}for(var x in top.libraries){eval("top.cls"+x.toString()+" = "+top.libraries[x.toString()])}}catch(e){}}loadPrototypes();function loadPrototypes(){if(!window.addEventListener){return}if(navigator.userAgent.indexOf("Safari")>0){HTMLElement.prototype.__setAttribute=HTMLElement.prototype.setAttribute;HTMLElement.prototype.setAttribute=function(attrName,newVal){var prevVal=this.getAttribute(attrName);this.__setAttribute(attrName,newVal);newVal=this.getAttribute(attrName);if(newVal!=prevVal){var evt=document.createEvent("MutationEvent");evt.initMutationEvent("DOMAttrModified",true,false,this,prevVal||"",newVal||"",attrName,(prevVal==null)?evt.ADDITION:evt.MODIFICATION);this.dispatchEvent(evt)}}}Document.prototype.loadXML=function(strXML){var domParser=new DOMParser();var objDoc=domParser.parseFromString(strXML,"text/xml");_copyDocuments(objDoc,this);updateReadyState(this,4)};Node.prototype.__defineGetter__("xml",_Node_getXML);Document.prototype.readyState="0";Document.prototype.onreadystatechange=null;Document.prototype.parseError=0;XMLDocument.prototype.selectSingleNode=_selectSingleNode;XMLDocument.prototype.selectNodes=_selectNodes;XMLDocument.prototype.cloneNodeFunction=XMLDocument.prototype.cloneNode;XMLDocument.prototype.cloneNode=_cloneNode;if(XMLDocument.prototype.load==null){XMLDocument.prototype.load=_load}Element.prototype.__defineGetter__("text",_element_getText);Element.prototype.__defineSetter__("text",_element_setText);Element.prototype.__defineGetter__("xml",_Node_getXML);Element.prototype.selectSingleNode=function(sXpath,XPathResultType,resultValue){if(this.ownerDocument.selectSingleNode){return this.ownerDocument.selectSingleNode(sXpath,this,XPathResultType,resultValue)}};Element.prototype.insertAdjacentElement=function(where,parsedNode){switch(where.toLowerCase()){case"beforebegin":this.parentNode.insertBefore(parsedNode,this);break;case"afterbegin":this.insertBefore(parsedNode,this.firstChild);break;case"beforeend":this.appendChild(parsedNode);break;case"afterend":if(this.nextSibling){this.parentNode.insertBefore(parsedNode,this.nextSibling)}else{this.parentNode.appendChild(parsedNode)}break}};Element.prototype.insertAdjacentHTML=function(where,htmlStr){var r=this.ownerDocument.createRange();r.setStartBefore(this);var parsedHTML=r.createContextualFragment(htmlStr);this.insertAdjacentElement(where,parsedHTML)};Element.prototype.selectNodes=function(sXpath){if(this.ownerDocument.selectNodes){return this.ownerDocument.selectNodes(sXpath,this)}};function _copyDocuments(sourceDoc,targetDoc){while(targetDoc.hasChildNodes()){targetDoc.removeChild(targetDoc.lastChild)}for(var i=0;i<sourceDoc.childNodes.length;i++){var objImportedNode=targetDoc.importNode(sourceDoc.childNodes[i],true);targetDoc.appendChild(objImportedNode)}}function _load(url){var req=new XMLHttpRequest();req.open("GET",url,false);req.send("");_copyDocuments(req.responseXML,this)}function _Node_getXML(){var objXMLSerializer=new XMLSerializer();var strXML=objXMLSerializer.serializeToString(this);return strXML}function _element_getText(){return this.textContent}function _element_setText(value){this.textContent=value}function _selectSingleNode(sXPath,xmlDocument,XPathResultType,resultValue){if(!xmlDocument){xmlDocument=this}if(!XPathResultType){XPathResultType=XPathResult.FIRST_ORDERED_NODE_TYPE}if(!resultValue){resultValue="singleNodeValue"}var oEvaluator=new XPathEvaluator();var oResult=oEvaluator.evaluate(sXPath,xmlDocument,nsResolver,XPathResultType,null);if(oResult!=null){return eval("oResult."+resultValue)}else{return null}}function _selectNodes(xPath,xmlDocument){if(!xmlDocument){xmlDocument=this}var oEvaluator=new XPathEvaluator();var oResult=oEvaluator.evaluate(xPath,xmlDocument,nsResolver,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);var aNodes=new Array();if(oResult!=null){var oElement=oResult.iterateNext();while(oElement){aNodes.push(oElement);oElement=oResult.iterateNext()}}return aNodes}function _cloneNode(value){var XmlDom=this.cloneNodeFunction(value);if(XmlDom==null){XmlDom=document.implementation.createDocument("","",null)}XmlDom.addEventListener("load",_Document_onload,false);return XmlDom}function nsResolver(sPrefix){switch(sPrefix){case"soap":return"http://schemas.xmlsoap.org/soap/envelope/";case"xsi":return"http://www.w3.org/2001/XMLSchema-instance";case"xsd":return"http://www.w3.org/2001/XMLSchema";case"xsl":return"http://www.w3.org/1999/XSL/Transform";case"transformiix":return"http://www.mozilla.org/TransforMiix"}return null}function _Document_onload(){handleOnLoad(this)}function handleOnLoad(xmlDomDoc){if(!xmlDomDoc.documentElement||xmlDomDoc.documentElement.tagName=="parsererror"){xmlDomDoc.parseError=9886120856}updateReadyState(xmlDomDoc,4)}function updateReadyState(xmlDomDoc,readyState){if(xmlDomDoc.readyState==null){xmlDomDoc.readyState=readyState;if(xmlDomDoc.onreadystatechange!=null&&typeof(xmlDomDoc.onreadystatechange)=="function"){xmlDomDoc.onreadystatechange()}}}}function clshelperLib(B){var Q=B;var t=this;this.lpad=u;this.ltrim=G;this.rtrim=ad;this.removeLineBreaks=J;this.getKeyCode=j;this.HTMLEncode=b;this.HTMLDecode=ai;this.GetURL=ag;this.checkValidSwitch=c;this.disposeObject=q;this.getISODate=l;this.getDayDiff=H;this.getSpeedDate=o;this.convertXsDurationToTime=T;this.deserialiseQueryString=K;this.buildRuleParamXml=W;this.processSoapRequest=L;this.processSoapRequestAsync=N;this.processServerRequest=z;this.cleanSoapResponse=U;this.formatForDisplay=E;this.alertChanges=ah;this.errLog=ae;this.errLogAsync=y;this.confirmLog=ac;this.openPopup=n;this.openPopupEx=n;this.showLoading=F;this.hideLoading=V;this.wsfMapPath=C;this.mapPath=X;this.formatISODateForDisplay=r;this.roundNumber=p;this.attachEvents=s;this.detachEvents=I;this.addReservedLocation=S;var f=",mc,widgets,webservices,wsfdesigner,design,";function E(al,ak){var aj=al.replace(/&#13;/g,"<br/>");switch(ak){case"boolean":aj=(al==1||al=="yes")?"Yes":"No";break;case"datetime":aj=r(al);break;case"time":aj=T(al);break}return aj}function U(ak){var aj=/&apos;/g;ak=ak.replace(aj,"'");aj=/%26/g;ak=ak.replace(aj,"&");return ak}function W(){var ak="<document><record>";for(var aj=0;aj<arguments.length;aj+=2){var al=arguments[aj];var am=arguments[aj+1];ak+="<"+al+">"+am+"</"+al+">"}ak+="</record></document>";return ak}function T(am){if(am.indexOf("T")!=-1){var ak="",aj="00",al="0";var ak=am.substring(am.indexOf("T")+1,am.indexOf("H"));if(isNaN(ak)){ak="0"}if(am.indexOf("M")>0){if(am.indexOf("H")>0){aj=am.substring(am.indexOf("H")+1,am.indexOf("M"))}else{aj=am.substring(am.indexOf("T")+1,am.indexOf("M"))}}if(am.indexOf("S")>0){al=am.substring(am.indexOf("M")+1,am.indexOf("S"))}am=u(ak,2)+":"+u(aj,2)}return am}function H(aj,ak){try{var al=new Date(aj[0],aj[1]-1,aj[2]);var an=new Date(ak[0],ak[1]-1,ak[2]);return(((((an.valueOf()-al.valueOf())/1000)/60)/60)/24)}catch(am){}return 0}function p(ak,al){var aj=Math.round(ak*Math.pow(10,al))/Math.pow(10,al);return aj}function r(ak){var al=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var am=2;var ap=1;var ao=0;var aj=" ";if(typeof(ak)=="string"){if(ak.indexOf("T")>0){ak=ak.substring(0,ak.indexOf("T"))}var an=ak.split(" ");var aq=an[0].split("-");ak=new Date(aq[ao],aq[ap]-1,aq[am]);if(an.length==2){aj+=an[1]}}return u(ak.getDate(),2)+"-"+al[ak.getMonth()]+"-"+ak.getFullYear()+aj}function u(al,ak){al=""+al;if(al.length<ak){for(var aj=0;aj<(ak-al.length);aj++){al="0"+al}}return al}function ab(ak,aj){if(typeof(aj)!="object"&&ak.document.getElementById(aj)){aj=ak.document.getElementById(aj)}return aj}function s(an,ak,al,am,aj){var ak=ab(an,ak);if(al.indexOf("on")==0){al=al.substring(2)}if(ak.addEventListener){if(aj==null){aj=false}ak.addEventListener(al,am,aj)}else{if(ak.attachEvent){ak.attachEvent("on"+al,am)}}}function I(an,ak,al,am,aj){var ak=ab(an,ak);if(al.indexOf("on")==0){al=al.substring(2)}if(ak.addEventListener){if(aj==null){aj=false}ak.removeEventListener(al,am,aj)}else{if(ak.attachEvent){ak.detachEvent("on"+al,am)}}}this.clsEventHandler=g;function S(aj){f+=aj+","}function X(aj,ak){var al=aj.location.href.split("/");al[al.length-1]=ak;return al.join("/")}this.hostPrefix="";function C(an,ap){var al;try{al=top.context}catch(ao){}if(an==null){return an}if(ap!=null){an=an.replace("$application","/mc/em/application/"+ap)}else{if(al!=null){if(al.session!=null){an=an.replace("$application","/mc/em/application/"+al.session.applicationid)}}}var aj="/widgets/skin";if(al!=null&&al.session!=null&&al.session.application!=null){if(al.session.application.skin!=null){aj+="/"+al.session.application.skin}}an=an.replace("$skin",aj);if(t.hostPrefix.length==0){var am=Q.location.href.split("/");for(var ak=3;ak<am.length;ak++){if(am[ak].length>0&&am[ak].indexOf("http")!=0&&ak<am.length-1){if(f.indexOf(","+am[ak].toLowerCase()+",")>=0){break}t.hostPrefix+="/"+am[ak]}}}if(an.indexOf(t.hostPrefix+"/")!=0){an=t.hostPrefix+an}return an}function ah(ao){var an=ao.selectSingleNode("document");an=an.firstChild;var ak=Q.screen.availHeight;var aj=Q.screen.availWidth-200;while(an!=null){var am=top.XMLLib.getNodeText(an,".//WFSys_lastELQueryTimeStamp");if(am.length>0){var al=w();if(al!=null){al.lastELQueryTimeStamp=am}}ak=ak-102;Q.showModelessDialog(C("/widgets/code/objectupdate.htm"),an,"dialogHeight: 100px; dialogWidth: 250px; dialogTop: "+ak+"px; dialogLeft: "+aj+"px; edge: raised; help: Yes; resizable: No; status: No;unadorned:yes");an=an.nextSibling}}function w(){var aj=top.context;if(aj==null&&top.wct!=null){aj=top.wct.adam}return aj}function v(aj){var ak;ak=top.XMLLib.objXMLDocTemplate.cloneNode(true);ak.async=true;ak.load(aj);top.context.cache.objErrLogLangXML=ak;return}function ac(am){this.description=am;var aj;var al;var ak="<b>Confirm</b>";al=this.description;var an=400;var aq=200;if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("MSIE 6.0")>0){aq+=52}var ap=(window.screen.availWidth-an)/2;var ao=(window.screen.availHeight-aq)/2;return Q.showModalDialog(C("/widgets/code/confirmlog.htm"),this,"dialogLeft:"+ap+"px;dialogTop:"+ao+"px;dialogHeight:"+aq+"px;dialogWidth:"+an+"px;unadorned:yes")}function y(ap,am,ar,aq,ao){var ak=400;var aj=200;var an=top.DHTMLLib.showCustomDialog(top,"height:"+aj+"px;width:"+ak+"px;",null,"allowtransparency",true);var al=h(am,ar,aq,ao);an.dialogArguments=al;an.container.innerHTML="<iframe src='"+C("/widgets/code/errorlog.htm")+"' style='height:"+aj+"px;width:"+ak+"px;border:0px' frameborder='0' allowtransparency = 'true'></iframe>";an.callBackRef=M;an.callBackArguments=ap}function M(ak,aj){if(aj!=null){aj(ak)}}function ae(ao,ar,aq,ap){var al=h(ao,ar,aq,ap);if(!Q.showModalDialog){alert(top.XMLLib.getNodeText(al.description,"/err"))}else{var ak=400;var aj=200;if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("MSIE 6.0")>0){aj+=52}var an=(window.screen.availWidth-ak)/2;var am=(window.screen.availHeight-aj)/2;Q.showModalDialog(C("/widgets/code/errorlog.htm"),al,"dialogTop:"+am+"px;dialogLeft:"+an+"px;dialogHeight:"+aj+"px;dialogWidth:"+ak+"px;unadorned:yes;status:no;resizable:no;help:no;")}}function h(au,aA,az,av){var an={};try{var ap=top.context.session.languageFolder;var ak="";if(ap!=""&&top.context.cache.objErrLogLangXML!=null){var aq;aq=top.XMLLib.objXMLDocTemplate.cloneNode(true);aq.async=true;if(top.context.cache.objErrLogLangXML==null){sErrLogXMLPath=C("/mc/"+ap+"application/"+top.context.session.applicationid+"/ErrLog_Localiser.xml");v(sErrLogXMLPath)}aq=top.context.cache.objErrLogLangXML;ak=aq.xml;if(ak!=""){var aw="<document><record><desc>"+av+"</desc></record></document>";var am=top.XMLLib.objXMLDocTemplate.cloneNode(true);var aj="<root><source>"+aw+"</source><language>"+ak+"</language></root>";var ay=/&apos;/g;aj=aj.replace(ay,"'");ay=/&/g;aj=aj.replace(ay,"%26");m_objXSLForLocaliser=top.XMLLib.objXSLDocTemplate.cloneNode(true);m_objXSLForLocaliser.loadXML('<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml" omit-xml-declaration="yes" /><xsl:template match="/"><document><record><xsl:apply-templates select="//source/document/record" mode="localise" /></record></document></xsl:template><xsl:template match="record" mode="localise"><xsl:variable name="valDesc" select="desc" /><xsl:variable name="valSep">##</xsl:variable><xsl:choose><xsl:when test="contains($valDesc, $valSep)"><desc><xsl:call-template name="strsplit"><xsl:with-param name="string" select="$valDesc" /><xsl:with-param name="pattern">##</xsl:with-param></xsl:call-template></desc></xsl:when><xsl:otherwise><xsl:variable name="valDescNormalised" select="normalize-space($valDesc)" /><xsl:variable name="valLngDesc" select="//root/language/document/record[code=$valDescNormalised]/label" /><xsl:choose><xsl:when test="string-length($valLngDesc) > 0"><xsl:value-of select="$valLngDesc" /></xsl:when><xsl:otherwise><xsl:value-of select="$valDesc" /></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="strsplit"><xsl:param name="string" /><xsl:param name="pattern" /><xsl:choose><xsl:when test="not($string)" /><xsl:when test="not($pattern)"><xsl:call-template name="strsplit-characters"><xsl:with-param name="string" select="$string" /></xsl:call-template></xsl:when><xsl:otherwise><xsl:call-template name="strsplit-pattern"><xsl:with-param name="string" select="$string" /><xsl:with-param name="pattern" select="$pattern" /></xsl:call-template></xsl:otherwise></xsl:choose></xsl:template><xsl:template name="strsplit-characters"><xsl:param name="string" /><xsl:if test="$string"><xsl:value-of select="substring($string, 1, 1)" /><xsl:call-template name="strsplit-characters"><xsl:with-param name="string" select="substring($string, 2)" /></xsl:call-template></xsl:if></xsl:template><xsl:template name="strsplit-pattern"><xsl:param name="string" /><xsl:param name="pattern" /><xsl:choose><xsl:when test="contains($string, $pattern)"><xsl:if test="not(starts-with($string, $pattern))"><xsl:variable name="valDesc" select="substring-before($string, $pattern)" /><xsl:variable name="valDescNormalised" select="normalize-space($valDesc)" /><xsl:variable name="valLngDesc" select="//root/language/document/record[code=$valDescNormalised]/label" /><xsl:choose><xsl:when test="string-length($valLngDesc) > 0"><xsl:value-of select="$valLngDesc" /></xsl:when><xsl:otherwise><xsl:value-of select="$valDesc" /></xsl:otherwise></xsl:choose></xsl:if><xsl:call-template name="strsplit-pattern"><xsl:with-param name="string" select="substring-after($string,$pattern)" /><xsl:with-param name="pattern" select="$pattern" /></xsl:call-template></xsl:when><xsl:otherwise><xsl:variable name="valDesc" select="$string" /><xsl:variable name="valDescNormalised" select="normalize-space($valDesc)" /><xsl:variable name="valLngDesc" select="//root/language/document/record[code=$valDescNormalised]/label" /><xsl:choose><xsl:when test="string-length($valLngDesc) > 0"><xsl:value-of select="$valLngDesc" /></xsl:when><xsl:otherwise><xsl:value-of select="$valDesc" /></xsl:otherwise></xsl:choose></xsl:otherwise></xsl:choose></xsl:template></xsl:stylesheet>');var al=top.XMLLib.transformXML(aj,m_objXSLForLocaliser);if(al!=null){av=top.XMLLib.getNodeText(al,"//document/record")}alert(av)}}}catch(at){}var ay=/##/g;av=av.replace(ay,"");an.page=au;an.line=aA;an.versionNo=az;an.description=av;var ao;var ax;var ar="<b>Alert</b>";ax=an.description;if(an.page==""){ao=C("/widgets/assets/erralert.gif")}else{ar+="Location : "+this.page;ao=C("/widgets/assets/errcritical.gif")}if(an.line!=""){ar+=" at line "+an.line}return an}function V(aj){if(aj==null){return}try{if(aj.loadingDialog==null){return}}catch(ak){return}aj.activeProcesses=aj.activeProcesses-1;if(aj.activeProcesses<0){aj.activeProcesses=0}if(aj.activeProcesses==0){aj.loadingDialog.style.display="none"}}function F(aj){if(aj==null){return}try{if(aj.loadingDialog==null){aj.loadingDialog=aj.document.createElement("div");aj.document.body.appendChild(aj.loadingDialog);aj.loadingDialog.innerHTML="<IMG src='"+C("/widgets/assets/animated_loading.gif")+"' align='absmiddle'/>&nbsp;Working on your request...";aj.loadingDialog.className="loadingwindow";aj.activeProcesses=0}aj.activeProcesses++;aj.loadingDialog.style.display="block"}catch(ak){}}function af(aj,an,am,ap,ak,aq){aj.setRequestHeader("Content-Type","text/xml; charset=utf-8");var ao='<?xml version="1.0" encoding="utf-8"?>';ao+='<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">';ao+="<soap:Body>";ao+="<"+ap+' xmlns="http://wolf.co.in/webservices/'+am+'">';for(var al=aq;al<ak.length;al+=2){ao+="<"+ak[al]+">";ao+=ak[al+1];ao+="</"+ak[al]+">"}ao+="</"+ap+">";ao+="</soap:Body>";ao+="</soap:Envelope>";ao=ao.replace("<record>","<record><wsf_clienttimezoneoffset>"+(new Date()).getTimezoneOffset()+"</wsf_clienttimezoneoffset>");aj.setRequestHeader("Content-Length",ao.length);aj.setRequestHeader("SOAPAction","http://wolf.co.in/webservices/"+am+"/"+ap);ao=ao.replace(/&(?!amp;|lt;|gt;)/g,"&amp;");return ao.replace(/&/g,"%26")}function z(an,ak,aq,al,ap){var am=ar(ak,aq,al,ap);var at=aq+"/"+ak;var au=L(null,C("/webservices/wf.object/utilityprocessor.asmx"),"wf.object","RequestService","sSoapEnvelope","<![CDATA["+am+"]]>","sSoapAction",at,"sURL",an);if(au==null){return}var ao=getNodeText(au,"//RequestServiceResponse");if(ao.length==0){return}ao=ao.replace("xmlns=","replaced=");ao=ao.replace(/&amp;lt;/g,"<");ao=ao.replace(/&amp;gt;/g,">");ao=ao.replace(/&gt;/g,">");ao=ao.replace(re=/&lt;/g,"<");var aj=top.XMLLib.getNodeXML(ao,"//"+ak+"Result/*");return aj;function ar(av,ay){var aw="<"+av+' xmlns="'+ay+'">';for(var ax=2;ax<arguments.length;ax+=2){if(arguments[ax].length>0){aw+="<"+arguments[ax]+">";aw+=arguments[ax+1];aw+="</"+arguments[ax]+">"}}aw+="</"+av+">";return aw}}function a(){var aj;if(window.addEventListener){aj=new XMLHttpRequest()}else{aj=new ActiveXObject("MSXML2.XMLHTTP")}return aj}function L(al,an,aq,ao){F(al);var ap=a();ap.open("POST",an,false);var am=af(ap,an,aq,ao,arguments,4);ap.send(am);var ar=ap.responseXML;var ak=new D(null,ap,ao,am,an,aq,al);var aj=i(ar,ak);V(al);return aj.result}function N(ao,ak,am,al,ap){F(ao);var aj=a();aj.open("POST",am,true);var an=af(aj,am,al,ap,arguments,5);aj.onreadystatechange=d;O[O.length]=new D(ak,aj,ap,an,am,al,ao);aj.send(an);return O.length-1}var O=new Array();function D(ak,aj,ap,al,an,am,ao){this.async=((ak==null)?false:true);this.pending=true;this.fnRef=ak;this.xmlObject=aj;this.FunctionName=ap;this.RequestXML=al;this.ServiceName=an;this.windowRef=ao;this.soapAction=am;this.callTime=new Date()}var Z=new Array();var A;function m(){var ak={message:"sessionstack",result:null};for(var aj=0;aj<Z.length;aj++){objCallBackDetails=Z[aj];objCallBackDetails.pending=true;objCallBackDetails.xmlObject.open("POST",objCallBackDetails.ServiceName,objCallBackDetails.async);objCallBackDetails.xmlObject.setRequestHeader("Content-Type","text/xml; charset=utf-8");objCallBackDetails.xmlObject.setRequestHeader("Content-Length",objCallBackDetails.RequestXML.length);objCallBackDetails.xmlObject.setRequestHeader("SOAPAction","http://wolf.co.in/webservices/"+objCallBackDetails.soapAction+"/"+objCallBackDetails.FunctionName);objCallBackDetails.xmlObject.onreadystatechange=d;objCallBackDetails.xmlObject.send(objCallBackDetails.RequestXML);if(objCallBackDetails.async==false){ak.result=P(objCallBackDetails.xmlObject.responseXML)}objCallBackDetails.callTime=new Date();Z[aj]=null}Z=new Array();return ak}function P(ak){if(window.addEventListener){var aj=ak.xml.replace(/xmlns=/g,"xmlns1=");ak=top.XMLLib.objXMLDocTemplate.cloneNode(true);ak.loadXML(aj)}return ak}function R(aj){if(aj==true){aa=false;m()}}var aa=false;function i(al,ak){al=P(al);if(al.selectSingleNode("//faultstring")!=null){var ao=top.XMLLib.getNodeText(al,"//faultstring");if(ao.indexOf("ex9886120856")>=0){if(aa==true){Z[Z.length]=ak;return{message:"sessiontimeout",result:null}}try{if(ak.callTime.valueOf()<=A.valueOf()&&aa==false){Z[Z.length]=ak;m();return{message:"sessiontimeout",result:null}}}catch(ap){}Z[0]=ak;aa=true;alert("Your Session has expired. Please login again.");top.EMLib.doLogin(null,R);A=new Date();return{message:"sessiontimeout",result:null}}else{if(ao.indexOf("License Exception")>=0){t.errLogAsync(null,"License validation exception","","","<b>Your License has expired</b>. Please contact your System Administrator or Vendor for further assitance.")}else{t.errLogAsync(null,"Unhandled Exception in Web Service \nService : "+ak.ServiceName+" ("+ak.FunctionName+")","","",ao);return{message:"failure",result:null}}}}var aj=top.XMLLib.objXMLDocTemplate.cloneNode(true);if(al.selectSingleNode("//"+ak.FunctionName+"Result")!=null){var an=top.XMLLib.getNodeText(al,"//"+ak.FunctionName+"Result");var am=top.XMLLib.getNodeXML(an,"err");if(am.length>0){am=am.replace("<err>","").replace("</err>","");am=am.replace(/^\\'/g,"");am=am.replace(/\\'$/g,"");if(ak.fnRef){t.errLogAsync(null,"Handled Exception in Web Service \nService : "+ak.ServiceName+" ("+ak.FunctionName+")","","",am)}else{t.errLogAsync(null,"Handled Exception in Web Service \nService : "+ak.ServiceName+" ("+ak.FunctionName+")","","",am)}return{message:"failure",result:null}}else{am=top.XMLLib.getNodeXML(an,"//alert").replace("<alert>","").replace("</alert>","");am=am.replace(/^'/g,"");am=am.replace(/'$/g,"");if(am.length>0){if(ak.fnRef){setTimeout(function(){t.errLogAsync(null,"","","",am)},200)}else{setTimeout(function(){t.errLogAsync(null,"","","",am)},200)}}}}return{message:"success",result:al}}function d(){for(var ak=0;ak<O.length;ak++){var aj=O[ak];if(aj.pending==true){if(aj.xmlObject.readyState!=4){continue}Result=aj.xmlObject.responseXML;aj.pending=false;var am=i(Result,aj);if(am.message=="success"||am.message=="failure"){try{aj.fnRef(am.result,ak)}catch(al){}V(aj.windowRef);aj.xmlObject=null;aj.fnRef=null;aj.FunctionName=null;aj.RequestXML=null;aj.windowRef=null}}}}function g(){var al=new Array();this.detachEvent=aj;this.attachEvent=an;this.raiseEvent=am;this.dispose=ak;function ak(){for(var ap in al){for(var ao in al[ap]){try{al[ap][ao]=null}catch(aq){}}try{al[ap]=null}catch(aq){}}}function aj(ap,ao){try{var ap=ap.toLowerCase();var ar="wsf_ptr"+ao.toString();if(al[ap]==null&&al[ap][ar]){al[ap][ar]=null}}catch(aq){}}function an(ap,ao){var ap=ap.toLowerCase();if(al[ap]==null){al[ap]=new Array()}var aq="wsf_ptr"+ao.toString();al[ap][aq]=ao}function am(aq,ao){if(ao==null){ao=new Object()}ao.type=aq;ao.cancel=false;if(ao.srcElement!=null&&ao.rootsrcElement==null){ao.rootsrcElement=ao.srcElement}var at=al[aq.toLowerCase()];var ap=true;for(k in at){if(k.indexOf("wsf_ptr")==0){try{at[k](ao);if(ao.cancel==true){ap=false}}catch(ar){ap=true}}}return ap}}function n(aq,ar,ak,an,am){if(an==null){an=window}objTop=an;for(var ao=0;ao<10;ao++){if(objTop.wct!=null){break}objTop=objTop.parent}var at=new top.EMLib.clsWCT();if(objTop.wct!=null){at.adam=objTop.wct.adam}else{if(objTop.context!=null){at.adam=objTop.context}}at.parentWCT=objTop.wct;at.bfu=aq;at.popupArgs=ak;var aj=500;if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("MSIE 6.0")>0){aj+=52}if(ar==""){ar="status:no;height:"+aj+"px;width:600px;"}else{ar=ar.toLowerCase().replace(/dialog/g,"")}at.adam.libraries=top.libraries;var ap=top.DHTMLLib.showCustomDialog(top,ar,null,"allowtransparency",true);ap.dialogArguments=at;ap.container.innerHTML="<iframe src='"+C("/widgets/runtime/htc/wct.htm")+"' style='"+ar+";border:0px' frameborder='0' allowtransparency = 'true'></iframe>";ap.callBackRef=al;ap.callBackArguments=am;function al(av,au){if(au!=null){try{au(av)}catch(aw){}}}}function c(ak){for(var aj=1;aj<arguments.length;aj++){if(ak==arguments[aj]){return ak}}return -1}function j(ak){for(var aj=1;aj<arguments.length;aj++){if(ak==arguments[aj]){return ak}}return -1}function l(ak){var aj=""+(ak.getMonth()-0+1);var al=""+ak.getDate();if(aj.length==1){aj="0"+aj}if(al.length==1){al="0"+al}var am=ak.getFullYear()+"-"+aj+"-"+al;return am}function q(al){for(var aj in al){try{al[aj]=null}catch(ak){}}}function K(ak){if(!ak){ak=top.location.href}var ao={};try{var aj=ak.split("?")[1].split("&");for(var al=0;al<aj.length;al++){var an=aj[al].split("=");if(an[1]!=null&&an[1]!=""){ao[an[0].toLowerCase()]=an[1]}}}catch(am){}return ao}var Y="";function o(){dt=new Date();return"-##-"+dt.getMinutes()+":"+dt.getSeconds()+":"+dt.getMilliseconds()+" "}function G(aj){return aj.replace(/^\s*/,"")}function ad(aj){return aj.replace(/\s*$/,"")}function J(al){try{var aj=/\r/g;al=al.replace(aj,"");aj=/\n/g;al=al.replace(aj,"");aj=/\t/g;al=al.replace(aj,"");return al}catch(ak){}}function ag(al){var aj=Q.location.href.split("/");var ak=aj[0]+"/"+aj[1]+"/"+aj[2];if(al.substring(0,1)=="/"){return ak+al}}function ai(ar){var am,ao,an,al,ap,aj,ak;am="&,\",<,>,','".split(",");an="&amp;amp;,&amp;quot;,&amp;lt;,&amp;gt;,&apos;,&amp;apos;".split(",");ao=ar;var aq=/&amp;/g;ao=ao.replace(aq,"&");var aq=/&apos;/g;ao=ao.replace(aq,"'");var aq=/&quot;/g;ao=ao.replace(aq,'"');var aq=/&lt;/g;ao=ao.replace(aq,"<");var aq=/&gt;/g;ao=ao.replace(aq,">");return ao}function b(al){var am,ap,ao,ak,aq,an,aj;am='&,",<,>'.split(",");ao="&amp;amp;,&amp;quot;,&amp;lt;,&amp;gt;".split(",");ap="";if(al.length>0){for(ak=0;ak<al.length;ak++){aq=al.substr(ak,1);an=0;for(aj=0;aj<am.length;aj++){if(aq==am[aj]){ap+=ao[aj];an=1;break}}if(an==0){ap+=aq}}}return ap}}function clsXMLLib(s){var t=s;if(t==null){t=top}using("helperLib",t);this.serverTransformXML=m;this.serverTransformXMLAsync=i;this.transformXML=l;this.getNodeText=h;this.getNodeXML=r;this.setNodeText=o;this.setNodeXML=f;this.getNodeNextSibling=q;this.getNodeFirstChild=a;this.getNodePreviousSibling=g;this.loadXSL=c;var j,d;var n="Msxml2.XSLTemplate.6.0";p();this.objXMLDocTemplate=j;this.objXSLDocTemplate=d;function p(){var z;if(window.addEventListener){z=document.implementation.createDocument("","",null);d=z}else{var y=["MSXML2.DomDocument.6.0"];var v=["Msxml2.FreeThreadedDOMDocument.6.0","Msxml2.FreeThreadedDOMDocument.3.0","Msxml2.FreeThreadedDOMDocument.4.0","Msxml2.FreeThreadedDOMDocument.5.0","Msxml2.FreeThreadedDOMDocument","Microsoft.FreeThreadedDOMDocument"];var u=["MSXML2.XSLTemplate.6.0","MSXML2.XSLTemplate.3.0","MSXML2.XSLTemplate.4.0","MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate","Microsoft.XSLTemplate"];for(var w=0;w<y.length;w++){try{z=new ActiveXObject(y[w]);d=new ActiveXObject(v[w]);n=u[w];break}catch(A){}}}j=z}function o(z,u,A){try{var w;if(typeof(z)=="string"){w=j.cloneNode(true);w.loadXML(z)}else{w=z}var v=w.selectSingleNode(u);if(v==null){v=w.appendChild(w.ownerDocument.createElement(u))}v.text=A;if(typeof(z)=="string"){return w.xml}else{return w}}catch(y){}}function f(w,y,z,u){try{var D;if(typeof(w)=="string"){D=j.cloneNode(true);D.loadXML(w)}else{D=w}var v=D.ownerDocument.cloneNode(true);v.loadXML("<root>"+z+"</root>");var B=D.selectSingleNode(y);if(B!=null){if(u!=true){var E=B.childNodes;for(var A=0;A<E.length;A++){B.removeChild(E[A])}}}else{B=D.appendChild(D.ownerDocument.createElement(y))}B.appendChild(v.selectSingleNode("/root").childNodes[0].cloneNode(true));if(typeof(w)=="string"){return D.xml}else{return D}}catch(C){}}function c(u,v,z){var y;try{y=t.context.cache[v]}catch(w){}if(y==null){if(!window.addEventListener){y=d.cloneNode(true);y.async=false;try{y.setProperty("AllowXsltScript",true);y.setProperty("AllowDocumentFunction",true)}catch(w){}}else{y=j.cloneNode(true);y.async=false}if(z==true||u.length>100){y.loadXML(u)}else{y.load(u)}}if(v!=null){t.context.cache[v]=y}return y}function a(u){try{var w=u.childNodes[0];if(window.addEventListener){while(w!=null&&w.nodeType==3){w=w.nextSibling}}return w}catch(v){return null}}function q(u){try{var w=u.nextSibling;while(w!=null&&w.nodeType==3){w=w.nextSibling}return w}catch(v){return null}}function g(u){try{var w=u.previousSibling;while(w!=null&&w.nodeType==3){w=w.previousSibling}return w}catch(v){return null}}function h(z,y){try{var v,u;if(typeof(z)=="string"){v=j.cloneNode(true);v.loadXML(z)}else{v=z}u=v.selectSingleNode(y);if(u==null){return""}else{if(u.text==undefined){return u.value}return u.text}}catch(w){return""}}function r(z,y){try{var v,u;if(typeof(z)=="string"){v=j.cloneNode(true);v.loadXML(z)}else{v=z}u=v.selectSingleNode(y);if(u==null){return""}else{return u.xml}}catch(w){}}function i(A,y,z,v){var u;if(z==true){y="<![CDATA[<document><record><path>"+t.helperLib.wsfMapPath("$application/participant/xml/tree.xml")+"</path><xsl>"+v+"</xsl></record></document>]]>"}u=t.helperLib.processSoapRequestAsync(top,w,t.helperLib.wsfMapPath("/webservices/wf.object/utilityprocessor.asmx"),"wf.object","XmlTransform","sXML",y);function w(B){var D="";if(B!=null){D=t.XMLLib.getNodeText(B,"//XmlTransformResult")}try{A(D)}catch(C){}}}function m(w,y,v){var u;if(y==true){w="<![CDATA[<document><record><path>"+t.helperLib.wsfMapPath("$applicationid/participant/xml/tree.xml")+"</path><xsl>"+v+"</xsl></record></document>]]>"}u=t.helperLib.processSoapRequest(top,t.helperLib.wsfMapPath("/webservices/wf.object/utilityprocessor.asmx"),"wf.object","XmlTransform","sXML",w);if(u!=null){return t.XMLLib.getNodeText(u,"//XmlTransformResult")}else{return""}}function b(u){var w,v;if(window.addEventListener){v=new XSLTProcessor();v.importStylesheet(u)}else{try{w=new ActiveXObject(n);w.stylesheet=u;v=w.createProcessor()}catch(y){alert("error in xmllib.getXSLTProcessor:"+y.description)}}return v}function l(u,E){var v,B,D,w,A;if(typeof(E)=="string"){B=c(E,null,false)}else{B=E}D=j.cloneNode(true);D.async=false;D.loadXML(u);w=b(B,D);if(window.addEventListener){if(arguments.length>2){for(var y=2;y<arguments.length;y++){w.setParameter(null,"param"+(y-1),arguments[y])}}var z=w.transformToDocument(D);A=z.xml;if(B.xml.indexOf('method="text"')>0&&z.documentElement.textContent){A=z.documentElement.textContent}if(A.indexOf("transformiix:result")>=0){var C=r(A,"//transformiix:result/*[name() != 'transformiix:result']");if(C.length==0){C=h(A,"//transformiix:result")}A=C}}else{w.input=D;if(arguments.length>2){for(var y=2;y<arguments.length;y++){w.addParameter("param"+(y-1),arguments[y])}}w.transform();A=w.output}return(A)}}function clsDHTMLLib(objTop){var me=this;var topWindow=objTop;topWindow.dialogCover=new Array();if(topWindow==null){topWindow=top}this.getEventSrcElement=function(e){element=e.srcElement?e.srcElement:e.target;return element};this.preventDefault=function(e){(e.preventDefault)?e.preventDefault():e.returnValue=false};this.getEvent=_getEvent;this.getKeyCode=function(e){return((e.charCode||e.charCode==0)?e.charCode:e.keyCode)};this.getDialog=_getDialog;this.getWindowPos=getWindowPos;this.getMousePos=getMousePos;this.getScreenCenterPos=_getScreenCenterPos;this.getStyleProp=getStyleProp;this.addStyleSheet=AddStyleSheet;this.addScript=_addScript;this.removeStyleSheet=removeStyleSheet;this.addClass=addClass;this.removeClass=removeClass;this.bHasClass=bHasClass;this.setWaitDisplay=setWaitDisplay;this.getWindowPane=getWindowPane;this.captureMouse=captureMouse;this.fixPNG=_fixPNG;this.transition=_transition;this.showCustomDialog=_showCustomDialog;this.toggleDashBoards=toggleDashBoards;this.makePane=makePane;this.roundIt=_roundIt;this.applyShadow=_applyShadow;this.changeToButon=_changeToButon;function getMousePos(e){var posx=0;var posy=0;if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY}else{if(e.clientX||e.clientY){posx=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return{x:posx,y:posy}}function _transition(el,shrink){var thisTransition=this;this.e=el;var elementHeight=parseInt(thisTransition.e.offsetHeight);var elementWidth=parseInt(thisTransition.e.offsetWidth);var elementFilter=el.style.filter;var elementOpacity=el.style.opacity;var _bShrink=(shrink==null)?true:shrink;var reduceHeight=Math.round(elementHeight/10);var reduceWidth=Math.round(elementWidth/10);addClass(thisTransition.e,"shrinkable");var opacity=100;var intervalId;this.onHideComplete=null;this.onStartAppear=null;this.hide=function(){opacity=100;intervalId=setInterval(_shrink,40)};this.show=function(){opacity=1;intervalId=setInterval(_appear,40)};function _appear(){thisTransition.e.style.filter="alpha(opacity="+opacity+")";try{thisTransition.e.style.opacity=(opacity/100)}catch(e){}if(opacity==1){try{thisTransition.onStartAppear()}catch(e){}}opacity+=8;if(opacity>=100){removeClass(thisTransition.e,"shrinkable");try{thisTransition.e.style.opacity=elementOpacity}catch(e){}thisTransition.e.style.filter=elementFilter;clearInterval(intervalId);try{thisTransition.onHideComplete()}catch(e){}}}function _shrink(){elementHeight-=reduceHeight;elementWidth-=reduceWidth;if(thisTransition.e!=null){try{if(_bShrink==true){thisTransition.e.style.height=elementHeight+"px"}thisTransition.e.style.filter="alpha(opacity="+opacity+")";try{thisTransition.e.style.opacity=(opacity/100)}catch(e){}opacity-=8}catch(e){}}if(opacity<=0){removeClass(thisTransition.e,"shrinkable");thisTransition.e.style.filter=elementFilter;try{thisTransition.e.style.opacity=elementOpacity}catch(e){}clearInterval(intervalId);try{thisTransition.onHideComplete()}catch(e){}}}}function getWindowPane(){return'<div class="subwindow" type="windowpane" ><span class="header" type="wp_header">wp_header_title</span><div id="wp_content_id" type="wp_content" class="windowpanecontent"></div></div>'}function setWaitDisplay(objWaitDisplay){with(objWaitDisplay){id=uniqueID;style.cssText="BORDER-RIGHT: 1px outset;PADDING-RIGHT: 30px;    BORDER-TOP: 1px outset;    PADDING-LEFT: 30px;    FONT-SIZE: 16pt;    PADDING-BOTTOM: 30px;    BORDER-LEFT: 1px outset;    CURSOR: wait;    COLOR: black;    PADDING-TOP: 30px;    BORDER-BOTTOM: 1px outset;    POSITION: absolute;    BACKGROUND-COLOR: #7BA2E7;    TEXT-ALIGN: center";style.display="none";noWrap=true;style.setExpression("top","(document.body.clientHeight/3) - "+id+".offsetHeight");style.setExpression("left","(document.body.clientWidth/2) - ("+id+".offsetWidth/2)");innerHTML="<img SRC='"+top.helperLib.wsfMapPath("/widgets/statusanimation.gif")+"' ALIGN='absmiddle' HEIGHT='36' WIDTH='36' STYLE='FILTER: invert'> Loading... Please wait."}}function addClass(elItem,sNewClass){if(elItem.className.indexOf(sNewClass)>=0){return}elItem.className+=" "+sNewClass}function removeClass(elItem,sOldClass){if(elItem.className.indexOf(sOldClass)>=0){elItem.className=elItem.className.replace(sOldClass,"")}}function bHasClass(elItem,sClass){if(elItem.className.indexOf(sClass)>=0){return true}else{return false}}function removeStyleSheet(sStyleSheetLocation){try{var w=window;if(arguments.length>1){w=arguments[1]}var objLinks=w.document.getElementsByTagName("LINK");for(var i=0;i<objLinks.length;i++){if(objLinks[i].href==sStyleSheetLocation){w.document.removeChild(objLinks[i]);break}}}catch(e){}}function _addScript(windowElement,scriptSource){var scriptTag=windowElement.document.createElement("script");scriptTag.type="text/javascript";scriptTag.src=scriptSource;windowElement.document.getElementsByTagName("HEAD")[0].appendChild(scriptTag)}function AddStyleSheet(styleSheetLocation){var w=window;if(arguments.length>1){w=arguments[1]}if(w.document.createStyleSheet){w.document.createStyleSheet(styleSheetLocation)}else{var newSS=w.document.createElement("link");newSS.rel="stylesheet";newSS.type="text/css";newSS.href=styleSheetLocation;newSS=w.document.getElementsByTagName("head")[0].appendChild(newSS)}}function getWindowPos(element,stopatTagName){var rect=new Array();rect[0]=0;rect[1]=0;if(element==null){return rect}rect[2]=element.offsetWidth;rect[3]=element.offsetHeight;if(stopatTagName==null){stopatTagName="body"}if(element.tagName.toLowerCase()!=stopatTagName.toLowerCase()){if(element.offsetParent!=null){var ParentRect=getWindowPos(element.offsetParent,stopatTagName);rect[0]=element.offsetLeft+ParentRect[0];rect[1]=element.offsetTop+ParentRect[1]}rect[1]-=element.scrollTop;if(window.addEventListener){}}return rect}function captureMouse(oSource,objWin){var objSource=oSource;var win=objWin;objSource.onmousemove=moveDragDiv;var m_offsetX=win.event.offsetX;var m_offsetY=win.event.offsetY;var m_bBeginMove=false;win.event.cancelBubble=true;win.event.returnValue=false;function moveDragDiv(){try{if(!m_bBeginMove){m_bBeginMove=true;m_offsetX=win.event.offsetX;m_offsetY=win.event.offsetY;objSource.setCapture();objSource.onmouseup=releaseMouse;return}if(win.event.button!=1){objSource.releaseCapture();return}objSource.style.left=win.event.clientX-m_offsetX;objSource.style.top=win.event.clientY-m_offsetY;win.event.cancelBubble=true;win.event.returnValue=false}catch(e){alert("dhtmllib.moveDragDiv:"+e.message)}}function releaseMouse(){objSource.onmousemove=null;objSource.onmouseup=null;objSource.releaseCapture();objSource=null;win=null}}function _getEvent(window,calleeArguments){var evt;try{evt=window.event}catch(e){}if(!evt){try{for(var i=0;i<10;i++){evt=calleeArguments.callee.caller.arguments[0];if(evt&&evt.constructor.toString().indexOf("Event]")>0){break}calleeArguments=calleeArguments.callee.caller.arguments}}catch(e){}}return evt}function _getDialog(){var obj={};if(topWindow.dialogStack!=null){obj=topWindow.dialogStack[topWindow.dialogStack.length-1];obj.arguments=obj.dialogArguments}else{if(topWindow.dialogArguments){obj=top;obj.arguments=topWindow.dialogArguments}}return obj}function _setFocusToOpenedDialog(){}function _createCover(allowtransparency){var coverFrame=topWindow.document.createElement("iframe");coverFrame.src=top.helperLib.wsfMapPath("/mc/blank.htm");coverFrame.frameBorder="0";coverFrame.className="coverFrame "+allowtransparency;coverFrame.allowTransparency=true;top.helperLib.attachEvents(topWindow,coverFrame,"onload",function(e){coverFrame.contentWindow.document.body.style.backgroundColor="transparent";coverFrame.contentWindow.document.body.style.backgroundImage="url("+top.helperLib.wsfMapPath("/widgets/assets/spacer.gif")+")";topWindow.helperLib.attachEvents(topWindow,coverFrame.contentWindow.document,"click",_setFocusToOpenedDialog)});topWindow.document.body.appendChild(coverFrame);topWindow.dialogCover[topWindow.dialogCover.length]=coverFrame;coverFrame.style.zIndex=200+topWindow.dialogCover.length}function _clearDialog(){if(topWindow.dialogStack){var dialog=topWindow.dialogStack[topWindow.dialogStack.length-1];dialog.callBackRef=null;dialog.callBackArguments=null;dialog.returnValue=null;dialog.outerContainer.parentNode.removeChild(dialog.outerContainer);dialog=null;topWindow.dialogStack.splice(topWindow.dialogStack.length-1,1);var coverFrame=topWindow.dialogCover[topWindow.dialogCover.length-1];topWindow.dialogCover.splice(topWindow.dialogCover.length-1,1);setTimeout(function(){coverFrame.parentNode.removeChild(coverFrame)},200);if(topWindow.dialogStack.length==0){topWindow.dialogStack=null}}}function _dialogUnload(evt){if(topWindow.dialogStack){var dialog=topWindow.dialogStack[topWindow.dialogStack.length-1];try{if(dialog.callBackRef){dialog.callBackRef(dialog.returnValue,dialog.callBackArguments)}}catch(e){}_clearDialog()}}function _getScreenCenterPos(windowref,width,height){var scrolledX,scrolledY;if(windowref.self.pageYOffset){scrolledX=windowref.self.pageXOffset;scrolledY=windowref.self.pageYOffset}else{if(windowref.document.documentElement&&document.documentElement.scrollTop){scrolledX=windowref.document.documentElement.scrollLeft;scrolledY=windowref.document.documentElement.scrollTop}else{if(document.body){scrolledX=windowref.document.body.scrollLeft;scrolledY=windowref.document.body.scrollTop}}}var centerX,centerY;if(self.innerHeight){centerX=self.innerWidth;centerY=self.innerHeight}else{if(windowref.document.documentElement&&windowref.document.documentElement.clientHeight){centerX=windowref.document.documentElement.clientWidth;centerY=windowref.document.documentElement.clientHeight}else{if(document.body){centerX=windowref.document.body.clientWidth;centerY=windowref.document.body.clientHeight}}}return{x:scrolledX+(centerX-width)/2,y:scrolledY+(centerY-height)/2}}function _showCustomDialog(windowRef,dialogArguments,showCustomDialog,allowtransparency,shadow){_createCover(allowtransparency);if(topWindow.dialogStack==null){topWindow.dialogStack=new Array()}var dialog={};dialog.close=_dialogUnload;dialog.outerContainer=topWindow.document.createElement("div");topWindow.document.body.appendChild(dialog.outerContainer);dialog.outerContainer.style.display="block";dialog.outerContainer.style.cssText=dialogArguments;dialog.outerContainer.style.zIndex=200+topWindow.dialogCover.length;dialog.outerContainer.style.position="absolute";var centerPosition=_getScreenCenterPos(topWindow,dialog.outerContainer.offsetWidth,dialog.outerContainer.offsetHeight);dialog.outerContainer.style.top=centerPosition.y+"px";dialog.outerContainer.style.left=centerPosition.x+"px";dialog.container=dialog.outerContainer.appendChild(topWindow.document.createElement("div"));if(shadow==true){_applyShadow(dialog.container)}topWindow.dialogCover[topWindow.dialogCover.length-1].style.display="block";dialog.returnValue=null;topWindow.dialogStack[topWindow.dialogStack.length]=dialog;return dialog}function makePane(sId,sTitle,sContent,styleAttrib,iExcessPadding,sMode,defaultShowMode){if(defaultShowMode==null){defaultShowMode="open"}if(sMode==null){sMode="closing"}if(iExcessPadding==null){iExcessPadding=14}if(styleAttrib==null){styleAttrib=""}var arrStyle=styleAttrib.split(";");var sWidth;for(var i=0;i<arrStyle.length;i++){var arrPV=arrStyle[i].split(":");try{if(arrPV[0].toLowerCase()=="width"){sWidth=parseInt(arrPV[1])+iExcessPadding;break}}catch(e){}}if(sWidth==null){sWidth="100%"}if(sMode=="closing"){sMode="<span style='padding-right:10px;cursor:hand'><img id='"+sId+"_toggleImage' src='"+top.helperLib.wsfMapPath("/widgets/assets/")+(defaultShowMode=="open"?"closepane.gif":"openpane.gif")+"'  onclick='top.DHTMLLib.toggleDashBoards(this)' align='absmiddle' ></span>"}else{sMode=""}if(sTitle!=null){sTitle='<span class="paneTitle">'+sTitle+"</span>"}else{sTitle=""}if(sMode.length>0||sTitle.length>0){sTitle='<div style="padding:2px;z-index:1" >'+sMode+sTitle+"</div>"}var sDashPaneHTML='<div class="dashpane" id="db_'+sId+'" style="position:relative;width:'+sWidth+'px;">';sDashPaneHTML+='<b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"><b class="xb31"></b></b><b class="xb4"><b class="xb41"></b></b></b>';sDashPaneHTML+='<div class="xboxcontent"><b class="xbc1">';sDashPaneHTML+=sTitle;sDashPaneHTML+='<div id="'+sId+'_dc" class="dashcontainer" style="#styleAttributes#'+(defaultShowMode=="open"?"":";display:none;")+'">';sDashPaneHTML+="#content#";sDashPaneHTML+="</div>";sDashPaneHTML+="</b></div>";sDashPaneHTML+='<b class="xbottom"><b class="xb4"><b class="xb41"></b></b><b class="xb3"><b class="xb31"></b></b><b class="xb2"></b><b class="xb1"></b></b>';sDashPaneHTML+="</div>";sDashPaneHTML=sDashPaneHTML.replace("#Title#",sTitle);sDashPaneHTML=sDashPaneHTML.replace("#content#",sContent);sDashPaneHTML=sDashPaneHTML.replace("#styleAttributes#",styleAttrib);return sDashPaneHTML}function _changeToButon(divToChange,buttonType,w){var parentDiv=divToChange.parentNode.insertBefore(w.document.createElement("div"),divToChange);parentDiv.className="buttoncontainer";parentDiv.innerHTML="<div class='button "+buttonType+"'></div>";parentDiv.firstChild.appendChild(divToChange);rightDiv=parentDiv.firstChild.appendChild(w.document.createElement("div"));addClass(rightDiv,"right");addClass(divToChange,"content")}function _applyShadow(o,bgColor,className){if(className==null){className=""}var shadowHtml='<table cellpadding="0" cellspacing="0" class="shadow '+className+'"><tr><td><div style="position:relative"><div class="topleft"><div class="topright"><div class="whiteplaceholder" ></div></div></div><div style="padding:0px 7px;"><div class="left-tile"><div class="right-tile"></div></div></div><div class="bottom-left"><div class="bottom-right"><div class="bottom-tile"></div></div></div></div></td></tr></table>';shadowHtml=shadowHtml.replace(/#bgcolor#/g,bgColor);o.insertAdjacentHTML("beforeBegin",shadowHtml);var t=o.previousSibling;var zIndex=getStyleProp(o,"zIndex");if(!isNaN(zIndex)){t.rows[0].cells[0].childNodes[0].childNodes[1].childNodes[0].style.zIndex=parseInt(zIndex)-1}if(zIndex==0){o.style.position="relative";o.style.zIndex=1}var olderOffsetHeight=o.offsetHeight;setTimeout(_setHeight,50);t.rows[0].cells[0].childNodes[0].childNodes[1].appendChild(o);return t;function _setHeight(){if(olderOffsetHeight==o.offsetHeight){setTimeout(_setHeight,50);return}o.onresize=_resize;_resize()}function _resize(){t.rows[0].cells[0].childNodes[0].childNodes[1].childNodes[0].style.height=(o.offsetHeight-12)+"px"}}function _roundIt(o,w,bgcolor,onlyTop,onlyBottom,outerOrInner){if(!bgcolor){bgcolor="#F6F5F5"}if(typeof(o)=="string"){o=w.document.getElementById(o)}if(!o){return}var borderColor='style="border-color:'+bgcolor+';"';offsetWidth=o.offsetWidth;if(onlyBottom!=true){var topCorners=w.document.createElement("b");topCorners.innerHTML='<b class="c1" '+borderColor+'></b><b class="c2" '+borderColor+' ></b><b class="c3" '+borderColor+'></b><b class="c4" '+borderColor+"></b>";topCorners.className="corners tc";topCorners.style.marginRight="-"+getStyleProp(o,"paddingRight");topCorners.style.marginBottom=(parseInt(getStyleProp(o,"paddingTop"))-4)+"px";topCorners.style.marginLeft="-"+getStyleProp(o,"paddingLeft");topCorners.style.position="relative";if(outerOrInner=="outer"){topCorners.style.zIndex=2}else{topCorners.style.zIndex=1}o.insertBefore(topCorners,o.childNodes[0]);topCorners.style.width=offsetWidth}if(onlyTop!=true){var bottomCorners=w.document.createElement("b");bottomCorners.innerHTML='<b class="c4" '+borderColor+'></b><b class="c3" '+borderColor+'></b><b class="c2" '+borderColor+'></b><b class="c1" '+borderColor+"></b>";bottomCorners.className="corners bc";bottomCorners.style.marginRight="-"+getStyleProp(o,"paddingRight");bottomCorners.style.marginTop=(parseInt(getStyleProp(o,"paddingBottom"))-4)+"px";bottomCorners.style.marginLeft="-"+getStyleProp(o,"paddingLeft");bottomCorners.style.position="relative";if(outerOrInner=="outer"){bottomCorners.style.zIndex=2}else{bottomCorners.style.zIndex=1}o.appendChild(bottomCorners);bottomCorners.style.width=offsetWidth}o.style.display="inline-block";o.style.paddingTop="0px";o.style.paddingBottom="0px"}function getStyleProp(x,prop){if(x.currentStyle){return(x.currentStyle[prop])}if(document.defaultView.getComputedStyle){return(document.defaultView.getComputedStyle(x,"")[prop])}return(null)}function toggleDashBoards(objUnKnown){function outQuint(iTimeElapsed,iActualHeight,iTickerDuration){iTimeElapsed=iTimeElapsed/iTickerDuration-1;return Math.round(iActualHeight*(iTimeElapsed*iTimeElapsed*iTimeElapsed*iTimeElapsed*iTimeElapsed+1)+(0-iActualHeight))}function smoothOpen(){if(parseInt(pane.body.ScrollPosition)>=0){clearInterval(vInterVal);return}if(timeElapsed==16){if(pane.body.actualHeight!=pane.body.offsetHeight){pane.body.actualHeight=pane.body.offsetHeight}}timeElapsed+=16;var iNewTop=outQuint(timeElapsed,pane.body.actualHeight,tickerDuration);pane.body.ScrollPosition=iNewTop;pane.body.style.top=iNewTop+"px";pane.element.style.height=(pane.element.closedHeight+(pane.body.actualHeight+iNewTop))+"px"}function smoothClose(){try{if(pane.body.ScrollPosition<(0-pane.body.actualHeight)){clearInterval(vInterVal);pane.body.style.display="none";pane.element.style.height=(pane.element.closedHeight)+"px";return}timeElapsed+=16;var iNewTop=outQuint(tickerDuration-timeElapsed,pane.body.actualHeight,tickerDuration);pane.body.ScrollPosition=iNewTop;pane.body.style.top=iNewTop+"px";var iParentHeight=pane.element.closedHeight+(pane.body.actualHeight+iNewTop);if(iParentHeight<0){iParentHeight=pane.element.closedHeight}pane.element.style.height=iParentHeight+"px"}catch(e){}}var timeElapsed=0,tickerDuration=200;var pane={};pane.titleElement=objUnKnown;pane.toggleImage=top.XMLLib.getNodeFirstChild(pane.titleElement);pane.element=pane.titleElement.parentNode;pane.body=top.XMLLib.getNodeNextSibling(pane.titleElement);var vInterVal;if(pane.toggleImage.className.indexOf("closed")>=0){pane.element.style.overflowY="hidden";pane.element.style.overflow="hidden";if(!pane.element.getAttribute("closedHeight")){var excludeBorder=0;var borderTopWidth=parseInt(getStyleProp(pane.element,"borderTopWidth"));if(!isNaN(borderTopWidth)){excludeBorder+=borderTopWidth}var borderBottomWidth=parseInt(getStyleProp(pane.element,"borderBottomWidth"));if(!isNaN(borderBottomWidth)){excludeBorder+=borderBottomWidth}pane.element.setAttribute("closedHeight",pane.element.offsetHeight-excludeBorder)}pane.element.style.height=pane.element.closedHeight+"px";pane.body.style.display="block";pane.body.style.visibility="hidden";pane.body.actualHeight=pane.body.offsetHeight;pane.body.ScrollPosition=(0-pane.body.maxPosition);pane.body.style.top=(0-pane.body.actualHeight)+"px";pane.body.style.visibility="visible";vInterVal=setInterval(smoothOpen,16);removeClass(pane.toggleImage,"closed");addClass(pane.toggleImage,"open")}else{removeClass(pane.toggleImage,"open");addClass(pane.toggleImage,"closed");pane.body.actualHeight=pane.body.offsetHeight;pane.body.ScrollPosition=0;pane.body.parentNode.style.overflowY="hidden";if(!pane.element.closedHeight){pane.element.closedHeight=pane.element.offsetHeight-pane.element.actualHeight}vInterVal=setInterval(smoothClose,16)}}function _fixPNG(objwindow){var arVersion=navigator.appVersion.split("MSIE");var version=parseFloat(arVersion[1]);var doc=objwindow==null?topWindow.document:objwindow.document;var shim=top.helperLib.wsfMapPath("/widgets/assets/spacer.gif");if((version>=5.5)&&(version<7)&&(doc.body.filters)){var pageImages=doc.getElementsByTagName("IMG");for(var i=0;i<pageImages.length;i++){var myImage=pageImages[i];if(myImage.src.indexOf(".png")>0){var imgID=(myImage.id)?"id='"+myImage.id+"' ":"";var imgClass=(myImage.className)?"class='"+myImage.className+"' ":"";var imgTitle=(myImage.title)?"title='"+myImage.title+"' ":"title='"+myImage.alt+"' ";var imgStyle="display:inline-block;"+myImage.style.cssText;var strNewHTML="<div "+imgID+imgClass+imgTitle+' style="width:'+myImage.width+"px; height:"+myImage.height+"px;"+imgStyle+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', src='"+myImage.src+"');\"></div>";myImage.outerHTML=strNewHTML}}for(var i=doc.all.length-1,obj=null;(obj=doc.all[i]);i--){if(obj.currentStyle.backgroundImage.match(/\.png/i)!==null){var mode="scale";var bg=obj.currentStyle.backgroundImage;var src=bg.substring(5,bg.length-2);if(obj.currentStyle.backgroundRepeat=="no-repeat"){mode="crop"}obj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='"+mode+"')";obj.style.backgroundImage="url("+shim+")"}}}}}function clscacheLib(n){if(n==null){n=top}if(n.context!=null){n.cache=n.context.cache}else{n.cache=new Array()}n.cacheUtil=this;var o="";var c=true;var d=this;var b=n.document.getElementById("cacheLib_cacheFrame");if(b==null){b=n.document.createElement("IFRAME");n.document.body.appendChild(b);b.id="cacheLib_cacheFrame";b.name="cacheLib_cacheFrame";b.setAttribute("APPLICATION","yes");b.style.cssText="position:absolute;visibility:visible;z-index:1000;top:100px;height:200px;width:500px;";b.style.display="none"}this.cacheFrame=b;var l=b.contentWindow;this.cacheIndex=0;this.cacheGroupIndex=0;this.publicQueue=new Array();this.clsXSL=q;this.clsCacheXMLQueueItem=a;this.initSpeedCache=m;this.loadXMLFromCache=i;function i(w,u,t,r){var v=new d.clsCacheXMLQueueItem();v.loadComplete=u;v.tagVariant=t;for(var s=3;s<arguments.length;s++){v.queue[v.queue.length]=new d.clsXSL(w,arguments[s])}d.publicQueue[d.publicQueue.length]=v;d.initSpeedCache();return d.publicQueue.length-1}function q(s,r){this.key=s;this.path=r;this.XMLObject=null}function a(){this.queue=new Array();this.loadComplete=null;this.speedStats="";this.tagVariant=null}function m(){if(c==true){p(this)}}function p(){c=false;if(d.publicQueue.length==d.cacheIndex){c=true;return}d.cacheGroupIndex=0;h()}function h(){var r=d.publicQueue[d.cacheIndex];if(r.queue[d.cacheGroupIndex]==null){r.speedStats=o;try{r.loadComplete(r,d.cacheIndex)}catch(s){alert(s.message)}d.cacheIndex++;p();return}j(r.queue[d.cacheGroupIndex].key,r.queue[d.cacheGroupIndex].path)}function j(s,r){if(window.addEventListener){top.helperLib.attachEvents(window,d.cacheFrame,"onload",f)}else{top.helperLib.attachEvents(window,d.cacheFrame,"onreadystatechange",f)}d.cacheFrame.src=r}function g(){}function f(v){var s=d.publicQueue[d.cacheIndex];if(s==null){return}if((d.cacheFrame.readyState&&d.cacheFrame.readyState!="complete")||(!d.cacheFrame.readyState&&v.type!="load")){return}top.helperLib.detachEvents(window,d.cacheFrame,"onreadystatechange",f);top.helperLib.detachEvents(window,d.cacheFrame,"onload",f);if(l.location.href.indexOf("about:blank")>=0){setTimeout(f,100);return}var u=l.document.getElementById("xsl");var t="";if(u!=null){u=u.XMLDocument.cloneNode(true)}else{try{u=top.XMLLib.objXMLDocTemplate.cloneNode(true);if(window.addEventListener){var r=new XMLSerializer();t=r.serializeToString(l.document)}else{t=l.document.XMLDocument.xml}u.loadXML(t)}catch(v){}}s.queue[d.cacheGroupIndex].XMLObject=u;s.queue[d.cacheGroupIndex].sXML=t;d.cacheGroupIndex++;h()}}function clsEMLib(objTop){using("helperLib");using("XMLLib");var bDologinActive=false;var top=window.top;if(objTop!=undefined){top=objTop}var objWin;initWindow();this.wsfMapPath=wsfMapPath;this.doLogin=doLogin;this.sessionExpired=_sessionExpired;this.readUserProfile=readUserProfile;this.login=login;this.initialiseDBData=initialiseDBData;this.returnObjectStatus=_returnObjectStatusFromPermissions;this.getObjectBFU=_getObjectBFU;this.getObjectDefaultImage=_getObjectDefaultImage;this.getObjectDef=_getObjectDefFromBrokerId;this.getObjectName=_getObjectNameFromBfu;this.getBrokerID=_getBrokerIdFromBfu;this.isPluginActive=_isPluginActive;this.escapeSpecialChars=escapeSpecialChars;this.GetApplicationID=GetApplicationID;this.GetSourceCombo=_getSourceCombo;this.linkObject=linkObject;this.getDirectCombo=_getDirectCombo;this.populateCombos=_populateCombos;this.reloadCombo=_reloadCombo;this.deserialise=deserialise;this.getEnvironData=getEnvironData;this.getTopWCT=_getTopWCT;this.openObject=openObject;this.openForm=openForm;this.resetWindowRef=resetWindowRef;this.getLookupResult=_getLookupResult;this.clsMainContext=clsMainContext;this.clsCombos=clsCombos;this.clsObjectsCreated=clsObjectsCreated;this.clsWCT=clsWCT;this.clsObjectLookup=clsObjectLookup;this.clsDeserialise=clsDeserialise;this.loadObjectHeader=loadObjectHeader;this.loadObjectInstance=loadObjectInstance;this.loadObjectInstanceFromXml=loadObjectInstanceFromXml;this.InitDependentLists=_initDependentLists;this.ProcessDynamicList=_processDynamicList;this.prepareWCTForChild=prepareWCTForChild;this.initOnBrowseSections=_initOnBrowseSections;this.updatePropertyValue=_updatePropertyValue;this.getPropertyValue=_getPropertyValue;this.updateChild=_updateChild;this.processBusinessRule=rts_processBusinessRule;this.fetchEntityRecords=_fetchEntityRecords;this.comboDataLoaded=_comboDataLoaded;var propertyCollection=new Array();function _getObjectDefaultImage(uniqueid,attachments,placeholderSrc){var returnValue=placeholderSrc;if(attachments!=null&&attachments.toLowerCase().indexOf("sysdefaultimage.")>=0){returnValue=attachments.split(";");for(var i=0;i<returnValue.length;i++){if(returnValue[i].toLowerCase().indexOf("sysdefaultimage.")==0){returnValue=top.helperLib.wsfMapPath("$application/attachments/"+uniqueid+"/"+returnValue[i]);break}}}return returnValue}function _fetchEntityRecords(callback,entityName,columnlist,whereClause,pageSize,pageNumber,sort){var me=this;this.cb=callback;if(pageSize!=null){pageSize="<pagesize>"+pageSize+"</pagesize><currentpagesize>"+pageSize+"</currentpagesize>"}else{pageSize=""}if(pageNumber!=null){pageNumber="<currentpage>"+pageNumber+"</currentpage>"}else{pageNumber=""}var tableName=entityName.indexOf("te_")==0?entityName:"te_"+entityName;if(sort!=null){var sortArray=sort.split(",");sort="";for(var i=0;i<sortArray.length;i++){if(sortArray[i].length>0){if(sortArray[i].indexOf(".")==-1){sortArray[i]=tableName+"."+sortArray[i]}sort+="<sortfield sortorder='1' sortmode='asc' >"+sortArray[i]+"</sortfield>"}}sort="<sort>"+sort+"</sort>"}else{sort="<sort><sortfield sortorder='1' sortmode='desc' >"+tableName+".sys_datetimechange</sortfield></sort>"}var sXML="<document><record><tablename>"+tableName+"</tablename><columns>"+columnlist+","+tableName+".UniqueID</columns><def>"+pageSize+pageNumber+"<where>"+(whereClause==null?"":whereClause)+"</where>"+sort+"</def></record></document>";result=top.helperLib.processSoapRequestAsync(window,_callback,top.helperLib.wsfMapPath("/webservices/wf.object/object.asmx"),"wf.object","FetchSearchDetails","sXML","<![CDATA["+sXML+"]]>");function _callback(result){if(result==null){return""}var response=top.XMLLib.getNodeText(result,"//FetchSearchDetailsResult");var re=/%26/g;response=response.replace(re,"&");try{me.cb(response)}catch(e){}me.cb=null}}function _getTopWCT(oWindow){if(oWindow==null){return null}for(var i=0;i<10;i++){if(oWindow.location.href.indexOf("wct.htm")>=0){return oWindow.wct}oWindow=oWindow.parent;if(oWindow==null){return}}}function _getPropertyValue(sPage,objCallBack){if(top.context.cache[sPage]!=null){try{objCallBack(top.context.cache[sPage])}catch(e){}return}sXML="<document><record><objectHeader.objectName>sysProperties</objectHeader.objectName><WF1page>"+sPage+"</WF1page></record></document>";var iIndex=top.helperLib.processSoapRequestAsync(null,_gotSysProperty,wsfMapPath("/webservices/wf.object/businessrules.asmx"),"wf.object","processbusinessrule","sBusinessRuleName","get system property","sXML","<![CDATA["+sXML+"]]>");propertyCollection[iIndex]=new Object();propertyCollection[iIndex].page=sPage;propertyCollection[iIndex].callBack=objCallBack;return iIndex}function rts_processBusinessRule(ruleName,sXML,async,callback){var _callback=callback;if(async==null){async=false}if(async==true){top.helperLib.processSoapRequestAsync(window,processResult,top.helperLib.wsfMapPath("/webservices/wf.object/businessrules.asmx"),"wf.object","processbusinessrule","sBusinessRuleName",ruleName,"sXML","<![CDATA["+sXML+"]]>")}else{var result=top.helperLib.processSoapRequest(null,wsfMapPath("/webservices/wf.object/BusinessRules.asmx"),"wf.object","processbusinessrule","sBusinessRuleName",ruleName,"sXML","<![CDATA["+sXML+"]]>");return processResult(result)}function processResult(response){if(response==null){return""}var sProcessBusinessRuleResult=top.XMLLib.getNodeText(response,"//processbusinessruleResult");var re=/%26/g;sProcessBusinessRuleResult=sProcessBusinessRuleResult.replace(re,"&");if(_callback!=null){_callback(sProcessBusinessRuleResult)}else{return sProcessBusinessRuleResult}}}function _updateChild(scrXML,cb,asynchronous){var cb_updateChild_response=cb;if(asynchronous==null||asynchronous==true){top.helperLib.processSoapRequestAsync(null,_cb_updateChild,wsfMapPath("/webservices/wf.object/object.asmx"),"wf.object","commit","sXML","<![CDATA["+scrXML+"]]>")}else{var result=top.helperLib.processSoapRequest(null,wsfMapPath("/webservices/wf.object/object.asmx"),"wf.object","commit","sXML","<![CDATA["+scrXML+"]]>");_cb_updateChild(result)}function _cb_updateChild(result){var returnValue="";if(result!=null){var sCommitResult=top.XMLLib.getNodeText(result,"//commitResult");if(sCommitResult.indexOf("<objectHeader.Locked>")==0){sCommitResult="<document>"+sCommitResult+"</document>"}var sLocked=top.XMLLib.getNodeText(sCommitResult,"/document/objectHeader.Locked");if(sLocked!=null&&sLocked.length>0){if(confirm('Details are modified by "'+top.XMLLib.getNodeText(sCommitResult,"/document/objectHeader.LockedbyUser")+'" at '+sLocked.split("T")[1]+" on "+sLocked.split("T")[0]+". \nDo you want to overwrite?")==false){return""}var objXML=top.XMLLib.objXMLDocTemplate.cloneNode(true);objXML.async=false;objXML.loadXML(scrXML);try{objXML.selectSingleNode("/document/record/sys_datetimechange").text=top.XMLLib.getNodeText(sCommitResult,"//objectHeader.Locked")}catch(e){}var sReturn=_updateChild(objXML.xml);returnValue=sReturn}else{returnValue=sCommitResult}}try{cb_updateChild_response(returnValue)}catch(e){}}}function _gotSysProperty(result,iIndex){if(result==null){return}var sFunctionResponse=top.XMLLib.getNodeText(result,"//processbusinessruleResult");var objPage=top.context.cache[propertyCollection[iIndex].page];if(objPage==null){objPage=new Object();objPage.personalisationXML=sFunctionResponse;top.context.cache[propertyCollection[iIndex].page]=objPage}try{propertyCollection[iIndex].callBack(objPage)}catch(e){}propertyCollection[iIndex].callBack=null;propertyCollection[iIndex]=null}function _updatePropertyValue(sProperty,sVal,sPage,objWindow,bForceServerUpdate){var sCacheKey=sPage;var objPage=top.context.cache[sCacheKey];if(objPage!=null){var sOldValue=top.XMLLib.getNodeText(objPage.personalisationXML,"//record[P='"+sProperty+"']/V");if(sOldValue==sVal.toString()&&bForceServerUpdate!=true){return}}var sXML="<document><record><objectHeader.objectName>sysProperties</objectHeader.objectName><WF1page>"+sPage+"</WF1page><WF1property>"+sProperty+"</WF1property><WF1val>"+sVal+"</WF1val></record></document>";var result=top.helperLib.processSoapRequestAsync(objWindow,null,wsfMapPath("/webservices/wf.object/businessrules.asmx"),"wf.object","processbusinessrule","sBusinessRuleName","update system property","sXML","<![CDATA["+sXML+"]]>");if(objPage==null){objPage=new Object();top.context.cache[sCacheKey]=objPage;objPage.personalisationXML="<document><record><P>"+sProperty+"</P><V>"+sVal+"</V></record></document>"}else{objPage.personalisationXML=top.XMLLib.setNodeText(objPage.personalisationXML,"//record[P='"+sProperty+"']/V",sVal.toString())}}function _getDirectCombo(objLinkTo,sFieldPrefix,objWindow,objSelectField){var sSelect=_getSourceCombo(objSelectField,false,objWindow);if(objLinkTo.dependency==null){objLinkTo.dependency=""}var sOptions=sSelect;var source=objSelectField.getAttribute("source");if(source.indexOf("businessrule.")!=0){var arrDependencies=objLinkTo.dependency.split(",");var sWhereClause="";for(var j=0;j<arrDependencies.length;j++){var arrLinktoId=arrDependencies[j].split("-");objTemp=objWindow.document.getElementById(sFieldPrefix+arrLinktoId[0]);if(objTemp==null){break}if(arrLinktoId.length==2){sTempLinkto=arrLinktoId[1]}else{sTempLinkto=arrLinktoId[0]}if(sTempLinkto.indexOf(".")>=0){var sTmpValue=sTempLinkto.split(".")[1];sTempLinkto=sTmpValue}sWhereClause+="and @"+sTempLinkto+"='"+objTemp.value+"' "}sWhereClause=sWhereClause.substring(4);var objXML=top.XMLLib.objXMLDocTemplate.cloneNode(true);objXML.loadXML(sSelect);if(sWhereClause!=""){sWhereClause="["+sWhereClause+"]"}var objOptions=objXML.selectNodes("//option"+sWhereClause);for(var i=0;i<objOptions.length;i++){sOptions+=objOptions[i].xml}sOptions="<select>"+sOptions+"</select>"}var evt=new Object();evt.options=sOptions;evt.controlid=objSelectField.id;if(objWindow!=null&&objWindow.runtimeRef!=null){objWindow.runtimeRef.raiseEvent("onbeforecomboreload",evt)}sOptions=evt.options;return sOptions}function _processDynamicList(objWindow,inputCollection,sourceInput,sFieldPrefix,objSource){var objTemp,objInput;var sSourceId=sourceInput.id;if(sFieldPrefix!=""){sSourceId=sSourceId.substring(sFieldPrefix.length)}for(var sID in inputCollection){var input=inputCollection[sID].fieldRef;if(input==null){input=inputCollection[sID].m_element}if(input.getAttribute("type")=="Select"&&input.getAttribute("i_multisel")!="3"){var linkToSettings=new linkObject(input.getAttribute("linkto"));if(linkToSettings.dependency==null){continue}if(linkToSettings.dependency.indexOf(sSourceId)==-1){continue}var sResponse;if(sourceInput.getAttribute("value")==""){sResponse="<select/>"}else{sResponse=_getDirectCombo(linkToSettings,sFieldPrefix,objWindow,input)}input.reload(sResponse);if(objSource!=null){var evt=new Object();evt.controlid=sID;try{objSource.raiseEvent("onaftercomboreload",evt)}catch(e){}}}}}function linkObject(sLink){if(sLink==null||sLink==""||sLink=="null"){return}var arrLinkTo=sLink.split(";");for(var i=0;i<arrLinkTo.length;i++){var arrNameValuePair=arrLinkTo[i].split(":");eval("this."+arrNameValuePair[0].toLowerCase()+" = arrNameValuePair[1]")}if(this.display==null){this.display=this.value}}function _initOnBrowseSections(inputObjects,functionPtr){try{for(var sID in inputObjects){var objField=inputObjects[sID].fieldRef;if(objField==null){objField=inputObjects[sID].m_element}if(objField.getAttribute("type")!="Text"){continue}var fieldSource=objField.getAttribute("source");if(fieldSource!=null&&fieldSource.toLowerCase().indexOf("tapplicationlist.")==0&&(objField._browse==true||objField._browseReadonly==true)){objField.attachEvents("onbrowsenew",functionPtr)}}}catch(e){}}function _initDependentLists(objWindow,inputObjects,functionPtr,sFieldPrefix){var arrInit=new Array();for(var sID in inputObjects){var objField=inputObjects[sID].fieldRef;if(objField==null){objField=inputObjects[sID].m_element}if(objField.getAttribute("type")!="Select"){continue}var objLinkTo=new linkObject(objField.getAttribute("linkto"));if(objLinkTo.dependency==null){continue}var arrLinkTo=objLinkTo.dependency.split(",");for(var j=0;j<arrLinkTo.length;j++){if(arrInit[arrLinkTo[j]]!=null){continue}var arrId=arrLinkTo[j].split("-");var objControl=objWindow.document.getElementById(sFieldPrefix+arrId[0]);if(objControl==null){continue}var sEval="objControl.attachEvents('onchange', functionPtr)";arrInit[arrId[0]]=true;eval(sEval)}}}function _populateCombos(inputCollection,caller){for(var sID in inputCollection){var input=inputCollection[sID].m_element;if(input==null){input=inputCollection[sID].fieldRef}if(input.getAttribute("type")=="Select"&&input.getAttribute("source")!=""&&input.getAttribute("source")!=null&&input.getAttribute("i_multisel")!="3"){if(input.getAttribute("linkto")!=null&&input.getAttribute("linkto").length>0&&input.getAttribute("linkto")!="null"){continue}if(input.getAttribute("source")!=""){_reloadCombo(input,caller)}}}}var comboReloadArray=new Array();function _reloadCombo(input,caller,bForceRefresh){if(bForceRefresh==null){bForceRefresh=false}_getSourceCombo(input,bForceRefresh,caller,true)}function _completeReload(reloadIndex,selectXml){var comboReloadReference=comboReloadArray[reloadIndex];selectXml=selectXml.replace(/&amp;(?=\w*;)/g,"&");var controlid=comboReloadReference.input.getAttribute("colname")||comboReloadReference.input.getAttribute("id");var evt=new Object();evt.options=selectXml;evt.controlid=controlid;try{comboReloadReference.caller.raiseEvent("onbeforecomboreload",evt)}catch(e){}selectXml=evt.options;if(selectXml!=null){if(selectXml.length>0){comboReloadReference.input.reload(selectXml)}}var evt=new Object();evt.controlid=controlid;try{comboReloadReference.caller.raiseEvent("onaftercomboreload",evt)}catch(e){}}function _getSourceCombo(objSourceCombo,bRefresh,caller,reloadSourceCombo){var reloadIndex;if(reloadSourceCombo==true){reloadIndex=comboReloadArray.length;comboReloadArray[reloadIndex]={input:objSourceCombo,caller:caller}}try{var obj;var sSourceComboName=objSourceCombo.source;if(sSourceComboName==null){sSourceComboName=objSourceCombo.getAttribute("source")}var bSecurityFilter=false;try{if(objSourceCombo.getAttribute("sourcefilter")!=null&&objSourceCombo.getAttribute("sourcefilter").length>0){bSecurityFilter=true}}catch(e){}if(sSourceComboName.length==0){return("")}var arrSourceCombo=sSourceComboName.split(".");var comboType=arrSourceCombo[0];var sReturnValue;var sComboData=null;var comboApplicationId=objSourceCombo.applicationid;if(comboApplicationId==null){comboApplicationId=objSourceCombo.getAttribute("applicationid")}if(comboApplicationId==null){comboApplicationId=top.context.session.clientpath}if(comboType=="tcombos"){sComboData=_fetchDataFromComboXml(arrSourceCombo,comboApplicationId,bRefresh,bSecurityFilter,reloadIndex)}else{if(comboType=="businessrule"){var sBRXML="<document><record/></document>";if(caller!=null){if(caller.BRXML){sBRXML=caller.BRXML}}var response=rts_processBusinessRule(arrSourceCombo[arrSourceCombo.length-1],sBRXML);response=cleanSoapResponse(response);if(response.length==null){sComboData=""}else{sComboData=top.XMLLib.transformXML(response,top.context.cache.combosort)}if(reloadIndex!=null){_completeReload(reloadIndex,sComboData)}}}if(reloadIndex==null){sComboData=sComboData.replace(/&amp;(?=\w*;)/g,"&");return sComboData}}catch(e){}}function _fetchDataFromComboXml(arrSourceCombo,comboApplicationId,bRefresh,bSecurityFilter,reloadIndex){var objComboCollectionContext=wflib.context;if(wflib.wct!=null&&wflib.wct.adam!=null){objComboCollectionContext=wflib.wct.adam}var comboXml;var key=comboApplicationId+"/"+arrSourceCombo[arrSourceCombo.length-1];if(objComboCollectionContext!=null){if(objComboCollectionContext.combos.combo[key]!=null&&bRefresh==false&&bSecurityFilter==false){comboXml=objComboCollectionContext.combos.combo[key]}}if(comboXml==null){var sComboLocation=wsfMapPath("/mc/em/application/"+comboApplicationId+"/"+arrSourceCombo[0]+"/"+arrSourceCombo[1]+".xml");if(arrSourceCombo[1].indexOf("/")==0){sComboLocation=arrSourceCombo[1]+".xml"}else{if(arrSourceCombo[1]=="designercombo"){sComboLocation="/wsfdesigner/SolutionExplorer/Combos/"+arrSourceCombo[2]+".xml"}}var comboVirtualLocation=sComboLocation;try{sComboLocation=wflib.helperLib.wsfMapPath(sComboLocation);var objSourceFileContent=wflib.XMLLib.objXMLDocTemplate.cloneNode(true);objSourceFileContent.async=false;objSourceFileContent.load(sComboLocation);comboXml=objSourceFileContent.xml}catch(e){var url=wflib.helperLib.wsfMapPath("/webservices/wf.handlers/javascript.ashx?service=getfile&appid="+comboApplicationId+"&wfs=1&mode=xml&xmlfilename="+comboVirtualLocation+'&callback=wflib.EMLib.comboDataLoaded&callbackparam=({"securityFilter":false,"sort":false,"reloadIndex":'+reloadIndex+"})");wflib.DHTMLLib.addScript(window,url);return}}if(reloadIndex!=null){comboReloadArray[reloadIndex].context=objComboCollectionContext;comboReloadArray[reloadIndex].comboKey=key;_comboDataLoaded(comboXml,{securityFilter:false,sort:true,reloadIndex:reloadIndex})}else{return comboXml}}function _comboDataLoaded(xml,param){if(typeof(param)=="string"){param=eval(param)}var comboXmlDocument=wflib.XMLLib.objXMLDocTemplate.cloneNode(true);comboXmlDocument.loadXML(xml);if(param.securityFilter==true){var objOptions=comboXmlDocument.selectNodes("/select/option");for(var i=0;i<objOptions.length;i++){if(objOptions[i].getAttribute("folderid")!=null&&objOptions[i].getAttribute("folderid")!=wflib.context.session.locationid){var objSelect=objOptions[i].parentNode;objSelect.removeChild(objOptions[i])}}}var comboData=comboXmlDocument.xml;if(param.sort==true){if(comboData!=null&&comboData.length>0){reloadElement=comboReloadArray[param.reloadIndex];if(reloadElement.context!=null){comboData=wflib.XMLLib.transformXML(comboData,wflib.context.cache.combosort);reloadElement.context.combos.add(reloadElement.comboKey,comboData)}}}_completeReload(param.reloadIndex,comboData)}function cleanSoapResponse(responseXml){var re=/&apos;/g;responseXml=responseXml.replace(re,"'");re=/%26/g;responseXml=responseXml.replace(re,"&");return responseXml}var m_arrObjectInstanceCallHandle=new Array();function loadObjectInstanceFromXml(xml,wct){var sResponse="<document>"+cleanSoapResponse(xml)+"</document>";var sTransResp=top.XMLLib.transformXML(sResponse,top.context.cache.RuntimeXSLForES);if(wct==null){wct=m_arrObjectInstanceCallHandle[callHandle].wct}wct.objectInstance.XMLRecord=sTransResp;if(sTransResp!=""){wct.objectInstance.record.mergedeserialise(sTransResp)}}function loadObjectInstanceAsync(result,callHandle,objWCT){var sResponse=top.XMLLib.getNodeText(result,"//GetObjectRecordResult");loadObjectInstanceFromXml(sResponse,objWCT);if(callHandle!=null){m_arrObjectInstanceCallHandle[callHandle].fnRef();m_arrObjectInstanceCallHandle[callHandle].wct=null;m_arrObjectInstanceCallHandle[callHandle].fnRef=null;m_arrObjectInstanceCallHandle[callHandle]=null}}function loadObjectInstance(objWCT,asyncCallBack){loadObjectHeader(objWCT);objWCT.objectInstance.record.objectHeader_UniqueID=objWCT.objectUniqueId;if(asyncCallBack==null){result=top.helperLib.processSoapRequest(objWCT.eventWindow,wsfMapPath("/webservices/wf.object/object.asmx"),"wf.object","GetObjectRecord","sXML","<![CDATA["+objWCT.objectInstance.record.serialise()+"]]>");loadObjectInstanceAsync(result,null,objWCT)}else{callHandle=top.helperLib.processSoapRequestAsync(objWCT.eventWindow,loadObjectInstanceAsync,wsfMapPath("/webservices/wf.object/object.asmx"),"wf.object","GetObjectRecord","sXML","<![CDATA["+objWCT.objectInstance.record.serialise()+"]]>");m_arrObjectInstanceCallHandle[callHandle]=new Object();m_arrObjectInstanceCallHandle[callHandle].wct=objWCT;m_arrObjectInstanceCallHandle[callHandle].fnRef=asyncCallBack}}function valueObject(useValueOf){var arrUseValueof=useValueOf.split(",");this.brokerId=arrUseValueof[0];this.searchTemplateName=arrUseValueof[1];this.objectName=arrUseValueof[2];this.foreignKey=arrUseValueof[3]}function _getLookupResult(useValueOf){var values=new valueObject(useValueOf);var objWct=new clsWCT();objWct.LRBrokerId=values.brokerId;objWct.LRSearchName=values.searchTemplateName;objWct.LRMode="popup";objWct.LRName=values.objectName;var objWindowArgs=new Object();var height=(document.body.offsetHeight/100)*98;var width=(document.body.offsetWidth/100)*60;objWindowArgs.dialogArgs="dialogWidth:"+width+"px;dialogHeight"+height+"px;border:1;help:no;status:no;resizable:yes;";var returnVal=openObject(objWct,objWindowArgs);return returnVal}function _isPluginActive(applicationID){var sXML=top.context.cache.SYSTBroker.xml;sXML=sXML.toLowerCase();return top.XMLLib.getNodeXML(sXML,"//record[applicationid = '"+applicationID.toLowerCase()+"']/applicationid").length>0}function GetApplicationID(sBrokerID,bObjectName){var sReturnValue=context.session.applicationid;var sXML=top.context.cache.SYSTBroker.xml;sXML=sXML.toLowerCase();var oNodeXML=top.XMLLib.getNodeXML(sXML,"//record[brokerid='"+sBrokerID.toLowerCase()+"' or objectname='"+sBrokerID.toLowerCase()+"' or objectshortname = '"+sBrokerID.toLowerCase()+"']");var sApplicationId=top.XMLLib.getNodeText(oNodeXML,"//applicationid");if(sApplicationId.length>0){sReturnValue=sApplicationId}if(bObjectName){sReturnValue+="#"+top.XMLLib.getNodeText(oNodeXML,"//objectname")}return sReturnValue}function resetWindowRef(objWindow){objWin=objWindow}var formArray=new Array();function openForm(windowReference,formPath,objectBrokerId,IframeNameReference,styleSheet){if(formPath){formArray[objectBrokerId]={};formArray[objectBrokerId].brokerId=objectBrokerId;formArray[objectBrokerId].windowReference=windowReference;formArray[objectBrokerId].formPath=formPath;formArray[objectBrokerId].IframeNameReference=IframeNameReference;formArray[objectBrokerId].styleSheet=styleSheet}if(!(top.context&&top.context.readyForForms())){top.context.formsInit();var evalText="setTimeout(function(){top.EMLib.openForm(null,null,'"+objectBrokerId+"',null);},100)";eval(evalText);return}var formSettings=formArray[objectBrokerId];var objWindowArgs={};objWindowArgs.targetObject=formSettings.IframeNameReference;objWindowArgs.target=objWindowArgs.targetObject.contentWindow;var wct=new clsWCT();wct.brokerid=formSettings.brokerId;wct.styleSheet=formSettings.styleSheet;wct.showDisplayBar=false;wct.bfu=top.helperLib.wsfMapPath(formSettings.formPath);openObject(wct,objWindowArgs)}function openObject(objWCT,objWindowArgs,mode,allowtransparency){if(mode==null){mode="popup"}objWCT.adam=top.context;if(objWCT.adam==null){try{objWCT.adam=top.wct.adam}catch(e){}}if(objWindowArgs!=null){objWCT.parentWCT=_getTopWCT(objWindowArgs.windowObject)}if(objWCT.parentWCT==null){objWCT.parentWCT=top.wct}if(objWCT.parentWCT!=null){prepareWCTForChild(objWCT,objWCT.parentWCT)}if(mode=="popup"){return showObject(objWCT,objWindowArgs,allowtransparency)}else{if(objWindowArgs==null){objWindowArgs={}}objWindowArgs.target=objWCT.parentWCT.objectWindow.parent;objWindowArgs.targetObject=objWindowArgs.target;return showObject(objWCT,objWindowArgs)}}function showObject(objWCT,objWindowArgs,allowtransparency){var objWindow=top.window;var bodyHeight=top.DHTMLLib.getStyleProp(top.document.body,"marginTop");bodyHeight=parseInt(bodyHeight)+top.document.body.offsetHeight;var sDefaultHeight=(bodyHeight/100)*95;var sDefaultWidth=parseInt((document.body.offsetWidth/100)*95);var defaultLeft=(document.body.offsetWidth-sDefaultWidth)/2;var defaultTop=(bodyHeight-sDefaultHeight)/2;var sDialogArgs=";height:"+sDefaultHeight+"px;width:"+sDefaultWidth+"px;";if(objWindowArgs!=null){if(objWindowArgs.windowObject!=null){objWindow=objWindowArgs.windowObject}if(objWindowArgs.dialogArgs!=null){sDialogArgs=objWindowArgs.dialogArgs.toLowerCase().replace("dialogheight","height").replace("dialogwidth","width")}}if(objWCT.objectWindow!=null){objWindow=objWCT.objectWindow}if(objWindowArgs!=null&&objWindowArgs.target!=null){try{top.lastBack++;top.backArray[top.lastBack]=objWCT}catch(e){}top.helperLib.attachEvents(objWindowArgs.targetObject,objWindowArgs.targetObject,"onload",showWCT);objWindowArgs.target.location="about:blank";objWindowArgs.targetObject.wct=objWCT;top.holdingWCT=objWCT;top.holdingWCT.targetObject=objWindowArgs.targetObject;top.holdingWCT.target=objWindowArgs.target;showWCT()}else{objWCT.showMode="popup";if(allowtransparency==null){allowtransparency="blacktransparency"}var dialog=top.DHTMLLib.showCustomDialog(top,sDialogArgs,null,allowtransparency,true);dialog.dialogArguments=objWCT;dialog.container.innerHTML="<iframe src='"+wsfMapPath("/widgets/runtime/htc/wct.htm")+"' style='"+sDialogArgs+";border:0px' frameborder='0' allowtransparency = 'true'></iframe>";dialog.callBackRef=_cb_openObject;dialog.callBackArguments=objWCT}}function _cb_openObject(returnValue,wct){try{wct.callBack(returnValue)}catch(e){}}function showWCT(evt){if(top.holdingWCT==null){return}objUnknown=top.holdingWCT.target;if(evt==null){evt=objUnknown.event}if((objUnknown.document.readyState&&objUnknown.document.readyState!="complete")||(evt&&!objUnknown.document.readyState&&evt.type!="load")){return}if(objUnknown.location.href.indexOf("wct.htm")>=0){top.helperLib.detachEvents(objUnknown,objUnknown,"onload",showWCT);top.helperLib.hideLoading(top.holdingWCT.target.parent)}else{objUnknown.location=wsfMapPath("/widgets/runtime/htc/wct.htm");if(window.addEventListener){top.helperLib.hideLoading(top.holdingWCT.target.parent)}objUnknown=null}}function initWindow(){try{if(top.wct.eventWindow!=null){objWin=top.wct.eventWindow}if(objWin==null){objWin=top.frames.wctFrame}if(objWin==null){objWin=window.frames.wctFrame}if(objWin==null){objWin=window.frames.em_objectFrame.frames.wctFrame}}catch(e){}}function escapeSpecialChars(value){sValue=""+value;var re=/</g;sValue=sValue.replace(re,"%26lt;");var re=/>/g;sValue=sValue.replace(re,"%26gt;");re=/&/g;sValue=sValue.replace(re,"%26");if(sValue.indexOf("<")>=0&&sValue.indexOf("<![CDATA[")!=0){sValue="&lt;![CDATA["+sValue+"]]&gt;"}else{if(sValue.indexOf("<![CDATA[")==0){sValue=sValue.replace("<![CDATA[","&lt;![CDATA[");sValue=sValue.replace("]]>","]]&gt;")}}return sValue}function _returnObjectStatusFromPermissions(sStatus,sObjectId,sObjectLocationId){var canProgress;var returnValue="C";if(top.session!=null){canProgress=top.XMLLib.getNodeText(top.context.session.sessionXML.xml.toLowerCase(),"//record[id='"+sObjectId+"' and type='object' and wffolderid='"+sObjectLocationId+"' and canprogress = 1]/canprogress");if(sStatus=="O"&&canProgress=="1"){returnValue="O"}else{returnValue="C"}}return returnValue}function _getBrokerIdFromBfu(wct){try{if(wct.bfu==null){return""}var sXML=top.context.cache.SYSTBroker.xml;sXML=sXML.toLowerCase();sName=_getObjectNameFromBfu(wct);var sBrokerID=top.XMLLib.getNodeText(sXML,"//record[name='"+sName+"']/brokerid");return sBrokerID}catch(e){return null}}function _getObjectNameFromBfu(wct){var sBFU=wct.bfu.toLowerCase();var sName=sBFU.split("/");sName=sName[sName.length-1].split(".")[0];if(sName.indexOf("_edit_")>=0){sName=sName.substring(0,sName.indexOf("_edit_"))}return sName}function _getObjectDefFromBrokerId(sBrokerID){sApplicationFolder=GetApplicationID(sBrokerID);return wsfMapPath("/mc/em/"+top.context.session.languageFolder+"Application/"+sApplicationFolder+"/objects/release/"+sBrokerID+"_def.xml")}function wsfMapPath(sURL){return wflib.helperLib.wsfMapPath(sURL)}function _getObjectBFU(sObjectName,templateName){if(!templateName){templateName=""}else{templateName="_edit_"+templateName}var appInfo=GetApplicationID(sObjectName,true);appInfo=appInfo.split("#");sURL=wsfMapPath("/mc/em/"+top.context.session.languageFolder+"application/"+appInfo[0]+"/objects/release/"+appInfo[1]+templateName+".html");return sURL}function clsWCT(){var objChildContexts=new Array();this.ObjectLookupDetails=null;this.objectsCreated=new clsObjectsCreated();this.plugin=null;this.LRBrokerId=null;this.LRSearchName=null;this.LRName=null;this.LRMode=null;this.objectStatus=null;this.objectUniqueId=null;this.bfu=null;this.firstPage=null;this.adam=null;this.objectWindow=null;this.parentWCT=null;this.objectInstance=new clsObject();this.spaces=null;this.attachment=null;this.helptext=null;this.showDisplayBar=true;this.childBFU=null;this.runtimeHelper=null;this.cancelCommit=false}function clsObject(){var meObject=this;this.resetRecord=false;this.reinit=_reinit;this.record=new clsObjectRecord();this.XMLRecord=null;function _reinit(){meObject.record=new clsObjectRecord()}}function clsObjectRecord(){var me=this;this.objectHeader_UniqueID="";this.objectHeader_Status="";this.parentserialisecode="";this.parents={};this.childSerialiseText="";this.serialisetext="";this.getDataType=getDataType;this.addAttribute=_addattribute;this.deserialise=_deserialise;this.mergedeserialise=_mergedeserialise;this.serialise=_serialise;this.appendChildRecord=_appendchildrecord;this.dispose=_dispose();var eventHandler=new top.helperLib.clsEventHandler();this.attachEvents=eventHandler.attachEvent;this.detachEvents=eventHandler.attachEvent;this.raiseEvent=eventHandler.raiseEvent;function _dispose(){try{eventHandler.dispose()}catch(e){}me.attachEvents=null;me.detachEvents=null;me.raiseEvent=null}function _appendchildrecord(sXML){appendChildObjectRecord(me,sXML)}function _mergedeserialise(sXML){objectMergeDeserialise(sXML,me)}function _deserialise(sXML){objectDeserialise(sXML,me)}function _addattribute(sAttributeName,sAttributeValue){var sAttributeExists=eval("me."+sAttributeName.replace(".","_")+"!=undefined");eval("me."+sAttributeName.replace(".","_")+"=sAttributeValue");if(!sAttributeExists){eval("me.serialisetext+=\"'<"+sAttributeName+">' + escapeSpecialChars(me."+sAttributeName.replace(".","_")+") + '</"+sAttributeName+">' + \"")}var evt=new Object();evt.attributeName=sAttributeName;evt.attributeValue=sAttributeValue;me.raiseEvent("onafteraddatribute",evt)}function _serialise(){var parentDocument=objectSerialise(me);if(parentDocument.length>0){parentDocument="'<Parents>"+parentDocument+"</Parents>'+"}var childrenXml="";if(me.childSerialiseText!=""&&me.childSerialiseText!=null){childrenXml="<Children>"+me.childSerialiseText+"</Children>"}var evalText="'<document><record>'+"+me.serialisetext+parentDocument+"'"+childrenXml+"</record></document>'";return eval(evalText)}function getDataType(oWindow,sFieldName){var sReturnValue="unknown";var objEditMeta=oWindow.document.getElementById("EditMeta");var objNode=objEditMeta.selectSingleNode("//fields/*[@id='"+sFieldName+"']");if(objNode!=null){sReturnValue=objNode.nodeName}return sReturnValue}}function appendChildObjectRecord(record,sObjectSerialised){record.childSerialiseText+=top.XMLLib.getNodeXML(sObjectSerialised,"/document/record")}function objectSerialise(record){try{var parentSerialiseText="";for(var sKey in record.parents){parentSerialiseText+=record.parents[sKey].serialise()}return parentSerialiseText}catch(e){alert("objectSerialise:"+e.description)}}function getParent(sName,objectRecord){if(objectRecord.objectHeader_objectName!=null){var objectName=objectRecord.objectHeader_objectName.toLowerCase();if(objectName==sName.toLowerCase()||"te_"+objectName==sName.toLowerCase()){return objectRecord}}var oParent=eval("objectRecord."+sName);if(oParent==null){eval("objectRecord."+sName+"= new clsObjectRecord()");oParent=eval("objectRecord."+sName);oParent.serialisetext="'<objectHeader.UniqueID>' + this.objectHeader_UniqueID + '</objectHeader.UniqueID>'+";var sParentUniqueID=eval("objectRecord.FK_"+sName);if(sParentUniqueID!=null&&sParentUniqueID.length>0){oParent.objectHeader_UniqueID=sParentUniqueID}objectRecord.parents[sName]=oParent}return oParent}function objectMergeDeserialise(scrXML,record){var objParent;scrXML=replaceLineBreaks(scrXML);var sFunctionScript=top.XMLLib.transformXML(scrXML,top.context.cache.objectDeserialise,"merge");sFunctionScript=replaceScript(sFunctionScript);sFunctionScript=replaceLineBreaks(sFunctionScript);try{eval(sFunctionScript)}catch(e){alert("objectMergeDeserialise"+e.message+"\n"+sFunctionScript);clipboardData.setData("text",sFunctionScript)}}function replaceScript(sScript){var re=/\\/g;sScript=sScript.replace(re,"\\\\");re=/"/g;sScript=sScript.replace(re,'\\"');re=/<quot>/g;sScript=sScript.replace(re,'"');return sScript}function replaceLineBreaks(text){re=/\r\n/g;text=text.replace(re,"&#13;");re=/\n/g;text=text.replace(re,"&#13;");re=/^[&#13;]*/g;text=text.replace(re,"");re=/[&#13;]*$/g;text=text.replace(re,"");return text}function objectDeserialise(scrXML,record){var objParent;record.serialisetext+="'<objectHeader.UniqueID>' + this.objectHeader_UniqueID + '</objectHeader.UniqueID>'+";record.serialisetext+="'<objectHeader.Status>' + this.objectHeader_Status + '</objectHeader.Status>'+";scrXML=replaceLineBreaks(scrXML);if(scrXML.length==0){return}var sFunctionScript=top.XMLLib.transformXML(scrXML,top.context.cache.objectDeserialise);sFunctionScript=replaceScript(sFunctionScript);sFunctionScript=replaceLineBreaks(sFunctionScript);try{eval(sFunctionScript)}catch(e){alert("objectDeserialise - "+e.message+"\n"+sFunctionScript);clipboardData.setData("text",sFunctionScript)}}function deserialise(sCurrentXML,sXPATH,objDeserialise){if(objDeserialise==null){objDeserialise=new clsDeserialise()}objDeserialise.serialisetext="";if(sCurrentXML==null||sCurrentXML.length==0){return objDeserialise}var objCurrentXML=top.XMLLib.objXMLDocTemplate.cloneNode(true);objCurrentXML.loadXML(sCurrentXML);if(objCurrentXML.xml.length==0){return objDeserialise}var objChildNode=objCurrentXML.selectSingleNode(sXPATH).firstChild;var sNodeName;while(objChildNode!=null){if(objChildNode.nodeType==1){sNodeName=objChildNode.nodeName;sNodeName=sNodeName.replace(".","_");objDeserialise.addAttribute(sNodeName,objChildNode.text)}objChildNode=objChildNode.nextSibling}return objDeserialise}function clsDeserialise(){var meDeserialise=this;this.serialisetext="";this.serialise=_serialise;this.internalSerialise=_internalserialise;this.addAttribute=_addattribute;function _addattribute(sAttributeName,sAttributeValue){var objValue=eval("this."+sAttributeName);if(objValue==null){eval("this."+sAttributeName+"=sAttributeValue;this.serialisetext += '<"+sAttributeName+'>" + escapeSpecialChars(this.'+sAttributeName+') + "</'+sAttributeName+">'")}else{eval("this."+sAttributeName+"=sAttributeValue")}}function _internalserialise(){return eval('"'+meDeserialise.serialisetext+'"')}function _serialise(){return eval('"'+meDeserialise.serialisetext+'"')}}function clsObjectRules(){this.preSave=null;this.postSave=null;this.preClose=null;this.postClose=null;this.printedOutput=false;this.attachmentEnabled=false;this.runtimehelperEnabled=false}function clsObjectsCreated(){var meObjectsCreated=this;this.items=new Array();this.count=0;this.add=_add;function _add(sNewObject){meObjectsCreated.items[meObjectsCreated.items.length]=sNewObject;meObjectsCreated.count++}}function clsCombos(){var meCombos=this;this.combo=new Array();this.add=_add;function _add(sNewComboName,sNewComboXML){meCombos.combo[sNewComboName]=sNewComboXML}}function clsMainContext(){var meMainContext=this;this.window=top;try{this.cacheUtil=new top.clscacheLib(meMainContext.window)}catch(e){}this.session=null;this.combos=new clsCombos();this.cache=new Array();this.reinitWCT=_reinitwct;this.lastELQueryTimeStamp="";this.wct=null;this.intervalHandle;this.plugin=null;this.applicationpopup=null;this.initSession=initSession;this.closeWindow=_closewindow;this.objInterfaceBase=null;this.firstMenuTitle=null;this.currentDate=getCurrentDate;this.currentTime=getCurrentTime;this.enviroment=new Array();this.addXMLToCache=_addXMLToCache;this.runtimeInit=_runtimeInit;this.formsInit=_formsInit;this.readyForForms=_readyForForms;var formInitialiseActivated=false;var runtimeInitialseActivated=false;function _readyForForms(){if(!top.context.cache.objectDeserialise){return false}if(!top.context.cache.combosort){return false}if(!top.context.cache.RT_SchemaTransformation){return false}if(!top.context.cache.RuntimeXSLForES){return false}if(!top.context.cache.SYSTBroker){return false}return true}function _runtimeInit(){if(runtimeInitialseActivated){return}runtimeInitialseActivated=true;var objSolutionXML=top.XMLLib.objXMLDocTemplate.cloneNode(true);objSolutionXML.async=false;objSolutionXML.load(wsfMapPath("$application/xml/solution.xml"));top.context.session.application=new clsSolutionDeserialise();top.context.session.application.deserialise(objSolutionXML.xml);top.context.session.languageFolder="";_formsInit()}function _formsInit(){if(formInitialiseActivated){return}formInitialiseActivated=true;try{initialiseXSL();initialiseDBData()}catch(e){}}function _addXMLToCache(objQueue,iCacheIndex){meMainContext.cache[objQueue.tagVariant]=objQueue.queue[0].XMLObject}function _initialisedXSL(xmlDocument){var xmlRecords=xmlDocument.selectNodes("/document/record");for(var i=0;i<xmlRecords.length;i++){var id=xmlRecords[i].getAttribute("id");var objXSL=top.XMLLib.objXSLDocTemplate.cloneNode(true);objXSL.loadXML(top.XMLLib.getNodeFirstChild(xmlRecords[i]).xml);meMainContext.cache[id]=objXSL}}function initialiseXSL(){var xmlDocument=top.XMLLib.objXMLDocTemplate.cloneNode(true);xmlDocument.async=false;xmlDocument.load(wsfMapPath("/widgets/runtime/xsl/runtimexsl.xml"));top.XMLLib.loadXSL(wsfMapPath("/widgets/runtime/xsl/readonlyTransform.xsl"),"readonlyTransformXML");top.XMLLib.loadXSL(wsfMapPath("/widgets/grid/xsl/griddata.xsl"),"wolf_griddata");_initialisedXSL(xmlDocument)}function _closewindow(){window.close()}function _reinitwct(){meMainContext.wct=new clsWCT()}function getCurrentDate(){var dt=new Date();return dt.getDate()+"/"+parseInt(dt.getMonth()+1)+"/"+dt.getFullYear()}function getCurrentTime(){var dt=new Date();return dt.getHours()+":"+dt.getMinutes()}function initSession(objsessionState){top.session=objsessionState;meMainContext.session=new clsSession(objsessionState)}}function clsObjectLookup(){var objObjectLookup=new Array();this.Add=addValues;this.ObjectLookValues=objObjectLookup;function addValues(newName,newValue){objObjectLookup[newName]=newValue}this.dispose=_dispose;function _dispose(){try{disposeObject(objObjectLookup)}catch(e){}}}function clsSession(oSessionXML){var me=this;this.sessionXML=oSessionXML;this.userid=top.XMLLib.getNodeText(oSessionXML,"/record/UniqueID");this.defaultfolderid=top.XMLLib.getNodeText(oSessionXML,"/record/WFfolderid");this.defaultfoldername=top.XMLLib.getNodeText(oSessionXML,"/record/WFdefaultfolder");this.applicationid=top.XMLLib.getNodeText(oSessionXML,"/record/applicationID");this.sessionid=top.XMLLib.getNodeText(oSessionXML,"/record/sessionID");this.username=top.XMLLib.getNodeText(oSessionXML,"/record/UserName");this.dateformat=top.XMLLib.getNodeText(oSessionXML,"/record/DateFormat");this.clientid=top.XMLLib.getNodeText(oSessionXML,"/record/ClientID");this.designer=top.XMLLib.getNodeText(oSessionXML,"/record/WFdesigner")=="1";var sClientPath=top.XMLLib.getNodeText(oSessionXML,"/record/applicationID");if(me.clientid!=""){sClientPath+="/clients/"+me.clientid}this.loginid=top.XMLLib.getNodeText(oSessionXML,"/record/loginId");this.clientpath=top.XMLLib.getNodeText(oSessionXML,"/record/ClientPath");this.useruid=top.XMLLib.getNodeText(oSessionXML,"/record/WFuserObjectmappingid");this.usermapname=top.XMLLib.getNodeText(oSessionXML,"/record/WFuserObjectmappingdisplayname");this.departmentid=top.XMLLib.getNodeText(oSessionXML,"/record/DepartmentID");this.languageFolder="";this.personalisation=new clsPersonalisationDeserialise();var sXML=top.XMLLib.getNodeXML(oSessionXML,"/record/SettingsXML");var re=/&lt;/g;sXML=sXML.replace(re,"<");re=/&gt;/g;sXML=sXML.replace(re,">");sXML=top.XMLLib.getNodeXML(sXML,"/record/SettingsXML/document");this.personalisation.deserialise(top.helperLib.HTMLDecode(sXML),false)}var g_parent=function(type){var p=new Object();for(x in type.prototype){if(x!="parent"){p[x.toString()]=this[x.toString()]}}return p};clsSolutionDeserialise.prototype=new clsDeserialise;function clsSolutionDeserialise(){var me=this;clsDeserialise.call(this,me);var parent=g_parent(clsDeserialise);this.deserialise=function(sSettingsXML){deserialise(sSettingsXML,"//document/record",me)};this.serialise=function(iDefaultPageSize){me.iPageSize=iDefaultPageSize;me.iEndRowID=iDefaultPageSize;return me.internalSerialise()}}clsPersonalisationDeserialise.prototype=new clsDeserialise;function clsPersonalisationDeserialise(){var me=this;clsDeserialise.call(this,me);var parent=g_parent(clsPersonalisationDeserialise);this.deserialise=function(sSettingsXML,bInit){deserialise(sSettingsXML,"/document",me);me.sDateFrom="";me.sDateTo=""};this.serialise=function(iDefaultPageSize){me.iPageSize=iDefaultPageSize;me.iEndRowID=iDefaultPageSize;return me.internalSerialise()}}function login(sUserName,sPassword,sApp){initialiseContext();var result=top.helperLib.processSoapRequest(null,wsfMapPath("/webservices/wf.session/session.asmx"),"wf.Session","GetUserProfile","sLogin",sUserName,"sPassword",sPassword,"sApplicationID",sApp);if(result==null){return}var sFunctionResponse=top.XMLLib.getNodeText(result,"//GetUserProfileResult");sFunctionResponse=sFunctionResponse.replace(/%26/g,"&amp;");if(sFunctionResponse==""){return}sFunctionResponse=sFunctionResponse.replace("<record>","<record><applicationname>"+sApp+"</applicationname>");sFunctionResponse=sFunctionResponse.replace("<record>","<record><loginId>"+sUserName+"</loginId>");var objsessionState=top.XMLLib.objXMLDocTemplate.cloneNode(true);sFunctionResponse=sFunctionResponse.replace(/WFfirstname>/g,"UserName>");sFunctionResponse=sFunctionResponse.replace(/WFdefaultlocation>/g,"LocationName>");sFunctionResponse=sFunctionResponse.replace(/UniqueID>/g,"UserID>");objsessionState.loadXML(sFunctionResponse);top.context.initSession(objsessionState);if(top.context.plugin!=null){setTimeout(function(){top.context.plugin.initialise()},1000)}initialiseDBData()}function initialiseDBData(){if(top.context.cache.SYSTBroker!=null){return}var result=top.helperLib.processSoapRequest(null,wsfMapPath("/webservices/wf.object/object.asmx"),"wf.object","GetBrokerDetails","sXML","<![CDATA[<document><record><tablename>tBroker</tablename><BrokerID ></BrokerID><def><fields><IsFinancialEnabled/><AuthorityTopLevel/></fields></def></record></document>]]>");var sResponse="";if(result==null){return}sResponse=top.XMLLib.getNodeText(result,"//GetBrokerDetailsResult");if(sResponse!=""){top.context.cache.SYSTBroker=top.XMLLib.objXMLDocTemplate.cloneNode(true);top.context.cache.SYSTBroker.loadXML(sResponse)}}function _sessionExpired(){alert("Your Session has expired. Please login again.");doLogin()}function doLogin(pluginObject,callBackRef){if(bDologinActive==true){return}bDologinActive=true;initialiseContext(pluginObject);top.helperLib.processSoapRequestAsync(window,_cb_doLogin,wsfMapPath("/webservices/wf.session/session.asmx"),"wf.Session","IsActiveSession");function _cb_doLogin(result){var sFunctionResponse=top.XMLLib.getNodeText(result,"//IsActiveSessionResult");var userIsAuthenticated=(sFunctionResponse.toLowerCase()=="true");if(!userIsAuthenticated){var currentWindow=objWin;if(currentWindow==null){currentWindow=window}var sLoginPage=wsfMapPath("/mc/login.html");var iWidth=350;var iHeight=400;if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("MSIE 6.0")>0){iHeight+=52}var iLeft=(window.screen.availWidth-iWidth)/2;var iTop=(window.screen.availHeight-iHeight)/2;var dialog=top.DHTMLLib.showCustomDialog(top,"height:"+iHeight+"px;width:"+iWidth+"px;");dialog.dialogArguments=top;dialog.container.innerHTML="<iframe src='"+sLoginPage+"' style='height:"+iHeight+"px;width:"+iWidth+"px;border:0px' frameborder='0' allowtransparency = 'true'></iframe>";dialog.callBackRef=_doLoginCallBack;dialog.callBackArguments=callBackRef}else{return _doLoginCallBack(true,callBackRef)}}}function _doLoginCallBack(returnValue,args){if(returnValue==null){top.location=wsfMapPath("/mc/blanklogin.htm");return;top.context=null}else{readUserProfile();bDologinActive=false}if(args){args(returnValue)}return returnValue}function initialiseContext(pluginObject){if(top.context==null){var objTemp=top.document.body.appendChild(top.document.createElement("script"));objTemp.language="javascript";objTemp.type="text/javascript";objTemp.text="var session;var context";top.context=new clsMainContext();top.context.appId=top.appId;top.context.loginPage=top.loginPage;if(pluginObject!=null){top.context.plugin=pluginObject}}}function readUserProfile(userName,password,applicationId){if(top.context==null){initialiseContext()}if(top.context.session==null){var result,sFunctionResponse;if(userName){result=top.helperLib.processSoapRequest(window,wsfMapPath("/webservices/wf.session/session.asmx"),"wf.Session","GetUserProfile","sLogin",userName,"sPassword",password,"sApplicationID",applicationId);if(result==null){return}sFunctionResponse=top.XMLLib.getNodeText(result,"//GetUserProfileResult")}else{result=top.helperLib.processSoapRequest(window,wsfMapPath("/webservices/wf.session/session.asmx"),"wf.Session","GetSessionXML");sFunctionResponse=top.XMLLib.getNodeText(result,"//GetSessionXMLResult")}sFunctionResponse=sFunctionResponse.replace(/%26/g,"&amp;");var sessionState=top.XMLLib.objXMLDocTemplate.cloneNode(true);sessionState.loadXML(sFunctionResponse);top.context.initSession(sessionState)}if(top.context.cache.objErrLogLangXML==null&&top.context.session.languageFolder!=""){var sErrLogXMLPath=wsfMapPath("/mc/"+top.context.session.languageFolder+"application/"+top.context.session.applicationid+"/ErrLog_Localiser.xml")}}function prepareWCTForChild(objWCT,topWCT){try{if(topWCT.objectInstance!=null&&(topWCT.objectInstance.record.objectHeader_UniqueID!=null&&topWCT.objectInstance.record.objectHeader_UniqueID!="")){objWCT.objectInstance.record.addAttribute("FK_"+topWCT.objectInstance.record.objectHeader_objectName,topWCT.objectInstance.record.objectHeader_UniqueID)}}catch(e){}}function loadObjectHeader(objWCT){if(objWCT.brokerid==null){objWCT.brokerid=_getBrokerIdFromBfu(objWCT)}if(objWCT.brokerid==null||objWCT.brokerid.length==0){return}var sObjectDef=_getObjectDefFromBrokerId(objWCT.brokerid);var sFunctionResponse=top.context.cache["objectHeader_"+objWCT.brokerid];if(sFunctionResponse==null||sFunctionResponse.length==0){var result=top.helperLib.processSoapRequest(objWCT.eventWindow,wsfMapPath("/webservices/wf.object/utilityprocessor.asmx"),"wf.object","XmlTransform","sXML","<![CDATA[<document><record><path>"+sObjectDef+"</path><xsl>"+wsfMapPath("/widgets/runtime/xsl/objectHeader.xsl")+"</xsl></record></document>]]>");sFunctionResponse=top.XMLLib.getNodeText(result,"//XmlTransformResult");top.context.cache["objectHeader_"+objWCT.brokerid]=sFunctionResponse}objWCT.objectInstance.record.deserialise(sFunctionResponse)}function getEnvironData(sEnvironSetting,objWCT){var sEnValue="",sEnvironBrkr,sEnvironFldname,sDefXML,sDefXMLPath;if(sEnvironSetting.indexOf("environ:")==0){sEnvironBrkr=sEnvironSetting.split(":")[1];sEnvironFldname=sEnvironSetting.split(":")[2];sDefXMLPath=_getObjectDefFromBrokerId(sEnvironBrkr);if(top.context.enviroment[sEnvironBrkr]!=null){var sDefXML=top.context.cache["objectDef_"+sEnvironBrkr];if(sDefXML==null){var result=top.helperLib.processSoapRequest(objWCT.eventWindow,wsfMapPath("/webservices/wf.object/utilityprocessor.asmx"),"wf.object","XmlTransform","sXML","<![CDATA[<document><record><path>"+sDefXMLPath+"</path><xsl>"+wsfMapPath("/widgets/runtime/xsl/objectfields.xsl")+"</xsl><params><param>"+sEnvironBrkr+"</param><param>;</param></params></record></document>]]>");sDefXML=top.XMLLib.getNodeText(result,"//XmlTransformResult");top.context.cache["objectDef_"+objWCT.brokerid]=sDefXML}var objDef=top.XMLLib.objXMLDocTemplate.cloneNode(true);objDef.loadXML(sDefXML);var sONodeName=top.XMLLib.getNodeText(objDef,"//Tree/TreeNode[displayname='"+sEnvironFldname+"']/name");var sObjectName=top.XMLLib.getNodeText(objDef,"//Tree/objectname");sONodeName=("te_"+sObjectName+"."+sONodeName).toLowerCase();var sEnXML=top.context.enviroment[sEnvironBrkr];sEnValue=top.XMLLib.getNodeText(sEnXML,"/document/record/"+sONodeName);if(sEnValue==""){var sTmpEnXML=sEnXML.toLowerCase();sEnValue=top.XMLLib.getNodeText(sTmpEnXML,"/document/record/"+sEnvironFldname.split(".")[1])}}}return sEnValue}};