var evalText="var wolf = {}";try{if(wolf){evalText=""}}catch(e){}eval(evalText);try{if(top.context!=null){top.cache=top.context.cache;wolf.cache={}}else{top.cache={};wolf.cache={}}}catch(e){}var wflib;function using(sLibraryName,libraryWindow){var objTemp;if(wflib!=null){libraryWindow=wflib;library=eval("libraryWindow."+sLibraryName)}else{if(libraryWindow==null){libraryWindow=window;for(var i=0;i<5;i++){if(libraryWindow.clsHelperLib!=null){break}libraryWindow=libraryWindow.parent}}var library;wflib=libraryWindow;syncLibraries();for(var i=0;i<5;i++){try{library=eval("libraryWindow."+sLibraryName);if(library!=null){wflib=libraryWindow;break}else{if(eval("libraryWindow.cls"+sLibraryName+"(wflib)")!=null){wflib=libraryWindow}libraryWindow=libraryWindow.parent}}catch(e){wflib=window;break}}}if(!library){if(!wflib.libraryDef){wflib.libraryDef=new Array()}if(!wflib.libraryDef[sLibraryName]){try{wflib.libraryDef[sLibraryName]=eval("wflib.cls"+sLibraryName+".toString()")}catch(e){}}try{eval("wflib."+sLibraryName+" = new wflib.cls"+sLibraryName+"(wflib)")}catch(e){try{eval("wflib."+sLibraryName+" = new cls"+sLibraryName+"(wflib)")}catch(e){}}}}function syncLibraries(){try{if(top.libraryDef){wflib.libraryDef=top.libraryDef}return;var dialogArguments=window.dialogArguments;if(dialogArguments==null){if(top.opener.dialog){dialogArguments=top.opener.dialog.arguments}}var openerWindowTop=dialogArguments;var workflowContext=dialogArguments;top.libraryDef=openerWindowTop.libraryDef;if(!top.libraryDef){top.libraryDef=workflowContext.adam.libraryDef}if(!top.libraryDef){return}for(var x in top.libraryDef){eval("top.cls"+x.toString()+" = "+top.libraryDef[x.toString()])}}catch(e){}}try{if(ctr==null){ctr=0}}catch(e){ctr=0}ctr++;if(ctr==1){loadPrototypes()}function loadPrototypes(){if(navigator.userAgent.indexOf("MSIE")>=0){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);var df=targetDoc.createDocumentFragment();df.appendChild(objImportedNode);targetDoc.appendChild(df)}}function _load(url){var xmlDoc=this;var req=new XMLHttpRequest();if(xmlDoc.onreadystatechange||xmlDoc.onload){req.onreadystatechange=_loadReady}req.open("GET",url,false);req.send("");if(!(xmlDoc.onreadystatechange||xmlDoc.onload)){_copyDocuments(req.responseXML,xmlDoc)}function _loadReady(){if(req.readyState==4){if(req.responseXML.selectSingleNode("/parsererror")!=null){xmlDoc.parseError=9886120856}else{xmlDoc.loadXML(req.responseXML.xml)}}}}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.onreadystatechange!=null&&typeof(xmlDomDoc.onreadystatechange)=="function"){xmlDomDoc.readyState=readyState;xmlDomDoc.onreadystatechange()}if(xmlDomDoc.onload!=null&&typeof(xmlDomDoc.onload)=="function"){xmlDomDoc.onload()}}}function clshelperLib(E){var W=E;var w=this;this.lpad=y;this.ltrim=J;this.rtrim=ak;this.isNullOrEmpty=K;this.removeLineBreaks=O;this.getKeyCode=j;this.HTMLEncode=b;this.HTMLDecode=ap;this.GetURL=an;this.checkValidSwitch=c;this.disposeObject=q;this.getISODate=l;this.getDateFromISO=Z;this.getMonthName=U;this.getDayDiff=L;this.dateAdd=r;this.getSpeedDate=o;this.convertXsDurationToTime=aa;this.deserialiseQueryString=P;this.buildRuleParamXml=ad;this.processSoapRequest=Q;this.processSoapRequestAsync=R;this.processServerRequest=C;this.cleanSoapResponse=ab;this.formatForDisplay=H;this.alertChanges=ao;this.errLog=al;this.errLogAsync=B;this.confirmLog=aj;this.openPopup=n;this.openPopupEx=n;this.showLoading=I;this.hideLoading=ac;this.wsfMapPath=F;this.mapPath=ae;this.formatISODateForDisplay=u;this.roundNumber=p;this.inactivityTimeout=M;this.attachEvents=v;this.detachEvents=N;this.soapNamespace="http://wolf.co.in/webservices";this.webServices={designer:{location:"/webservices/wf.designer/designer.asmx",soapAction:"WF.Designer"},object:{location:"/webservices/wf.object/object.asmx",soapAction:"wf.object"}};this.addReservedLocation=Y;var f=",mc,widgets,webservices,wsfdesigner,design,";this.getUniqueId=function(){var ar=new Date();return"wolf_"+ar.valueOf()+Math.floor((Math.random()*100))};function r(ar,au,at){if(at=="d"){au=au*86400000;ar=new Date(ar.valueOf()+au)}if(at=="m"){ar=new Date(ar.getFullYear(),(ar.getMonth()+1)+au,1)}return ar}function H(au,at){var ar=au.replace(/&#13;/g,"<br/>");switch(at){case"boolean":ar=(au==1||au=="yes")?"Yes":"No";break;case"datetime":ar=u(au);break;case"time":ar=aa(au);break}return ar}function M(ax,at){var av=this;var aw;var ar;this.activity=function(){aw=new Date();if(ar==null){ar=setInterval(au,av.duration)}};this.duration=at;this.stop=function(){if(ar!=null){clearInterval(ar)}ar=null};function au(){var ay=new Date();var az=ay.valueOf()-aw.valueOf();if(az>=av.duration){clearInterval(ar);ar=null;try{ax()}catch(aA){}}}}function ab(at){var ar=/&apos;/g;at=at.replace(ar,"'");ar=/%26/g;at=at.replace(ar,"&");return at}function ad(){var at="<document><record>";for(var ar=0;ar<arguments.length;ar+=2){var au=arguments[ar];var av=arguments[ar+1];at+="<"+au+">"+av+"</"+au+">"}at+="</record></document>";return at}function aa(aw){if(aw.indexOf("T")!=-1){if(aw.indexOf("H")==-1&&aw.indexOf("M")==-1&&aw.indexOf("S")==-1){arrTime=aw.split("T")[1].split(":");var au=parseInt(arrTime[0]);var ar="AM";if(au>11){au-=12;ar="PM"}var at=arrTime[1];if(au==0){au=12}aw=y(au,2)+":"+y(at,2)+" "+ar}else{var au="",at="00",av="0";var au=aw.substring(aw.indexOf("T")+1,aw.indexOf("H"));if(isNaN(au)){au="0"}if(aw.indexOf("M")>0){if(aw.indexOf("H")>0){at=aw.substring(aw.indexOf("H")+1,aw.indexOf("M"))}else{at=aw.substring(aw.indexOf("T")+1,aw.indexOf("M"))}}if(aw.indexOf("S")>0){av=aw.substring(aw.indexOf("M")+1,aw.indexOf("S"))}aw=y(au,2)+":"+y(at,2)}}else{if(!isNaN(aw)){var au=Math.floor(aw/3600);var at=(aw-(au*3600))/60;aw=y(au,2)+":"+y(at,2)}}return aw}function L(ar,at){try{var au=new Date(ar[0],ar[1]-1,ar[2]);var aw=new Date(at[0],at[1]-1,at[2]);return(((((aw.valueOf()-au.valueOf())/1000)/60)/60)/24)}catch(av){}return 0}function p(at,au){var ar=Math.round(at*Math.pow(10,au))/Math.pow(10,au);return ar}function K(ar){if(ar==null||ak(J(ar))==""){return true}return false}function u(av,az){if(K(av)){return""}var aA=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var ar=2;var aw=1;var at=0;var ax=" ";if(typeof(av)=="string"){if(av.indexOf("T")>0){av=av.substring(0,av.indexOf("T"))}var ay=av.split(" ");var au=ay[0].split("-");av=new Date(au[at],au[aw]-1,au[ar]);if(ay.length==2){ax+=ay[1]}}if(az=="us"){return lpad((av.getMonth()+1),2)+"/"+y(av.getDate(),2)+"/"+av.getFullYear()}else{if(az=="uk"){return y(av.getDate(),2)+"/"+lpad((av.getMonth()+1),2)+"/"+av.getFullYear()}else{return y(av.getDate(),2)+"-"+aA[av.getMonth()]+"-"+av.getFullYear()+ax}}}function y(au,at){au=""+au;if(au.length<at){for(var ar=0;ar<(at-au.length);ar++){au="0"+au}}return au}function ai(at,ar){if(typeof(ar)!="object"&&at.document.getElementById(ar)){ar=at.document.getElementById(ar)}return ar}function v(aw,at,au,av,ar){var at=ai(aw,at);if(au.indexOf("on")==0){au=au.substring(2)}if((navigator.userAgent.indexOf("MSIE")<0)){if(ar==null){ar=false}at.addEventListener(au,av,ar)}else{if(at.attachEvent){at.attachEvent("on"+au,av)}}}function N(aw,at,au,av,ar){var at=ai(aw,at);if(au.indexOf("on")==0){au=au.substring(2)}if((navigator.userAgent.indexOf("MSIE")<0)){if(ar==null){ar=false}at.removeEventListener(au,av,ar)}else{if(at.attachEvent){at.detachEvent("on"+au,av)}}}this.clsEventHandler=g;function Y(ar){f+=ar+","}function ae(ar,at){var au=ar.location.href.split("/");au[au.length-1]=at;return au.join("/")}this.hostPrefix="";function F(aw,ay){var au;try{au=top.context}catch(ax){}if(aw==null){return aw}if(ay!=null){aw=aw.replace("$application","/mc/em/application/"+ay)}else{if(au!=null){if(au.session!=null){aw=aw.replace("$application","/mc/em/application/"+au.session.applicationid)}}}var ar="/widgets/skin";if(au!=null&&au.session!=null&&au.session.application!=null){if(au.session.application.skin!=null){ar+="/"+au.session.application.skin}}aw=aw.replace("$skin",ar);if(w.hostPrefix.length==0){var av=W.location.href.split("/");for(var at=3;at<av.length;at++){if(av[at].length>0&&av[at].indexOf("http")!=0&&at<av.length-1){if(f.indexOf(","+av[at].toLowerCase()+",")>=0){break}w.hostPrefix+="/"+av[at]}}}if(aw.indexOf(w.hostPrefix+"/")!=0){aw=w.hostPrefix+aw}return aw}function ao(ax){var aw=ax.selectSingleNode("document");aw=aw.firstChild;var at=W.screen.availHeight;var ar=W.screen.availWidth-200;while(aw!=null){var av=top.XMLLib.getNodeText(aw,".//WFSys_lastELQueryTimeStamp");if(av.length>0){var au=A();if(au!=null){au.lastELQueryTimeStamp=av}}at=at-102;W.showModelessDialog(F("/widgets/code/objectupdate.htm"),aw,"dialogHeight: 100px; dialogWidth: 250px; dialogTop: "+at+"px; dialogLeft: "+ar+"px; edge: raised; help: Yes; resizable: No; status: No;unadorned:yes");aw=aw.nextSibling}}function A(){var ar=top.context;if(ar==null&&top.wct!=null){ar=top.wct.adam}return ar}function z(ar){var at;at=top.XMLLib.objXMLDocTemplate.cloneNode(true);at.async=true;at.load(ar);top.context.cache.objErrLogLangXML=at;return}function aj(av){this.description=av;var ar;var au;var at="<b>Confirm</b>";au=this.description;var aw=400;var az=200;if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("MSIE 6.0")>0){az+=52}var ay=(window.screen.availWidth-aw)/2;var ax=(window.screen.availHeight-az)/2;return W.showModalDialog(F("/widgets/code/confirmlog.htm"),this,"dialogLeft:"+ay+"px;dialogTop:"+ax+"px;dialogHeight:"+az+"px;dialogWidth:"+aw+"px;unadorned:yes")}function B(ay,av,aA,az,ax){var at=400;var ar=200;var aw=top.DHTMLLib.showCustomDialog(top,"height:"+ar+"px;width:"+at+"px;",null,"allowtransparency",true);var au=h(av,aA,az,ax);aw.dialogArguments=au;aw.container.innerHTML="<iframe src='"+F("/widgets/code/errorlog.htm")+"' style='height:"+ar+"px;width:"+at+"px;border:0px' frameborder='0' allowtransparency = 'true'></iframe>";aw.callBackRef=S;aw.callBackArguments=ay}function S(at,ar){if(ar!=null){ar(at)}}function al(ax,aA,az,ay){var au=h(ax,aA,az,ay);if(!W.showModalDialog){alert(top.XMLLib.getNodeText(au.description,"/err"))}else{var at=400;var ar=200;if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("MSIE 6.0")>0){ar+=52}var aw=(window.screen.availWidth-at)/2;var av=(window.screen.availHeight-ar)/2;W.showModalDialog(F("/widgets/code/errorlog.htm"),au,"dialogTop:"+av+"px;dialogLeft:"+aw+"px;dialogHeight:"+ar+"px;dialogWidth:"+at+"px;unadorned:yes;status:no;resizable:no;help:no;")}}function h(aC,aI,aH,aD){var aw={};try{var ay=top.context.session.languageFolder;var at="";if(ay!=""&&top.context.cache.objErrLogLangXML!=null){var az;az=top.XMLLib.objXMLDocTemplate.cloneNode(true);az.async=true;if(top.context.cache.objErrLogLangXML==null){sErrLogXMLPath=F("/mc/"+ay+"application/"+top.context.session.applicationid+"/ErrLog_Localiser.xml");z(sErrLogXMLPath)}az=top.context.cache.objErrLogLangXML;at=az.xml;if(at!=""){var aE="<document><record><desc>"+aD+"</desc></record></document>";var av=top.XMLLib.objXMLDocTemplate.cloneNode(true);var ar="<root><source>"+aE+"</source><language>"+at+"</language></root>";var aG=/&apos;/g;ar=ar.replace(aG,"'");aG=/&/g;ar=ar.replace(aG,"%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 au=top.XMLLib.transformXML(ar,m_objXSLForLocaliser);if(au!=null){aD=top.XMLLib.getNodeText(au,"//document/record")}alert(aD)}}}catch(aB){}var aG=/##/g;aD=aD.replace(aG,"");aw.page=aC;aw.line=aI;aw.versionNo=aH;aw.description=aD;var ax;var aF;var aA="<b>Alert</b>";aF=aw.description;if(aw.page==""){ax=F("/widgets/assets/erralert.gif")}else{aA+="Location : "+this.page;ax=F("/widgets/assets/errcritical.gif")}if(aw.line!=""){aA+=" at line "+aw.line}return aw}function ac(ar){if(ar==null){return}try{if(ar.loadingDialog==null){return}}catch(at){return}ar.activeProcesses=ar.activeProcesses-1;if(ar.activeProcesses<0){ar.activeProcesses=0}if(ar.activeProcesses==0){ar.loadingDialog.style.display="none"}}function I(ar){if(ar==null){return}try{if(ar.loadingDialog==null){ar.loadingDialog=ar.document.createElement("div");ar.document.body.appendChild(ar.loadingDialog);ar.loadingDialog.innerHTML="<IMG src='"+F("/widgets/assets/animated_loading.gif")+"' align='absmiddle'/>&nbsp;Working on your request...";ar.loadingDialog.className="loadingwindow";ar.activeProcesses=0}ar.activeProcesses++;ar.loadingDialog.style.display="block"}catch(at){}}function am(ay,av,az,aw,ax,aA){ay.setRequestHeader("Content-Type","text/xml; charset=utf-8");var ar=az;if(!isNullOrEmpty(ar)){ar="/"+ar}var au='<?xml version="1.0" encoding="utf-8"?>';au+='<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/">';au+="<soap:Body>";au+="<"+aw+' xmlns="'+w.soapNamespace+ar+'">';for(var at=aA;at<ax.length;at+=2){au+="<"+ax[at]+">";au+=ax[at+1];au+="</"+ax[at]+">"}au+="</"+aw+">";au+="</soap:Body>";au+="</soap:Envelope>";au=au.replace("<record>","<record><wsf_clienttimezoneoffset>"+(new Date()).getTimezoneOffset()+"</wsf_clienttimezoneoffset>");ay.setRequestHeader("Content-Length",au.length);ay.setRequestHeader("SOAPAction",w.soapNamespace+ar+"/"+aw);au=aq(au);au=au.replace(/&(?!amp;|lt;|gt;)/g,"&amp;");return au.replace(/&/g,"%26")}function C(aw,at,az,au,ay){var av=aA(at,az,au,ay);var aB=az+"/"+at;var aC=Q(null,F("/webservices/wf.object/utilityprocessor.asmx"),"wf.object","RequestService","sSoapEnvelope","<![CDATA["+av+"]]>","sSoapAction",aB,"sURL",aw);if(aC==null){return}var ax=getNodeText(aC,"//RequestServiceResponse");if(ax.length==0){return}ax=ax.replace("xmlns=","replaced=");ax=ax.replace(/&amp;lt;/g,"<");ax=ax.replace(/&amp;gt;/g,">");ax=ax.replace(/&gt;/g,">");ax=ax.replace(re=/&lt;/g,"<");var ar=top.XMLLib.getNodeXML(ax,"//"+at+"Result/*");return ar;function aA(aD,aG){var aE="<"+aD+' xmlns="'+aG+'">';for(var aF=2;aF<arguments.length;aF+=2){if(arguments[aF].length>0){aE+="<"+arguments[aF]+">";aE+=arguments[aF+1];aE+="</"+arguments[aF]+">"}}aE+="</"+aD+">";return aE}}function a(){var ar;if((navigator.userAgent.indexOf("MSIE")<0)){ar=new XMLHttpRequest()}else{ar=new ActiveXObject("MSXML2.XMLHTTP")}return ar}function Q(au,aw,az,ax){w.showLoading(au);var ay=a();ay.open("POST",aw,false);var av=am(ay,aw,az,ax,arguments,4);ay.send(av);var aA=ay.responseXML;var at=new G(null,ay,ax,av,aw,az,au);var ar=i(aA,at);w.hideLoading(au);return ar.result}function R(ax,at,av,au,ay){w.showLoading(ax);var ar=a();ar.open("POST",av,true);var aw=am(ar,av,au,ay,arguments,5);ar.onreadystatechange=d;T[T.length]=new G(at,ar,ay,aw,av,au,ax);ar.send(aw);return T.length-1}var T=new Array();function G(at,ar,ay,au,aw,av,ax){this.async=((at==null)?false:true);this.pending=true;this.fnRef=at;this.xmlObject=ar;this.FunctionName=ay;this.RequestXML=au;this.ServiceName=aw;this.windowRef=ax;this.soapAction=av;this.callTime=new Date()}var ag=new Array();var D;function m(){var at={message:"sessionstack",result:null};for(var ar=0;ar<ag.length;ar++){objCallBackDetails=ag[ar];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",w.soapNamespace+objCallBackDetails.soapAction+"/"+objCallBackDetails.FunctionName);objCallBackDetails.xmlObject.onreadystatechange=d;objCallBackDetails.xmlObject.send(objCallBackDetails.RequestXML);if(objCallBackDetails.async==false){at.result=V(objCallBackDetails.xmlObject.responseXML)}objCallBackDetails.callTime=new Date();ag[ar]=null}ag=new Array();return at}function aq(ar){return ar.replace(/\u0085/g," ").replace(/\u0091/g,"")}function V(at){if((navigator.userAgent.indexOf("MSIE")<0)){var ar=at.xml.replace(/xmlns=/g,"xmlns1=");at=top.XMLLib.objXMLDocTemplate.cloneNode(true);at.loadXML(ar)}return at}function X(ar){if(ar==true){ah=false;m()}}var ah=false;function i(au,at){au=V(au);if(au.selectSingleNode("//faultstring")!=null){var ax=top.XMLLib.getNodeText(au,"//faultstring");if(ax.indexOf("ex9886120856")>=0){if(ah==true){ag[ag.length]=at;return{message:"sessiontimeout",result:null}}try{if(at.callTime.valueOf()<=D.valueOf()&&ah==false){ag[ag.length]=at;m();return{message:"sessiontimeout",result:null}}}catch(ay){}ag[0]=at;ah=true;alert("Your Session has expired. Please login again.");top.EMLib.doLogin(null,X);D=new Date();return{message:"sessiontimeout",result:null}}else{if(ax.indexOf("License Exception")>=0){w.errLogAsync(null,"License validation exception","","","<b>Your License has expired</b>. Please contact your System Administrator or Vendor for further assitance.")}else{w.errLogAsync(null,"Unhandled Exception in Web Service \nService : "+at.ServiceName+" ("+at.FunctionName+")","","",ax);return{message:"failure",result:null}}}}var ar=top.XMLLib.objXMLDocTemplate.cloneNode(true);if(au.selectSingleNode("//"+at.FunctionName+"Result")!=null){var aw=top.XMLLib.getNodeText(au,"//"+at.FunctionName+"Result");var av=top.XMLLib.getNodeXML(aw,"err");if(av.length>0){av=av.replace("<err>","").replace("</err>","");av=av.replace(/^\\'/g,"");av=av.replace(/\\'$/g,"");if(av.indexOf('"')==0){av=av.substring(1,av.length-1)}if(at.fnRef){w.errLogAsync(null,"Handled Exception in Web Service \nService : "+at.ServiceName+" ("+at.FunctionName+")","","",av)}else{w.errLogAsync(null,"Handled Exception in Web Service \nService : "+at.ServiceName+" ("+at.FunctionName+")","","",av)}return{message:"failure",result:null}}else{av=top.XMLLib.getNodeXML(aw,"//alert").replace("<alert>","").replace("</alert>","");av=av.replace(/^'/g,"");av=av.replace(/'$/g,"");if(av.length>0){if(at.fnRef){setTimeout(function(){w.errLogAsync(null,"","","",av)},200)}else{setTimeout(function(){w.errLogAsync(null,"","","",av)},200)}}}}return{message:"success",result:au}}function d(){for(var at=0;at<T.length;at++){var ar=T[at];if(ar.pending==true){if(ar.xmlObject.readyState!=4){continue}Result=ar.xmlObject.responseXML;ar.pending=false;var av=i(Result,ar);if(av.message=="success"||av.message=="failure"){try{ar.fnRef(av.result,at)}catch(au){}w.hideLoading(ar.windowRef);ar.xmlObject=null;ar.fnRef=null;ar.FunctionName=null;ar.RequestXML=null;ar.windowRef=null}}}}function g(){var au=new Array();this.detachEvent=ar;this.attachEvent=aw;this.raiseEvent=av;this.dispose=at;function at(){for(var ay in au){for(var ax in au[ay]){try{au[ay][ax]=null}catch(az){}}try{au[ay]=null}catch(az){}}}function ar(ay,ax){try{var ay=ay.toLowerCase();var aA="wsf_ptr"+ax.toString();if(au[ay]==null&&au[ay][aA]){au[ay][aA]=null}}catch(az){}}function aw(ay,ax){var ay=ay.toLowerCase();if(au[ay]==null){au[ay]=new Array()}var az="wsf_ptr"+ax.toString();au[ay][az]=ax}function av(az,ax){if(ax==null){ax=new Object()}ax.type=az;ax.cancel=false;if(ax.srcElement!=null&&ax.rootsrcElement==null){ax.rootsrcElement=ax.srcElement}var aB=au[az.toLowerCase()];var ay=true;for(k in aB){if(k.indexOf("wsf_ptr")==0){try{aB[k](ax);if(ax.cancel==true){ay=false}}catch(aA){ay=true}}}return ay}}function n(az,aA,at,aw,av){if(aw==null){aw=window}objTop=aw;for(var ax=0;ax<10;ax++){if(objTop.wct!=null){break}objTop=objTop.parent}var aB=new top.EMLib.clsWCT();if(objTop.wct!=null){aB.adam=objTop.wct.adam}else{if(objTop.context!=null){aB.adam=objTop.context}}aB.parentWCT=objTop.wct;aB.bfu=az;aB.popupArgs=at;var ar=500;if(navigator.appName=="Microsoft Internet Explorer"&&navigator.userAgent.indexOf("MSIE 6.0")>0){ar+=52}if(aA==""){aA="status:no;height:"+ar+"px;width:600px;"}else{aA=aA.toLowerCase().replace(/dialog/g,"")}aB.adam.libraryDef=top.libraryDef;var ay=top.DHTMLLib.showCustomDialog(top,aA,null,"allowtransparency",true);ay.dialogArguments=aB;ay.container.innerHTML="<iframe src='"+F("/widgets/runtime/htc/wct.htm")+"' style='"+aA+";border:0px' frameborder='0' allowtransparency = 'true'></iframe>";ay.callBackRef=au;ay.callBackArguments=av;function au(aD,aC){if(aC!=null){try{aC(aD)}catch(aE){}}}}function c(at){for(var ar=1;ar<arguments.length;ar++){if(at==arguments[ar]){return at}}return -1}function j(at){for(var ar=1;ar<arguments.length;ar++){if(at==arguments[ar]){return at}}return -1}function U(au,ar){var at=new Array("January","February","March");var at=at.concat("April","May","June");var at=at.concat("July","August","September");var at=at.concat("October","November","December");if(ar==true){return at[au].substr(0,3)}else{return at[au]}}function Z(ar){var at=ar.split("T")[0].split("-");return new Date(at[0],at[1]-1,at[2])}function l(at){var ar=""+(at.getMonth()-0+1);var au=""+at.getDate();if(ar.length==1){ar="0"+ar}if(au.length==1){au="0"+au}var av=at.getFullYear()+"-"+ar+"-"+au;return av}function q(au){for(var ar in au){try{au[ar]=null}catch(at){}}}function P(at){if(!at){at=top.location.href}var ax={};try{var ar=at.split("?")[1].split("&");for(var au=0;au<ar.length;au++){var aw=ar[au].split("=");if(aw[1]!=null&&aw[1]!=""){ax[aw[0].toLowerCase()]=unescape(aw[1])}}}catch(av){}return ax}var af="";function o(){dt=new Date();return"-##-"+dt.getMinutes()+":"+dt.getSeconds()+":"+dt.getMilliseconds()+" "}function J(ar){return ar.replace(/^\s*/,"")}function ak(ar){return ar.replace(/\s*$/,"")}function O(au){try{var ar=/\r/g;au=au.replace(ar,"");ar=/\n/g;au=au.replace(ar,"");ar=/\t/g;au=au.replace(ar,"");return au}catch(at){}}function an(au){var ar=W.location.href.split("/");var at=ar[0]+"/"+ar[1]+"/"+ar[2];if(au.substring(0,1)=="/"){return at+au}}function ap(aA){var av,ax,aw,au,ay,ar,at;av="&,\",<,>,','".split(",");aw="&amp;amp;,&amp;quot;,&amp;lt;,&amp;gt;,&apos;,&amp;apos;".split(",");ax=aA;var az=/&amp;/g;ax=ax.replace(az,"&");var az=/&apos;/g;ax=ax.replace(az,"'");var az=/&quot;/g;ax=ax.replace(az,'"');var az=/&lt;/g;ax=ax.replace(az,"<");var az=/&gt;/g;ax=ax.replace(az,">");return ax}function b(au){var av,ay,ax,at,az,aw,ar;av='&,",<,>'.split(",");ax="&amp;amp;,&amp;quot;,&amp;lt;,&amp;gt;".split(",");ay="";if(au.length>0){for(at=0;at<au.length;at++){az=au.substr(at,1);aw=0;for(ar=0;ar<av.length;ar++){if(az==av[ar]){ay+=ax[ar];aw=1;break}}if(aw==0){ay+=az}}}return ay}}function clsXMLLib(v){var y=this;var w=v;if(w==null){w=top}using("helperLib",w);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.loadXml=u;this.loadXSL=c;var j,d;var n="Msxml2.XSLTemplate.6.0";p();this.objXMLDocTemplate=j;this.objXSLDocTemplate=d;function u(F,B,z){var A;try{A=top.context.cache}catch(E){}var D;try{D=A[B.toString()]}catch(E){}if(D!=null){return z(D,B)}D=wflib.XMLLib.objXMLDocTemplate.cloneNode(true);D.async=true;if(navigator.userAgent.indexOf("MSIE")<0){D.onload=G}else{D.onreadystatechange=C}D.load(F);if(B!=null){try{A[B]=D}catch(E){}}function G(){try{z(D,B)}catch(H){}}function C(){if(D.readyState!=4){return}try{z(D,B)}catch(H){}}}function p(){var D;if(navigator.userAgent.indexOf("MSIE")<0){D=document.implementation.createDocument("","",null);d=D}else{var C=["MSXML2.DomDocument.6.0"];var A=["Msxml2.FreeThreadedDOMDocument.6.0","Msxml2.FreeThreadedDOMDocument.3.0","Msxml2.FreeThreadedDOMDocument.4.0","Msxml2.FreeThreadedDOMDocument.5.0","Msxml2.FreeThreadedDOMDocument","Microsoft.FreeThreadedDOMDocument"];var z=["MSXML2.XSLTemplate.6.0","MSXML2.XSLTemplate.3.0","MSXML2.XSLTemplate.4.0","MSXML2.XSLTemplate.5.0","MSXML2.XSLTemplate","Microsoft.XSLTemplate"];for(var B=0;B<C.length;B++){try{D=new ActiveXObject(C[B]);d=new ActiveXObject(A[B]);n=z[B];break}catch(E){}}}j=D}function o(D,z,E){try{var B;if(typeof(D)=="string"){B=j.cloneNode(true);B.loadXML(D)}else{B=D}var A=B.selectSingleNode(z);if(A==null){A=B.appendChild(B.ownerDocument.createElement(z))}A.text=E;if(typeof(D)=="string"){return B.xml}else{return B}}catch(C){}}function f(B,C,D,z){try{var H;if(typeof(B)=="string"){H=j.cloneNode(true);H.loadXML(B)}else{H=B}var A=H.ownerDocument.cloneNode(true);A.loadXML("<root>"+D+"</root>");var F=H.selectSingleNode(C);if(F!=null){if(z!=true){var I=F.childNodes;for(var E=0;E<I.length;E++){F.removeChild(I[E])}}}else{F=H.appendChild(H.ownerDocument.createElement(C))}F.appendChild(A.selectSingleNode("/root").childNodes[0].cloneNode(true));if(typeof(B)=="string"){return H.xml}else{return H}}catch(G){}}function c(z,A,D){var C;if(w.cache==null){if(w.context==null){w.cache={}}else{w.cache=w.context.cache}}try{C=w.cache[A]}catch(B){}if(C==null){if(!(navigator.userAgent.indexOf("MSIE")<0)){C=d.cloneNode(true);C.async=false;try{C.setProperty("AllowXsltScript",true);C.setProperty("AllowDocumentFunction",true)}catch(B){}}else{C=j.cloneNode(true);C.async=false}if(D==true||z.length>100){C.loadXML(z)}else{C.load(z)}}if(A!=null){w.cache[A]=C}return C}function a(z){try{var B=z.childNodes[0];while(B!=null&&B.nodeType==3){B=B.nextSibling}return B}catch(A){return null}}function q(z){try{var B=z.nextSibling;while(B!=null&&B.nodeType==3){B=B.nextSibling}return B}catch(A){return null}}function g(z){try{var B=z.previousSibling;while(B!=null&&B.nodeType==3){B=B.previousSibling}return B}catch(A){return null}}function h(D,C){try{var A,z;if(typeof(D)=="string"){A=j.cloneNode(true);A.loadXML(D)}else{A=D}z=A.selectSingleNode(C);if(z==null){return""}else{if(z.text==undefined){return z.value}return z.text}}catch(B){return""}}function r(D,C){try{var A,z;if(typeof(D)=="string"){A=j.cloneNode(true);A.loadXML(D)}else{A=D}z=A.selectSingleNode(C);if(z==null){return""}else{return z.xml}}catch(B){}}this.webServices={utilityProcessor:{location:"/webservices/wf.object/utilityprocessor.asmx",soapAction:"wf.object"}};function i(E,C,D,A){var z;if(D==true){C="<![CDATA[<document><record><path>"+w.helperLib.wsfMapPath("$application/participant/xml/tree.xml")+"</path><xsl>"+A+"</xsl></record></document>]]>"}z=w.helperLib.processSoapRequestAsync(top,B,w.helperLib.wsfMapPath(y.webServices.utilityProcessor.location),y.webServices.utilityProcessor.soapAction,"XmlTransform","sXML",C);function B(F){var H="";if(F!=null){H=w.XMLLib.getNodeText(F,"//XmlTransformResult")}try{E(H)}catch(G){}}}function m(B,C,A){var z;if(C==true){B="<![CDATA[<document><record><path>"+w.helperLib.wsfMapPath("$applicationid/participant/xml/tree.xml")+"</path><xsl>"+A+"</xsl></record></document>]]>"}z=w.helperLib.processSoapRequest(top,w.helperLib.wsfMapPath(y.webServices.utilityProcessor.location),y.webServices.utilityProcessor.soapAction,"XmlTransform","sXML",B);if(z!=null){return w.XMLLib.getNodeText(z,"//XmlTransformResult")}else{return""}}function b(z){var B,A;if(navigator.userAgent.indexOf("MSIE")<0){A=new XSLTProcessor();A.importStylesheet(z)}else{try{B=new ActiveXObject(n);B.stylesheet=z;A=B.createProcessor()}catch(C){alert("error in xmllib.getXSLTProcessor:"+C.description)}}return A}function l(z,I){var A,F,H,B,E;if(typeof(I)=="string"){F=c(I,null,false)}else{F=I}H=j.cloneNode(true);H.async=false;H.loadXML(z);B=b(F,H);if(navigator.userAgent.indexOf("MSIE")<0){if(arguments.length>2){for(var C=2;C<arguments.length;C++){B.setParameter(null,"param"+(C-1),arguments[C])}}var D=B.transformToDocument(H);E=D.xml;if(F.xml.indexOf('method="text"')>0&&D.documentElement.textContent){E=D.documentElement.textContent}if(E.indexOf("transformiix:result")>=0){var G=r(E,"//transformiix:result/*[name() != 'transformiix:result']");if(G.length==0){G=h(E,"//transformiix:result")}E=G}}else{B.input=H;if(arguments.length>2){for(var C=2;C<arguments.length;C++){B.addParameter("param"+(C-1),arguments[C])}}B.transform();E=B.output}return(E)}}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.getChildByType=_getChildByType;this.getParentByType=_getParentByType;this.getWindowPos=getWindowPos;this.getMousePos=getMousePos;this.getScreenCenterPos=_getScreenCenterPos;this.getStyleProp=getStyleProp;this.addStyleSheet=AddStyleSheet;this.addScript=_addScript;this.crossDomainCall=_crossDomainCall;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.slideActions=new _slideActions();this.drag=_clsDrag;this.showCustomDialog=_showCustomDialog;this.toggleDashBoards=toggleDashBoards;this.makePane=makePane;this.roundIt=_roundIt;this.applyShadow=_applyShadow;this.refreshShadow=_refreshShadow;this.changeToButon=_changeToButon;function _clsDrag(evt,el){var me=this;this.instance={x:evt.clientX,y:evt.clientY,dragStartLeft:el.offsetLeft,dragStartTop:el.offsetTop,el:el,fixedTop:true};el.style.width=me.instance.el.offsetWidth+"px";el.parentNode.style.position="relative";el.parentNode.style.overflow="hidden";el.parentNode.style.width=el.parentNode.offsetWidth+"px";el.parentNode.style.height=el.parentNode.offsetHeight+"px";el.style.position="absolute";_disableSelection(document.body);wflib.helperLib.attachEvents(window,el,"onmouseup",_endDrag);var timer=new wflib.helperLib.inactivityTimeout(_endDrag,1000);function _endDrag(evt){var distance,to,force=false;if(el.offsetLeft<me.instance.dragStartLeft){distance=el.parentNode.offsetWidth-(el.offsetLeft+el.offsetWidth);if(distance>0){to=0}}else{if(el.offsetLeft>me.instance.dragStartLeft){distance=el.offsetLeft;if(distance>0){to=0}force=true}}if(to!=null){wflib.DHTMLLib.slideActions.moveComplete=null;wflib.DHTMLLib.slideActions.move(el,el.parentNode,{from:el.offsetLeft,to:to,force:force})}mouseButtonPressed=false;_enableSelection(document.body);wflib.helperLib.detachEvents(window,el,"onmouseup",_endDrag);me.instance=null}function _enableSelection(target){if(typeof target.onselectstart!="undefined"){target.onselectstart=null}else{if(typeof target.style.MozUserSelect!="undefined"){target.style.MozUserSelect=""}else{target.onmousedown=null}}target.style.cursor="default"}function _disableSelection(target){if(typeof target.onselectstart!="undefined"){target.onselectstart=function(){return false}}else{if(typeof target.style.MozUserSelect!="undefined"){target.style.MozUserSelect="none"}else{target.onmousedown=function(){return false}}}target.style.cursor="default"}this.drag=function(evt){el.style.left=(parseInt(me.instance.dragStartLeft)+evt.clientX-me.instance.x)+"px";if(me.instance.fixedTop!=true){el.style.top=(parseInt(me.instance.dragStartTop)+evt.clientY-me.instance.y)+"px"}timer.activity();wflib.DHTMLLib.preventDefault(evt)}}function _getChildByType(el,wftypeValue){try{for(var i=0;i<el.childNodes.length;i++){var node=el.childNodes[i];if(node.nodeType!=3){if(node.getAttribute("wftype")==wftypeValue){return node}var match=_getChildByType(node,wftypeValue);if(match!=null){return match}}}}catch(e){return null}}function _getParentByType(el,wftypeValue){try{var parent=el;for(var i=0;i<10;i++){if(parent.getAttribute("wftype")==wftypeValue){break}parent=parent.parentNode}return parent}catch(e){return null}}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"}}catch(e){}try{thisTransition.e.style.filter="alpha(opacity="+opacity+")"}catch(e){}try{thisTransition.e.style.opacity=(opacity/100)}catch(e){}opacity-=8}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 _slideActions(){var me=this;this.moveComplete;var moving=false;this.move=function(el,elContainer,position,v){if(moving){return}moving=true;var offset,pos=position.from,speed=0.4,distance,intervalId,reverse=false;if(elContainer.offsetWidth<(position.to+el.offsetWidth)&&position.force!=true){position.to=(elContainer.offsetWidth-el.offsetWidth)}distance=(position.to-position.from);if(position.from>position.to){distance=(position.from-position.to);reverse=true}var travelled=distance;offset=distance*speed;intervalId=setInterval(_move,20);function _move(){if(reverse){pos-=offset}else{pos+=offset}travelled-=offset;offset=travelled*speed;if(v==true){el.style.top=pos+"px"}else{el.style.left=pos+"px"}if(parseInt(travelled)<=1){clearInterval(intervalId);moving=false;el.style.left=position.to;try{me.moveComplete()}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.indexOf(sStyleSheetLocation)>=0){w.document.removeChild(objLinks[i]);break}}}catch(e){}}var crossDomainCalls=new Array();function _crossDomainCall(windowElement,scriptSource){s=_addScript(windowElement,scriptSource);crossDomainCalls[crossDomainCalls.length]={el:s,on:new Date().valueOf()};setTimeout(_clearCrossDomainCalls,5000)}function _clearCrossDomainCalls(){for(var i=crossDomainCalls.length-1;i>=0;i--){if((new Date().valueOf()-crossDomainCalls[i].on)>5000){crossDomainCalls[i].el.parentNode.removeChild(crossDomainCalls[i].el);crossDomainCalls.splice(i,1)}}}function _addScript(windowElement,scriptSource){try{var elDocument=windowElement.document.getElementsByTagName("head")[0]||windowElement.documentElement;var scriptTag=windowElement.document.createElement("script");scriptTag.type="text/javascript";scriptTag.async="async";scriptTag.src=unescape(scriptSource);elDocument.appendChild(scriptTag);return scriptTag}catch(e){_writeScript(scriptSource)}}function _writeScript(scriptSource){try{var elDocument=windowElement.document.getElementsByTagName("head")[0]||windowElement.documentElement;var scriptTag=windowElement.document.createElement("script");return _addScript(scriptSource)}catch(e){}var newScript=unescape("%3Cscript type='text/javascript' src='"+scriptSource+"'>%3C/script>");document.write(newScript)}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((navigator.userAgent.indexOf("MSIE")<0)){}}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[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(){try{topWindow.dialogStack[topWindow.dialogStack.length-1].coverframeClick()}catch(e){}}function _createCover(windowRef,allowtransparency,blankPageUrl){if(blankPageUrl==null){blankPageUrl=wflib.helperLib.wsfMapPath("/mc/blank.htm")}var coverFrame=windowRef.document.createElement("iframe");coverFrame.style.height="100%";coverFrame.style.width=windowRef.document.body.clientWidth+"px";coverFrame.style.position="absolute";coverFrame.src=blankPageUrl;coverFrame.frameBorder="0";coverFrame.className="coverFrame "+allowtransparency;coverFrame.allowTransparency=true;wflib.helperLib.attachEvents(windowRef,coverFrame,"onload",function(e){coverFrame.contentWindow.document.body.style.backgroundColor="transparent";coverFrame.contentWindow.document.body.style.backgroundImage="url("+wflib.helperLib.wsfMapPath("/widgets/assets/spacer.gif")+")";wflib.helperLib.attachEvents(windowRef,coverFrame.contentWindow.document,"click",_setFocusToOpenedDialog)});windowRef.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);if(dialog.coverCreated==true){var coverFrame=topWindow.dialogCover[topWindow.dialogCover.length-1];setTimeout(function(){coverFrame.parentNode.removeChild(coverFrame)},200);topWindow.dialogCover.splice(topWindow.dialogCover.length-1,1)}dialog=null;topWindow.dialogStack.splice(topWindow.dialogStack.length-1,1);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,createNewCover,allowtransparency,shadow,x,y,blankPageUrl){if(windowRef==null){windowRef=topWindow}if(createNewCover!=false){_createCover(windowRef,allowtransparency,blankPageUrl)}if(topWindow.dialogStack==null){topWindow.dialogStack=new Array()}var dialog={};dialog.coverCreated=(createNewCover!=false);dialog.close=_dialogUnload;dialog.outerContainer=windowRef.document.createElement("div");windowRef.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(windowRef,dialog.outerContainer.offsetWidth,dialog.outerContainer.offsetHeight);if(x!=null){centerPosition.x=x}if(y!=null){centerPosition.y=y}dialog.outerContainer.style.top=centerPosition.y+"px";dialog.outerContainer.style.left=centerPosition.x+"px";dialog.container=dialog.outerContainer.appendChild(windowRef.document.createElement("div"));dialog.container.setAttribute("wftype","dlg_container");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){try{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")}catch(e){}}function _refreshShadow(o){try{t=me.getParentByType(o,"shadow");t.rows[0].cells[0].childNodes[0].childNodes[1].childNodes[0].style.height=(o.offsetHeight-12)+"px"}catch(e){}}function _applyShadow(o,bgColor,className){if(className==null){className=""}var shadowHtml='<table wftype="shadow" 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);var loopCounter=1;_resize();return t;function _setHeight(){try{if(olderOffsetHeight==o.offsetHeight){if(loopCounter++==600){return}setTimeout(_setHeight,50);return}o.onresize=_resize;_resize()}catch(e){}}function _resize(){try{t.rows[0].cells[0].childNodes[0].childNodes[1].childNodes[0].style.height=(o.offsetHeight-12)+"px"}catch(e){}}}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 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.getBrokerIDfromName=_getBrokerId;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("/webservices/wf.fileimage/fileimage.aspx?imagename=$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=="custom"){var values=objSourceCombo.i_usevalueof;if(values==null){values=objSourceCombo.getAttribute("i_usevalueof")}sComboData="";if(!wflib.helperLib.isNullOrEmpty(values)){var arrVal=values.split(",");for(var i=0;i<arrVal.length;i++){var option=arrVal[i].split(":");if(option.length==1){option[1]=option[0]}sComboData+="<option value='"+option[0]+"'>"+option[1]+"</option>"}}if(!wflib.helperLib.isNullOrEmpty(values)){sComboData="<select>"+sComboData+"</select>"}if(reloadIndex!=null){_completeReload(reloadIndex,sComboData)}}else{if(comboType=="businessrule"){var sBRXML="<document><record/></document>";if(caller!=null){if(caller.BRXML){sBRXML=caller.BRXML}}var businessRuleName=arrSourceCombo[arrSourceCombo.length-1];var response;var d=new Date();var requestedAt=top.context.cache["requestedAt"+businessRuleName];var request=top.context.cache["request"+businessRuleName];if(d.valueOf()-requestedAt<120000&&request==sBRXML){sComboData=top.context.cache["combo"+businessRuleName]}else{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)}top.context.cache["combo"+businessRuleName]=sComboData;top.context.cache["requestedAt"+businessRuleName]=d.valueOf();top.context.cache["request"+businessRuleName]=sBRXML}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,"&");responseXml=responseXml.replace(/&nbsp;/g,"&amp;nbsp;");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,callback){var values=new valueObject(useValueOf);var objWct=new clsWCT();objWct.LRBrokerId=values.brokerId;objWct.LRSearchName=values.searchTemplateName;objWct.LRMode="popup";objWct.LRName=values.objectName;objWct.callBack=callback;var objWindowArgs=new Object();var bodyHeight=top.DHTMLLib.getStyleProp(document.body,"marginTop");bodyHeight=parseInt(bodyHeight)+document.body.offsetHeight;var height=parseInt((bodyHeight/100)*98);var width=parseInt((document.body.offsetWidth/100)*60);objWindowArgs.dialogArgs="width:"+width+"px;height:"+height+"px;";openObject(objWct,objWindowArgs,null,"allowtransparency")}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((navigator.userAgent.indexOf("MSIE")<0)){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 _getBrokerId(objectName){if(objectName.indexOf("te_")==0){objectName=objectName.substr(3)}return top.XMLLib.getNodeText(top.context.cache.SYSTBroker.xml,"//record[name='"+objectName+"' or BrokerID='"+objectName+"']/BrokerID")}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;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}};
