Ext.define("egindex.controller.indexController",{extend:"Ext.app.Controller",refs:[{selector:"quicklinkprofile",ref:"quicklinkprofile"},{selector:"quicklinkmenuitem",ref:"quicklinkmenuitem"},{selector:"logotabset",ref:"logotabset"},{selector:"switchuserprofile",ref:"switchuserprofile"}],init:function(){setInterval("execute()",searchRefFrequency);
appCnt=this;this.control({'button[id="EditBtn"]':{"click":this.editfn},'button[id="SubmitBtn"]':{"click":this.userprofilesave},'quicklinkmenuitem combo[id="reportType"]':{"change":this.comboLoad},'logotabset trigger[name="egsearches"]':{"keyup":this.searchfn,"afterrender":this.refreshfunction},"logotabset ":{"afterrender":this.logotabsetfunction},'button[id="UserSubmitBtn"]':{"click":this.goToSwitchProfileUrl},"tabset":{"afterrender":this.tabsetfunction},'logotabset trigger[name="egcommonsearch"]':{"keyup":this.commonSearchfn,}});
},tabsetfunction:function(){if(isAlarmViewer=="true"){Ext.getCmp("monitorIconIndexMenuId").hide();}},logotabsetfunction:function(){if((isNewBrowWin=="yes"&&isNewBrowWin!=null)||(!Ext.isEmpty(switchback)&&switchback==false)){if(isNewBrowWin=="yes"&&isNewBrowWin!=null){Ext.getCmp("switchBack").hide();Ext.getCmp("switchBackseperator").hide();
}Ext.getCmp("switchUser").hide();Ext.getCmp("switchuserseparator").hide();Ext.getCmp("signout").hide();Ext.getCmp("monitortbseparatorId").hide();}},refreshfunction:function(){if(displayTab!=null&&displayTab!=undefined&&displayTab!="monitor"){return;}if(isConfigGlobalSearch!=null&&isConfigGlobalSearch=="true"){isConfigGlobalSearch="false";
return;}if(searchType.toLowerCase()=="user"||searchType.toLowerCase()=="vm"){if(this.checkSpecialCharacter(searchValue)){Ext.Msg.show({title:"Search",msg:"Special Characters are not allowed",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}}if(searchType.toLowerCase()=="segment"||searchType.toLowerCase()=="zone"||searchType.toLowerCase()=="server"||searchType.toLowerCase()=="service"){var c="`~!@#$%^&()+={}[]|;\"'<>,?/";
for(var a=0;a<searchValue.length;a++){check_char=c.indexOf(searchValue.charAt(a));if(check_char>=0){Ext.Msg.show({title:"Search",msg:"Special Characters are not allowed",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}}}if(searchType!=null&&searchType!=""&&searchType!="undefined"&&searchValue!=null&&searchValue!=""&&searchValue!="undefined"){searchValue=searchValue.trim();
Ext.getCmp("searchCombo").setValue(searchType);Ext.getCmp("egsearches").setValue(searchValue);if(searchType.toLowerCase()=="user"||searchType.toLowerCase()=="vm"){searchValue=this.replaceSpecialCharacter(searchValue,"'","|quots|");searchValue=this.replaceSpecialCharacter(searchValue,"#","|hash|");var b=searchType+" "+searchValue;
this.loadUsersdata(b);}else{if(searchType.toLowerCase()=="segment"){this.loadsegmentsdata(searchValue);}else{if(searchType.toLowerCase()=="zone"){this.loadzonesdata(searchValue);}else{if(searchType.toLowerCase()=="server"){this.loadserversdata(searchValue);}else{if(searchType.toLowerCase()=="service"){this.loadservicesdata(searchValue);
}}}}}}},removeglobalsessionvalue:function(){isWindowClosable=true;closeNotificationWindow("mangerNotificationWindow");var a="removesession=yes&searchType="+searchType+"&searchValue="+searchValue;Ext.Ajax.request({url:"/final/servlet/com.eg.EgSearchController",method:"POST",params:a,scope:this,async:false,success:function(b){if(b.status==200&&!Ext.isEmpty(b.responseText)){}},failure:function(b){}});
},userprofilesave:function(L){var J=/^(\+\d\d)?[0-9]+$/g;var af=/(((([\+]?([0-9]){4,15})|([\_\#]?([a-zA-Z0-9]+[\ \_\.\-\&\#]?)*[a-zA-Z0-9])+)\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])|((\+\d\d)?[0-9]+))/g;var k="";var aa="";var V="";var U;var D=true;var w=Ext.getCmp("mailTo").getValue();
if(w!=null&&w!="undefined"){k=w;}var f=Ext.getCmp("mailCC").getValue();if(f!=null&&f!="undefined"){aa=f;}var e=Ext.getCmp("mailBCC").getValue();if(e!=null&&e!="undefined"){V=e;}var t=Ext.getCmp("Cmd").getValue();var Y="";if(!Ext.isEmpty(t)&&t!="undefined"){Y=t;}var M=validateEmail(w);var q=validateEmail(f);
var ag=validateEmail(e);var u=w.match(J);var z=f.match(J);var n=e.match(J);var p=w.match(af);var Z=f.match(af);var K=e.match(af);if((k!="")&&(M==false&&u==null)&&(p!=w)){var ae=Ext.Msg.show({title:alertlbl,modal:false,msg:validMailandMobileNo,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});ae.alignTo(Ext.get("configModUserProfile"),"c-c");
Ext.getCmp("mailTo").focus();return;}if((aa!="")&&(q==null||q==false)&&z==null&&(Z!=f)){var P=Ext.Msg.show({title:alertlbl,modal:false,msg:validMobileNumber,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});P.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailCC").focus();return;}if((V!="")&&(ag==null||ag==false)&&n==null&&K!=e){var O=Ext.Msg.show({title:alertlbl,modal:false,msg:validEmailId,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
O.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailBCC").focus();return;}if(!validateSingleByte(w)){var ai=Ext.Msg.show({title:alertlbl,modal:false,msg:toNotAllowed,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});ai.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailTo").focus();return;
}if((aa!="")&&!validateSingleByte(f)){var Q=Ext.Msg.show({title:alertlbl,modal:false,msg:ccNotAllowed,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});Q.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailCC").focus();return;}if((V!="")&&!validateSingleByte(e)){var F=Ext.Msg.show({title:alertlbl,modal:false,msg:bccNotAllowed,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
F.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailBCC").focus();return;}if(!checkspecial(Y,"@*+=[]|;\"'<>?`")){Ext.getCmp("Cmd").focus();D=false;return;}if(!D||Y!=""){if(Ext.getCmp("critical").pressed==false&&Ext.getCmp("major").pressed==false&&Ext.getCmp("minor").pressed==false){var j=Ext.Msg.show({title:"Alert",modal:false,msg:"Please choose the type of alarms",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
j.alignTo(Ext.get("configModUserProfile"),"c-c");D=false;return;}}var A=Ext.getCmp("critical").pressed;if(A==true){A="H";}else{A="null";}var B=Ext.getCmp("major").pressed;if(B==true){B="I";}else{B="null";}var G=Ext.getCmp("minor").pressed;if(G==true){G="L";}else{G="null";}if(D){if((k==""&&k.length==0)&&(aa!=""&&aa.length>0)){var h=Ext.Msg.show({title:"Alert",modal:false,msg:"Please enter valid To mail id and/or mobile number",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
h.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailTo").focus();D=false;return;}if((k==""&&k.length==0)&&(V!=""&&V.length>0)){var d=Ext.Msg.show({title:"Alert",modal:false,msg:"Please enter valid To mail id and/or mobile number",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});d.alignTo(Ext.get("configModUserProfile"),"c-c");
Ext.getCmp("mailTo").focus();D=false;return;}if((Ext.getCmp("minor").pressed)||(Ext.getCmp("critical").pressed)||(Ext.getCmp("major").pressed)){if((k==""&&k.length==0)&&(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no")){var c=Ext.Msg.show({title:"Alert",modal:false,msg:"Please enter valid To mail id and/or mobile number",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
c.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailTo").focus();D=false;return;}}if((!Ext.isEmpty(Ext.getCmp("critical"))&&Ext.getCmp("critical").pressed)||(!Ext.isEmpty(Ext.getCmp("major"))&&Ext.getCmp("major").pressed)||(!Ext.isEmpty(Ext.getCmp("minor"))&&Ext.getCmp("minor").pressed)){var T=" or ";
var H="'";var y="Please enter either"+H+"To Mail ID/Mobile No"+H+T+H+"Command"+H+".";if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="no"){y="Please enter valid To mail id and/or mobile number";}if((k==""&&k.length==0)&&(Y==""&&Y.length==0)){var b=Ext.Msg.show({title:"Alert",modal:false,msg:y,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
b.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("mailTo").focus();D=false;return;}}}var r=tempJsonData["is2FAFlagEnabled"];if(!Ext.isEmpty(r)&&r.toLowerCase()=="yes"){var v=Ext.getCmp("mailTo").getValue();if(Ext.isEmpty(v)||Ext.String.trim(v).length==0){var b=Ext.Msg.show({title:alertlbl,modal:false,msg:userIDValidationMsg65+". "+userIDValidationMsg66,buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING,width:270,fn:function(){if(!Ext.isEmpty(Ext.getCmp("mailTo"))){Ext.getCmp("mailTo").focus();
}}});b.alignTo(Ext.get("configModUserProfile"),"c-c");return;}}var ah=Ext.getCmp("reportType2").getValue();if(isAlarmViewerUser=="true"){if(ah!="Current Alarms"){var b=Ext.Msg.show({title:"Alert",modal:false,msg:"You can set only Current Alarm page as home page",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
b.alignTo(Ext.get("configModUserProfile"),"c-c");Ext.getCmp("reportType2").focus();return;}}var x=tempJsonData.hiddenParams["$_high"];var o=tempJsonData.hiddenParams["$_medium"];var l=tempJsonData.hiddenParams["$_low"];var s=tempJsonData.hiddenParams["$_tomailid"];var ad=tempJsonData.hiddenParams["$_ccmailid"];
var m=tempJsonData.hiddenParams["$_bccmailid"];var R=tempJsonData.hiddenParams["$_monitorHomePage"];if(!Ext.isEmpty(enableCommand)&&enableCommand.toLowerCase()=="yes"){var S=Ext.getCmp("Cmd");if(S.isVisible()&&!Ext.isEmpty(Y)&&Y.length>0){var E="";var N=Y.split(",");var g="cmd:";for(var ab=0;ab<N.length;
ab++){var C=N[ab];E+=g+C;if(N.length!=(ab+1)){E+=",";}}customesc=E;}}var W=Ext.getCmp("monitorHomeOpt");var ac="";if(!Ext.isEmpty(W)){var X=W.getChecked();ac=X[0].inputValue;}var I=false;if(ac!=null&&ac=="dynamic"){var a=Ext.getCmp("reportType2").previousSelectedOption;if(ah!=null&&ah!=a){I=true;}}else{if(ah!=null&&ah!=R){I=true;
}}Ext.Ajax.request({url:"/final/scripts/EgIndexApp/data/EguserprofileQuickViewp.jsp?tomailid="+encodeURIComponent(w)+"&ccmailid="+encodeURIComponent(f)+"&bccmailid="+encodeURIComponent(e)+"&high="+encodeURIComponent(A)+"&medium="+encodeURIComponent(B)+"&low="+encodeURIComponent(G)+"&monitorHomePage="+encodeURIComponent(ah)+"&cmdescvalues="+encodeURIComponent(customesc)+"&entrypageval="+encodeURIComponent(entrypage)+"&$_low="+encodeURIComponent(l)+"&$_high="+x+"&$_medium="+o+"&$_monitorHomePage= Monitor Home Page$"+R+"&$_tomailid= Mail ID / Mobile No To$"+encodeURIComponent(s)+"&$_ccmailid=Mail ID / Mobile No  Cc$"+encodeURIComponent(ad)+"&$_bccmailid=Mail ID / Mobile No  Bcc$"+encodeURIComponent(m)+"&monitorHomePageOption="+ac,method:"POST",scope:this,success:function(ak){var al=ak.responseText;
var aj=Ext.decode(al);var i=Ext.Msg.show({title:aj["Title"],modal:false,msg:aj["Msg"],buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(am){if(am=="ok"){if(I){window.parent.location.href="/final/egIndex.jsp?entry=monitor&displayTab=all&uname=&integritycheckviolated=false";}else{refreshEgIndexPage("userprofile_monitor_homepage");
}}}});i.alignTo(Ext.get("configModUserProfile"),"c-c");}});},editfn:function(a){var b=Ext.dom.Query.select(".iconUserIndex");var c=Ext.fly(b[0]);Ext.get("userprofile").removeCls("selected_navigation");userproclicked=false;Ext.getCmp("configModUserProfile").destroy();document.getElementById("main").src="/final/admin/userProfile.jsp";
},replaceSpecialCharacter:function(a,f,e){var d="";var c="";for(var b=0;b<a.length;b++){d=a.charAt(b);if(d==f){d=d.replace(f,e);c+=d;}else{c+=d;continue;}}return c;},checkSpecialCharacter:function(a){var c='%&+"';for(var b=0;b<a.length;b++){check_char=c.indexOf(a.charAt(b));if(check_char>=0){return true;
}}return false;},refreshSearch:function(b){if(b==null||b==undefined){b=Ext.getCmp("searchTrigger").getValue();}if(Ext.isEmpty(b)||b==null||b==undefined){Ext.Msg.show({title:searchLbl,msg:validSearchPrefix+"  '*'",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});return;}b=b.trim();var a="searchValue="+b+"&fromCommonSearch=yes";
Ext.Ajax.request({url:"/final/servlet/com.eg.EgSearchController",method:"POST",params:a,scope:this,async:false,success:function(d){if(d.status==200&&!Ext.isEmpty(d.responseText)){var f=Ext.decode(d.responseText);f=f.SearchData;var c=Ext.getCmp("commonSearchWin");if(!Ext.isEmpty(c)&&c!=null){var e=new Array();
if(Ext.isEmpty(f)||f==null||f==undefined){c.removeAll();var g=this.createNodataDockedItems();if(e==""||e==null||e=="undefined"){if(Ext.getCmp("timelineLabel")){Ext.getCmp("timelineLabel").update("");}e.push({xtype:"container",margin:"100 0 0 0",html:'<div style="height:100%;width:100%;display:table"><div class="msgFont" style="display:table-cell;vertical-align:middle"> <div class="f14-normal iconInformation" style="margin:0px auto"></div><div style="text-align:center">Search string is not found in components,services,segments,zones or users.</div></div></div>'});
c.add(e);c.setSize(500,300);c.alignTo(Ext.getCmp("egcommonsearch"),"tr-tr",[0,0]);}}else{if(Ext.getCmp("timelineLabel")){Ext.getCmp("timelineLabel").update("showing results for last 24 hours");}c.removeAll();var e=this.createItemsArray(f,b);c.add(e);c.setSize(635,535);c.alignTo(Ext.getCmp("egcommonsearch"),"tr-tr",[0,0]);
c.doLayout();}Ext.getCmp("searchTrigger").setValue(b);Ext.getCmp("searchTrigger").focus(true,10);}}},failure:function(c){}});},commonSearchfn:function(f,d){var c="";if((d!=undefined&&d.type=="keyup"&&d.getKey()==d.ENTER)||(d==undefined)){c=f.getValue();c=c.trim();if(Ext.isEmpty(c)||c==null||c==undefined){Ext.Msg.show({title:searchLbl,msg:validSearchPrefix+"  '*'",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});
return;}var g="";try{g=parent.filterEncode(c);}catch(d){try{g=window.opener.filterEncode(c);}catch(b){try{g=filterEncode(c);}catch(h){g=parent.parent.filterEncode(c);}}}var a="searchValue="+g+"&fromCommonSearch=yes";Ext.Ajax.request({url:"/final/servlet/com.eg.EgSearchController",method:"POST",params:a,scope:this,async:false,success:function(i){if(i.status==200&&!Ext.isEmpty(i.responseText)){var j=Ext.decode(i.responseText);
var k=j.isLink;if(k=="true"){j=j.SearchData;var e=document.getElementById("main");e.src=j;}else{j=j.SearchData;this.loadSearchWindow(j,c);Ext.getCmp("searchTrigger").setValue(c);Ext.getCmp("searchTrigger").focus(true,10);}}},failure:function(e){}});}},createInnerItemsArray:function(d,c){var b=new Array();
if(c){for(var a=0;a<d.length;a++){b.push({columnWidth:0.2,xtype:"container",padding:"0 10 0 10",html:'<div style="margin:auto"><a href="javascript:void(0)"> <div onclick="loadLinkURL(\''+d[a].href+'\')" onmouseover="javascript:void(0)"><div class="'+d[a].cssClass+'"><div class="state_'+d[a].state+' searchStatePos" ></div></div><div class="crl"></div><div class="f11-normal labelAlignCenter searchLabelElipsis" data-qtip="'+d[a].displayName+'">'+d[a].displayName+"</div></div></a></div>"});
}}else{for(var a=0;a<d.length;a++){b.push({columnWidth:0.2,xtype:"container",padding:"0 10 0 10",html:'<div><a href="javascript:void(0)"> <div onclick="loadLinkURL(\''+d[a].href+'\')" onmouseover="javascript:void(0)"><div class="'+d[a].image+'"></div><div class="crl"></div><div class="f11-normal labelAlignCenter searchLabelElipsis" data-qtip="'+d[a].name+'">'+d[a].name+"</div></div></a></div>"});
}}return b;},createItemsArray:function(c,e){var a=new Array();var b=new Array();var f=c.User;var g=true;if(!Ext.isEmpty(c.User_ShowMore)&&c.User_ShowMore!=null&&c.User_ShowMore!=undefined){g=false;}if(!Ext.isEmpty(f)&&f!=null){var d=this;b=this.createInnerItemsArray(f);a.push({xtype:"panel",margin:"7 0 0 0",layout:"column",cls:"indexSearchPopup",padding:0,dockedItems:[{xtype:"toolbar",dock:"top",items:[{xtype:"label",height:15,cls:"f12-bold",margin:"0 0 0 10",text:"USERS"},"->",{xtype:"label",height:15,cls:"f10-bold mouse",text:"Click here for details",hidden:g,listeners:{afterrender:function(){this.el.on("click",function(){var h="";
var j=e;if(e.indexOf(" ")>0){h=e.substring(0,e.indexOf(" "));j=e.substring(e.indexOf(" ")+1);}j=parent.filterEncode(j);j=encodeURIComponent(j);var i="user "+j;d.loadUsersdata(i);Ext.getCmp("commonSearchWin").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);
});}}}]}],items:b});}f=c.VMDesktop;g=true;if(!Ext.isEmpty(c.VMDesktop_ShowMore)&&c.VMDesktop_ShowMore!=null&&c.VMDesktop_ShowMore!=undefined){g=false;}if(f!=null&&!Ext.isEmpty(f)){var d=this;b=this.createInnerItemsArray(f);a.push({xtype:"panel",margin:"7 0 0 0",layout:"column",cls:"indexSearchPopup",padding:0,dockedItems:[{xtype:"toolbar",dock:"top",items:[{xtype:"label",height:15,cls:"f12-bold",margin:"0 0 0 10",text:"VM/DESKTOPS"},"->",{xtype:"label",height:15,cls:"f10-bold mouse",text:"Click here for details",hidden:g,listeners:{afterrender:function(){this.el.on("click",function(){var h="";
var j=e;if(e.indexOf(" ")>0){h=e.substring(0,e.indexOf(" "));j=e.substring(e.indexOf(" ")+1);}j=parent.filterEncode(j);j=encodeURIComponent(j);var i="vm "+j;d.loadUsersdata(i);Ext.getCmp("commonSearchWin").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);});
}}}]}],items:b});}b=new Array();f=c.Zones;g=true;if(!Ext.isEmpty(c.Zones_ShowMore)&&c.Zones_ShowMore!=null&&c.Zones_ShowMore!=undefined){g=false;}if(f!=null&&!Ext.isEmpty(f)){var d=this;b=this.createInnerItemsArray(f,true);a.push({xtype:"panel",margin:"7 0 0 0",layout:"column",cls:"indexSearchPopup",padding:0,dockedItems:[{xtype:"toolbar",dock:"top",items:[{xtype:"label",height:15,cls:"f12-bold",margin:"0 0 0 10",text:"ZONE"},"->",{xtype:"label",height:15,cls:"f10-bold mouse",text:"Click here for details",hidden:g,listeners:{afterrender:function(){this.el.on("click",function(){d.loadzonesdata(e);
Ext.getCmp("commonSearchWin").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);});}}}]}],items:b});}b=new Array();f=c.Services;g=true;if(!Ext.isEmpty(c.Services_ShowMore)&&c.Services_ShowMore!=null&&c.Services_ShowMore!=undefined){g=false;}if(f!=null&&!Ext.isEmpty(f)){var d=this;
b=this.createInnerItemsArray(f,true);a.push({xtype:"panel",margin:"7 0 0 0",layout:"column",cls:"indexSearchPopup",padding:0,dockedItems:[{xtype:"toolbar",dock:"top",items:[{xtype:"label",height:15,cls:"f12-bold",margin:"0 0 0 10",text:"SERVICE"},"->",{xtype:"label",height:15,cls:"f10-bold mouse",text:"Click here for details",hidden:g,listeners:{afterrender:function(){this.el.on("click",function(){d.loadservicesdata(e);
Ext.getCmp("commonSearchWin").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);});}}}]}],items:b});}b=new Array();f=c.Segments;g=true;if(!Ext.isEmpty(c.Segments_ShowMore)&&c.Segments_ShowMore!=null&&c.Segments_ShowMore!=undefined){g=false;}if(f!=null&&!Ext.isEmpty(f)){var d=this;
b=this.createInnerItemsArray(f,true);a.push({xtype:"panel",margin:"7 0 0 0",layout:"column",cls:"indexSearchPopup",padding:0,dockedItems:[{xtype:"toolbar",dock:"top",items:[{xtype:"label",height:15,cls:"f12-bold",margin:"0 0 0 10",text:"SEGMENT"},"->",{xtype:"label",height:15,cls:"f10-bold mouse",text:"Click here for details",hidden:g,listeners:{afterrender:function(){this.el.on("click",function(){d.loadsegmentsdata(e);
Ext.getCmp("commonSearchWin").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);});}}}]}],items:b});}b=new Array();f=c.Components;g=true;if(!Ext.isEmpty(c.Components_ShowMore)&&c.Components_ShowMore!=null&&c.Components_ShowMore!=undefined){g=false;}if(f!=null&&!Ext.isEmpty(f)){var d=this;
b=this.createInnerItemsArray(f,true);a.push({xtype:"panel",margin:"7 0 0 0",layout:"column",cls:"indexSearchPopup",padding:0,dockedItems:[{xtype:"toolbar",dock:"top",items:[{xtype:"label",height:15,cls:"f12-bold",margin:"0 0 0 10",text:"COMPONENTS"},"->",{xtype:"label",height:15,cls:"f10-bold mouse",text:"Click here for details",hidden:g,listeners:{afterrender:function(){this.el.on("click",function(){d.loadserversdata(e);
Ext.getCmp("commonSearchWin").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);});}}}]}],items:b});}return a;},createNodataDockedItems:function(){var a=new Array();var b=this;if(a!=""||a!=null||a!="undefined"){a.push({xtype:"toolbar",cls:"searchPopupHeadBorder",layout:"hbox",margin:"5 10 5 10",items:[{xtype:"trigger",ui:"SearchCombo inputSearchIcon",width:300,id:"searchTrigger",listeners:{afterrender:function(c){this.el.on("keyup",function(d){if(d!=undefined&&d.getKey()==d.ENTER){b.refreshSearch();
}});}}},"->",{xtype:"button",cls:"iconClose",width:16,margin:"0 0 0 0",style:{"border":"none"},handler:function(){this.up("window").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);}}]});return a;}a.doLayout();},createDockedItems:function(){var a=new Array();
var b=this;if(a!=""||a!=null||a!="undefined"){a.push({xtype:"toolbar",cls:"searchPopupHeadBorder",layout:"hbox",margin:"5 10 5 10",items:[{xtype:"trigger",ui:"SearchCombo inputSearchIcon",width:300,id:"searchTrigger",listeners:{afterrender:function(c){this.el.on("keyup",function(d){if(d!=undefined&&d.getKey()==d.ENTER){b.refreshSearch();
}});}}},"->",{xtype:"container",cls:"f10-normal",padding:"0 0 0 0",id:"timelineLabel",html:"showing results for last 24 hours"},{xtype:"button",cls:"iconClose",width:16,margin:"0 0 0 0",style:{"border":"none"},handler:function(){this.up("window").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);
}}]});return a;}},loadSearchWindow:function(e,h){var a="";var d=Ext.getCmp("egcommonsearch").getPosition();if(Ext.isEmpty(e)||e==null){var g=this.createNodataDockedItems();var f=this;a=Ext.create("Ext.window.Window",{hideHeader:true,header:false,height:300,width:500,shadow:"drop",shadowOffset:10,bodyPadding:"0 14 14 14",resizable:false,ui:"searchPopup",id:"commonSearchWin",autoScroll:true,dockedItems:g,listeners:{show:function(i){Ext.create("Ext.util.KeyNav",i.getEl(),{"esc":function(j){i.hide();
},scope:i});}},items:[{xtype:"container",margin:"100 0 0 0",html:'<div style="height:100%;width:100%;display:table"><div class="msgFont" style="display:table-cell;vertical-align:middle"> <div class="f14-normal iconInformation" style="margin:0px auto"></div><div style="text-align:center">Search string is not found in components,services,segments,zones or users.</div></div></div>'}]}).show();
a.alignTo(Ext.getCmp("egcommonsearch"),"tr-tr",[0,0]);if(Ext.getCmp("timelineLabel")){Ext.getCmp("timelineLabel").hide();}return a;}else{var b=this.createItemsArray(e,h);var c=this.createDockedItems();a=Ext.create("Ext.window.Window",{hideHeader:true,header:false,height:535,width:635,shadow:"drop",shadowOffset:10,bodyPadding:"0 14 12 14",resizable:false,layout:"anchor",ui:"searchPopup",id:"commonSearchWin",autoScroll:true,dockedItems:c,listeners:{show:function(i){Ext.create("Ext.util.KeyNav",i.getEl(),{"esc":function(j){i.hide();
},scope:i});}},items:b}).show();if(Ext.getCmp("timelineLabel")){Ext.getCmp("timelineLabel").show();}a.alignTo(Ext.getCmp("egcommonsearch"),"tr-tr",[0,0]);return a;}},searchfn:function(h,g){var c="",d="";var a=Ext.getCmp("searchCombo").getValue();if(a!=null&&a!=undefined&&!Ext.isEmpty(a)&&((g!=undefined&&g.type=="keyup"&&g.getKey()==g.ENTER)||(g==undefined))){if(isConfigGlobalSearch!=null&&isConfigGlobalSearch=="true"){isConfigGlobalSearch="false";
return;}d=h.getValue();d=d.trim();if(a.toLowerCase()=="user"||a.toLowerCase()=="vm"){if(this.checkSpecialCharacter(d)){Ext.Msg.show({title:"Search",msg:"Special Characters are not allowed",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}}if(a.toLowerCase()=="segment"||a.toLowerCase()=="zone"||a.toLowerCase()=="server"||a.toLowerCase()=="service"){var f="`~!@#$%^&()+={}[]|;\"'<>,?/";
for(var b=0;b<d.length;b++){check_char=f.indexOf(d.charAt(b));if(check_char>=0){Ext.Msg.show({title:"Search",msg:"Special Characters are not allowed",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});return;}}}if(d!=""&&d!=null&&d!=undefined){if(a.toLowerCase()=="user"||a.toLowerCase()=="vm"){d=this.replaceSpecialCharacter(d,"'","|quots|");
d=this.replaceSpecialCharacter(d,"#","|hash|");d=parent.filterEncode(d);d=encodeURIComponent(d);c=a+" "+d;this.loadUsersdata(c);}else{if(a.toLowerCase()=="segment"){this.loadsegmentsdata(d);}else{if(a.toLowerCase()=="zone"){this.loadzonesdata(d);}else{if(a.toLowerCase()=="server"){this.loadserversdata(d);
}else{if(a.toLowerCase()=="service"){this.loadservicesdata(d);}}}}}}else{Ext.Msg.show({title:searchLbl,msg:validSearchPrefix+"  '*'",buttons:Ext.Msg.OK,icon:Ext.Msg.WARNING});}}if(!Ext.isEmpty(h.getValue())){Ext.fly(h.triggerEl.elements[0].dom).setStyle("background-image","url('/final/images/Light/search_trigger_close.png')");
Ext.fly(h.triggerEl.elements[0].dom).set({"data-qtip":"Clear","data-qclass":"light_theme_yellowTip"});return false;}else{Ext.fly(h.triggerEl.elements[0].dom).setStyle("background-image","none");Ext.fly(h.triggerEl.elements[0].dom).set({"data-qtip":"","data-qclass":""});return false;}},loadUsersdata:function(c){var b="",a="";
searchvalues=c;a=c.split(" ");if(a[0].toLowerCase()=="vm"){b="searchuser="+c+"&state=any&eg_tbound=Fixed";c=parent.filterDecode(c);searchvalues="vm "+c;}if(a[0].toLowerCase()=="user"){b="searchuser="+c+"&eg_tbound=Fixed";c=parent.filterDecode(c);searchvalues="user "+c;}b+="&fromSearch="+a[0]+"&entry=monitor&fromPage=GlobalSearch";
this.searchTabChange(b);var d=null;if(opener!=null&&opener!=undefined){d=opener.window.parent.Ext.getCmp("egsearches");}else{if(window.parent!=null&&window.parent!=undefined){d=window.parent.Ext.getCmp("egsearches");}}if(!Ext.isEmpty(d)&&d!=null&&d!="undefined"){if(opener!=null&&opener!=undefined){opener.window.parent.Ext.getCmp("searchCombo").setValue(a[0]);
opener.window.parent.Ext.getCmp("egsearches").setValue(a[1]);opener.window.parent.searchvalues=searchvalues;}}},loadsegmentsdata:function(b){var c="";if(b.indexOf(" ")>0){c=b.substring(0,b.indexOf(" "));b=b.substring(b.indexOf(" ")+1);}globalsearch=true;segmentSearchval=b;var a="";if(b=="*"){a="monCmd=segmentList&from=MainDashboard&action=globalsearchallsegment&treeOpen="+segmenttreeOpenval+"&entry=monitor&fromPage=GlobalSearch";
segmentSearchval="segment "+b;}else{a="monCmd=segmentList&from=segmentList&action=globalsearch&searchString="+encodeURIComponent(segmentSearchval)+"&treeOpen="+segmenttreeOpenval+"&entry=monitor&fromPage=GlobalSearch";segmentSearchval="segment "+b;}a+="&fromSearch=segment";this.searchTabChange(a);var d=null;
if(opener!=null&&opener!=undefined){d=opener.window.parent.Ext.getCmp("egsearches");}else{if(window.parent!=null&&window.parent!=undefined){d=window.parent.Ext.getCmp("egsearches");}}if(!Ext.isEmpty(d)&&d!=null&&d!="undefined"){if(opener!=null&&opener!=undefined){opener.window.parent.Ext.getCmp("searchCombo").setValue("segment");
opener.window.parent.Ext.getCmp("egsearches").setValue(b);opener.window.parent.segmentSearchval=segmentSearchval;}}},loadzonesdata:function(a){var b="";if(a.indexOf(" ")>0){b=a.substring(0,a.indexOf(" "));a=a.substring(a.indexOf(" ")+1);}globalsearch=true;zoneSearchval=a;var c="";if(a=="*"){c="monCmd=zoneList&from=MainDashboard&action=globalsearchallzone&treeOpen="+zonetreeOpenval+"&entry=monitor&fromPage=GlobalSearch";
zoneSearchval="zone "+a;}else{c="monCmd=zoneList&from=zoneList&action=globalsearch&searchString="+encodeURIComponent(zoneSearchval)+"&treeOpen="+zonetreeOpenval+"&entry=monitor&fromPage=GlobalSearch";zoneSearchval="zone "+a;}c+="&fromSearch=zone";this.searchTabChange(c);var d=null;if(opener!=null&&opener!=undefined){d=opener.window.parent.Ext.getCmp("egsearches");
}else{if(window.parent!=null&&window.parent!=undefined){d=window.parent.Ext.getCmp("egsearches");}}if(!Ext.isEmpty(d)&&d!=null&&d!="undefined"){if(opener!=null&&opener!=undefined){opener.window.parent.Ext.getCmp("searchCombo").setValue("zone");opener.window.parent.Ext.getCmp("egsearches").setValue(a);
opener.window.parent.zoneSearchval=zoneSearchval;}}},loadserversdata:function(a){globalsearch=true;serverSearchval=a;servertypeval="";var b="";if(a.indexOf(" ")>0){b=a.substring(0,a.indexOf(" "));a=a.substring(a.indexOf(" ")+1);}if(!Ext.isEmpty(b)&&b!=null&&b.toLowerCase()=="component"){servertypeval=b;
serverSearchval=a;}else{serverSearchval=a;}var c="";if(a=="*"){c="monCmd=componentList&from=TreeMenu&action=globalsearchallcomponent&searchIndComps=checked&treeOpen="+serverstreeOpenval+"&entry=monitor&fromPage=GlobalSearch";serverSearchval="server "+a;}else{c="monCmd=componentList&from=componentList&action=search&searchStateString=All States&searchNameString="+encodeURIComponent(serverSearchval)+"&selTypeString=AllServers&searchTypeString="+servertypeval+"&searchIndComps=on&treeOpen="+serverstreeOpenval+"&entry=monitor&fromPage=GlobalSearch";
serverSearchval="server "+a;}c+="&fromSearch=server";this.searchTabChange(c);var d=null;if(opener!=null&&opener!=undefined){d=opener.window.parent.Ext.getCmp("egsearches");}else{if(window.parent!=null&&window.parent!=undefined){d=window.parent.Ext.getCmp("egsearches");}}if(!Ext.isEmpty(d)&&d!=null&&d!="undefined"){if(opener!=null&&opener!=undefined){opener.window.parent.Ext.getCmp("searchCombo").setValue("server");
opener.window.parent.Ext.getCmp("egsearches").setValue(a);opener.window.parent.serverSearchval=serverSearchval;}}},loadservicesdata:function(a){var b="";if(a.indexOf(" ")>0){b=a.substring(0,a.indexOf(" "));a=a.substring(a.indexOf(" ")+1);}globalsearch=true;serviceSearchval=a;var c="";if(a=="*"){c="monCmd=serviceList&from=MainDashboard&action=globalsearchallservice&treeOpen="+servicetreeOpenval+"&entry=monitor&fromPage=GlobalSearch";
serviceSearchval="service "+a;}else{c="monCmd=serviceList&from=serviceList&action=globalsearch&searchString="+encodeURIComponent(serviceSearchval)+"&treeOpen="+servicetreeOpenval+"&entry=monitor&fromPage=GlobalSearch";serviceSearchval="service "+a;}c+="&fromSearch=service";this.searchTabChange(c);var d=null;
if(opener!=null&&opener!=undefined){d=opener.window.parent.Ext.getCmp("egsearches");}else{if(window.parent!=null&&window.parent!=undefined){d=window.parent.Ext.getCmp("egsearches");}}if(!Ext.isEmpty(d)&&d!=null&&d!="undefined"){if(opener!=null&&opener!=undefined){opener.window.parent.Ext.getCmp("searchCombo").setValue("service");
opener.window.parent.Ext.getCmp("egsearches").setValue(a);opener.window.parent.serviceSearchval=serviceSearchval;}}},searchTabChange:function(url){lastTabQueryString=url;Ext.Ajax.request({url:"/final/scripts/EgIndexApp/data/egIndexJson.jsp",method:"POST",params:url,success:function(response){var jsonText=response.responseText;
var jsonData=Ext.decode(jsonText);isShowAlarmsInLightBox=jsonData["isShowAlarmsInLightBox"];homepage=jsonData["homepage"];smartHomePage=jsonData["smartHomePage"];url=jsonData["url"];adminPressed=eval(jsonData["adminPressed"]);monitorPressed=jsonData["monitorPressed"];reporterPressed=jsonData["reporterPressed"];
configPressed=jsonData["configPressed"];slaPressed=jsonData["slaPressed"];isUsersLimitCrossed=jsonData["isUsersLimitCrossed"];alertUserAbtUserCert=jsonData["alertUserAbtUserCert"];userExpiryMsg=jsonData["userExpiryMsg"];isLicenseEnabled=jsonData["isLicenseEnabled"];isLicenceValid=jsonData["isLicenceValid"];
var previousSkin=jsonData["previousSkin"];var currentSkin=jsonData["currentSkin"];var previousTheme=jsonData["previousTheme"];var currentTheme=jsonData["currentTheme"];logoImageName=jsonData["LogoImageName"];moduleName=jsonData["moduleName"];egTheme=jsonData["egTheme"];selectedTabTheme=jsonData["selectedTabTheme"];
hideAlarmPopup=jsonData["hideAlarmPopup"];Ext.getCmp("help").helpUrl=jsonData["helpURL"];$('link[href="'+previousSkin+'"]').attr("href",currentSkin);$('img[id="logoImg"]').attr("src",logoImageName);isDisableMydashboardPopout=jsonData["isDisableMydashboardPopout"];var mainIframe=document.getElementById("main");
if(monitorPressed!=null&&(monitorPressed==true||monitorPressed=="true")){isAdminModule=false;isMonitorModule=true;isConfigModule=false;isRepModule=false;isSlaModule=false;selectedTabModule="monitor";adminPressed=false;monitorPressed=true;reporterPressed=false;configPressed=false;slaPressed=false;var isRepTabObj=Ext.getCmp("reporter");
if(isRepTabObj!=null&&!isRepTabObj.isHidden()){Ext.getCmp("reporterNewWindowBtn").show();}var isConfigTabObj=Ext.getCmp("config");if(isConfigTabObj!=null&&!isConfigTabObj.isHidden()){Ext.getCmp("configNewWindowBtn").show();}var isSlaTabObj=Ext.getCmp("sla");if(isSlaTabObj!=null&&!isSlaTabObj.isHidden()){Ext.getCmp("slaNewWindowBtn").show();
}if(isAlarmViewerUser=="false"){Ext.getCmp("monitorIconIndexMenuId").show();}Ext.getCmp("adminIndexMenuIcon").hide();Ext.getCmp("reporterIndexMenuIcon").hide();Ext.getCmp("configIndexMenuIcon").hide();Ext.getCmp("slaIndexMenuIcon").hide();var meTabSetView=Ext.getCmp("tabset");meTabSetView.getComponent("adminTabContainer").removeCls("indexButtonBgPressed");
meTabSetView.getComponent("reporterTabContainer").removeCls("indexButtonBgPressed");meTabSetView.getComponent("configTabContainer").removeCls("indexButtonBgPressed");meTabSetView.getComponent("slaTabContainer").removeCls("indexButtonBgPressed");meTabSetView.getComponent("monitorTabContainer").fireEvent("afterrender",meTabSetView.getComponent("monitorTabContainer"));
}if(mainIframe!=null){mainIframe.src=homepage;}refreshInProgress=false;if(previousTheme!=currentTheme){$('link[href="/final/styles/index'+previousTheme+'.css"]').attr("href","/final/styles/index"+currentTheme+".css");}}});},hitUrl:function(a){window.location.href=a;},comboLoad:function(){var a=Ext.getCmp("reportType").getValue();
Ext.Ajax.request({url:"/final/scripts/EgIndexApp/data/EgQuickMenuItems.jsp?moduleName="+a+"&newwindow="+newwin,method:"POST",scope:this,success:function(c){var d=c.responseText;var b=Ext.decode(d);if(Ext.isObject(Ext.getCmp("config_errorpan"))){Ext.getCmp("config_errorpan").hide();}if(Ext.isObject(Ext.getCmp("enabledLinkContainer"))){Ext.getCmp("enabledLinkContainer").update(b["enabledList"]);
}Ext.select(".jspHorizontalBar").setStyle({"display":"none"});}});},goToSwitchProfileUrl:function(){var a=Ext.getCmp("enabledUserContainer").getValue();var c=Ext.getCmp("hiddenUserId").getValue();if(a=="-1"){Ext.Msg.show({title:"Switch Profile",msg:"Please choose a user id to switch",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
return false;}var b=Ext.Date.format(new Date(),"m/d/Y H:i:s");Ext.Ajax.request({url:"/final/scripts/EgIndexApp/data/EgSwitchUsersJson.jsp",method:"post",timeout:120000,params:{"kpe":kpe,"dp":b},scope:this,success:function(d){var f=d.responseText;switchUserJSON=Ext.decode(f);var e=switchUserJSON.rpe;var g=switchUserJSON.dpe;
Ext.Ajax.request({url:"/final/servlet/com.egurkha.EgSwitchUserServlet",method:"POST",params:{"uname":a,"ape":ape,"demoUser":c,"reqFrom":reqFrom,"spe":spe,"kpe":kpe,"dpe":g,"rpe":e},scope:this,timeout:120000,success:function(j){var i=j.responseText;var l=i.split(":");if(l[0]=="Error"){var h=l[1];if(h!=null&&h.indexOf("The user is not authorized to switch")!=-1){var k=Ext.Msg.show({title:"Switch Profile",msg:h,buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.WARNING});
k.alignTo(Ext.get("enabledUserContainer"),"c-c");return false;}}else{window.location.href="/final"+i;}},failure:function(h){console.log("failure");}});}});},submitDefaultPassword:function(){var f;var g;var b;Ext.Ajax.request({url:"/final/scripts/EgIndexApp/data/ModifyPwdForDefaultUsers.jsp",params:{"from":"getPwdPolicy"},method:"POST",scope:this,async:false,success:function(m){var n=m.responseText;
var l=Ext.decode(n);f=l["pwdLength"];b=l["pwdComplexityCount"];g=l["pwdComplexity"];if(f==""||f<2){f=8;}else{if(f!=""&&f<b){f=b;}}}});var d="";if(Ext.getCmp("newpwd").isVisible()){var k=Ext.getCmp("newpwd");var d=k.getValue();d=Ext.String.trim(d);var i=Ext.getCmp("confirmpwd");var c=i.getValue();c=Ext.String.trim(c);
var j=Ext.String.trim(usersForPasswordChange);var h=appCnt.pwdComplexityCheck(d,g);var a=true;if(isDoubleByteEnabled=="false"){a=validateSingleByte(d);}if(Ext.isEmpty(d)){Ext.Msg.show({title:pageTitleForPwdChange,msg:userPwdValidationMsg1+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){k.focus(true,true);
}});return false;}else{if(Ext.isEmpty(c)){Ext.Msg.show({title:pageTitleForPwdChange,msg:userCnfPwdValidationMsg1+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){k.focus(true,true);}});return false;}else{if(d.toLowerCase()!=c.toLowerCase()){Ext.Msg.show({title:pageTitleForPwdChange,msg:userCnfPwdValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){k.focus(true,true);
}});return false;}else{if(d.toLowerCase()==j.toLowerCase()){Ext.Msg.show({title:pageTitleForPwdChange,msg:userPwdValidationMsg2+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){k.focus(true,true);}});return false;}else{if(!checkloginpass(d)){k.focus(true,true);return false;}else{if(d.length<f){Ext.Msg.show({title:pageTitleForPwdChange,msg:passLabel1+" "+f+" "+passLabel2,buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){k.focus(true,true);
}});return false;}else{if(h.indexOf("false")>-1){var e=h.substring(h.indexOf("false#")+6);Ext.Msg.show({title:pageTitleForPwdChange,msg:userPwdValidationMsg3+". "+passLabel1+" "+e+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){k.focus(true,true);}});return false;}else{if(!a){Ext.Msg.show({title:pageTitleForPwdChange,msg:userPwdValidationMsg4+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){k.focus(true,true);
}});return false;}}}}}}}}}Ext.Ajax.request({url:"/final/scripts/EgIndexApp/data/ModifyPwdForDefaultUsers.jsp",params:{"from":"updatePwdForDefaultUsers","pass":d},method:"POST",scope:this,async:false,success:function(m){var o=m.responseText;var l=Ext.decode(o);var n=l.pwdUpdate;if(!n){Ext.Msg.show({title:pageTitleForPwdChange,msg:pwdFailureMsg+".",buttons:Ext.Msg.OK,icon:"iconExclamation",fn:function(){Ext.getCmp("pwdUpdate").focus(true,true);
}});}else{Ext.Msg.show({title:pageTitleForPwdChange,msg:pwdSuccessMsg,buttons:Ext.Msg.OK,icon:"iconInformation",fn:function(){Ext.getCmp("modifydefuserpwd").close();}});}}});},pwdComplexityCheck:function(e,g){var c="^";var a="";var f=".+$";var m="";var b=".";var l="<br/>";if(g!=null&&g!=undefined){m="false#";
if(g.indexOf(",")>-1){var i=g.split(",");for(var d=0;d<i.length;d++){var j=i[d].toLowerCase();if(j=="lc"){a+="(?=.*[a-z])";m+=l+(d+1)+b+" "+passCheckMsg1;}else{if(j=="uc"){a+="(?=.*[A-Z])";m+=l+(d+1)+b+" "+passCheckMsg2;}else{if(j=="dg"){a+="(?=.*[0-9])";m+=l+(d+1)+b+" "+passCheckMsg3;}else{if(j=="sp"){a+="(?=.*[^0-9a-zA-Z])";
m+=l+(d+1)+b+" "+passCheckMsg4;}}}}}}else{var j=g.toString().toLowerCase();if(j=="lc"){a+="(?=.*[a-z])";m+=passCheckMsg1;}else{if(j=="uc"){a+="(?=.*[A-Z])";m+=passCheckMsg2;}else{if(j=="dg"){a+="(?=.*[0-9])";m+=passCheckMsg3;}else{if(j=="sp"){a+="(?=.*[^0-9a-zA-Z])";m+=passCheckMsg4;}}}}}var h=new RegExp(c+a+f);
if(h.test(e)){m="true";}}return m;}});function trim(f){f=f.toString();var c=/[^\s].*[^\s]/;var e=f.match(c);return e;}function validateEmail(e){var f=/(([\+]?([0-9]){4,15})|([\_\#]?([a-zA-Z0-9]+[\ \_\.\-\&\#]?)*[a-zA-Z0-9])+)\@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]/g;if(e!=""){e=trim(e)+"";
var c=e.match(f);if(c==null||c!=e){return false;}return true;}}function loadLinkURL(c){var a=document.getElementById("main");isAdminModule=false;isMonitorModule=true;isConfigModule=false;isRepModule=false;isSlaModule=false;selectedTabModule="monitor";adminPressed=false;monitorPressed=true;reporterPressed=false;
configPressed=false;slaPressed=false;var f=Ext.getCmp("reporter");if(f!=null&&!f.isHidden()){Ext.getCmp("reporterNewWindowBtn").show();}var b=Ext.getCmp("config");if(b!=null&&!b.isHidden()){Ext.getCmp("configNewWindowBtn").show();}var d=Ext.getCmp("sla");if(d!=null&&!d.isHidden()){Ext.getCmp("slaNewWindowBtn").show();
}if(isAlarmViewerUser=="false"){Ext.getCmp("monitorIconIndexMenuId").show();}Ext.getCmp("adminIndexMenuIcon").hide();Ext.getCmp("reporterIndexMenuIcon").hide();Ext.getCmp("configIndexMenuIcon").hide();Ext.getCmp("slaIndexMenuIcon").hide();var e=Ext.getCmp("tabset");e.getComponent("adminTabContainer").removeCls("indexButtonBgPressed");
e.getComponent("reporterTabContainer").removeCls("indexButtonBgPressed");e.getComponent("configTabContainer").removeCls("indexButtonBgPressed");e.getComponent("slaTabContainer").removeCls("indexButtonBgPressed");e.getComponent("monitorTabContainer").fireEvent("afterrender",e.getComponent("monitorTabContainer"));
if(a!=null){a.src=c;}Ext.getCmp("commonSearchWin").close();Ext.getCmp("egcommonsearch").setValue("");Ext.getCmp("egcommonsearch").focus(true,10);}