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=_init;this.onSelect=_onSelect;this.showMenu=_showMenu;var m_objPlugin=null;this.signOut=_signOut;this.hideHeader=_hideHeader;this.design=_design;this.updatePageSize=_updatePageSize;this.login=_login;function _design(){var designUrl="http://design.wolfframeworks.com";if(top.appid!=null){designUrl+="?appid="+top.appid}window.open(designUrl,"wsfdesigner")}function _hideHeader(){var headerElement=document.getElementById("hideheader");if(headerElement.innerHTML.indexOf("Hide Header")>=0){document.body.className+=" noheader";headerElement.innerHTML="Show Header"}else{document.body.className=document.body.className.replace("noheader","");headerElement.innerHTML="Hide Header"}windowresized(true)}function _signOut(){top.helperLib.processSoapRequestAsync(null,null,top.helperLib.wsfMapPath("/webservices/wf.session/session.asmx"),"wf.Session","SignOut");top.window.location.reload()}function _showMenu(sMenuId,sNewTabSuffix,sTabCaption){var objCurrentTreeNode=top.context.userMenuXML.selectSingleNode("//TreeNode[xml/def/id ='"+sMenuId+"']");_onSelect(null,objCurrentTreeNode,objCurrentTreeNode.getAttribute("Title"),"leaf",false,sNewTabSuffix,sTabCaption)}function _onSelect(evt,objNode,sTitle,sType,bToggleMenu,sNewTabSuffix,sTabCaption){if(objNode!=null&&sTitle!=null&&sType!=null){m_objCurrentNodeXML=objNode}else{var node=evt.node;m_objCurrentNodeXML=node.getXMLElement();sTitle=node.getTitle();sType=node.type}if(sTabCaption!=null){sTitle=sTabCaption}switch(top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/type").toLowerCase()){case"menulevel2":case"menulevel1":var slink="";if(bToggleMenu!=false){toggleMenu()}var sBFU=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/bfu");var sIsObject=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/isobject").toLowerCase();var sLRBrokerId=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/LRBrokerID");var sBrokerId=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/BrokerID");var sScreenName=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/LRSearchTemplateName");var sLRName=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/LRName");var sMenuId=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/id");var isPopup=(top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/ispopup").toLowerCase()=="1");var sDialogArgs=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/dialogargs");var sImage=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/image");var screenType=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/ScreenType");var menuAppID=top.XMLLib.getNodeText(m_objCurrentNodeXML,".//def/appID");if(menuAppID.length==0){menuAppID=top.context.session.applicationid}slink=top.helperLib.wsfMapPath(sBFU,menuAppID);if(sMenuId=="0.7"){slink=top.helperLib.wsfMapPath("/mc/em/Application/pluginsecurity/objects/release/help.htm");sImage=top.helperLib.wsfMapPath("/widgets/assets/taskhelp16.gif")}if(sType!="parent"&&sIsObject!="false"){var wct=new top.EMLib.clsWCT();wct.LRBrokerId=sLRBrokerId;wct.LRSearchName=sScreenName;wct.LRName=sLRName;if(sBrokerId.length>0){top.helperLib.showLoading(window);var sObjectName=sBrokerId.split(".")[0];slink=top.EMLib.getObjectBFU(sObjectName,sScreenName)}wct.bfu=slink;var objWindowArgs=new Object();if(sDialogArgs.length>0){objWindowArgs.dialogArgs=sDialogArgs}top.context.firstMenuTitle=sTitle;if(!isPopup){var sTempMenuId="frame_"+sMenuId.replace(/\./g,"");if(sNewTabSuffix!=null){sTempMenuId=sTempMenuId+"_"+sNewTabSuffix}objFrame=colObjectFrames[sTempMenuId];if(objFrame==null){colObjectFrames[sTempMenuId]=window.document.getElementById("objectframe").cloneNode(true);objFrame=colObjectFrames[sTempMenuId];objFrame.id=sTempMenuId;objFrame.name=sTempMenuId;objFrame.className="tabchild tabInnerFrame";window.document.getElementById("objectframe").parentNode.appendChild(objFrame);objWindowArgs.target=objFrame.contentWindow;objWindowArgs.targetObject=objFrame;wct.menuId=sMenuId;top.EMLib.openObject(wct,objWindowArgs);var tabXML='<tab id="tab_'+sTempMenuId+'" tabid="'+sTempMenuId+'" ><allowclose>yes</allowclose><name>'+sTitle+"</name><image>"+sImage+"</image><tooltip></tooltip></tab>";m_objTabset.addTab(tabXML.replace(/&(?!amp;)/g,"&amp;"))}else{top.helperLib.hideLoading(window)}objWindowArgs.target=null;objWindowArgs.targetObject=null;m_objTabset.selectTab("tab_"+sTempMenuId)}else{top.helperLib.hideLoading(window);top.EMLib.openObject(wct)}}else{if(sIsObject=="false"){window.open(slink,"newone","height=600,width=800,status=no,toolbar=no,menubar=no,location=no")}}break}}function onRemoveReady(e){if(m_tempFrameToRemove.document&&m_tempFrameToRemove.document.readyState!="complete"){return}top.helperLib.detachEvents(window,m_tempFrameToRemove,"onload",onRemoveReady);top.helperLib.detachEvents(window,m_tempFrameToRemove,"onreadystatechange",onRemoveReady);m_tempFrameToRemove.parentNode.removeChild(m_tempFrameToRemove);colObjectFrames[m_tempFrameToRemove.id]=null;m_tempFrameToRemove=null}var m_tempFrameToRemove;function removeTab(evt){m_tempFrameToRemove=colObjectFrames[evt.tab.getAttribute("tabid")];top.helperLib.attachEvents(window,m_tempFrameToRemove,"onload",onRemoveReady);top.helperLib.attachEvents(window,m_tempFrameToRemove,"onreadystatechange",onRemoveReady);m_tempFrameToRemove.src="about:blank"}var colObjectFrames=new Array();function _init(){window.onunload=_signOut;top.helperLib.showLoading(window);using("XMLLib");using("DHTMLLib");using("EMLib");using("helperLib");using("cacheLib");m_objQuickLaunch=top.XMLLib.objXMLDocTemplate.cloneNode(true);m_objTabset.attachEvents("onremovetab",removeTab);_initplugins();document.getElementById("safariQuirk").click()}var iCount=0;function xmlLoaded(objQueue,iCacheIndex){m_oMenusXML=objQueue.queue[0].XMLObject;nowProcessIt();iCount++}function pluginXMLLoaded(){if(top.context.plugin.activePluginsXML==null){setTimeout(pluginXMLLoaded,10);return}try{var sCacheStatement='top.context.cacheUtil.loadXMLFromCache("notrelobject", sPluginMenuLoaded,"#applicationid#"';var tagVariants="";if(top.context.plugin!=null&&top.context.plugin.activePluginsXML!=null){var oPlugins=top.context.plugin.activePluginsXML.selectNodes("//objectname");for(var k=0;k<oPlugins.length;k++){sCacheStatement+=',"'+top.helperLib.wsfMapPath("/mc/em/application/"+oPlugins[k].text+"/xml/menus.xml")+'"';tagVariants+=oPlugins[k].text+","}if(oPlugins.length>0){sCacheStatement=sCacheStatement.replace("#applicationid#",tagVariants);sCacheStatement=sCacheStatement+")";m_bPluginMenuLoaded=false;eval(sCacheStatement)}}}catch(e){alert(e.message)}}var m_bPluginMenuLoaded=false;function sPluginMenuLoaded(objQueue,iCacheIndex){m_bPluginMenuLoaded=true;var arrTagVariants=objQueue.tagVariant.split(",");for(var i=0;i<objQueue.queue.length;i++){m_arrPluginMenus[i]={};m_arrPluginMenus[i].appID=arrTagVariants[i];m_arrPluginMenus[i].xmlObject=objQueue.queue[i].XMLObject}nowProcessIt()}function openChangePwdLogin(){if(top.XMLLib.getNodeText(top.context.session.sessionXML,"//WFchangepasswordonnextlogon")=="1"){var objWct=new top.EMLib.clsWCT();objWct.brokerid="sysChangePassword.PluginSecurity";objWct.bfu=top.helperLib.wsfMapPath("/mc/em/application/pluginsecurity/objects/release/sysChangePassword.html");var objArgs=new DialogArgs();objArgs.dialogArgs="dialogHeight:302px;dialogWidth:630px";top.EMLib.openObject(objWct,objArgs)}}function DialogArgs(){this.location="";this.data="<document><record/></document>";this.meta;this.title="";this.behavior=null;this.behaviorArgs=null;this.dialogArgs=null}function mergeWithMenus(sMenusXML,oMergeMenu,oMergeMenusXSL){if(oMergeMenu.xmlObject.selectSingleNode("//TreeNode")!=null){var sReturnValue=top.XMLLib.transformXML("<document><sysmenu>"+sMenusXML+"</sysmenu>"+oMergeMenu.xmlObject.xml.replace("<Tree","<Tree appID='"+oMergeMenu.appID+"'")+"</document>",oMergeMenusXSL);return sReturnValue}else{return sMenusXML}}function nowProcessIt(){if(m_bPluginMenuLoaded==false||m_oMenusXML==null||processed==true){return top.helperLib.hideLoading(window)}var sMenusXML=top.XMLLib.transformXML("<document><sysmenu>"+m_oSystemMenuXML.xml+"</sysmenu>"+m_oMenusXML.xml+"</document>",top.context.cache.mergemenus);for(var i=0;i<m_arrPluginMenus.length;i++){sMenusXML=mergeWithMenus(sMenusXML,m_arrPluginMenus[i],top.context.cache.mergemenus)}var sMergeXML="<document><application>"+sMenusXML+top.context.session.sessionXML.xml+"</application></document>";sMergeXML=top.XMLLib.transformXML(sMergeXML,top.context.cache.userprofilemenumap);m_objQuickLaunch.loadXML(sMergeXML);if(m_objQuickLaunch.documentElement.childNodes.length==0){function _cb_closeOnError(){window.close()}top.helperLib.errLogAsync(_cb_closeOnError,"","","","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 eWidgetNodes=m_objQuickLaunch.selectNodes("//TreeNode[xml/def/widget]");for(var i=eWidgetNodes.length-1;i>=0;i--){var eWidgetParent=eWidgetNodes[i].parentNode;eWidgetParent.removeChild(eWidgetNodes[i])}sMergeXML=m_objQuickLaunch.xml;try{window.document.getElementById("navigationFrame").contentWindow.mc_tree.rebuild(sMergeXML)}catch(e){}document.getElementById("Iframe0").src=top.helperLib.wsfMapPath("/mc/splash.htm");top.helperLib.hideLoading(window);setTimeout(openChangePwdLogin,1000);processed=true}function sharedXMLLoaded(objQueue,iCacheIndex){top.context.applicationpopup=objQueue.queue[0].XMLObject.selectSingleNode("/document/record[@id = 'applicationpopup']/document").cloneNode(true);m_oSystemMenuXML=objQueue.queue[0].XMLObject.selectSingleNode("/document/record[@id = 'systemmenus']/Tree").cloneNode(true)}function _loginComplete(returnValue){if(top.context==null||returnValue==false){return}windowresized();top.helperLib.showLoading(window);if(top.context.plugin!=null&&top.context.plugin!=""){top.context.plugin.attachEvent("onpluginready",detachedLogin);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();personalizeSolution();top.context.cacheUtil.loadXMLFromCache("Attachments",top.context.addXMLToCache,"Attachments",top.helperLib.wsfMapPath("$application/xml/attachments.xml"));top.context.cacheUtil.loadXMLFromCache("notrelevent",sharedXMLLoaded,"",top.helperLib.wsfMapPath("/mc/shared/xml/shared.xml"));top.context.cacheUtil.loadXMLFromCache("notrelevent",xmlLoaded,"",top.helperLib.wsfMapPath("$application/xml/menus.xml"))}function _login(){top.helperLib.hideLoading(window);bStatus=top.EMLib.doLogin(m_objPlugin,_loginComplete)}function overrideProperty(defaultValue,value){if(value==""){return defaultValue}else{return value}}function personalizeSolution(){top.DHTMLLib.addStyleSheet(top.helperLib.wsfMapPath("$skin/colors.css"));top.document.title=top.context.session.application.name+" - "+top.context.session.username;var app=top.context.session.application;if(app.customenvbr!=null){var result=top.EMLib.processBusinessRule(app.customenvbr,"<document><record/></document>");if(result!=null){var re=/%26/g;result=result.replace(re,"&amp;");app.solutionImage=overrideProperty(app.solutionImage,top.XMLLib.getNodeText(result,"//solutionimage"));app.headerfontcolor=overrideProperty(app.headerfontcolor,top.XMLLib.getNodeText(result,"//headerfontcolor"));app.headerbgcolor=overrideProperty(app.headerbgcolor,top.XMLLib.getNodeText(result,"//headerbgcolor"));top.context.session.application.name=top.helperLib.HTMLDecode(overrideProperty(top.context.session.application.name,top.XMLLib.getNodeText(result,"//solutionname")))}}if(app.solutionImage==null||app.solutionImage==""){app.solutionImage="/widgets/assets/logo-wolf.png"}if(app.headerbgcolor){window.document.getElementById("logoContainer").style.backgroundColor=app.headerbgcolor}var companyLogoElement=window.document.getElementById("company-logo");var appNameElement=window.document.getElementById("applicationName");var welcomemsgElement=window.document.getElementById("welcomemsg");var logofftoolElement=window.document.getElementById("logofftool");var designtoolElement=window.document.getElementById("designtool");var environmenttools=window.document.getElementById("environmenttools");if(app.headerfontcolor){appNameElement.style.color=app.headerfontcolor;welcomemsgElement.style.color=app.headerfontcolor;logofftoolElement.style.color=app.headerfontcolor}companyLogoElement.src=top.helperLib.wsfMapPath(app.solutionImage);appNameElement.innerHTML="<span id='"+(app.headerbgcolor==null?"filler":"")+"'></span>"+top.context.session.application.name+"";if(app.footer==null||app.footer==""){app.footer="© 2008-2009 Wolf Frameworks"}window.document.getElementById("copyright").innerHTML=app.footer;window.document.getElementById("termsofuse").innerHTML="<a target='_blank' href='"+top.helperLib.wsfMapPath(app.termsOfUse)+"'>Terms of Use</a>";top.EMLib.getPropertyValue("consolePage",applyConsolePersonalisation);if(app.codebehind!=null){top.DHTMLLib.addScript(top,top.helperLib.wsfMapPath(app.codebehind))}}function _updatePageSize(){var evt=top.DHTMLLib.getEvent(window,arguments);var objUnknown=top.DHTMLLib.getEventSrcElement(evt);var defaultPageSize=top.context.session.defaultPageSize;if(defaultPageSize==objUnknown.value){return}top.EMLib.updatePropertyValue("pageSize",objUnknown.value,"consolePage");top.context.session.defaultPageSize=objUnknown.value}function applyConsolePersonalisation(page){var defaultPageSize=top.XMLLib.getNodeText(page.personalisationXML,"//record[P = 'pageSize']/V").split(",");if(defaultPageSize==""){return}document.getElementById("defaultpagesize").value=defaultPageSize;top.context.session.defaultPageSize=defaultPageSize}function detachedLogin(){pluginXMLLoaded()}function _initplugins(){m_objPlugin=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){var tabElement=window.document.getElementById(sTabId);if(tabElement==null){tabElement=window.document.getElementById("tab_maindiv_"+sTabId)}return tabElement}function _deleteTab(sTabId){var objSource=_getTabElement(sTabId);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);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}}};