var alertcounter=0;function Popup(pPage,hWnd,w,h,scroller){var winOpts="resizable=yes, scrollbars="+scroller+", location=no, directories=no, status=no, menubar=no, toolbar=no, width="+w+",height="+h;var popUpWin=window.open(pPage,hWnd,winOpts);popUpWin.focus()}createXMLHttpRequestObj=function(){var xmlHttp;if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest()}else{if(window.ActiveXObject){xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}}return xmlHttp};function in_array(needl,haystack){var str_needl=needl.toString();for(var i in haystack){if(haystack[i].toString()==str_needl){return true}}return false}function open_agb(){window.open("templates/WM_CT_DE_generic/agb.html","agb","dependent=yes,menubar=no,status=no,toolbar=no,left=100,top=100,scrollbars=yes")}function placeLanguageSwitch(targetDiv,defaultLangId,langsAvailArr){if((typeof(targetDiv)=="undefined")||(targetDiv=="")){return}if(typeof(defaultLangId)=="undefined"){var defaultLangId=""}var comboStore=new Ext.data.SimpleStore({fields:["vals","label"],data:langsAvailArr});var combo=new Ext.form.ComboBox({store:comboStore,editable:false,mode:"local",width:100,triggerAction:"all",displayField:"label",valueField:"vals",allowBlank:true,selectOnFocus:false,value:wmGetText(defaultLangId),emptyText:defaultLangId});combo.render(targetDiv);combo.on("select",function(){doSwitch(combo.getValue())});var doSwitch=function(lang){if((typeof(lang)=="undefined")||(lang=="")){return}var getList=new Array();var search=window.location.search.substr(1);var assignments=search.split("&");for(var i=0;i<assignments.length;i++){var assignment_splitted=assignments[i].split("=");var param_name=assignment_splitted[0];var param_value=assignment_splitted[1];if((param_name!="language")&&(param_name!="")&&(param_value!="")){getList.push(assignments[i])}}var langParmStr="language="+lang;getList.push(langParmStr);var newSearchStr=getList.join("&");var host=window.location.host;var pathname=window.location.pathname;var protocol=window.location.protocol;var newUrl=protocol+"//"+host+pathname+"?"+newSearchStr;window.location=newUrl}}function WMTreePanel(ajaxUrl,baseParams){if((typeof(ajaxUrl)=="undefined")){alert("Could not load WMTreePanel.");return false}if((typeof(baseParams)=="undefined")){var baseParams={}}this.rootTreeNode=new Ext.tree.AsyncTreeNode({text:"/",draggable:false,id:"rootTreeNode",iconCls:"wmTreePanelFolder"});this.treeLoader=new Ext.tree.TreeLoader({dataUrl:ajaxUrl,baseParams:baseParams});this.tree=new Ext.tree.TreePanel({root:this.rootTreeNode,cls:"wmTreePanel",collapsible:false,animCollapse:false,border:true,autoScroll:true,animate:false,enableDD:false,containerScroll:true,height:420,width:300,loader:this.treeLoader});this.treeSort=new Ext.tree.TreeSorter(this.tree,{folderSort:true,dir:"asc"});this.rootTreeNode.expand()}function WMGridPanel(ajaxUrl,gridDataStoreMappingArr,gridColumnModelObj,baseParams,gridTbar,gridBbar,skipLoading,sortField,gridId){if((typeof(ajaxUrl)=="undefined")||(typeof(gridDataStoreMappingArr)=="undefined")||(typeof(gridColumnModelObj)=="undefined")){alert("Could not load GridPanel.");return false}if((typeof(baseParams)=="undefined")){var baseParams={}}if((typeof(gridTbar)=="undefined")){var gridTbar=""}if((typeof(gridBbar)=="undefined")){var gridBbar=""}if((typeof(gridId)=="undefined")){var gridId="grid"}if(sortField==null){var mySortInfo=null}else{if((typeof(sortField)=="undefined")){var sortField="isFolder"}mySortInfo={field:sortField,direction:"DESC"}}this.gridDataStore=new Ext.data.Store({id:"gridDataStore",proxy:new Ext.data.HttpProxy({url:ajaxUrl,method:"POST"}),baseParams:baseParams,reader:new Ext.data.JsonReader({root:""},gridDataStoreMappingArr),sortInfo:mySortInfo});this.gridColumnModel=gridColumnModelObj;this.gridColumnModel.defaultSortable=true;this.grid=new Ext.grid.GridPanel({id:gridId,store:this.gridDataStore,cm:this.gridColumnModel,cls:"wmGridPanel",height:420,width:300,loadMask:true,enableColLock:false,selModel:new Ext.grid.RowSelectionModel({singleSelect:true}),tbar:gridTbar,bbar:gridBbar});if(skipLoading!=1){this.gridDataStore.load()}}function WMTreeGridWindow(wmTreePanelObj,wmGridPanelObj,renderTargetId,treeGridWindowTitle,wmTreeGridWindowToolbar,wmSearchObj,wmTreeGridBottomWindow){if((typeof(ajaxUrl)=="undefined")||typeof(renderTargetId)=="undefined"||(typeof(wmTreePanelObj)=="undefined")||(typeof(wmGridPanelObj)=="undefined")||(typeof(wmSearchObj)=="undefined")){alert("Could not load WMTreeGridWindow.");return false}if(typeof(wmTreeGridWindowToolbar)=="undefined"){var wmTreeGridWindowToolbar=""}this.wmTreePanelObj=wmTreePanelObj;this.wmGridPanelObj=wmGridPanelObj;this.wmSearchObj=wmSearchObj;this.treeGridWindow=new Ext.Window({id:"WMTreeGridWindow",title:treeGridWindowTitle,closable:false,draggable:false,width:725,height:500,renderTo:renderTargetId,plain:true,layout:"column",items:[{layout:"card",id:"WMTreeGridLeftWindow",columnHeigth:1,columnWidth:0.25,border:false,activeItem:0,items:[this.wmTreePanelObj.tree,this.wmSearchObj]},{layout:"card",id:"WMTreeGridRightWindow",columnHeigth:1,columnWidth:0.75,border:false,activeItem:0,items:this.wmGridPanelObj.grid}],tbar:wmTreeGridWindowToolbar,bbar:wmTreeGridBottomWindow})}function WMPanel(wmTreePanelObj,wmGridPanelObj,renderTargetId,treeGridWindowTitle,wmTreeGridWindowToolbar,wmSearchObj,wmTreeGridBottomWindow){if((typeof(ajaxUrl)=="undefined")||typeof(renderTargetId)=="undefined"||(typeof(wmTreePanelObj)=="undefined")||(typeof(wmGridPanelObj)=="undefined")||(typeof(wmSearchObj)=="undefined")){alert("Could not load WMTreeGridWindow.");return false}if(typeof(wmTreeGridWindowToolbar)=="undefined"){var wmTreeGridWindowToolbar=""}this.wmTreePanelObj=wmTreePanelObj;this.wmGridPanelObj=wmGridPanelObj;this.wmSearchObj=wmSearchObj;var WMTreeGridLeftWindow=new Array();if(typeof(this.wmTreePanelObj)=="object"){WMTreeGridLeftWindow.push(this.wmTreePanelObj)}if(typeof(this.wmSearchObj)=="object"){WMTreeGridLeftWindow.push(this.wmSearchObj)}this.treeGridWindow=new Ext.Panel({id:"WMTreeGridWindow",title:treeGridWindowTitle,draggable:false,width:725,renderTo:renderTargetId,layout:"column",items:[{layout:"card",id:"WMTreeGridLeftWindow",columnHeigth:1,columnWidth:0.25,border:false,activeItem:0,items:WMTreeGridLeftWindow},{layout:"card",id:"WMTreeGridRightWindow",columnHeigth:1,columnWidth:0.75,border:false,activeItem:0,items:this.wmGridPanelObj.grid}],tbar:wmTreeGridWindowToolbar,bbar:wmTreeGridBottomWindow})}var WMButtons=function(){this.createSubmitBtn=function(renderTo,formId,label,triggerOnSubmit){new Ext.Button({text:label,renderTo:renderTo,type:"submit",style:"border-spacing: 0px;",handler:function(){if((triggerOnSubmit==true)||(triggerOnSubmit=="true")){Ext.getDom(formId).onsubmit()}Ext.getDom(formId).submit()}})};this.createCancelBtn=function(renderTo,label,redirectTo){new Ext.Button({text:label,renderTo:renderTo,type:"button",style:"border-spacing: 0px;",handler:function(){document.location.href=redirectTo}})};this.callbackBtn=function(renderTo,label,functionParams){this.callbackButtonFunction=function(){};new Ext.Button({text:label,renderTo:renderTo,type:"button",style:"border-spacing: 0px;",scope:this,handler:function(){this.callbackButtonFunction(functionParams)}})}};var KpiPanel=function(kpiContainerId,dataControllerNum,width){this.dataControllerObj=dataController[dataControllerNum];this.dataControllerNum=dataControllerNum;var collapsedPanel=(this.dataControllerObj.getParameter("displayValueObj.showKpi")==0);var decSeparator=wmGetText("charDecSeperator");this.hasLoad=false;var thSeparator=wmGetText("charThousandSeperator");var kpiTemplate='<div class="kpi-main" id="kpi-main">';kpiTemplate+='<div class="kpi-left" id="kpi-left">';kpiTemplate+="<table>";kpiTemplate+='<tr><td class="kpi-value"><div id="kpiVal1"></div></td><td class="kpi-label"><div id="kpiLabel1">'+wmGetText("page_impressions")+"</div></td></tr>";kpiTemplate+='<tr><td class="kpi-value"><div id="kpiVal2"></div></td><td class="kpi-label"><div id="kpiLabel2">'+wmGetText("KPIVisits")+"</div></td></tr>";kpiTemplate+='<tr><td class="kpi-value"><div id="kpiVal3"></div></td><td class="kpi-label"><div id="kpiLabel2">'+wmGetText("Pageviews / visit")+"</div></td></tr>";kpiTemplate+="</table>";kpiTemplate+="</div>";kpiTemplate+='<div class="kpi-right" id="kpi-right">';kpiTemplate+="<table>";kpiTemplate+='<tr><td class="kpi-value"><div id="kpiVal4"></div></td><td class="kpi-label"><div id="kpiLabel4">'+wmGetText("Average Duration per Visit")+"</div></td></tr>";kpiTemplate+='<tr><td class="kpi-value"><div id="kpiVal5"></div></td><td class="kpi-label"><div id="kpiLabel5">'+wmGetText("New Visitors")+"</div></td></tr>";kpiTemplate+='<tr><td class="kpi-value"><div id="kpiVal6"></div></td><td class="kpi-label"><div id="kpiLabel6">'+wmGetText("Bounce Visits")+"</div></td></tr>";kpiTemplate+="</table>";kpiTemplate+="</div>";kpiTemplate+="</div>";var getPreloader=function(){return"<div class='loading'><img src='"+GlobPanelPreloader+"'/><div>"};var FormatNumberBy3=function(num,decpoint,sep){num=Math.round(num*100)/100;if(arguments.length==2){sep=","}if(arguments.length==1){sep=",";decpoint="."}num=num.toString();a=num.split(".");x=a[0];y=a[1];z="";if(typeof(x)!="undefined"){for(i=x.length-1;i>=0;i--){z+=x.charAt(i)}z=z.replace(/(\d{3})/g,"$1"+sep);if(z.slice(-sep.length)==sep){z=z.slice(0,-sep.length)}x="";for(i=z.length-1;i>=0;i--){x+=z.charAt(i)}if(typeof(y)!="undefined"&&y.length>0){x+=decpoint+y}}return x};var kpiRequestParms=function(reload){var params=dataController[defaultDataControllerNum].getParamsAsProperties();params.pieRadius=null;params.dashb_action="load_kpi";params.hideTotal=null;params.mode=null;if((typeof(reload)!="undefined")&&(reload)){params.reload=1}return params};this.loadKpi=function(paramObj){if(dataController[paramObj.dataControllerNum].getParameter("displayValueObj.showKpi")==0){return true}var kpiConn=new Ext.data.Connection();kpiConn.on({beforerequest:function(){Ext.get("innerKpiContainer").dom.innerHTML='<div id="innerKpiContainer"><br /><br /><br />&nbsp;</div>';loadingLayer=new Ext.LoadMask(Ext.get("innerKpiContainer"),{msg:wmGetText("Please wait")});loadingLayer.show()},requestcomplete:function(){if(typeof(loadingLayer)!="undefined"){loadingLayer.hide()}Ext.get("innerKpiContainer").dom.innerHTML=""}});kpiConn.request({url:GlobDashboardRequestUri2,method:"POST",params:kpiRequestParms(paramObj.reload),thisParent:this,success:function(responseObject,thisKpiConn){var xml=responseObject.responseXML;if((xml)&&(typeof(xml.documentElement.getElementsByTagName("KPIPageImpressions")[0])!="undefined")&&(typeof(xml.documentElement.getElementsByTagName("KPIPageViewsPerVisitor")[0])!="undefined")&&(typeof(xml.documentElement.getElementsByTagName("KPIVisitors")[0])!="undefined")&&(typeof(xml.documentElement.getElementsByTagName("KPIAverageDurationVisit")[0])!="undefined")&&(typeof(xml.documentElement.getElementsByTagName("KPIBounceVisits")[0])!="undefined")&&(typeof(xml.documentElement.getElementsByTagName("KPINewVisitors")[0])!="undefined")){var KPIPageImpressions=xml.documentElement.getElementsByTagName("KPIPageImpressions")[0].firstChild.data;var KPIPageViewsPerVisitor=xml.documentElement.getElementsByTagName("KPIPageViewsPerVisitor")[0].firstChild.data;var KPIVisitors=xml.documentElement.getElementsByTagName("KPIVisitors")[0].firstChild.data;var KPIAverageDurationVisit=xml.documentElement.getElementsByTagName("KPIAverageDurationVisit")[0].firstChild.data;var KPIBounceVisits=xml.documentElement.getElementsByTagName("KPIBounceVisits")[0].firstChild.data;var KPINewVisitors=xml.documentElement.getElementsByTagName("KPINewVisitors")[0].firstChild.data;Ext.get("innerKpiContainer").dom.innerHTML=kpiTemplate;Ext.get("kpiVal1").dom.innerHTML=FormatNumberBy3(KPIPageImpressions,decSeparator,thSeparator);Ext.get("kpiVal3").dom.innerHTML=FormatNumberBy3(KPIPageViewsPerVisitor,decSeparator,thSeparator);Ext.get("kpiVal2").dom.innerHTML=FormatNumberBy3(KPIVisitors,decSeparator,thSeparator);Ext.get("kpiVal4").dom.innerHTML=WM.Date.formatSeconds(KPIAverageDurationVisit);Ext.get("kpiVal6").dom.innerHTML=FormatNumberBy3(KPIBounceVisits,decSeparator,thSeparator);Ext.get("kpiVal5").dom.innerHTML=FormatNumberBy3(KPINewVisitors,decSeparator,thSeparator);thisKpiConn.thisParent.hasLoad=true;return true}else{var noDataReturnedText=wmGetText("No data for this timerange");Ext.get("innerKpiContainer").dom.innerHTML=noDataReturnedText;return false}},failure:function(){return false}});kpiConn=null};this.kpiTools=[{id:"refresh",qtip:wmGetText("refresh"),handler:function(e,target,panel){panel.thisParent.loadKpi({dataControllerNum:panel.thisParent.dataControllerNum,reload:true})}}];this.kpiPanel=new Ext.Panel({bodyStyle:"border-top:0px",renderTo:kpiContainerId,autoWidth:true,autoHeight:true,minWidth:735,id:"kpi",thisParent:this,collapsible:true,collapsed:collapsedPanel,collapseFirst:false,title:wmGetText("kpi"),tools:this.kpiTools,html:"<div id='innerKpiContainer' class='innerKpiContainer'></div>"});this.kpiPanel.thisParent=this;this.kpiPanel.on("collapse",function(){this.thisParent.dataControllerObj.setParameter("displayValueObj.showKpi",false)});this.kpiPanel.on("expand",function(){this.thisParent.dataControllerObj.setParameter("displayValueObj.showKpi",true);if(this.thisParent.hasLoad==false){this.thisParent.loadKpi({dataControllerNum:this.thisParent.dataControllerNum,reload:true})}});this.dataControllerObj.addEventListener(["apiParamsObj.dateFrom","apiParamsObj.dateTo","apiParamsObj.scale","apiParamsObj.filtername","apiParamsObj.filterowner","apiParamsObj.ud2hiersel","apiParamsObj.groupname","apiParamsObj.ipclasssel","apiParamsObj.periodsel","apiParamsObj.instantdisplayfilter","apiParamsObj.detail_mode","apiParamsObj.reloadData"],this.loadKpi,{dataControllerNum:this.dataControllerNum,reload:false});this.loadKpi({dataControllerNum:this.dataControllerNum,reload:false})};var MultipleTreeWindow=function(containerDivId,newMode,firstText,dataControllerNum,iconDivId,grow,allowTyping,goBtnDivId,toolTip){this.dataControllerNum=dataControllerNum;this.fieldEmptyTextArr={groups:wmGetText("All"),ud2:wmGetText("All"),pages:wmGetText("All"),milestones:wmGetText("All")};this.newDelimiter={groups:"/",ud2:"|",pages:"|",milestones:"|",campaigns:"|"};this.firstText=firstText;this.windowTitle="";this.ajaxTreeUrl="../frontend/Ajax/tree/getExtTree.php";this.ajaxSearchUrl="../frontend/Ajax/tree/getExtSearch.php";this.containerDivId=containerDivId;this.fieldEmptyText=this.fieldEmptyTextArr[newMode];this.delimiter=this.newDelimiter[newMode];this.mode=newMode;this.selectedValue=firstText;this.selectedId=0;this.inputFieldName="wmTreeSelectField"+containerDivId;this.ParentSearchField="ParentSearchField"+containerDivId;this.iconDivId=(typeof(iconDivId)!="undefined")?iconDivId:null;this.goBtnDivId=(typeof(goBtnDivId)!="undefined")?goBtnDivId:null;this.toolTip=(typeof(toolTip)!="undefined")?toolTip:null;this.grow=(typeof(grow)!="undefined")?grow:false;this.allowTyping=(typeof(allowTyping)!="undefined")?allowTyping:false;this.defaultWidth=200;this.defaultMaxGrowWidth=580;var thisScope=this;switch(this.mode){case"groups":this.windowTitle=wmGetText("Areas");break;case"ud2":this.windowTitle=wmGetText("UD2");break;case"pages":this.windowTitle=wmGetText("Page");break;case"milestones":this.windowTitle=wmGetText("Milestone");break;case"campaigns":this.windowTitle=wmGetText("Campaign");break}this.handlerFnc=function(){switch(this.mode){case"groups":dataController[this.dataControllerNum].setParameter("apiParamsObj.groupname",this.selectedValue);break;case"ud2":dataController[this.dataControllerNum].setParameter("apiParamsObj.ud2hiersel",this.selectedValue);break;case"pages":dataController[this.dataControllerNum].setParameter("apiParamsObj.selpageid",this.selectedId);dataController[this.dataControllerNum].setParameter("apiParamsObj.selpagename",this.selectedValue);break}Ext.getCmp(this.inputFieldName).setValue(this.selectedValue)};this.getPath=function(node){myNode=node;searchPattern=new Array();while(!myNode.attributes.isRoot){newPattern=myNode.attributes.pattern;var isPacked=(typeof(myNode.attributes.pack)&&(myNode.attributes.pack==true));if(!isPacked){if(!isPacked){searchPattern.push(newPattern)}}myNode=myNode.parentNode}searchPattern.reverse();searchPatternStr=searchPattern.join(this.delimiter);return searchPatternStr};this.create=function(){if(typeof(this.containerDivId)=="undefined"){alert("no target div provided for tree");return false}this.treeTextField=new Ext.form.TextField({id:this.inputFieldName,layout:"form",width:this.defaultWidth,growMin:this.defaultWidth,growMax:this.defaultMaxGrowWidth,emptyText:this.fieldEmptyText,hideLabel:false,value:this.firstText,grow:this.grow,enableKeyEvents:true});if(this.toolTip!=null){var __toolTip=this.toolTip;this.treeTextField.on("render",function(c){if(!Ext.QuickTips.isEnabled()){Ext.QuickTips.init()}Ext.QuickTips.register({target:c.getEl(),text:__toolTip})})}this.treeTextField.render(this.containerDivId);this.treeTextField.thisParent=this;if(!this.allowTyping){this.treeTextField.on("focus",function(){this.thisParent.showTree()})}else{var scope=this;this.treeTextField.on("keyup",function(){scope.selectedValue=this.getValue();if(scope.goBtnDivId==null){scope.handlerFnc()}});this.treeTextField.on("specialkey",function(){if(Ext.EventObject.getKey()=="13"){scope.selectedValue=this.getValue();scope.handlerFnc()}})}if((iconDivId!=null)&&(Ext.get(iconDivId)!=null)){var parent=this;var elem=Ext.get(iconDivId);elem.on("click",function(){parent.showTree()})}if(Ext.get(this.goBtnDivId)){Ext.get(this.goBtnDivId).on("click",function(){scope.handlerFnc()})}};this.createWindow=function(){alert("this function is not used any more!")};this.showTree=function(){var gridColumnModelObj=new Ext.grid.ColumnModel({defaultSortable:true,columns:[{header:wmGetText("Name"),dataIndex:"text"}]});var gridDataStoreMappingArr=[{name:"value",type:"string",mapping:"value"},{name:"text",type:"string",mapping:"text"},{name:"textValue",type:"string",mapping:"textValue"},{name:"dataId",type:"int",mapping:"id"}];var wmExplorerBaseObj=new WMExplorerBase(customConfigObj,explorerType);var customConfigObj={container:{type:"window",extJsConfig:{title:thisScope.windowTitle},topToolbars:[{extJsConfig:{items:[{id:thisScope.ParentSearchField,xtype:"textfield",emptyText:wmGetText("Enter search..."),name:"searchField",enableKeyEvents:true,allowBlank:true,listeners:{specialkey:function(thisTextField,e){var keyCode=e.getKey();if(keyCode==13){e.stopEvent();var thisContainer=wmExplorerBaseObj.getContainer();thisContainer.getLayout().setActiveItem(1);var searchPhrase=Ext.getCmp(thisScope.ParentSearchField).getValue().trim();if(searchPhrase!=""){var contents=wmExplorerBaseObj.getContents();var grid=contents[1];grid.getStore().baseParams={mode:thisScope.mode,searchPhrase:searchPhrase};grid.getStore().load()}}}}},{iconCls:"wmTbarSearch",text:wmGetText("Search"),tooltip:wmGetText("Start the search"),xtype:"button",style:"border-spacing: 0px;",handler:function(){var thisContainer=wmExplorerBaseObj.getContainer();thisContainer.getLayout().setActiveItem(1);var searchPhrase=Ext.getCmp(thisScope.ParentSearchField).getValue().trim();if(searchPhrase!=""){var contents=wmExplorerBaseObj.getContents();var grid=contents[1];grid.getStore().baseParams={mode:thisScope.mode,searchPhrase:searchPhrase};grid.getStore().load()}}},{id:"ShowTree",iconCls:"iconOverview",text:wmGetText("Overview"),tooltip:wmGetText("Show tree view"),handler:function(){var thisContainer=wmExplorerBaseObj.getContainer();thisContainer.getLayout().setActiveItem(0)}}]}}]},contents:[{type:"tree",config:{ajaxUrl:this.ajaxTreeUrl,baseParams:{objMethod:"getRootData"},extJsOnEvents:{beforeload:function(node){var searchPattern=thisScope.getPath(node);this.loader.baseParams={pattern:searchPattern,type:thisScope.mode}},click:function(node){thisScope.selectedValue=thisScope.getPath(node);if(node.attributes.dataId){thisScope.selectedId=node.attributes.dataId}else{thisScope.selectedId=0}Ext.getCmp(thisScope.inputFieldName).setValue(thisScope.selectedValue);if(thisScope.goBtnDivId==null){thisScope.handlerFnc()}var wmTreeWindowObj=wmExplorerBaseObj.getContainer();wmTreeWindowObj.destroy()}},rootTreeNode:{extJsConfig:{pattern:"/",isRoot:true}},treeSorter:{extJsConfig:{folderSort:false,dir:"asc"}}}},{type:"grid",config:{ajaxUrl:this.ajaxSearchUrl,baseParams:{mode:this.mode,objMethod:"getRootData"},extJsOnEvents:{rowclick:function(grid,rowIndex,e){var contents=wmExplorerBaseObj.getContents();var grid=contents[1];var rowRecord=grid.store.getAt(rowIndex);thisScope.selectedValue=rowRecord.data.textValue;thisScope.selectedId=rowRecord.data.dataId;thisScope.handlerFnc();var wmTreeWindowObj=wmExplorerBaseObj.getContainer();wmTreeWindowObj.destroy()}},gridDataStoreMappingArr:gridDataStoreMappingArr,gridColumnModelObj:gridColumnModelObj}}]};try{var explorerType="treeOnlyWithSearch";var isInitialized=wmExplorerBaseObj.init(customConfigObj,explorerType);if(isInitialized==true){wmExplorerBaseObj.createWMExplorer()}}catch(e){alert(e)}};this.create()};var CustomStatisticPanel=function(containerId,dataControllerNum,panelId,dataControllerObjId,title,contentEl){this.dataControllerObj=dataController[dataControllerNum];this.dataControllerNum=dataControllerNum;var collapsedPanel=eval('this.dataControllerObj.getParameter("'+dataControllerObjId+'") == 0');var getPreloader=function(){return"<div class='loading'><img src='"+GlobPanelPreloader+"'/><div>"};this.CustomStatisticPanel=new Ext.Panel({bodyStyle:"border-top:0px",renderTo:containerId,autoWidth:true,autoHeight:true,id:panelId,thisParent:this,collapsible:true,collapsed:collapsedPanel,collapseFirst:false,title:title,contentEl:contentEl});this.CustomStatisticPanel.thisParent=this;this.CustomStatisticPanel.on("collapse",function(){eval('this.thisParent.dataControllerObj.setParameter("'+dataControllerObjId+'", false)')});this.CustomStatisticPanel.on("expand",function(){eval('this.thisParent.dataControllerObj.setParameter("'+dataControllerObjId+'", true)')})};var statInfoObj;Ext.onReady(function(){startDescriptionPanel()});startDescriptionPanel=function(){if(typeof statInfoObj!="object"&&document.getElementById("stdStatisticInfo")!=null){dataController[defaultDataControllerNum].setParameter("displayValueObj.showInfo",false);statInfoObj=new stdStatisticInfo("stdStatisticInfo","stdStatisticInfoText",dataController[defaultDataControllerNum].getParameter("displayValueObj.showInfo"))}};switchDisplayDescription=function(){if(dataController[defaultDataControllerNum].getParameter("displayValueObj.showInfo")==true){statInfoObj.infoPanel.hide()}else{statInfoObj.infoPanel.show()}};stdStatisticInfo=function(htmlObjId,textDivId,showInfo){var htmlObjId=htmlObjId;this.infoPanel=new Object;var chartWidth=575;var hidden=(showInfo==0);if(Ext.get(htmlObjId)){Ext.get(htmlObjId).dom.style.display="block"}this.createInfoPanel=function(){this.infoPanel=new Ext.Panel({id:"statisticInfoPanel",bodyStyle:"padding:5px",border:true,renderTo:htmlObjId,collapsible:true,autoHeight:true,autoWidth:true,title:wmGetText("Description"),hidden:hidden,contentEl:textDivId,header:false});this.infoPanel.on("hide",function(){dataController[defaultDataControllerNum].setParameter("displayValueObj.showInfo",false)});this.infoPanel.on("show",function(){dataController[defaultDataControllerNum].setParameter("displayValueObj.showInfo",true)})};this.createInfoPanel();if(Ext.get(textDivId)){Ext.get(textDivId).dom.style.display="block"}};MyFavorites=function(){myFavoritesData={mode:"",name:"",description:"",date_from:"",date_to:"",dateFrom:0,dateTo:0,groupname:"",ud2hiersel:"",filtername:"",filterowner:"",ipclasssel:""};this.calendarInstance;var rand=Math.floor(Math.random()*10000000000000000000+1);this.areaFieldCont="area-"+rand;this.calFieldCont="cal-"+rand;this.ud2FieldCont="ud2-"+rand;this.filterFieldCont="filter-"+rand;this.ipFieldCont="ip-"+rand;this.showEdit=false;this.showWindow=function(){var form=this.createForm();var favWin=new Ext.Window({id:"favWin",title:wmGetText("Add to my favorites"),modal:true,closable:true,draggable:true,width:640,autoHeight:true,plain:true,resizable:false,items:[form],buttons:[{text:wmGetText("Cancel"),handler:function(){Ext.getCmp("favWin").destroy()}},{text:wmGetText("Save"),scope:this,handler:function(){var params=this.getParams();this.requestAdd(params,this.favAddedCallback)}}]});favWin.on("show",function(){if(this.showEdit===true){this.renderEditOptions()}},this);favWin.show()};this.renderEditOptions=function(){this.calendarInstance=startCalendar(33,this.calFieldCont,null,true,myFavoritesData.dateFrom,myFavoritesData.dateTo);if(checkRightByName("RIGHT_FILTER_GROUP")){var groupname=myFavoritesData.groupname;var treeType="groups";var treeDivId=this.areaFieldCont+"Tree";var treeIconDivId=this.areaFieldCont+"Icon";var code="<table border='0' cellspacing='0' cellpadding='0' style='border:0px none; margin:0px; border-style:collapse;'><tr><td><div id='"+treeDivId+"'></div></td><td><div id='"+treeIconDivId+"' class='treeOpenIcon'></div></td></tr></table>";Ext.get(this.areaFieldCont).dom.innerHTML=code;var tree=new MultipleTreeWindow(treeDivId,treeType,groupname,1,treeIconDivId,false,true);tree.handlerFnc=function(){if((tree.selectedValue!=null)&&(typeof(tree.selectedValue)!="undefined")){if(Ext.getCmp(tree.inputFieldName)){Ext.getCmp(tree.inputFieldName).setValue(tree.selectedValue)}myFavoritesData.groupname=tree.selectedValue}}}if(checkRightByName("RIGHT_FILTER_UD2")){var ud2hiersel=myFavoritesData.ud2hiersel;var treeType="ud2";var treeDivId=this.ud2FieldCont+"Tree";var treeIconDivId=this.ud2FieldCont+"Icon";var code="<table border='0' cellspacing='0' cellpadding='0' style='border:0px none; margin:0px; border-style:collapse;'><tr><td><div id='"+treeDivId+"'></div></td><td><div id='"+treeIconDivId+"' class='treeOpenIcon'></div></td></tr></table>";Ext.get(this.ud2FieldCont).dom.innerHTML=code;var tree2=new MultipleTreeWindow(treeDivId,treeType,ud2hiersel,1,treeIconDivId,false,true);tree2.handlerFnc=function(){if((tree2.selectedValue!=null)&&(typeof(tree2.selectedValue)!="undefined")){if(Ext.getCmp(tree2.inputFieldName)){Ext.getCmp(tree2.inputFieldName).setValue(tree2.selectedValue)}myFavoritesData.ud2hiersel=tree2.selectedValue}}}if(checkRightByName("RIGHT_FILTER_GENERAL")){var filterOnSelectCallback=function(combo,record){var selectedStoreItem=record;var selectedValue=this.getValue();var filtername=null;var filterowner=null;if(selectedValue==filterComboEmptyText){filtername=""}else{if((typeof selectedStoreItem.data.filterowner=="undefined")||(selectedStoreItem.data.filterowner=="")){filtername=selectedStoreItem.data.filtername}else{filtername=selectedStoreItem.data.filtername;filterowner=selectedStoreItem.data.filterowner}}if(filtername!=null){myFavoritesData.filtername=filtername}if(filterowner!=null){myFavoritesData.filterowner=filterowner}else{myFavoritesData.filterowner=""}};var filtername=myFavoritesData.filtername;var filterComboEmptyText=(filtername!="")?filtername:wmGetText("No Active Filter!");var filterComboId=this.filterFieldCont+"2";var filterComboHiddenId=this.filterFieldCont+"3";var filterComboHiddenName=this.filterFieldCont+"4";PlaceFilterCombo(this.filterFieldCont,filterOnSelectCallback,filtername,filterComboEmptyText,filterComboId,filterComboHiddenId,filterComboHiddenName)}if(checkRightByName("RIGHT_FILTER_IP")){var ipclasssel=myFavoritesData.ipclasssel;var onSelectFnc=function(combo){var val="";var selectedValue=combo.getValue();if(selectedValue<0){myFavoritesData.ipclasssel=""}else{myFavoritesData.ipclasssel=selectedValue}};var IpSelectId=this.ipFieldCont+"field";var IpSelectHiddenId=this.ipFieldCont+"hiden";var IpSelectHiddenName=this.ipFieldCont+"name";PlaceIpFilterCombo(IpSelectId,IpSelectHiddenId,IpSelectHiddenName,this.ipFieldCont,ipclasssel,onSelectFnc)}};this.createForm=function(){var checkboxDate=((myFavoritesData.dateFrom!="")||(myFavoritesData.dateTo!="")||(myFavoritesData.date_from!="")||(myFavoritesData.date_to!=""))?true:false;var checkboxArea=(myFavoritesData.groupname!="")?true:false;var checkboxUD2=(myFavoritesData.ud2hiersel!="")?true:false;var checkboxFilter=(myFavoritesData.filtername!="")?true:false;var checkboxIP=(myFavoritesData.ipclasssel!="")?true:false;var checkboxes=new Array();checkboxes.push({xtype:"checkbox",fieldLabel:wmGetText("Date"),boxLabel:wmGetText("inherit"),id:"checkboxDate",checked:checkboxDate});if(checkRightByName("RIGHT_FILTER_GROUP")){checkboxes.push({xtype:"checkbox",fieldLabel:wmGetText("Area"),boxLabel:wmGetText("inherit"),id:"checkboxArea",checked:checkboxArea})}if(checkRightByName("RIGHT_FILTER_UD2")){checkboxes.push({xtype:"checkbox",fieldLabel:wmGetText("UD2"),boxLabel:wmGetText("inherit"),id:"checkboxUD2",checked:checkboxUD2})}if(checkRightByName("RIGHT_FILTER_GENERAL")){checkboxes.push({xtype:"checkbox",fieldLabel:wmGetText("Filter"),boxLabel:wmGetText("inherit"),id:"checkboxFilter",checked:checkboxFilter})}if(checkRightByName("RIGHT_FILTER_IP")){checkboxes.push({xtype:"checkbox",fieldLabel:wmGetText("IP"),boxLabel:wmGetText("inherit"),id:"checkboxIP",checked:checkboxIP})}var items=[{width:260,layout:"form",items:checkboxes}];if(this.showEdit==true){var elements=new Array();elements.push({html:"<div style='padding:2px;position:relative;' id="+this.calFieldCont+">[date][date]</div>"});if(checkRightByName("RIGHT_FILTER_GROUP")){elements.push({html:"<div style='padding:2px;' id="+this.areaFieldCont+"></div>"})}if(checkRightByName("RIGHT_FILTER_UD2")){elements.push({html:"<div style='padding:2px;' id="+this.ud2FieldCont+"></div>"})}if(checkRightByName("RIGHT_FILTER_GENERAL")){elements.push({html:"<div style='padding:2px;' id="+this.filterFieldCont+"></div>"})}if(checkRightByName("RIGHT_FILTER_IP")){elements.push({html:"<div style='padding:2px;' id="+this.ipFieldCont+"></div>"})}items.push({width:255,layout:"form",items:elements})}var favForm=new Ext.FormPanel({frame:true,bodyStyle:"padding:5px 5px 0",autoWidth:true,buttonAlign:"right",items:[{xtype:"textfield",fieldLabel:wmGetText("Name"),id:"favName",width:375,allowBlank:false,value:myFavoritesData.name},{xtype:"textarea",fieldLabel:wmGetText("Description"),id:"favDescription",width:375,height:50,value:myFavoritesData.description},{layout:"column",items:items}]});return favForm};this.setParams=function(p){for(var key in p){if(typeof(myFavoritesData[key])!="undefined"){myFavoritesData[key]=p[key]}}};this.unsetParams=function(){myFavoritesData=null};this.getParams=function(){if(this.showEdit==true){myFavoritesData.dateFrom=this.calendarInstance.getDateFrom();myFavoritesData.dateTo=this.calendarInstance.getDateTo()}var checkboxDate=Ext.getCmp("checkboxDate");if(checkboxDate&&checkboxDate.getValue()==false){myFavoritesData.date_from=null;myFavoritesData.date_from=null;myFavoritesData.date_to=null;myFavoritesData.dateFrom=null;myFavoritesData.dateTo=null}var checkboxArea=Ext.getCmp("checkboxArea");if(checkboxArea&&checkboxArea.getValue()==false){myFavoritesData.groupname=null}var checkboxUD2=Ext.getCmp("checkboxUD2");if(checkboxUD2&&checkboxUD2.getValue()==false){myFavoritesData.ud2hiersel=null}var checkboxFilter=Ext.getCmp("checkboxFilter");if(checkboxFilter&&checkboxFilter.getValue()==false){myFavoritesData.filtername=null;myFavoritesData.filterowner=null}var checkboxIP=Ext.getCmp("checkboxIP");if(checkboxIP&&checkboxIP.getValue()==false){myFavoritesData.ipclasssel=null}var favName=Ext.getCmp("favName");myFavoritesData.name=favName.getValue();var favDescription=Ext.getCmp("favDescription");myFavoritesData.description=favDescription.getValue();return myFavoritesData};this.requestAdd=function(params,successFnc){var data=Ext.util.JSON.encode(params);Ext.Ajax.request({url:GlobAjaxUri+"FavoriteControl.php",success:successFnc,failure:function(submitForm,postAction){},params:{objMethod:"formAdd",objData:data}})};this.favAddedCallback=function(responseObject){var message;if(responseObject.responseText!=""){message=Ext.util.JSON.decode(responseObject.responseText)}if(message.success==true){Ext.getCmp("favWin").destroy();document.location.reload()}else{if(message.errors.errorMsg){Ext.Msg.alert("",message.errors.errorMsg)}else{Ext.Msg.alert("",wmGetText("Error"))}}}};function addFavorite(){var fav=new MyFavorites;var params=dataController[defaultDataControllerNum].getParamsAsProperties();fav.setParams(params);fav.showWindow()}function LeftNavi(displayMode,activePattern){this.responseXML;var localNaviElement=document.getElementById("leftnavi");var localSitemapElement=document.getElementById("leftnaviSitemap");var localImgPath="../public/img/wm/LeftNavi/";this.displayMode=displayMode;var localGroupIconId="leftnaviGroupIcon";var localGroupId="leftnaviGroup";var localSubnaviId="leftnaviSubnavi";var localSubSubnaviId="leftnaviSubSubnavi";var localActiveGroup=null;var localActiveSubgroup=null;var localActiveSequence=new Array();var localActivePattern=activePattern;function getChildNodesByTag(domElement,tagName){var sepEl=new Array();for(var i in domElement.childNodes){if(domElement.childNodes[i].nodeName==tagName){sepEl.push(domElement.childNodes[i])}}return sepEl}function findIndexOfActive(){if(typeof localActivePattern=="object"){if(typeof localActivePattern.auto!="undefined"&&localActivePattern.auto){}else{if(typeof localActivePattern.id!="undefined"){localActiveSequence=new Array();var groups=this.responseXML.getElementsByTagName("group");for(var gi=0;gi<groups.length;gi++){if(findPosOfAcitveSubId(groups[gi].childNodes,localActivePattern.id)!=null){localActiveSequence.unshift(gi);break}}}else{if(typeof localActivePattern.index=="object"){localActiveSequence=localActivePattern.index}}}}}function findPosOfAcitveSubId(elDom,Id){var subPos=null;for(var pos=0;pos<elDom.length;pos++){if(elDom[pos].childNodes.length>0){subPos=findPosOfAcitveSubId(elDom[pos].childNodes,Id)}if(Id==decodeURIComponent(elDom[pos].getAttribute("id"))||subPos!=null){localActiveSequence.unshift(pos);return pos}}return null}function leftnaviLoad(){Request_URL="../frontend/Ajax/WMNavi.php?naviMode="+displayMode;var request=createXMLHttpRequestObj();request.open("GET",Request_URL,true);request.send(null);request.onreadystatechange=function(){if(request.readyState==4){saveResponseAndStartBuilding(request.responseXML)}}}function saveResponseAndStartBuilding(responseXML){this.responseXML=responseXML;findIndexOfActive();leftnaviBuildNavi();createSitemap()}function leftnaviBuildNavi(){var groups=this.responseXML.getElementsByTagName("group");var imgName="";for(var i=0;i<groups.length;i++){var link=decodeURIComponent(groups[i].getAttribute("link"));if(link!=""){var onClickFunc=""+link+'; showMenuItem("'+localSubnaviId+i+'");'}else{var onClickFunc='showMenuItem("'+localSubnaviId+i+'");'}var isActiveGroup=(localActiveSequence[0]!=null&&localActiveSequence[0]==i);localNaviElement.appendChild(createGroupButton(decodeURIComponent(groups[i].getAttribute("imgName")),decodeURIComponent(groups[i].getAttribute("label")),isActiveGroup,i,onClickFunc));if(groups[i].childNodes.length>0){var newTable=leftnaviBuildSubnavi(localSubnaviId+i,groups[i].childNodes,isActiveGroup);localNaviElement.appendChild(newTable)}}}function createGroupButton(iconName,labelText,active,idNum,onClickFunc){var newTable=createNewTableElement("LeftNaviGrouptable","0","0");var newTr=document.createElement("tr");newTr.iconName=iconName;newTr.groupIconId=localGroupIconId+idNum;if(!active){newTr.setAttributeNode(createAttributeNode("class","LeftNaviGroupRow"));newTr.onmouseover=function(evt){this.className="LeftNaviGroupRowHover";document.getElementById(this.groupIconId).src=localImgPath+this.iconName+"_hover.gif"};newTr.onmouseout=function(evt){this.className="LeftNaviGroupRow";document.getElementById(this.groupIconId).src=localImgPath+this.iconName+".gif"};newTr.onmousedown=function(evt){this.className="LeftNaviGroupRowClick";document.getElementById(this.groupIconId).src=localImgPath+this.iconName+"_click.gif"};imgName=iconName}else{newTr.setAttributeNode(createAttributeNode("class","LeftNaviGroupRowActive"));imgName=iconName+"_active"}if(typeof onClickFunc=="string"){newTr.onClickFunc=onClickFunc;newTr.onmouseup=function(){eval(this.onClickFunc)}}var newTh=document.createElement("th");newTh.setAttributeNode(createAttributeNode("class","LeftNaviGroupIcon"));var newImg=document.createElement("img");newImg.setAttributeNode(createAttributeNode("src",localImgPath+imgName+".gif"));newImg.setAttributeNode(createAttributeNode("border","0"));newImg.setAttributeNode(createAttributeNode("id",localGroupIconId+idNum));newTh.appendChild(newImg);newTr.appendChild(newTh);var newTh2=document.createElement("th");newTh2.setAttributeNode(createAttributeNode("class","LeftNaviGroupLable"));var newText=document.createTextNode(labelText);newTh2.appendChild(newText);newTr.appendChild(newTh2);newTr.setAttributeNode(createAttributeNode("id",localGroupId+idNum));newTable.firstChild.appendChild(newTr);return newTable}recursionLevel=0;function leftnaviBuildSubnavi(elId,elDom,active,sitemapmode){recursionLevel++;if(typeof sitemapmode=="undefined"){sitemapmode=false}if(typeof active=="undefined"){active=false}var newDiv=document.createElement("div");newDiv.setAttributeNode(createAttributeNode("id",elId));var newTable=createNewTableElement("LeftNaviSubnaviTable","0","0");newDiv.appendChild(newTable);for(var i=0;i<elDom.length;i++){var newTr=document.createElement("tr");newTable.firstChild.appendChild(newTr);var newTd=document.createElement("td");newTr.appendChild(newTd);if(active&&localActiveSequence[recursionLevel]!=null&&localActiveSequence[recursionLevel]==i){newTr.setAttributeNode(createAttributeNode("class","LeftNaviSubnaviRowActive"));var subEl=elDom[i].childNodes;if(subEl.length>0){var subTd=document.createElement("td");var subTr=document.createElement("tr");subTd.appendChild(leftnaviBuildSubnavi((elId+"."+i),subEl,active));subTr.appendChild(document.createElement("td"));subTr.appendChild(subTd);newTable.firstChild.appendChild(subTr)}}else{var activeNewSub=(localActiveSequence[recursionLevel]!=null&&localActiveSequence[recursionLevel]==i);newTr.setAttributeNode(createAttributeNode("class","LeftNaviSubnaviRow"));newDiv.style.display="none";newTr.setAttributeNode(createAttributeNode("onMouseOver","this.className='LeftNaviSubnaviRowHover';"));newTr.setAttributeNode(createAttributeNode("onMouseOut","this.className='LeftNaviSubnaviRow';"));var subEl=elDom[i].childNodes;if(subEl.length>0){var subSitemapmode=true;var subTd=document.createElement("td");var subTr=document.createElement("tr");subTd.appendChild(leftnaviBuildSubnavi((elId+"."+i),subEl,activeNewSub,subSitemapmode));subTr.appendChild(document.createElement("td"));subTr.appendChild(subTd);newTable.firstChild.appendChild(subTr)}}newTd.setAttributeNode(createAttributeNode("class","LeftNaviSubnaviIcon"));var newImg=document.createElement("img");newImg.setAttributeNode(createAttributeNode("src",localImgPath+decodeURIComponent(elDom[i].getAttribute("imgName"))+".gif"));newTd.appendChild(newImg);newTr.appendChild(newTd);var newTd=document.createElement("td");newTr.appendChild(newTd);newTd.setAttributeNode(createAttributeNode("class","LeftNaviSubnaviLable"));var newAhref=document.createElement("a");newAhref.setAttributeNode(createAttributeNode("class","LeftNaviLink"));newTd.appendChild(newAhref);newAhref.setAttributeNode(createAttributeNode("href",decodeURIComponent(elDom[i].getAttribute("link"))));var newText=document.createTextNode(decodeURIComponent(elDom[i].getAttribute("label")));newAhref.appendChild(newText)}newDiv.setAttributeNode(createAttributeNode("class","LeftNaviSubnaviDiv"));if(active||sitemapmode){newDiv.style.display="block"}else{newDiv.style.display="none"}recursionLevel--;return newDiv}function createSitemap(){windowPanel=new Ext.Window({title:wmGetText("Sitemap"),id:"sitemapWindow",closable:true,draggable:true,closeAction:"hide",hideMode:"offset",width:880,autoHeight:true,plain:true,autoScroll:true,modal:false,renderTo:"leftnaviSitemapContainer",x:10,y:0,contentEl:"leftnaviSitemap",listeners:{render:function(){Ext.getDom("sitemapWindow").style.display="none"}}});var newTable=createNewTableElement("LeftNaviSitemapTable","4","4");var unfilterdGroups=this.responseXML.getElementsByTagName("group");var cntUnfiltered=unfilterdGroups.length+1;var groups=new Array;var cnt=0;for(i=0;i<unfilterdGroups.length;i++){if(decodeURIComponent(unfilterdGroups[i].getAttribute("link")).search(/switchSitemap/)==-1){groups[cnt++]=unfilterdGroups[i]}}var maxCols=4;var cntGroups=0;for(var cntRows=0;cntGroups<groups.length;cntRows++){var tr=document.createElement("tr");for(var cntCol=0;cntCol<maxCols&&cntGroups<groups.length;cntGroups++,cntCol++){var td=document.createElement("td");td.appendChild(createGroupButton(decodeURIComponent(groups[cntGroups].getAttribute("imgName")),decodeURIComponent(groups[cntGroups].getAttribute("label")),false,(cntGroups+cntUnfiltered),decodeURIComponent(groups[cntGroups].getAttribute("link"))));td.appendChild(leftnaviBuildSubnavi(localSubnaviId+(cntUnfiltered+cntGroups),groups[cntGroups].childNodes,false,true));td.setAttributeNode(createAttributeNode("class","LeftNaviSitemapTd"));tr.appendChild(td)}newTable.firstChild.appendChild(tr)}localSitemapElement.appendChild(newTable)}function closeAllMenuItems(){for(var i=0;document.getElementById(localGroupId+i);i++){if(document.getElementById(localSubnaviId+i)){document.getElementById(localSubnaviId+i).style.display="none"}}}function showMenuItem(section){closeAllMenuItems();if(document.getElementById&&document.getElementById(section)){if(document.getElementById(section).style.display=="block"){document.getElementById(section).style.display="none"}else{document.getElementById(section).style.display="block"}}}this.switchSitemap=function(){windowPanel.show()};leftnaviLoad()}var WMExplorerBase=function(){};WMExplorerBase.prototype={explorerType:"",customConfigObj:{},neededConfigsObj:{},customTreeConfig:{},customGridConfig:{},tree:null,grid:null,contents:[],cotnainer:{},isInitialized:false,predefinedConfigObj:{treeGridPanel:{neededConfigsObj:{container:{type:"string",extJsConfig:{title:"string",renderTo:"string"},topToolbars:{0:{extJsConfig:"object"},1:{extJsConfig:"object"}},bottomToolbars:{0:{extJsConfig:"object"}}},contents:{0:{type:{checkForValue:"tree"},config:{ajaxUrl:"string",baseParams:"object",extJsOnEvents:{click:"function",dblclick:"function"},selectionModel:{extJsOnEvents:{beforeselect:"function"}}}},1:{type:{checkForValue:"grid"},config:{ajaxUrl:"string",baseParams:"object",extJsOnEvents:{rowdblclick:"function"},gridDataStoreMappingArr:"object",gridColumnModelObj:"object",selectionModel:{extJsOnEvents:{rowselect:"function"}}}}}},configs:{defaultTreeConfig:{cls:"wmTreePanel",collapsible:false,animCollapse:false,border:true,autoScroll:true,animate:false,enableDD:true,containerScroll:true,height:420,width:240,ddAppendOnly:true},defaultGridConfig:{cls:"wmGridPanel",height:420,width:485,border:true,loadMask:true,enableColLock:false,viewConfig:{autoFill:true}},defaultTreeSelectionModelConfig:{},defaultGridSelectionModelConfig:{singleSelect:true},defaultGridDataReaderConfig:{root:""},defaultToolbarConfig:{},defaultContainerItemsConfig:{layout:"card",columnHeigth:1,border:false,activeItem:0},defaultContainerConfig:{draggable:false,width:735,layout:"column"},defaultRootTreeNodeConfig:{text:"/",draggable:false,iconCls:"wmTreePanelFolder",expanded:true},defaultTreeLoaderConfig:{},defaultTreeSorterConfig:{folderSort:true,dir:"asc"}}},treeGridWindow:{neededConfigsObj:{container:{type:"string",extJsConfig:{title:"string"},topToolbars:{0:{extJsConfig:"object"},1:{extJsConfig:"object"}},bottomToolbars:{0:{extJsConfig:"object"}}},contents:{0:{type:{checkForValue:"tree"},config:{ajaxUrl:"string",baseParams:"object",extJsOnEvents:{dblclick:"function"},selectionModel:{extJsOnEvents:{beforeselect:"function"}}}},1:{type:{checkForValue:"grid"},config:{ajaxUrl:"string",baseParams:"object",extJsOnEvents:{rowdblclick:"function"},gridDataStoreMappingArr:"object",gridColumnModelObj:"object",selectionModel:{extJsOnEvents:{rowselect:"function"}}}}}},configs:{defaultTreeConfig:{cls:"wmTreePanel",collapsible:false,animCollapse:false,border:true,autoScroll:true,animate:false,enableDD:true,containerScroll:true,height:420,width:240,ddAppendOnly:true},defaultGridConfig:{cls:"wmGridPanel",height:420,width:485,loadMask:true,enableColLock:false,viewConfig:{autoFill:true}},defaultTreeSelectionModelConfig:{},defaultGridSelectionModelConfig:{singleSelect:true},defaultGridDataReaderConfig:{root:""},defaultToolbarConfig:{},defaultContainerItemsConfig:{layout:"card",columnHeigth:1,border:false,activeItem:0},defaultContainerConfig:{closable:true,draggable:true,width:765,height:480,plain:true,layout:"column",modal:true},defaultRootTreeNodeConfig:{text:"/",draggable:false,iconCls:"wmTreePanelFolder",expanded:true},defaultTreeLoaderConfig:{},defaultTreeSorterConfig:{folderSort:true,dir:"asc"}}},treeOnlyWithSearch:{neededConfigsObj:{container:{type:"string",extJsConfig:{title:"string"},topToolbars:{0:{extJsConfig:"object"}}},contents:{0:{type:{checkForValue:"tree"},config:{ajaxUrl:"string",baseParams:"object",extJsOnEvents:{click:"function"}}},1:{type:{checkForValue:"grid"},config:{ajaxUrl:"string",baseParams:"object",extJsOnEvents:{rowclick:"function"},gridDataStoreMappingArr:"object",gridColumnModelObj:"object"}}}},configs:{defaultTreeConfig:{cls:"wmTreePanel",collapsible:false,animCollapse:false,border:true,autoScroll:true,animate:false,enableDD:false,containerScroll:true,height:420,width:240,ddAppendOnly:true},defaultGridConfig:{cls:"wmGridPanel",height:420,width:485,loadMask:true,enableColLock:false,viewConfig:{autoFill:true}},defaultTreeSelectionModelConfig:{},defaultGridSelectionModelConfig:{singleSelect:true},defaultGridDataReaderConfig:{root:""},defaultToolbarConfig:{},defaultContainerItemsConfig:{layout:"card",columnHeigth:1,border:false,activeItem:0},defaultContainerConfig:{closable:true,draggable:true,width:600,height:480,plain:true,modal:true,layout:"card",activeItem:0},defaultRootTreeNodeConfig:{text:"/",draggable:false,iconCls:"wmTreePanelFolder",expanded:true},defaultTreeLoaderConfig:{},defaultTreeSorterConfig:{folderSort:true,dir:"asc"}}},gridOnlySearch:{neededConfigsObj:{container:{type:"string",extJsConfig:{title:"string"},topToolbars:{0:{extJsConfig:"object"}}},contents:{0:{type:{checkForValue:"grid"},config:{ajaxUrl:"string",baseParams:"object",extJsOnEvents:{rowclick:"function"},gridDataStoreMappingArr:"object",gridColumnModelObj:"object"}}}},configs:{defaultGridConfig:{cls:"wmGridPanel",height:420,width:485,loadMask:true,enableColLock:false,viewConfig:{autoFill:true}},defaultGridSelectionModelConfig:{singleSelect:true},defaultGridDataReaderConfig:{root:""},defaultToolbarConfig:{},defaultContainerItemsConfig:{layout:"card",columnHeigth:1,border:false,activeItem:0},defaultContainerConfig:{closable:true,draggable:true,width:600,height:480,plain:true,modal:true,layout:"card",activeItem:0}}}},getContainer:function(){return this.container},getContents:function(){return this.contents},init:function(customConfigObj,explorerType){this.explorerType="";this.customConfigObj={};this.neededConfigsObj={};this.customTreeConfig={};this.customGridConfig={};this.tree=null;this.grid=null;this.contents=new Array();this.container={};this.isInitialized=false;if((typeof(customConfigObj)=="object")&&(typeof(explorerType)=="string")){this.explorerType=explorerType;this.customConfigObj=customConfigObj;this.neededConfigsObj=this.getNeededConfigDef(explorerType)}else{throw wmGetText("Invalid parameters given.")}try{this.checkCustomConfigObj();this.isInitialized=true}catch(e){var errorMsg=wmGetText("Please contact our support. Error message was:")+" "+e;Ext.MessageBox.show({title:"",buttons:Ext.MessageBox.OK,msg:errorMsg});this.isInitialized=false}return this.isInitialized},createWMExplorer:function(){try{if(this.isInitialized!=true){throw wmGetText("Initialize first.")}var contentsCnt=this.customConfigObj.contents.length;for(var i=0;i<contentsCnt;i++){switch(this.customConfigObj.contents[i].type){case"tree":this.customTreeConfig=this.customConfigObj.contents[i].config;var tree=this.getTreePanelObj();this.contents[i]=tree;break;case"grid":this.customGridConfig=this.customConfigObj.contents[i].config;var grid=this.getGridPanelObj();this.contents[i]=grid;break;default:break}}this.showWMExplorer()}catch(e){var errorMsg=wmGetText("Please contact our support. Error message was:")+" "+e;Ext.MessageBox.show({title:"",buttons:Ext.MessageBox.OK,msg:errorMsg})}},checkCustomConfigObj:function(){for(var key in this.customConfigObj){try{this.checkNeededConfig(this.neededConfigsObj[key],this.customConfigObj[key])}catch(e){throw wmGetText("Invalid or missing configuration for:")+" "+key+" - "+e}}},checkNeededConfig:function(neededConfigsObj,customConfigObj){if(typeof(neededConfigsObj)!="undefined"){for(var checkForKey in neededConfigsObj){if((neededConfigsObj[checkForKey].checkForValue)){if(customConfigObj[checkForKey]!=neededConfigsObj[checkForKey].checkForValue){throw checkForKey}}else{if(typeof(neededConfigsObj[checkForKey])=="object"){try{if(typeof(customConfigObj[checkForKey])=="undefined"){throw checkForKey}this.checkNeededConfig(neededConfigsObj[checkForKey],customConfigObj[checkForKey])}catch(e){throw" - "+e}}else{if((typeof(customConfigObj[checkForKey])=="undefined")||((neededConfigsObj[checkForKey]!="")&&(typeof(customConfigObj[checkForKey])!=neededConfigsObj[checkForKey]))){throw checkForKey}}}}}},getNeededConfigDef:function(explorerType){if(typeof(this.predefinedConfigObj[explorerType])=="undefined"){throw wmGetText("Invalid type definition.")}else{return Ext.ux.clone(this.predefinedConfigObj[explorerType].neededConfigsObj)}},getDefaultConfig:function(configKey){if(typeof(this.predefinedConfigObj[this.explorerType].configs[configKey])=="undefined"){throw wmGetText("Could not get default config for key:")+" "+configKey}else{return Ext.ux.clone(this.predefinedConfigObj[this.explorerType].configs[configKey])}},mergeObjectsFirstHierarchy:function(mergeTo,mergeFrom){for(var mergeKey in mergeFrom){mergeTo[mergeKey]=mergeFrom[mergeKey]}return mergeTo},getRootTreeNode:function(){var rootTreeNodeConfigObj=this.getDefaultConfig("defaultRootTreeNodeConfig");if((typeof(this.customTreeConfig.rootTreeNode)!="undefined")&&(typeof(this.customTreeConfig.rootTreeNode.extJsConfig)!="undefined")){rootTreeNodeConfigObj=this.mergeObjectsFirstHierarchy(rootTreeNodeConfigObj,this.customTreeConfig.rootTreeNode.extJsConfig)}var rootTreeNode=new Ext.tree.AsyncTreeNode(rootTreeNodeConfigObj);return rootTreeNode},getTreeLoader:function(){var ajaxUrl=this.customTreeConfig.ajaxUrl;var baseParams={};if(typeof(this.customTreeConfig.baseParams)){baseParams=this.customTreeConfig.baseParams}var treeLoaderConfigObj=this.getDefaultConfig("defaultTreeLoaderConfig");treeLoaderConfigObj.dataUrl=ajaxUrl;treeLoaderConfigObj.baseParams=baseParams;if((typeof(this.customTreeConfig.treeLoader)!="undefined")&&(typeof(this.customTreeConfig.treeLoader.extJsConfig)!="undefined")){treeLoaderConfigObj=this.mergeObjectsFirstHierarchy(treeLoaderConfigObj,this.customTreeConfig.treeLoader.extJsConfig)}var treeLoader=new Ext.tree.TreeLoader(treeLoaderConfigObj);return treeLoader},setTreeSorter:function(tree){var treeSorterConfigObj=this.getDefaultConfig("defaultTreeSorterConfig");if((typeof(this.customTreeConfig.treeSorter)!="undefined")&&(typeof(this.customTreeConfig.treeSorter.extJsConfig)!="undefined")){treeSorterConfigObj=this.mergeObjectsFirstHierarchy(treeSorterConfigObj,this.customTreeConfig.treeSorter.extJsConfig)}var treeSorter=new Ext.tree.TreeSorter(tree,treeSorterConfigObj);return treeSorter},createTreePanelObj:function(rootTreeNode,treeLoader,selectionModel){var treeConfigObj=this.getDefaultConfig("defaultTreeConfig");treeConfigObj.selModel=selectionModel;if((typeof(this.customTreeConfig)!="undefined")&&(typeof(this.customTreeConfig.extJsConfig)!="undefined")){treeConfigObj=this.mergeObjectsFirstHierarchy(treeConfigObj,this.customTreeConfig.extJsConfig)}treeConfigObj.root=rootTreeNode;treeConfigObj.loader=treeLoader;var treePanel=new Ext.tree.TreePanel(treeConfigObj);if(typeof(this.customTreeConfig.extJsOnEvents)=="object"){for(var eventName in this.customTreeConfig.extJsOnEvents){treePanel.on(eventName,this.customTreeConfig.extJsOnEvents[eventName])}}return treePanel},getTreeSelectionModel:function(){if((typeof(this.customTreeConfig.selectionModel)!="undefined")&&(typeof(this.customTreeConfig.selectionModel.selModel)!="undefined")&&(typeof(this.customTreeConfig.selectionModel.selModel)=="object")){return this.customTreeConfig.selectionModel.selModel}var treeSelectionModelConfig=this.getDefaultConfig("defaultTreeSelectionModelConfig");if((typeof(this.customTreeConfig.selectionModel)!="undefined")&&(typeof(this.customTreeConfig.selectionModel.extJsConfig)!="undefined")){treeSelectionModelConfig=this.mergeObjectsFirstHierarchy(treeSelectionModelConfig,this.customTreeConfig.selectionModel.extJsConfig)}var selectionModel=new Ext.tree.DefaultSelectionModel(treeSelectionModelConfig);if((typeof(this.customTreeConfig.selectionModel)!="undefined")&&typeof(this.customTreeConfig.selectionModel.extJsOnEvents)=="object"){for(var eventName in this.customTreeConfig.selectionModel.extJsOnEvents){selectionModel.on(eventName,this.customTreeConfig.selectionModel.extJsOnEvents[eventName])}}return selectionModel},getTreePanelObj:function(){var rootTreeNode=this.getRootTreeNode();var treeLoader=this.getTreeLoader();var selectionModel=this.getTreeSelectionModel();var tree=this.createTreePanelObj(rootTreeNode,treeLoader,selectionModel);var treeSorter=this.setTreeSorter(tree);rootTreeNode.expand();return tree},getGridDataReader:function(){var gridDataStoreMappingArr=this.customGridConfig.gridDataStoreMappingArr;var gridDataReaderConfig=this.getDefaultConfig("defaultGridDataReaderConfig");if((typeof(this.customGridConfig.dataReader)!="undefined")&&(typeof(this.customGridConfig.dataReader.extJsConfig)!="undefined")){gridDataReaderConfig=this.mergeObjectsFirstHierarchy(gridDataReaderConfig,this.customGridConfig.dataReader.extJsConfig)}var dataReader=new Ext.data.JsonReader(gridDataReaderConfig,gridDataStoreMappingArr);return dataReader},getGridDataStore:function(){var ajaxUrl=this.customGridConfig.ajaxUrl;var baseParams={};if(typeof(this.customGridConfig.baseParams)){baseParams=this.customGridConfig.baseParams}var dataStoreReader=this.getGridDataReader();var dataStore=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:ajaxUrl,method:"POST"}),baseParams:baseParams,reader:dataStoreReader});if((typeof(this.customGridConfig.gridStore)!="undefined")&&(typeof(this.customGridConfig.gridStore.extJsOnEvents)=="object")){for(var eventName in this.customGridConfig.gridStore.extJsOnEvents){dataStore.on(eventName,this.customGridConfig.gridStore.extJsOnEvents[eventName])}}return dataStore},getGridSelectionModel:function(){var gridSelectionModelConfig=this.getDefaultConfig("defaultGridSelectionModelConfig");if((typeof(this.customGridConfig.selectionModel)!="undefined")&&(typeof(this.customGridConfig.selectionModel.extJsConfig)!="undefined")){gridSelectionModelConfig=this.mergeObjectsFirstHierarchy(gridSelectionModelConfig,this.customGridConfig.selectionModel.extJsConfig)}var selectionModel=new Ext.grid.RowSelectionModel(gridSelectionModelConfig);if((typeof(this.customGridConfig.selectionModel)!="undefined")&&typeof(this.customGridConfig.selectionModel.extJsOnEvents)=="object"){for(var eventName in this.customGridConfig.selectionModel.extJsOnEvents){selectionModel.on(eventName,this.customGridConfig.selectionModel.extJsOnEvents[eventName])}}return selectionModel},createGridPanelObj:function(gridDataStore,gridColumnModelObj,selectionModel){var defaultGridPanelConfigObj=this.getDefaultConfig("defaultGridConfig");defaultGridPanelConfigObj.store=gridDataStore;defaultGridPanelConfigObj.cm=gridColumnModelObj;defaultGridPanelConfigObj.selModel=selectionModel;if((typeof(this.customGridConfig)!="undefined")&&(typeof(this.customGridConfig.extJsConfig)!="undefined")){defaultGridPanelConfigObj=this.mergeObjectsFirstHierarchy(defaultGridPanelConfigObj,this.customGridConfig.extJsConfig)}var gridPanel=new Ext.grid.GridPanel(defaultGridPanelConfigObj);if(typeof(this.customGridConfig.extJsOnEvents)=="object"){for(var eventName in this.customGridConfig.extJsOnEvents){gridPanel.on(eventName,this.customGridConfig.extJsOnEvents[eventName])}}return gridPanel},getGridPanelObj:function(){var gridColumnModelObj=this.customGridConfig.gridColumnModelObj;gridColumnModelObj.defaultSortable=true;var gridDataStore=this.getGridDataStore();var rowSelectionModel=this.getGridSelectionModel();var grid=this.createGridPanelObj(gridDataStore,gridColumnModelObj,rowSelectionModel);if(typeof(this.customGridConfig.defaultSort)=="object"){grid.getStore().setDefaultSort(this.customGridConfig.defaultSort.field,this.customGridConfig.defaultSort.direction)}if((typeof(this.customGridConfig.skipLoading)!="undefined")&&(this.customGridConfig.skipLoading!=1)){grid.getStore().load()}return grid},createToolbarObj:function(toolbarConfig,renderTo){var defaultToolbarConfigObj=this.getDefaultConfig("defaultToolbarConfig");if(typeof(renderTo)!="undefined"){defaultToolbarConfigObj.renderTo=renderTo}if((typeof(toolbarConfig)!="undefined")&&(typeof(toolbarConfig.extJsConfig)!="undefined")){defaultToolbarConfigObj=this.mergeObjectsFirstHierarchy(defaultToolbarConfigObj,toolbarConfig.extJsConfig)}switch(toolbarConfig.type){case"statusBar":var toolbarObj=new Ext.StatusBar(defaultToolbarConfigObj);break;default:var toolbarObj=new Ext.Toolbar(defaultToolbarConfigObj);break}return toolbarObj},showWMExplorerPanel:function(){var contentItems=[];var defaultWidth=1;var contentsCnt=this.contents.length;if(contentsCnt>0){defaultWidth=(defaultWidth/contentsCnt)}for(var i=0;i<contentsCnt;i++){var defaultPanelItemsConfigObj=this.getDefaultConfig("defaultContainerItemsConfig");defaultPanelItemsConfigObj.columnWidth=defaultWidth;if((this.customConfigObj.contents[i].config)&&(this.customConfigObj.contents[i].config.containerItems)&&typeof(this.customConfigObj.contents[i].config.containerItems.extJsConfig!="undefined")){defaultPanelItemsConfigObj=this.mergeObjectsFirstHierarchy(defaultPanelItemsConfigObj,this.customConfigObj.contents[i].config.containerItems.extJsConfig)}defaultPanelItemsConfigObj.items=this.contents[i];contentItems.push(defaultPanelItemsConfigObj)}var firstTopToolbar="";var tbarLength=0;if(this.customConfigObj.container.topToolbars){tbarLength=this.customConfigObj.container.topToolbars.length;if(tbarLength>0){firstTopToolbar=this.createToolbarObj(this.customConfigObj.container.topToolbars[0])}}var firstBottomToolbar="";var bbarLength=0;if(this.customConfigObj.container.bottomToolbars){bbarLength=this.customConfigObj.container.bottomToolbars.length;if(bbarLength>0){firstBottomToolbar=this.createToolbarObj(this.customConfigObj.container.bottomToolbars[0])}}var defaultContainerConfigObj=this.getDefaultConfig("defaultContainerConfig");defaultContainerConfigObj.items=contentItems;defaultContainerConfigObj.tbar=firstTopToolbar;defaultContainerConfigObj.bbar=firstBottomToolbar;if((typeof(this.customConfigObj.container)!="undefined")&&(typeof(this.customConfigObj.container.extJsConfig)!="undefined")){defaultContainerConfigObj=this.mergeObjectsFirstHierarchy(defaultContainerConfigObj,this.customConfigObj.container.extJsConfig)}var wmExplorer=new Ext.Panel(defaultContainerConfigObj);this.container=wmExplorer;for(var i=1;i<tbarLength;i++){this.createToolbarObj(this.customConfigObj.container.topToolbars[i],wmExplorer.tbar)}for(var i=1;i<bbarLength;i++){this.createToolbarObj(this.customConfigObj.container.topToolbars[i],wmExplorer.bbar)}},showWMExplorerWindow:function(){var contentItems=[];var defaultWidth=1;var contentsCnt=this.contents.length;if(contentsCnt>0){defaultWidth=(defaultWidth/contentsCnt)}for(var i=0;i<contentsCnt;i++){var defaultPanelItemsConfigObj=this.getDefaultConfig("defaultContainerItemsConfig");defaultPanelItemsConfigObj.columnWidth=defaultWidth;if((this.customConfigObj.contents[i].config)&&(this.customConfigObj.contents[i].config.containerItems)&&typeof(this.customConfigObj.contents[i].config.containerItems.extJsConfig!="undefined")){defaultPanelItemsConfigObj=this.mergeObjectsFirstHierarchy(defaultPanelItemsConfigObj,this.customConfigObj.contents[i].config.containerItems.extJsConfig)}defaultPanelItemsConfigObj.items=this.contents[i];contentItems.push(defaultPanelItemsConfigObj)}var firstTopToolbar="";var tbarLength=0;if(this.customConfigObj.container.topToolbars){tbarLength=this.customConfigObj.container.topToolbars.length;if(tbarLength>0){firstTopToolbar=this.createToolbarObj(this.customConfigObj.container.topToolbars[0])}}var firstBottomToolbar="";var bbarLength=0;if(this.customConfigObj.container.bottomToolbars){bbarLength=this.customConfigObj.container.bottomToolbars.length;if(bbarLength>0){firstBottomToolbar=this.createToolbarObj(this.customConfigObj.container.bottomToolbars[0])}}var defaultContainerConfigObj=this.getDefaultConfig("defaultContainerConfig");defaultContainerConfigObj.items=contentItems;defaultContainerConfigObj.tbar=firstTopToolbar;defaultContainerConfigObj.bbar=firstBottomToolbar;if((typeof(this.customConfigObj.container)!="undefined")&&(typeof(this.customConfigObj.container.extJsConfig)!="undefined")){defaultContainerConfigObj=this.mergeObjectsFirstHierarchy(defaultContainerConfigObj,this.customConfigObj.container.extJsConfig)}var wmExplorer=new Ext.Window(defaultContainerConfigObj);this.container=wmExplorer;wmExplorer.show();for(var i=1;i<tbarLength;i++){this.createToolbarObj(this.customConfigObj.container.topToolbars[i],wmExplorer.tbar)}for(var i=1;i<bbarLength;i++){this.createToolbarObj(this.customConfigObj.container.topToolbars[i],wmExplorer.bbar)}},showWMExplorer:function(){switch(this.customConfigObj.container.type){case"panel":this.showWMExplorerPanel();break;case"window":this.showWMExplorerWindow();break;default:throw wmGetText("Invalid container type.");break}}};Ext.namespace("Ext.ux");Ext.ux.IconCombo=function(config){Ext.ux.IconCombo.superclass.constructor.call(this,config);this.tpl=config.tpl||'<tpl for="."><div class="x-combo-list-item x-icon-combo-item {'+this.iconClsField+'}">{'+this.displayField+"}</div></tpl>";this.on({render:{scope:this,fn:function(){var wrap=this.el.up("div.x-form-field-wrap");this.wrap.applyStyles({position:"relative"});this.el.addClass("x-icon-combo-input");this.flag=Ext.DomHelper.append(wrap,{tag:"div",style:"position:absolute"})}}})};Ext.extend(Ext.ux.IconCombo,Ext.form.ComboBox,{setIconCls:function(){var rec=this.store.query(this.valueField,this.getValue()).itemAt(0);if(rec){this.flag.className="x-icon-combo-icon "+rec.get(this.iconClsField)}},setValue:function(value){Ext.ux.IconCombo.superclass.setValue.call(this,value);this.setIconCls()}});