var g_oPluginHandlersByIndex=new Array();var g_oPluginHandlersByName=new Array();var g_oPluginWCT=new Array();function clsPlugin(){var me=this;this.initialise=initialise;this.afterDataInitClosedEvent=afterDataInitClosedEvent;this.getInstance=getInstance;this.getDesignerMenuXML=getDesignerMenuXML;this.designerClickMenuItem=designerClickMenuItem;this.activePluginsXML=null;this.attachEvent=_attachevent;this.detachEvent=_detachevent;var m_objPluginFilesCounter=0;var m_PluginDataHTML;var m_oAvailPlugins;var m_oAvailPlugins=top.XMLLib.objXMLDocTemplate.cloneNode(true);var m_Plugin=top.XMLLib.objXMLDocTemplate.cloneNode(true);m_Plugin.async=false;m_Plugin.load(top.helperLib.wsfMapPath("/mc/shared/xml/Plugin.xml"));var objTemp;var m_arrEventHandlers=new Array();function _attachevent(sEventName,ptrEventHandler){var sEventName=sEventName.toLowerCase();if(m_arrEventHandlers[sEventName]==null){m_arrEventHandlers[sEventName]=new Array()}m_arrEventHandlers[sEventName][ptrEventHandler.toString()]=ptrEventHandler}function _detachevent(sEventName,ptrEventHandler){var sEventName=sEventName.toLowerCase();if(m_arrEventHandlers[sEventName]==null&&m_arrEventHandlers[sEventName][ptrEventHandler.toString()]){m_arrEventHandlers[sEventName][ptrEventHandler.toString()]=null}}function getInstance(wct){var oPlugin=new clsPluginInstance(wct);return oPlugin}function clsPluginInstance(wct){var oPluginHandlersByName=new Array();var oPluginHandlersByIndex=new Array();this.allowSave=getAllowSave;this.wct=wct;initPluginsArray(this);this.onChange=null;this.runtimeSaveEnable=null;this.runtimeSave=null;this.createPluginTools=function(objToolbar){createPluginTools(oPluginHandlersByName,this.wct,objToolbar)};this.notifyToolClick=function(toolId){notifyToolClick(oPluginHandlersByName,this.wct,toolId)};this.notifyToolChange=function(toolId,sValue){notifyToolChange(oPluginHandlersByName,this.wct,toolId,sValue)};this.resetDirtyState=function(){resetDirtyState(this.wct,oPluginHandlersByName)};this.afterDataInit=function(objWindowRef){afterDataInit(objWindowRef,oPluginHandlersByIndex)};function createPluginTools(oPluginHandlersByName,wct,objToolbar){var oPluginHeader=top.XMLLib.objXMLDocTemplate.cloneNode(true);oPluginHeader.loadXML(wct.pluginDef.xml);var oPlugins=oPluginHeader.selectNodes("/document/record");var oMenuOption,sPluginName;var sTaskXML="";var objTool,sPluginName,oMenuOption;var oTool;for(var i=0;i<oPlugins.length;i++){sPluginName=top.XMLLib.getNodeText(oPlugins[i],"pluginName");oMenuOption=top.XMLLib.getNodeText(oPlugins[i],"menuSelected");sTaskXML=oPluginHandlersByName[sPluginName].containerToolXML(oMenuOption);objTool=top.XMLLib.objXMLDocTemplate.cloneNode(true);objTool.loadXML(sTaskXML);oTool=objTool.selectNodes("//task");for(var j=0;j<oTool.length;j++){objToolbar.InsertTool(oTool[j].xml)}}}function notifyToolClick(oPluginHandlersByName,wct,toolId){var arrToolid=toolId.split("_");var sPluginName=arrToolid[1];oPluginHandlersByName[sPluginName].NotifyToolClick(toolId)}function notifyToolChange(oPluginHandlersByName,wct,toolId,sValue){var arrToolid=toolId.split("_");var sPluginName=arrToolid[1];if(wct.eventInstance.record.eventHeader_UniqueID!=""){oPluginHandlersByName[sPluginName].NotifyToolChange(toolId,sValue)}}function resetDirtyState(wct,oPluginHandlersByName){try{var oPlugins=wct.pluginDef.selectNodes("//pluginName");for(var i=0;i<oPlugins.length;i++){try{if(oPluginHandlersByName[oPlugins[i].text]!=null){oPluginHandlersByName[oPlugins[i].text].dirty(false)}}catch(e){}}}catch(e){}}function afterDataInit(objWindowRef,oPluginHandlersByIndex){var windowRef=objWindowRef;for(var i=0;i<oPluginHandlersByIndex.length;i++){try{oPluginHandlersByIndex[i].afterDataInit(windowRef)}catch(e){}}}function initPluginsArray(thisObject){try{var objMenuXML,oResult;var oPlugins=m_oAvailPlugins.selectNodes("/document/record");if(oPlugins==null||oPlugins.length==0||oPlugins[0].text==""){return}for(var i=0;i<oPlugins.length;i++){oPluginHandlersByName[top.XMLLib.getNodeText(oPlugins[i],"objectname")]=eval("new "+top.XMLLib.getNodeText(oPlugins[i],"JScriptClassName")+"()");oPluginHandlersByIndex[i]=oPluginHandlersByName[top.XMLLib.getNodeText(oPlugins[i],"objectname")];oPluginHandlersByIndex[i].PluginCollection=thisObject;oPluginHandlersByIndex[i].pluginName=top.XMLLib.getNodeText(oPlugins[i],"objectname");var sInterface="thisObject."+top.XMLLib.getNodeText(oPlugins[i],"objectname")+"= oPluginHandlersByIndex[i]";eval(sInterface)}}catch(e){}}function getAllowSave(){return(getValidState())}function getValidState(){var bValid=true;for(var i=0;i<oPluginHandlersByIndex.length;i++){try{if(oPluginHandlersByIndex[i].valid==false){bValid=false;return bValid}}catch(e){}}return bValid}}function classReady(){m_objPluginFilesCounter--;if(m_objPluginFilesCounter<=0){initialisePluginsArray()}}function pluginXMLLoaded(objQueue,iCacheIndex){me.activePluginsXML=objQueue.queue[0].XMLObject;if(me.activePluginsXML.xml!=""){m_oAvailPlugins.loadXML("<document/>");var objAvailPlugin=m_oAvailPlugins.selectSingleNode("/document");var arrPluginName=me.activePluginsXML.selectNodes("/document/record/objectname");for(var iCntr=0;iCntr<arrPluginName.length;iCntr++){objAvailPlugin.appendChild(m_Plugin.selectSingleNode("/document/record[objectname='"+arrPluginName[iCntr].text+"']").cloneNode(true))}var changedPlugins=m_oAvailPlugins.selectNodes("/document/record/versiondate");for(var i=0;i<changedPlugins.length;i++){var sourceVersionDate=changedPlugins[i].text;var pluginID=top.XMLLib.getNodeText(changedPlugins[i],"../objectname");var myDate=top.XMLLib.getNodeText(me.activePluginsXML,"/document/record[objectname = '"+pluginID+"']/versiondate");if(myDate.length==0){myDate="2006-05-01"}var daysOld=top.helperLib.getDayDiff(myDate.split("-"),sourceVersionDate.split("-"));if(parseInt(daysOld)>0){top.helperLib.processSoapRequestAsync(null,null,top.helperLib.wsfMapPath("/webservices/wf.designer/designer.asmx"),"WF.Designer","SynchDb","sXML","<![CDATA[<document><record><synchwithapplicationid>"+pluginID+"</synchwithapplicationid><versiondate>"+sourceVersionDate+"</versiondate></record></document>]]>")}}classReady()}}function initialise(){var oPlugins=top.XMLLib.objXMLDocTemplate.cloneNode(true);oPlugins.async=false;oPlugins.load(top.helperLib.wsfMapPath("$application/XML/plugin.xml"));var objQueue=new Object();objQueue.queue=new Array();objQueue.queue[0]=new Object();objQueue.queue[0].XMLObject=oPlugins;pluginXMLLoaded(objQueue,0)}function initialisePluginsArray(){try{var objMenuXML,oResult;var oPlugins=m_oAvailPlugins.selectNodes("/document/record");if(oPlugins==null||oPlugins.length==0||oPlugins[0].text==""){return}for(var i=0;i<oPlugins.length;i++){g_oPluginHandlersByName[top.XMLLib.getNodeText(oPlugins[i],"objectname")]=eval("new "+top.XMLLib.getNodeText(oPlugins[i],"JScriptClassName")+"()");g_oPluginHandlersByIndex[i]=g_oPluginHandlersByName[top.XMLLib.getNodeText(oPlugins[i],"objectname")];g_oPluginHandlersByIndex[i].PluginCollection=me;g_oPluginHandlersByIndex[i].pluginName=top.XMLLib.getNodeText(oPlugins[i],"objectname");var sInterface="me."+top.XMLLib.getNodeText(oPlugins[i],"objectname")+"= g_oPluginHandlersByIndex[i]";eval(sInterface)}}catch(e){}firePluginReadyEvent()}function getDesignerMenuXML(){var dgrMenuXML="";for(var i=0;i<g_oPluginHandlersByIndex.length;i++){try{dgrMenuXML+=g_oPluginHandlersByIndex[i].designerMenuXML()}catch(e){}}return dgrMenuXML}function designerClickMenuItem(sMenuName,sXML){var sArgs="";sPluginName=sMenuName.split("_")[1];g_oPluginHandlersByName[sPluginName].designerClickMenuItem(sMenuName.split("_")[0],sXML,arguments[2],arguments[3],arguments[4])}function _raiseevent(sEventName,evt){if(evt==null){evt=new Object()}evt.type=sEventName;evt.srcElement=me.m_element;var ptrCollection=m_arrEventHandlers[sEventName];for(k in ptrCollection){try{ptrCollection[k](evt)}catch(e){}}}function firePluginReadyEvent(){_raiseevent("onpluginready")}function afterDataInitClosedEvent(){for(var i=0;i<g_oPluginHandlersByIndex.length;i++){try{g_oPluginHandlersByIndex[i].afterDataInitClosedEvent()}catch(e){}}}}var m_objPlugin;var m_oAsyncGetStandAloneListPtr=null;var m_oMenusXML=null;var m_oSystemMenuXML;var m_arrPluginMenus=new Array();var m_objQuickLaunch=null;var processed=false;function defaultPage(){this.init=l;this.onSelect=d;this.showMenu=y;var m=null;this.signOut=C;this.hideHeader=b;this.myinfo=h;this.design=B;this.updatePageSize=p;this.login=e;this.closeTab=x;function x(G){m_objTabset.removeTab(G)}function B(){var G="http://design.wolfframeworks.com";if(top.appid!=null){G+="?appid="+top.appid}window.open(G,"wsfdesigner")}function h(){var G="<TreeNode><xml><def><type>menulevel1</type><id>x1</id><bfu>/widgets/templates/n/n.html?brokerid=sysUsers.PluginSecurity&amp;t=myset&amp;content=/content/editpage.xml</bfu></def></xml></TreeNode>";d(null,G,"My Info","menulevel1",false)}function b(){var G=document.getElementById("hideheader");if(G.innerHTML.indexOf("Hide Header")>=0){document.body.className+=" noheader";G.innerHTML="Show Header"}else{document.body.className=document.body.className.replace("noheader","");G.innerHTML="Hide Header"}windowresized(true)}function C(){top.helperLib.processSoapRequestAsync(null,null,top.helperLib.wsfMapPath("/webservices/wf.session/session.asmx"),"wf.Session","SignOut");try{if(top.context.session.application.signoutTo!=null){top.window.location=top.helperLib.wsfMapPath(top.context.session.application.signoutTo)}else{top.window.location.reload()}}catch(G){}}function y(H,G,I){var J=top.context.userMenuXML.selectSingleNode("//TreeNode[xml/def/id ='"+H+"']");d(null,J,J.getAttribute("Title"),"leaf",false,G,I)}function d(V,I,R,T,aa,J,S){if(I!=null&&R!=null&&T!=null){m_objCurrentNodeXML=I}else{var Z=V.node;m_objCurrentNodeXML=Z.getXMLElement();R=Z.getTitle();T=Z.type}if(S!=null){R=S}switch(top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/type").toLowerCase()){case"menulevel2":case"menulevel1":var P="";if(aa!=false){toggleMenu()}var Y=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/bfu");var M=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/isobject").toLowerCase();var W=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/LRBrokerID");var ab=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/BrokerID");var ad=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/LRSearchTemplateName");var H=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/LRName");var U=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/id");var K=(top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/ispopup").toLowerCase()=="1");var Q=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/dialogargs");var af=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/image");var L=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/ScreenType");var O=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/appID");if(O.length==0){O=top.context.session.applicationid}P=top.helperLib.wsfMapPath(Y,O);if(U=="0.7"){P=top.helperLib.wsfMapPath("/mc/em/Application/pluginsecurity/objects/release/help.htm");af=top.helperLib.wsfMapPath("/widgets/assets/taskhelp16.gif")}if(T!="parent"&&M!="false"){var G=new top.EMLib.clsWCT();G.LRBrokerId=W;G.LRSearchName=ad;G.LRName=H;if(ab.length>0){top.helperLib.showLoading(window);var N=ab.split(".")[0];P=top.EMLib.getObjectBFU(N,ad)}G.bfu=P;var ac=new Object();if(Q.length>0){ac.dialogArgs=Q}top.context.firstMenuTitle=R;if(!K){var X="frame_"+U.replace(/\./g,"");if(J!=null){X=X+"_"+J}objFrame=v[X];if(objFrame==null){v[X]=window.document.getElementById("objectframe").cloneNode(true);objFrame=v[X];objFrame.id=X;objFrame.name=X;objFrame.className="tabchild tabInnerFrame";window.document.getElementById("objectframe").parentNode.appendChild(objFrame);ac.target=objFrame.contentWindow;ac.targetObject=objFrame;G.menuId=U;top.EMLib.openObject(G,ac);var ae='<tab id="tab_'+X+'" tabid="'+X+'" ><allowclose>yes</allowclose><name>'+R+"</name><image>"+af+"</image><tooltip></tooltip></tab>";m_objTabset.addTab(ae.replace(/&(?!amp;)/g,"&amp;"))}else{top.helperLib.hideLoading(window)}ac.target=null;ac.targetObject=null;m_objTabset.selectTab("tab_"+X)}else{top.helperLib.hideLoading(window);top.EMLib.openObject(G)}}else{if(M=="false"){window.open(P,"newone","height=600,width=800,status=no,toolbar=no,menubar=no,location=no")}}break}}function g(G){if(D.document&&D.document.readyState!="complete"){return}top.helperLib.detachEvents(window,D,"onload",g);top.helperLib.detachEvents(window,D,"onreadystatechange",g);D.parentNode.removeChild(D);v[D.id]=null;D=null}var D;function o(G){D=v[G.tab.getAttribute("tabid")];top.helperLib.attachEvents(window,D,"onload",g);top.helperLib.attachEvents(window,D,"onreadystatechange",g);D.src="about:blank"}var v=new Array();function l(){window.onunload=C;top.helperLib.showLoading(window);using("XMLLib");using("DHTMLLib");using("EMLib");using("helperLib");m_objQuickLaunch=top.XMLLib.objXMLDocTemplate.cloneNode(true);m_objTabset.attachEvents("onremovetab",o);c();document.getElementById("safariQuirk").click()}var n=0;function j(G){m_oMenusXML=G;t();n++}function F(){if(top.context.plugin.activePluginsXML==null){setTimeout(F,10);return}try{var G="";if(top.context.plugin!=null&&top.context.plugin.activePluginsXML!=null){var H=top.context.plugin.activePluginsXML.selectNodes("//objectname");for(var I=0;I<H.length;I++){m_arrPluginMenus[H[I].text]={appId:H[I].text};new wflib.XMLLib.loadXml(top.helperLib.wsfMapPath("$application/xml/menus.xml",H[I].text),H[I].text,f)}}}catch(J){alert(J.message)}}var s=false;function f(I,H){m_arrPluginMenus[H].xmlObject=I;for(var G in m_arrPluginMenus){if(m_arrPluginMenus[G].xmlObject==null){return}}s=true;t()}function a(){if(top.XMLLib.getNodeText(top.context.session.sessionXML,"//WFchangepasswordonnextlogon")=="1"){var G=new top.EMLib.clsWCT();G.brokerid="sysChangePassword.PluginSecurity";G.bfu=top.helperLib.wsfMapPath("/mc/em/application/pluginsecurity/objects/release/sysChangePassword.html");var H=new z();H.dialogArgs="dialogHeight:340px;dialogWidth:630px";top.EMLib.openObject(G,H)}}function z(){this.location="";this.data="<document><record/></document>";this.meta;this.title="";this.behavior=null;this.behaviorArgs=null;this.dialogArgs=null}function u(J,I,G){if(I.xmlObject.selectSingleNode("//TreeNode")!=null){var H=top.XMLLib.transformXML("<document><sysmenu>"+J+"</sysmenu>"+I.xmlObject.xml.replace("<Tree","<Tree appID='"+I.appId+"'")+"</document>",G);return H}else{return J}}function t(){if(s==false||m_oMenusXML==null||m_oSystemMenuXML==null){return}if(processed==true){return top.helperLib.hideLoading(window)}var N=top.XMLLib.transformXML("<document><sysmenu>"+m_oSystemMenuXML.xml+"</sysmenu>"+m_oMenusXML.xml+"</document>",top.context.cache.mergemenus);for(var G in m_arrPluginMenus){N=u(N,m_arrPluginMenus[G],top.context.cache.mergemenus)}var M="<document><application>"+N+top.context.session.sessionXML.xml+"</application></document>";M=top.XMLLib.transformXML(M,top.context.cache.userprofilemenumap);m_objQuickLaunch.loadXML(M);if(m_objQuickLaunch.documentElement.childNodes.length==0){function I(){window.close()}top.helperLib.errLogAsync(I,"","","","You do not have sufficient privileges to use the application <br> Please contact your <b>system administrator<b>")}top.context.userMenuXML=m_objQuickLaunch.selectSingleNode("/").cloneNode(true);if(top.context.userMenuXML.xml==""){top.context.userMenuXML=m_objQuickLaunch.selectSingleNode("/Tree").cloneNode(true)}var J=m_objQuickLaunch.selectNodes("//TreeNode[xml/def/widget]");for(var H=J.length-1;H>=0;H--){var L=J[H].parentNode;L.removeChild(J[H])}M=m_objQuickLaunch.xml;try{window.document.getElementById("navigationFrame").contentWindow.mc_tree.rebuild(M)}catch(K){}if(top.context.session.application.customSplashScript!=null){document.getElementById("Iframe0").src=top.helperLib.wsfMapPath("/mc/blanksplash.htm")}else{document.getElementById("Iframe0").src=top.helperLib.wsfMapPath("/mc/splash.htm")}top.helperLib.hideLoading(window);setTimeout(a,1000);processed=true}function r(G){top.context.applicationpopup=G.selectSingleNode("/document/record[@id = 'applicationpopup']/document").cloneNode(true);m_oSystemMenuXML=G.selectSingleNode("/document/record[@id = 'systemmenus']/Tree").cloneNode(true);t()}function w(G){if(top.context==null||G==false){return}windowresized();top.helperLib.showLoading(window);if(top.context.plugin!=null&&top.context.plugin!=""){top.context.plugin.attachEvent("onpluginready",q);top.context.plugin.initialise()}window.document.getElementById("logofftool").style.display="inline-block";window.document.getElementById("welcomemsg").innerHTML="Welcome <b>"+top.context.session.username+"</b>";if(top.context.session.designer||top.context.session.userid=="0"){window.document.getElementById("designtool").style.display="inline-block"}top.context.runtimeInit();A();new wflib.XMLLib.loadXml(top.helperLib.wsfMapPath("$application/xml/attachments.xml"),"Attachments",null);new wflib.XMLLib.loadXml(top.helperLib.wsfMapPath("/mc/shared/xml/shared.xml"),null,r);new wflib.XMLLib.loadXml(top.helperLib.wsfMapPath("$application/xml/menus.xml"),null,j)}function e(){top.helperLib.hideLoading(window);bStatus=top.EMLib.doLogin(m,w)}function i(G,H){if(H==""){return G}else{return H}}function A(){top.DHTMLLib.addStyleSheet(top.helperLib.wsfMapPath("$skin/colors.css"));top.document.title=top.context.session.application.name+" - "+top.context.session.username;var I=top.context.session.application;if(I.customenvbr!=null){var P=top.EMLib.processBusinessRule(I.customenvbr,"<document><record/></document>");if(P!=null){var N=/%26/g;P=P.replace(N,"&amp;");I.solutionImage=i(I.solutionImage,top.XMLLib.getNodeText(P,"//solutionimage"));I.headerfontcolor=i(I.headerfontcolor,top.XMLLib.getNodeText(P,"//headerfontcolor"));I.headerbgcolor=i(I.headerbgcolor,top.XMLLib.getNodeText(P,"//headerbgcolor"));top.context.session.application.name=top.helperLib.HTMLDecode(i(top.context.session.application.name,top.XMLLib.getNodeText(P,"//solutionname")))}}if(I.solutionImage==null||I.solutionImage==""){I.solutionImage="/widgets/assets/logo-wolf.png"}if(I.headerbgcolor){window.document.getElementById("logoContainer").style.backgroundColor=I.headerbgcolor}var O=window.document.getElementById("company-logo");var G=window.document.getElementById("applicationName");var J=window.document.getElementById("welcomemsg");var M=window.document.getElementById("logofftool");var K=window.document.getElementById("designtool");var L=window.document.getElementById("environmenttools");if(I.headerfontcolor){G.style.color=I.headerfontcolor;J.style.color=I.headerfontcolor;M.style.color=I.headerfontcolor}O.src=top.helperLib.wsfMapPath(I.solutionImage);G.innerHTML="<span id='"+(I.headerbgcolor==null?"filler":"")+"'></span>"+top.context.session.application.name+"";if(I.footer==null||I.footer==""){I.footer="© 2008-2009 Wolf Frameworks"}window.document.getElementById("copyright").innerHTML=I.footer;window.document.getElementById("termsofuse").innerHTML="<a target='_blank' href='"+top.helperLib.wsfMapPath(I.termsOfUse)+"'>Terms of Use</a>";top.EMLib.getPropertyValue("consolePage",E);if(I.codebehind!=null){top.DHTMLLib.addScript(top,top.helperLib.wsfMapPath(I.codebehind))}var H=window.location.protocol+"//run.wolfframeworks.com/webservices/wf.handlers/javascript.ashx?appid=workspace&host=wolfframeworks.com&key=91029832776182818272828&service=processbusinessrule&rulename=Recent Logins&callback=checkResponse&soln_id="+top.context.session.applicationid+"&user_name="+top.context.session.username+"&soln_name="+top.context.session.application.name;top.DHTMLLib.addScript(top,H)}function p(){var H=top.DHTMLLib.getEvent(window,arguments);var I=top.DHTMLLib.getEventSrcElement(H);var G=top.context.session.defaultPageSize;if(G==I.value){return}top.EMLib.updatePropertyValue("pageSize",I.value,"consolePage");top.context.session.defaultPageSize=I.value}function E(H){var G=top.XMLLib.getNodeText(H.personalisationXML,"//record[P = 'pageSize']/V").split(",");if(G==""){return}document.getElementById("defaultpagesize").value=G;top.context.session.defaultPageSize=G}function q(){F()}function c(){m=new clsPlugin()}}var KEYCODE_LEFT=37;var KEYCODE_UP=38;var KEYCODE_RIGHT=39;function clsTabset(){var m_objMetaXML,m_objMasterTable,m_objTabRow,m_objContentRow,m_objTabContent;var tabContainer;var scrollContainer;var m_objSelected,m_objGlow,m_objHighlight,m_objTabMainDiv;var orientation="top";var me=this;this.init=initObjects;this._onmouseover=onTabMouseOver;this._onmouseout=onTabMouseOut;this._onkeyup=keyUp;this._onclick=onTabClick;this._onfocus=onTabClick;this.refreshDisplay=_refreshDisplay;this.hide=_hide;this.show=_show;this.dispose=_dispose;this.addTab=addTab;this.removeTab=_deleteTab;this.selectTab=selectTab;this.closeImage=top.helperLib.wsfMapPath("/widgets/assets/close16.gif");this.setCaption=setCaption;this.getTabElement=_getTabElement;var eventHandler=new top.helperLib.clsEventHandler();this.attachEvents=eventHandler.attachEvent;this.detachEvents=eventHandler.detachEvent;this.raiseEvent=eventHandler.raiseEvent;function _getTabElement(sTabId,exactMatch){var tabElement;if(exactMatch!=true){tabElement=window.document.getElementById(sTabId)||m_objSelected}else{tabElement=window.document.getElementById(sTabId)}if(tabElement==null){tabElement=window.document.getElementById("tab_maindiv_"+sTabId)}return tabElement}function _deleteTab(sTabId){var objSource=_getTabElement(sTabId,true);if(objSource==null&&sTabId==null){objSource=m_objSelected}if(objSource==null){return}removeTab(objSource)}function _hide(sTabId){var objSource=_getTabElement(sTabId);if(objSource==null){return false}else{objSource.style.display="none"}}function _show(sTabId){var objSource=_getTabElement(sTabId);if(objSource==null){objSource=window.document.getElementById("tab_maindiv_"+sTabId)}if(objSource==null){return false}else{if(objSource.style.display=="none"){objSource.style.display="block"}}}function _dispose(){m_objMetaXML=null;m_objMasterTable=null;m_objTabRow=null;m_objContentRow=null;m_objTabContent=null;m_objGlow=null;m_objHighlight=null;m_objTabMainDiv=null;try{eventHandler.dispose()}catch(e){}me.attachEvents=null;me.detachEvents=null;me.raiseEvent=null}function getTabsContainer(){}function addTab(sTabXML){var objTabXML=top.XMLLib.objXMLDocTemplate.cloneNode(true);objTabXML.loadXML(sTabXML);var objTabSpan=tabContainer.appendChild(document.createElement("SPAN"));objTabSpan.setAttribute("type","tab");with(objTabSpan){id=objTabXML.documentElement.getAttribute("id");var sImage=top.XMLLib.getNodeText(objTabXML,"//image");if(sImage.length>0){sImage="<image src='"+top.helperLib.wsfMapPath(sImage)+"' align='absmiddle'/>&nbsp;&nbsp;"}var sClose=top.XMLLib.getNodeText(objTabXML,"//allowclose");if(sClose!="no"){sClose="<span type='tab_close' class='tabclose' onmouseover='this.className=\"tabclosehover\";event.cancelBubble=true;' onmouseout='this.className=\"tabclose\";event.cancelBubble=true;' ></span>"}else{sClose=""}innerHTML="<nobr><span>"+sImage+top.XMLLib.getNodeText(objTabXML,"//name")+"</span>"+sClose+"</nobr>";className="tab";if(sClose.length>0){className+=" tabwithclose"}setAttribute("unselectable","on");setAttribute("hideFocus","true");setAttribute("MetaXML",objTabXML.xml);setAttribute("tabid",objTabXML.documentElement.getAttribute("tabid"));setAttribute("name",objTabXML.documentElement.getAttribute("id"));setAttribute("index",m_objTabRow.cells[0].childNodes.length-3);if(objTabXML.documentElement.getAttribute("tabid")!=null){var objTab=window.document.getElementById(objTabXML.documentElement.getAttribute("tabid"));if(objTab!=null&&objTab.parentNode!=m_objTabContent){m_objTabContent.appendChild(objTab);top.DHTMLLib.addClass(objTab,"tabchild");objTab.style.overflow="auto"}}if((objTabSpan.readyState&&objTabSpan.readyState=="complete")||(!objTabSpan.readyState)){top.helperLib.attachEvents(window,objTabSpan,"onclick",onTabClick);top.helperLib.attachEvents(window,objTabSpan,"onfocus",onTabClick);top.helperLib.attachEvents(window,objTabSpan,"onmouseover",onTabMouseOver);top.helperLib.attachEvents(window,objTabSpan,"onmouseout",onTabMouseOut);top.helperLib.attachEvents(window,objTabSpan,"onkeyup",keyUp)}else{top.helperLib.attachEvents(window,objTabSpan,"onreadystatechange",tabspanReady)}}var evt=new Object;evt.tab=objTabSpan;me.raiseEvent("onaddtab",evt);return(objTabSpan)}function tabspanReady(){var objSource=null;try{objSource=window.event.srcElement}catch(e){objSource=arguments[0]}if(objSource.readyState!="complete"){return}objSource.detachEvent("onreadystatechange",tabspanReady);top.helperLib.attachEvents(window,objSource,"onclick",onTabClick);top.helperLib.attachEvents(window,objSource,"onfocus",onTabClick);top.helperLib.attachEvents(window,objSource,"onmouseover",onTabMouseOver);top.helperLib.attachEvents(window,objSource,"onmouseout",onTabMouseOut);top.helperLib.attachEvents(window,objSource,"onkeyup",keyUp)}function tabClick(objClicked){if(m_objSelected==objClicked){return}if(m_objSelected!=null){showContent(false,m_objSelected);top.DHTMLLib.removeClass(m_objSelected,"clicked"+orientation)}top.DHTMLLib.addClass(objClicked,"clicked"+orientation);showContent(true,objClicked);m_objSelected=objClicked;positionHighlight();m_objGlow.style.visibility="hidden";try{fireTabClick(objClicked)}catch(ex){setTimeout(function(){fireTabClick(objClicked)},100)}}function _refreshDisplay(){positionHighlight()}function positionHighlight(){try{with(m_objHighlight.style){left=(m_objSelected.offsetLeft+1)+"px";top=(m_objSelected.offsetTop-1)+"px";width=(m_objSelected.offsetWidth-2)+"px";visibility="visible"}}catch(e){}}function fireTabClick(objClicked){var evt=new Object();evt.tab=objClicked;evt.srcElement=objClicked;me.raiseEvent("ontabclick",evt);evt.tab=null;evt.srcElement=null}function keyUp(){var nextSibling=top.XMLLib.getNodeNextSibling(m_objSelected);var previousSibling=top.XMLLib.getNodePreviousSibling(m_objSelected);switch(window.event.keyCode){case KEYCODE_RIGHT:if(nextSibling!=null){tabClick(nextSibling)}break;case KEYCODE_LEFT:if(previousSibling!=null){if(previousSibling.tagName=="SPAN"){tabClick(previousSibling)}}break;break}}function showContent(bVisible,obj){try{var tabId=obj.getAttribute("tabid");if(tabId&&tabId!=""){var objTemp=document.getElementById(tabId);if(objTemp!=null){if(bVisible){top.DHTMLLib.removeClass(objTemp,"tabchild")}else{top.DHTMLLib.addClass(objTemp,"tabchild")}}}}catch(e){}}function removeTab(objClicked){if(m_objSelected==objClicked){var nextSibling=top.XMLLib.getNodeNextSibling(objClicked);var previousSibling=top.XMLLib.getNodePreviousSibling(objClicked);if(previousSibling!=null){selectTab(previousSibling.id)}else{if(nextSibling!=null){selectTab(nextSibling.id)}}}top.helperLib.detachEvents(window,objClicked,"onclick",onTabClick);top.helperLib.detachEvents(window,objClicked,"onfocus",onTabClick);top.helperLib.detachEvents(window,objClicked,"onmouseover",onTabMouseOver);top.helperLib.detachEvents(window,objClicked,"onmouseout",onTabMouseOut);top.helperLib.detachEvents(window,objClicked,"onkeyup",keyUp);var evt=new Object;evt.tab=objClicked;evt.srcElement=objClicked;me.raiseEvent("onremovetab",evt);var objParent=objClicked.parentNode;objParent.removeChild(objClicked);evt.tab=null;evt.srcElement=null;objClicked=null}function checkScrolling(){objScroll=scrollContainer.insertAdjacentHTML("afterbegin",'<span class="alltabs" id="'+m_objTabMainDiv.id+'scrolltab"><span id="'+m_objTabMainDiv.id+'leftscroll" type="l" class="leftscroll" ></span><span id="'+m_objTabMainDiv.id+'rightscroll" type="r" class="rightscroll"></span></span>');top.helperLib.attachEvents(window,window.document.getElementById(m_objTabMainDiv.id+"scrolltab"),"onmouseover",handleScroll);top.helperLib.attachEvents(window,window.document.getElementById(m_objTabMainDiv.id+"scrolltab"),"onmouseout",cancelScroll);if(objScroll){objScroll.style.right="0px"}}var m_sScrollDirection="";function cancelScroll(){m_sScrollDirection=""}function handleScroll(evt){if(evt==null){evt=window.event}var srcElement=top.DHTMLLib.getEventSrcElement(evt);m_sScrollDirection="";if(srcElement.getAttribute("type")=="r"){m_sScrollDirection="right"}else{if(srcElement.getAttribute("type")=="l"){m_sScrollDirection="left"}}loopScroll()}function loopScroll(){if(m_sScrollDirection!=""){if(m_sScrollDirection=="left"){tabContainer.scrollLeft-=14}else{tabContainer.scrollLeft+=14}setTimeout(loopScroll,40)}}function onTabClick(e){var objClicked=(window.event)?window.event.srcElement:((e)?e.target:arguments.callee.caller.arguments[0].target);var objTab=objClicked;for(var i=1;i<10;i++){if(objTab.getAttribute("type")=="tab"){break}objTab=objTab.parentNode}if(objClicked.getAttribute("type")=="tab_close"){removeTab(objTab);return}tabClick(objTab)}function onTabMouseOut(){if(m_objGlow!=null){m_objGlow.style.visibility="hidden"}}function initObjects(sPrefix){if(m_objGlow!=null){return}if(sPrefix==null){sPrefix=""}m_objGlow=window.document.getElementById(sPrefix+"tabglow");m_objHighlight=window.document.getElementById(sPrefix+"tabhighlight");m_objTabMainDiv=window.document.getElementById(sPrefix+"tab_maindiv");m_objTabRow=m_objTabMainDiv.rows[0];m_objTabContent=m_objTabMainDiv.rows[1].cells[0];tabContainer=GetHtmlElement(m_objTabRow.cells[0],"div");if(tabContainer==null||tabContainer.tagName!="DIV"){tabContainer=m_objTabRow.cells[0];scrollContainer=tabContainer}else{scrollContainer=tabContainer.parentNode}var objSelected=GetHtmlElement(m_objTabMainDiv,"SPAN","tab");for(var i=0;i<100;i++){if(objSelected==null){break}if(objSelected.className.indexOf("clickedtop")>=0){break}objSelected=objSelected.nextSibling}if(objSelected!=null){tabClick(objSelected)}checkScrolling()}function GetHtmlElement(objParent,strChildTagName,strType){var i=0;var objRetVal=null;var oChildren=null;if(objParent){oChildren=objParent.childNodes}for(i=0;oChildren&&i<oChildren.length;i++){var child=oChildren[i];if(child.tagName){if(child.tagName.toUpperCase()==strChildTagName.toUpperCase()&&(child.getAttribute("type")==strType||strType==null)){objRetVal=child;break}objRetVal=GetHtmlElement(child,strChildTagName,strType)}if(objRetVal!=null){break}}return objRetVal}var m_sSpeedDate;function onTabMouseOver(e){var o=(window.event)?window.event.srcElement:((e)?e.target:arguments.callee.caller.arguments[0].target);highlightTab(o)}function highlightTab(objTab){for(var i=0;i<10;i++){if(objTab.getAttribute("type")=="tab"){break}objTab=objTab.parentNode}if(m_objGlow==null){return}m_objGlow.style.visibility="visible";m_objGlow.style.left=(objTab.offsetLeft+1)+"px";m_objGlow.style.top=(objTab.offsetTop-1)+"px";m_objGlow.style.width=(objTab.offsetWidth-2)+"px"}function selectTab(sTabId){var objSource=_getTabElement(sTabId);if(objSource==null){return false}else{tabClick(objSource);return true}}function setCaption(sNewCaption,sTabId){var objSource=window.document.getElementById(sTabId)||m_objSelected;if(objSource==null){return false}else{var nobr=objSource.getElementsByTagName("NOBR");top.XMLLib.getNodeFirstChild(nobr[0]).innerHTML=sNewCaption;if(m_objSelected.id==objSource.id){m_objHighlight.style.width=objSource.offsetWidth-2}return true}}};
