<!DOCTYPE html>
<%
/********************************************************************************
FileName	:egMonDashBoard.jsp
Purpose		:This is the Parent page for ServerDashboard  According to the tab selection the egSysDashBoard, egMonDashBoard or other child pages will be loaded.
Created by	:Simeon.D
Created on	:05/03/2009
**********************************************************************************/
%>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld" %>
<%@ include file = "EgLoginTracker.jsp"%>
<%@ page errorPage = "EgProbsM.jsp"%>
<%@ page import = "java.util.*"%>
<%@ page import="com.egurkha.util.StringUtils"%>
<%@ page import="egurkha.reporter.ErUtils"%>
<%@ page import="com.egurkha.monitor.*"%>
<%@ page import="com.egurkha.monitor.alarms.*"%>
<%@ page import="com.eg.EgMappingInfo"%>
<%@ page import="com.egurkha.monitor.EgServerDashBoardDAO" %>
<%@ page import = "com.eg.EgURLEncoder"%>
<%@ page import = "com.egurkha.EgUserRole"%>
<%@ page import = "com.egurkha.EgUserPermission"%>
<%@ page import = "com.eg.MappingNameComparator"%>
<%@ page import = "com.eg.EgName"%>
<%@ page import="com.eg.EgManagersIniForManager"%>
<%@ page import = "com.eg.EgMaintenanceInfo"%>
<%@ page import = "com.eg.EgDateInfo"%>
<%@ page import = "com.eg.EgSpecsInfo"%>
<%@ page import = "com.eg.EgTablesInfo"%>
<%@ page import = "com.eg.EgDiscInfo" %>
<%@ page import = "com.eg.EgConfigChangeThread"%>
<%@ page import = "com.egurkha.config.TimeLineBean"%>
<%@ page import = "com.egurkha.util.DateUtil"%>
<%@ page import = "com.egurkha.HighChartTimeline"%>
<%@ page import = "com.eg.supermanager.*"%>
<%@ page import = "com.eg.EgDbInfo"%>
<%@ page import = "egurkha.EgTestParamBean"%>
<%@ page import = "com.eg.EgRoleInfo"%>
<jsp:useBean id="prgBean" scope="page" class="egurkha.EgTestParamBean"/>
<%@ page buffer="150kb" %> 
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader("Expires", -1);
%>
<%
	if(EgInstallInfo.isSuperManager)
	{
		String hostname = request.getParameter("host");
		//System.out.println("egMonDashboard.jsp hostname " + hostname);
		if(hostname != null && !hostname.trim().equalsIgnoreCase("null"))
		{
			if(hostname.indexOf(":")>-1)
			{
				hostname = hostname.substring(0,hostname.indexOf(":"));
			}
			//System.out.println("egMonDashboard.jsp host " + hostname);
			ArrayList managerIds = EgElementInfo.getInstance().getManagerIDs("component",hostname);
			//System.out.println("egMonDashboard.jsp managerIds " + managerIds);
			if(managerIds != null && !managerIds.isEmpty())
			{
				SmSessionData smsData = new SmSessionData(session.getId(),managerIds);
				EgThreadLocal egtl = new EgThreadLocal();
				egtl.set(smsData);
			}
		}
	}
	boolean isMoreInfosTreeView=false;
	String styleforMoreInfos="";
	String MoreInfosTreeView = request.getParameter("MoreInfosTreeView");
	if(MoreInfosTreeView!=null && MoreInfosTreeView.trim().length()>0 && (MoreInfosTreeView.equalsIgnoreCase("true") || MoreInfosTreeView.equalsIgnoreCase("yes")))
	{
		isMoreInfosTreeView=true;
		styleforMoreInfos="border:0px solid red !important";
	}

	String isInterface = request.getParameter("isInterface");
	isInterface = (isInterface==null)?"":isInterface;
	String selectedInterface = request.getParameter("selectedInterface");
	selectedInterface=(selectedInterface==null)?"":selectedInterface;

	boolean isFusion =HighChartTimeline.isFusion();
	//business dash board work
	String treeFlag_SBD = request.getParameter("treeFlag_SBD");
	String toBackUED2 = request.getParameter("toBackUED2");
	String toBackUED2_url=null;
	if(toBackUED2 != null && toBackUED2.trim().length() > 0)
	{
		toBackUED2_url = (String)session.getAttribute("toBackUED2_url");
	}
	String outsideService_SBD = request.getParameter("outsideService_SBD");
	String titleText_SBD = request.getParameter("titleText_SBD");
	String selectNode_SBD = request.getParameter("selectNode_SBD");
	String isEmulTrans_SBD = request.getParameter("isEmulTrans_SBD");
	String serviceState_SBD = request.getParameter("serviceState_SBD");
	String serviceName = request.getParameter("serviceName");
	String serviceState = request.getParameter("serviceState");
	String compState = request.getParameter("compState");
	String vdiType_SBD = request.getParameter("vdiType_SBD");
	//business dash board work end
	String zoneName = request.getParameter("zoneName");
	String currentTab = request.getParameter("currentTab");
	String aggregateTab = request.getParameter("aggregateTab");
	String openNode = request.getParameter("openNode");
	String treeFlag = request.getParameter("treeFlag");
	String fromHomepage = request.getParameter("fromHomepage");
	String monCmdFrom = request.getParameter("monCmdFrom");
	String PagesComesfrom = request.getParameter("PagesComesfrom");
	String actionFrom = request.getParameter("actionFrom");
	String action = request.getParameter("action");
	String componenttype = request.getParameter("componentType");
	String isAggregate = request.getParameter("isAggregate");
	String treeAction = request.getParameter("treeAction");
	String from = request.getParameter("from");
	String isServiceBusiDash = request.getParameter("isServiceBusiDash");
	String isServiceBusiDetails = request.getParameter("isServiceBusiDetails");
	String fromUserView = request.getParameter("fromUserView");

	String isLogonType = request.getParameter("isLogonType");
	String uedOverviewType = request.getParameter("overviewType");
	uedOverviewType=(uedOverviewType==null)?"":uedOverviewType;

	String fromPages = request.getParameter("fromPages");
	String toBckComp=request.getParameter("comptype");
	String parentZone = request.getParameter("parentZone");
	String showAlarms = request.getParameter("showAlarms");
	String fromalarmWindow = request.getParameter("fromalarmWindow");
	String arrangeAlarms = request.getParameter("arrangeAlarms");
	String selectedSubFilterOption = request.getParameter("selectedSubFilterOption");
	if(selectedSubFilterOption == null || selectedSubFilterOption.equalsIgnoreCase("NULL"))
		selectedSubFilterOption = "";
	String FromDashBoard = request.getParameter("FromDashBoard");
	String gauageClick = request.getParameter("gauageClick");
	if(gauageClick == null){
		gauageClick ="";
	}
	String curViewTab = request.getParameter("curViewTab");
	session.removeAttribute("measureUrl");
	String monitorLastSession = "";
	if(request!=null)
		monitorLastSession = request.getQueryString();
	boolean configChangeIcon = false;
	String dashBoardComponentName = "";
	String dashboardConfigQry = "";
	EgSpecsInfo specsInfo = new EgSpecsInfo(EgConstants.MANAGER);
	String hostName=request.getParameter("host");
	String compType=request.getParameter("comptype");
	String hostNameWithType=hostName+":"+compType;
	String comeFrom=request.getParameter("comeFrom");
	String Vmhost = request.getParameter("Vmhost");
	String vmcomp_type = request.getParameter("vmcomp_type");
	String vmstate = request.getParameter("state");
	String vmport = request.getParameter("port");
	String monCmdComeFrom = request.getParameter("monCmdComeFrom");
	String topologyType = request.getParameter("topologyType");
	String isFromMenu = request.getParameter("isFromMenu");
	String treeComeFrom = request.getParameter("treeComeFrom");
	String egQuickLaunch = request.getParameter("egQuickLaunch"); //murugan

	String treeTitle = request.getParameter("treeTitle");
	String ltype = request.getParameter("ltype");
	String filterBy = request.getParameter("filterBy");
	String subFilter = request.getParameter("subFilter");
	String componentNameSearch = request.getParameter("componentNameSearch"); 
	String fromp = request.getParameter("fromp");
	String fromServiceDashboard = request.getParameter("fromServiceDashboard");
	String externalAgent = request.getParameter("externalAgent");
	String isFromInfraHome = request.getParameter("isFromInfraHome");
	String isFromZoneInfra = request.getParameter("isFromZoneInfra");
	String fromPageView = request.getParameter("fromPageView");
	String selectedState = request.getParameter("selectedState");
	String viewPageTitle = request.getParameter("viewPageTitle");
	String stateName = request.getParameter("stateName");
	String selectNode = request.getParameter("selectNode");
	String selectedParam = request.getParameter("selectedParam");
	String layerForVM = request.getParameter("layer");
	String fromSystemTab = request.getParameter("fromSystemTab");
	String testForVM = request.getParameter("test");
	String infoForVm="";
	String infoVMCombo = request.getParameter("infoVMCombo");
	infoVMCombo = com.egurkha.util.StringUtils.replace(infoVMCombo,"\\","\\\\");
	String csrfToken = request.getParameter("com.eg.CSRF_NONCE");
	csrfToken = (csrfToken==null || csrfToken.trim().length()==0)?"":csrfToken;
	String userType = request.getParameter("userType");
	String isServiceBusiViewMetrics = request.getParameter("isServiceBusiViewMetrics");
	isServiceBusiViewMetrics = (isServiceBusiViewMetrics==null || isServiceBusiViewMetrics.trim().length()==0)?"":isServiceBusiViewMetrics;

	componentNameSearch = (componentNameSearch==null || componentNameSearch.trim().length()==0)?"":componentNameSearch;
	String showKeyUserStr = request.getParameter("showKeyUser");
	boolean showKeyUser=false;
	if(showKeyUserStr!=null && (showKeyUserStr.equalsIgnoreCase("true") || showKeyUserStr.equalsIgnoreCase("yes")))
	{
		showKeyUser=true;
	}
	String isEndUserIcon = request.getParameter("isEndUserIcon");
	
	// RUM App Flow Back Handling..
	String isFrom = request.getParameter("isFrom");
	String activeView = request.getParameter("activeView");
	String iniName = request.getParameter("iniName");
	String dashboard_mapping = request.getParameter("dashboard_mapping");
	String userBased = request.getParameter("userBased");
	String user_name1 = request.getParameter("user_name");
	String fromMenu = request.getParameter("fromMenu");
	String showConfig = request.getParameter("showConfig");
	String dashboard_name = request.getParameter("dashboard_name");
	String appliesTo = request.getParameter("appliesTo");
	String selectedRum = request.getParameter("selectedRum");
	String isBackFromRUM = request.getParameter("isBackFromRUM");
	String isfromCitrix = request.getParameter("isfromCitrix");
	String isfromRum = request.getParameter("isfromRum");
	String isFromZone = request.getParameter("isFromZone");
	String iszoneName = request.getParameter("iszoneName");
	//String parentZone = request.getParameter("parentZone");
	String fromServiceHomePage = request.getParameter("fromServiceHomePage");
	fromServiceHomePage = (fromServiceHomePage==null || fromServiceHomePage.trim().length()==0)?"false":fromServiceHomePage;
	String fromSerComboChange = request.getParameter("fromSerComboChange");
	String view_name = request.getParameter("view_name");
	String service_system = request.getParameter("serviceSystem");
	String service_aggregate = request.getParameter("serviceAggregate");
	String simulationName = request.getParameter("simulationName");
	String service_component = request.getParameter("serviceComponent");
	String service_Topology = request.getParameter("serviceTopology");
	String virtualTopology = request.getParameter("virtualTopology");
	String isToLayerModel = request.getParameter("isToLayerModel");
	String fromCompGroup = request.getParameter("fromCompGroup");
	String group = request.getParameter("group");
	String segmentName = request.getParameter("segmentName");
	String virtualIconBack = request.getParameter("virtualIconBack");
	String isRumTitle = request.getParameter("isRumTitle");

	String manyComponentTypes = request.getParameter("manyComponentTypes");
	String manyComponentTitle = request.getParameter("manyComponentTitle");
	manyComponentTypes = (manyComponentTypes==null || manyComponentTypes.equalsIgnoreCase("null"))?"":manyComponentTypes;
	manyComponentTitle = (manyComponentTitle==null || manyComponentTitle.equalsIgnoreCase("null"))?"":manyComponentTitle;

	String selTypeString = request.getParameter("selTypeString");
	selTypeString=(selTypeString==null)?"":selTypeString;
	
	String searchStateString = request.getParameter("searchStateString");
	searchStateString=(searchStateString==null)?"":searchStateString;
	
	String searchNameString = request.getParameter("searchNameString");
	searchNameString=(searchNameString==null)?"":searchNameString;
	
	String searchIndComps = request.getParameter("searchIndComps");
	searchIndComps=(searchIndComps==null)?"checked":searchIndComps;

	String isFromServiceMenu = request.getParameter("isFromServiceMenu");
	String isFromZoneMain = request.getParameter("isFromZoneMain");
	String isFromZoneMenu = request.getParameter("isFromZoneMenu");
	String isFromServiceGroup = request.getParameter("isFromServiceGroup");
	String isRumLogon = request.getParameter("isRumLogon");
	String isCitrixLogon = request.getParameter("isCitrixLogon");
	String zoneAggregate = request.getParameter("zoneAggregate");
	String isFromSessionSim = request.getParameter("isFromSessionSim");
	String isFromMetricsPage = request.getParameter("isFromMetricsPage");
	String isFromSessionToplogy = request.getParameter("isFromSessionToplogy");
	String isFromList = request.getParameter("isFromList");

	String msmt_host = request.getParameter("msmt_host");

	String selectedSystemCompType = request.getParameter("selectedSystemCompType");
	isFromServiceMenu = (isFromServiceMenu==null || isFromServiceMenu.trim().length()==0)?"false":isFromServiceMenu;
	isFromZoneMain = (isFromZoneMain==null || isFromZoneMain.trim().length()==0)?"false":isFromZoneMain;
	isFromZoneMenu = (isFromZoneMenu==null || isFromZoneMenu.trim().length()==0)?"false":isFromZoneMenu;
	isFromServiceGroup = (isFromServiceGroup==null || isFromServiceGroup.trim().length()==0)?"false":isFromServiceGroup;
	isFromSessionSim = (isFromSessionSim==null || isFromSessionSim.trim().length()==0)?"false":isFromSessionSim;
	isFromMetricsPage = (isFromMetricsPage==null || isFromMetricsPage.trim().length()==0)?"false":isFromMetricsPage;
	isFromSessionToplogy = (isFromSessionToplogy==null || isFromSessionToplogy.trim().length()==0)?"false":isFromSessionToplogy;
	isFromList = (isFromList==null || isFromList.trim().length()==0)?"false":isFromList;

	if(testForVM!=null && testForVM.length()>0 && testForVM.indexOf(" ")>-1)
	{
		infoForVm=testForVM.substring(testForVM.indexOf(" ")+1);
		if(infoForVm!=null && infoForVm.length()>0 && infoForVm.indexOf(":")>-1)
		{
			infoForVm=infoForVm.substring(0,infoForVm.indexOf(":"));
		}
	}
	
	String infoForVmNew=null;
	if(infoForVm!=null && infoForVm.trim().length()>0)
	{
		infoForVmNew = EgURLEncoder.encode(infoForVm,"UTF-8");
	}
	
	EgTablesInfo tablesInfo = new EgTablesInfo("manager");
	//Alagu starts for config change
	String uiFile = "eg_ui.ini";
	String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
	Map paramMap = new HashMap();
	IniFile iniFile = new IniFile(s_iniFile_dir + uiFile);
	IniFile eDashConfIni = new IniFile(EgInstallInfo.getInstallDir()+ "/manager/config/eg_dashboardConfig.ini");
	String insideViewMFlag = eDashConfIni.getValue("InsideviewDashboard_LayerView","EnableLayerView");
	ArrayList tab_view_list = new ArrayList();
	if(insideViewMFlag != null && insideViewMFlag.equalsIgnoreCase("true")){
		String tabdetails = eDashConfIni.getValue("InsideviewDashboard_LayerView","Layers");
		StringTokenizer tab_view_name=new StringTokenizer(tabdetails,",");
		while(tab_view_name.hasMoreTokens())
		{
			tab_view_list.add((String)tab_view_name.nextToken());
		}
	}
	String duration = iniFile.getValue("CONFIG_CHANGE","Timeperiod");
	if(duration!=null&&!duration.equals(""))
	{
		paramMap.put("ec_timeline",new String[]{duration});
		paramMap.put("ec_prevtimeline",new String[]{duration});
	}
	//To enable or disable asset icon in layer page.
	prgBean.createFile("eg_services.ini");
	String showAssetInfoInLayers = (prgBean.getStrValue("ASSET_MANAGEMENT", "ShowAssetInfoInLayers")).toLowerCase();

	String isDisableTrendComputation = (prgBean.getStrValue("MISC_ARGS", "DisableTrendComputation")).toLowerCase();

	String timelineChartOption = iniFile.getValue("CHART_TYPE", "ChartOption");
	String timelinePeriod = iniFile.getValue("CHART_TYPE", "Timeline");
	String timelineLinewidth= iniFile.getValue("CHART_TYPE", "Linewidth");

	TimeLineBean timeLineBean = new TimeLineBean(paramMap);
	String ciscoSelectedType = request.getParameter("ciscoSelectedType");
	if ( !StringUtils.isNull( ciscoSelectedType ) )
	{
		ciscoSelectedType = ciscoSelectedType;
	}
	String startDate = timeLineBean.getStartDate();
	String startHour = timeLineBean.getStartHour();
	String startMinute = timeLineBean.getStartMinute();
	String endDate = timeLineBean.getEndDate();
	String endHour = timeLineBean.getEndHour();
	String endMinute = timeLineBean.getEndMinute();
	//String treeFlag=request.getParameter("treeFlag");
	String currentDateFormat1 = iniFile.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
	 
	String tempStartDate = DateUtil.changeDateFormat(startDate,"MM/dd/yyyy",currentDateFormat1);
	String tempEndDate = DateUtil.changeDateFormat(endDate,"MM/dd/yyyy",currentDateFormat1);
	String pickInfoAutomatically=request.getParameter("pickInfoAutomatically");
	boolean isPickInfoAutomatically=false;
	if(pickInfoAutomatically!=null && pickInfoAutomatically.equalsIgnoreCase("true"))
	{
		isPickInfoAutomatically=true;
	}
	String queryString1 = "/final/servlet/EcConfigurationServletNew?ec_rtype=ChangeNew&ec_option1=Component Name&ec_timeline=Any&ec_prevtimeline=Any&ec_sthr="+startHour+"&ec_endhr="+endHour+"&ec_stdate="+tempStartDate+"&ec_enddate="+tempEndDate+"&ec_option2="+EgURLEncoder.encode(hostName+":"+compType,"UTF-8")+"&ec_startmin="+startMinute+"&ec_endmin="+endMinute+"&ec_changetype=Latest&ec_viewchange=byInformation";
	String backButtonFunction="";
	String treeSession="";
	String backText="";
//	session.setAttribute("configLastAccessedURL",queryString1);

	Hashtable ht_changeHash = EgConfigChangeThread.ht_changeHash;
	//Alagu ends for config change

	long refreshFrequency = 60 * 1000L;
	String refFreq = u_ser.getRefreshFrequency();

	if(refFreq!=null && refFreq.length()>0)
	{
		refreshFrequency =  Long.valueOf(refFreq).longValue() * 1000L;
	}
	EgDiscInfo discInfo = new EgDiscInfo("manager");
	EgServerDashboardModel  egDashboard=new  EgServerDashboardModel();
	EgCustomDashboardModel customDashModel=new EgCustomDashboardModel();
	egDashboard.setUser(u_ser);
	ErUtils erUtils=new  ErUtils();
	EgUserRole userRole = u_ser.getUserRole();
	boolean hasConfigSupport = userRole.hasAnyConfigRole(EgUserPermission.CONFIG);
	boolean allComp = userRole.hasAllComponentAccess();
	long perm = EgUserPermission.ADMIN;
	boolean adminPermission = userRole.hasAdminRole(perm);
	EgMappingInfo egMappingInfo=new EgMappingInfo(trackerLanguage);
	MonitorDAOFactory	monitorDaoFactory = MonitorDAOFactory.getInstance();
	EgServerDashBoardDAO dashboardDAO=monitorDaoFactory.getServerDashBoardDAO();
	String subSys=request.getParameter("subsystem");
	String componentName=compType+":"+hostName;
	String isHostlevelTest=request.getParameter("isHostlevelTest");
	isHostlevelTest=(isHostlevelTest==null || isHostlevelTest.trim().length()==0)?"false":isHostlevelTest;
	String toDashBoardLayer = request.getParameter("toDashBoardLayer");
	String fromAlarms= request.getParameter("fromalarmWindow");
	String display = request.getParameter("display");
	String profileName=request.getParameter("profileName");
	if(!StringUtils.isNull(profileName))
	{
		profileName=StringUtils.decodeSecurityChar(profileName);
	}
	String site = request.getParameter("site");

	String ltest = request.getParameter("ltest");
	String monitorsBy = request.getParameter("monitorsBy");
	boolean backHidden = false;
	String isFromTabsetChange = request.getParameter("isFromTabsetChange");
	if(isFromTabsetChange != null && isFromTabsetChange.equalsIgnoreCase("true"))
	   backHidden = true;

	String fromComponentHealth = request.getParameter("fromHealth");
	fromComponentHealth=(fromComponentHealth==null || fromComponentHealth.trim().length()==0)?"":fromComponentHealth;

	ArrayList userBasedCompTypeList = new ArrayList();
	boolean isLicenseViolatedType = false;
	boolean userViolated = false;
	String loginid = u_ser.getLoginID();
	if(!EgInstallInfo.isSuperManager && loginid!=null && loginid.trim().length()>0)
	{
		com.eg.GroupCertValidator licenseChecker = new com.eg.GroupCertValidator(loginid);
		userViolated = licenseChecker.checkForUserViolation(loginid);
		if(userViolated)
		{
			com.eg.EgUsersInfo usersInfo = new com.eg.EgUsersInfo();
			userBasedCompTypeList = (ArrayList)usersInfo.getAllUserBasedCompTypes();
		}

		if(compType != null && compType.trim().length() > 0 && userBasedCompTypeList != null && userBasedCompTypeList.size() >0 && userBasedCompTypeList.contains(compType))
			isLicenseViolatedType = true;

		if(!isLicenseViolatedType && compType !=null && compType.equalsIgnoreCase("Host_system"))
		{
			String temphostName = (hostName != null && hostName.indexOf(":") >0)?hostName:hostName+":NULL";
			String tempServerType = discInfo.getServerTypesForComponentNamePort(temphostName);
			if(userBasedCompTypeList != null && userBasedCompTypeList.size() > 0 && userBasedCompTypeList.contains(tempServerType))
				isLicenseViolatedType = true;
		}
	}

	if(site == null || site.equals("null"))
	{
		site="NULL";
	}
	String tstate = request.getParameter("tstate");
	String setActiveTab = request.getParameter("setActiveTab");
	String fromDesignDashboard=request.getParameter("fromDesignDashboard");
	boolean isfromSuper = session.getAttribute("fromSuper") != null &&
	session.getAttribute("fromSuper").toString().equalsIgnoreCase("yes");
	if(profileName==null)
		profileName="";
	if(display==null)
		display ="none";
	String selectedInfo="";
	if(isHostlevelTest!=null && isHostlevelTest.equals("true"))
	{
		String dashBoardCompName=request.getParameter("dashBoardCompName");
		String dashBoardCompType=request.getParameter("dashBoardCompType");
		componentName=dashBoardCompType+":"+dashBoardCompName;
		compType=dashBoardCompType;
	}
	HealthDAO healthDAO=new HealthDAO();
	String subsystem="Overview";
	String graphType="";
	String threadType="";
	String tab = request.getParameter("tab");

	Vector compTypes=egDashboard.getUserCompTypes();
	Vector compTypes_mapping=new Vector();
	String comp_name=hostName+":"+compType;
	String  compName="";
	boolean isDouble=EgDbInfo.doubleByteEnabled;
	
	if(compTypes!=null && compTypes.size()>0)
	{
		for(int i=0;i<compTypes.size();i++)
		{
			String comp=(String)compTypes.get(i);
			if(comp.indexOf(":")!=-1)
			{
				StringTokenizer st = new StringTokenizer(comp,":");
				int count = st.countTokens();
				String type=egMappingInfo.getComponentTypeDescription(st.nextToken());
				String nick=st.nextToken();
				String port=st.nextToken();
				compName=type+":"+nick;
				if(count>3 && port!=null && !port.equals("NULL"))
				{
					String sid=st.nextToken();
					compName=compName+":"+port+":"+sid;
				}
				else if(port!=null && !port.equals("NULL"))
				{
						compName=compName+":"+port;
				}
				compTypes_mapping.add(new EgName(comp,compName));
			}
		}
		Collections.sort(compTypes_mapping,new MappingNameComparator());
	}

	Hashtable component_mapping=new Hashtable();
	if(compTypes!=null && compTypes.size()>0)
	{
		for(int i=0;i<compTypes.size();i++)
		{
			String comp=(String)compTypes.get(i);
			String type=comp.substring(0,comp.indexOf(":"));
			String nick=comp.substring(comp.indexOf(":")+1,comp.length());
			String type_mapping=egMappingInfo.getComponentTypeDescription(type);
			String tmpComp = nick.substring(0,nick.indexOf(":"));
			String port = nick.substring(nick.indexOf(":")+1,nick.length());
			if(!port.equalsIgnoreCase("null"))
				compName=type_mapping+":"+nick;
			else
				compName=type_mapping+":"+tmpComp;
			component_mapping.put(compName,comp);
		}
		
	}
	IniFile egUI = new IniFile(s_iniFile_dir + uiFile);
	String currentDateFormat = egUI.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
	String dashboardIni = "eg_serverdashboard.ini";
	if(compType!=null && compType.startsWith("Agg_"))
	{
		dashboardIni = "eg_aggregateserverdashboard.ini";
	}
	IniFile inifile = new IniFile(s_iniFile_dir + dashboardIni);

	IniFile serverDashboardInifile = new IniFile(s_iniFile_dir + "eg_serverdashboard.ini");

	String isSystemDashboard = inifile.getValue("System_Dashboard",compType); 
	String isNetworkDashboard = inifile.getValue("Network_Dashboard",compType);
	String clusterEnabledTests = inifile.getValue("cluster_dashboard_config","enabledTests");
	String isApplicationDashboard = inifile.getValue("Application_Dashboard",compType);
	String isVirtualDashboard = inifile.getValue("Virtual_Dashboard",compType);
	String isCustomDashboard = "No"; 
	String enableCustomTab=serverDashboardInifile.getValue("Dashboard_Settings","EnableCustomTab");
	if(enableCustomTab!=null && (enableCustomTab.equalsIgnoreCase("true") || enableCustomTab.equalsIgnoreCase("yes")))
	{
		 isCustomDashboard = inifile.getValue("Custom_Dashboard",compType);
	} 
	String isJVMEnabledForCompType = inifile.getValue("JVM_Enabled_AppServers", compType); 
	String includedNetflowDevice = inifile.getValue("Included_NetflowDevice",compType);
	String excludedNetflowDevice = inifile.getValue("Excluded_NetflowDevice",compType);
	boolean isIncludedNetflowDeviceAvailable = false;
	if(includedNetflowDevice!=null && includedNetflowDevice.equalsIgnoreCase("yes"))
	{
		isIncludedNetflowDeviceAvailable = true;
	}
	boolean isExcludedNetflowDeviceAvailable = false;
	if(excludedNetflowDevice!=null && excludedNetflowDevice.equalsIgnoreCase("yes"))
	{
		isExcludedNetflowDeviceAvailable = true;
	}
	if(EgInstallInfo.isSuperManager)
	{
		isCustomDashboard="No";
	}
	String isSysDefaultHide = inifile.getValue("SystemDashboard_Excluded_servers",compType);
	if(isSysDefaultHide.equalsIgnoreCase("No") && isSysDefaultHide.trim().length()>0)
		isSystemDashboard="No";
	String fromSiteInfraView=request.getParameter("fromSiteInfraView");
	String tabPriority=inifile.getValue("Dashboard_Settings","TabPriority");

	String maxComponent=serverDashboardInifile.getValue("Dashboard_Settings","MaxComponent");
	serverDashboardInifile=null;


	String compTypeForInterface = inifile.getValue("Interfaces","EnabledComponents");
	ArrayList interfaceTabList =null;
	if(compTypeForInterface!=null && compTypeForInterface.length() > 0)
	{
		interfaceTabList = new ArrayList();
		StringTokenizer str= new StringTokenizer(compTypeForInterface,",");
		while(str.hasMoreTokens())
		{
			interfaceTabList.add(str.nextToken());
		}
	}

	int maxComp = Integer.parseInt(maxComponent);
	Hashtable compType_Name = egDashboard.getComponentDetails();
	int compCount = compTypes.size();
	if(hostName==null || hostName.equalsIgnoreCase("null"))
	{
		Vector compNames=(Vector)compType_Name.get(compType);
		hostName=(String)compNames.get(0);
		if(EgInstallInfo.isSuperManager)
		{
			if(hostName != null && !hostName.trim().equalsIgnoreCase("null") && hostName.indexOf(":")>-1)
			{
				String hostname = hostName.substring(0,hostName.indexOf(":"));
				ArrayList managerIds = EgElementInfo.getInstance().getManagerIDs("component",hostname);
				if(managerIds != null && !managerIds.isEmpty())
				{
					SmSessionData smsData = new SmSessionData(session.getId(),managerIds);
					EgThreadLocal egtl = new EgThreadLocal();
					egtl.set(smsData);
				}
			}
		}
	}

	boolean isAppFound=false;
	List subjects=Arrays.asList(inifile.getSubjects());
	List layersList = tablesInfo.getSortedLayersForComponent(compType,"desc");
	String subject = compType;
	if(isCustomDashboard != null && isCustomDashboard.equalsIgnoreCase("Yes") && isJVMEnabledForCompType != null && isJVMEnabledForCompType.equalsIgnoreCase("Yes")&& layersList != null && (layersList.contains("JVM")|| layersList.contains("JB_JVM"))) {
		subject = "Java_virtual_machine";
	}

	if(subjects.contains(subject))
		isAppFound=true;
	boolean isSystemDashboardEnabled = (isSystemDashboard!=null && isSystemDashboard.equalsIgnoreCase("No"))?false:true;

	boolean isCustomDashboardEnabled = (isCustomDashboard!=null && isCustomDashboard.equalsIgnoreCase("No"))?false:true;

	Vector customDashboardTemplates=customDashModel.getTemplates(u_ser.getLoginID(),compType);
	if(customDashboardTemplates!=null && customDashboardTemplates.isEmpty())
		isCustomDashboardEnabled=false;	

	boolean isNetworkDashboardEnabled = (isNetworkDashboard!=null && isNetworkDashboard.equalsIgnoreCase("No"))?false:true;
	boolean isApplicationDashboardEnabled = (isApplicationDashboard!=null && isApplicationDashboard.equalsIgnoreCase("No"))?false:true;
	boolean isVirtualDashboardEnabled = (isVirtualDashboard!=null && isVirtualDashboard.equalsIgnoreCase("No"))?false:true;
	if(isHostlevelTest!=null && isHostlevelTest.equals("true"))
		isApplicationDashboardEnabled=false;

	if(!isAppFound)
		isApplicationDashboardEnabled=false;

	boolean isAllTabsDisabled=!isSystemDashboardEnabled && !isNetworkDashboardEnabled && !isApplicationDashboardEnabled && !isCustomDashboardEnabled && !isVirtualDashboardEnabled;
	boolean doubleSelectBox=false;
	if(compCount >= maxComp)
	{
		doubleSelectBox=true;
	}
	
	String excludedServersForDashBoard[]=inifile.getVariables("Dashboard_Excluded_servers");
	
	List excludedServers=new ArrayList();
	
	if(excludedServersForDashBoard!=null && excludedServersForDashBoard.length>0)
	{
		for(int i=0;i<excludedServersForDashBoard.length;i++)
		{
			String value=inifile.getValue("Dashboard_Excluded_servers",excludedServersForDashBoard[i]);
			if(value!=null && value.equalsIgnoreCase("Yes"))
			{
				excludedServers.add(excludedServersForDashBoard[i]);
			}
		}
	}
	IniFile dashboardIniObj = new IniFile(s_iniFile_dir + "eg_dashboard.ini");
	String[] supported_types=dashboardIniObj.getVariables("Supported_Types");
	List supported_types_list=null;
	if(supported_types!=null && supported_types.length>0)
	{
		supported_types_list=Arrays.asList(supported_types);
	}

	if(userBasedCompTypeList != null && userBasedCompTypeList.size() > 0 && supported_types_list != null && supported_types_list.size() > 0){
		List temp_supported_types_list = supported_types_list;
		supported_types_list = new ArrayList();
		for(int k=0;k<temp_supported_types_list.size();k++){
			String type = (String)temp_supported_types_list.get(k);
			if(type != null && type.trim().length() > 0){
				if(userBasedCompTypeList.contains(type))
					continue;
				supported_types_list.add(type);
			}
		}
	}

	boolean isDefaultTabDisabled=false;

	if(!isSystemDashboardEnabled && tabPriority.equalsIgnoreCase("System"))
	{
		isDefaultTabDisabled=true;
	}
	else if(!isNetworkDashboardEnabled && tabPriority.equalsIgnoreCase("Network"))
	{
		isDefaultTabDisabled=true;
	}
	else if(!isApplicationDashboardEnabled && tabPriority.equalsIgnoreCase("Application"))
	{
		isDefaultTabDisabled=true;
	}
	/* else if(!isCustomDashboardEnabled && tabPriority.equalsIgnoreCase("Custom"))
	{
		isDefaultTabDisabled=true;
	} */

	boolean isICComponent=compType!=null && compType.endsWith("_ex");
	boolean isExcludedServer=(excludedServers!=null && excludedServers.contains(compType));
	boolean hasSystemTab=false;
	boolean hasNetworkTab=false;
	boolean hasInterfaceTab=false;
	boolean hasAppTab=false;
	boolean hasVMTab=false;
	boolean hasClusterTab=false;
	String defaultTabUrl="/final/monitor/EgDispLayers.jsp?site=NULL&qctr=0&fromPage=componentList&newWindow=false&comptype="+compType+"&host="+hostName;
	if(tabPriority==null || tabPriority.equals("") || (tabPriority!=null && tabPriority.equals("Layers")) || isExcludedServer || isAllTabsDisabled)
	{
		tabPriority="LayerModel";
	}
	if(isDefaultTabDisabled)
	{
		tabPriority="LayerModel";
		toDashBoardLayer="false";
	}
	
	if(request.getParameter("subsystem")!=null)
	{
		subsystem=request.getParameter("subsystem");
	}
	if(request.getParameter("graphType")!=null)
	{
		graphType=request.getParameter("graphType");
	}
	if(request.getParameter("threadType")!=null)
	{
		threadType=request.getParameter("threadType");
	}
	if(request.getParameter("selectedInfo")!=null)
	{
		selectedInfo=request.getParameter("selectedInfo");
	}
/*
	String sessionVal = (String)session.getAttribute("monitorLastSession");
	if(sessionVal!=null && sessionVal.indexOf("com.eg.EgDashboardController")>-1)
	{
		StringTokenizer stk = new StringTokenizer(sessionVal,"&");
		while(stk.hasMoreTokens())
		{
			String tok = stk.nextToken();
			if(tok.indexOf("subsystem")!= -1)
			{
				subsystem=tok.substring(tok.indexOf("=")+1,tok.length());
			}
			else if(tok.indexOf("graphType")!= -1)
			{
				graphType=tok.substring(tok.indexOf("=")+1,tok.length());
			}
			else if(tok.indexOf("tab")!= -1)
			{
				tab=tok.substring(tok.indexOf("=")+1,tok.length());
			}
			else if(tok.indexOf("threadType")!= -1)
			{
				threadType=tok.substring(tok.indexOf("=")+1,tok.length());
			}
			else if(tok.indexOf("selectedInfo")!= -1)
			{
				selectedInfo=tok.substring(tok.indexOf("=")+1,tok.length());
			}
			else if(isDefaultTabDisabled && tok.indexOf("toDashBoardLayer")!=-1)
			{
				toDashBoardLayer = tok.substring(tok.indexOf("=")+1,tok.length());
			}
		}
	}*/
	Vector layersForCompType=new Vector();

	//layersForCompType=dashboardDAO.getLayerForCompType(compType);
	//EgTablesInfo tablesInfo = new EgTablesInfo("manager");
	ArrayList layerList=tablesInfo.getSortedLayersForComponent(compType,"desc");
	if(layerList==null)
	{
		layersForCompType=new Vector();
	}
	else if(layerList!=null && layerList.size()>0)
	{
		String cname = hostName;
		if(cname!=null && cname.trim().length()>0 && cname.indexOf(":")>-1)
			cname = cname.substring(0, cname.indexOf(":"));
		String tmp =null;
		for(int k=0;k<layerList.size();k++)
		{
			tmp =(String)layerList.get(k);
			ArrayList listOfTest=(ArrayList)tablesInfo.getTestsForLayer(tmp,compType);
			if(listOfTest==null || listOfTest.size()==0)
			continue;
		layersForCompType.add(tmp);
		}
	}
	Vector layer=new Vector();

	String layerStr="";

	boolean basic=true;
	boolean basicWithVirtual=false;
	boolean basicWithApplication=false;
	boolean basicWithInterface=false;
	boolean onlyLayerTab=false;

	if(layersForCompType!=null && layersForCompType.contains("HOST") && isSystemDashboardEnabled && !isExcludedServer)
	{
		hasSystemTab=true;
		layer.add("System");
		layerStr+="System";
		layerStr+=",";
	}

	if(layersForCompType!=null && (layersForCompType.contains("NETWORK") || layersForCompType.contains("TCP") || layersForCompType.contains("UDP")) && isNetworkDashboardEnabled && !isExcludedServer)
	{
		hasNetworkTab=true;
		layer.add("Network");
		layerStr+="Network";
		layerStr+=",";
	}
	/*Enable the Cluster tab*/
	String hostForclusterDashboard ="";
	String portForclusterDashboard ="";
	String sidForclusterDashboard ="";
	String testToEnableClusterTab = "FCStatusTest";
	if(hostName!=null)
	{
		StringTokenizer stcluster=new StringTokenizer(hostName,":");
		if(stcluster.hasMoreTokens())
			hostForclusterDashboard=stcluster.nextToken();

		if(stcluster.hasMoreTokens())
			portForclusterDashboard=stcluster.nextToken();

		if(stcluster.hasMoreTokens())
			sidForclusterDashboard=stcluster.nextToken();
	}
	String msmtHost=egDashboard.getMsmtHostForTest(compType,hostForclusterDashboard,testToEnableClusterTab,portForclusterDashboard);
	boolean isClusterDashboardEnabled = dashboardDAO.isEnableClusterTab(compType,hostForclusterDashboard,portForclusterDashboard,msmtHost,testToEnableClusterTab);

	if(isClusterDashboardEnabled && !isExcludedServer) // && layersForCompType!=null && layersForCompType.contains("OS_CLUSTER")
	{
		hasClusterTab=true;
		layer.add("Cluster");
		layerStr+="Cluster";
		layerStr+=",";
	}
	if((compType!=null && interfaceTabList!=null ) && interfaceTabList.contains(compType))
	{
		hasInterfaceTab=true;
		layer.add("Interfaces");
		layerStr+="Interfaces";
		layerStr+=",";
		basic=false;
		basicWithInterface=true;
	}

	Vector applicationLayers=healthDAO.selectApplicationLayers(compType);

	String applicationSubsystems=inifile.getValue(subject, "Application_subsystems");

	if(isApplicationDashboardEnabled && (applicationLayers!=null && !applicationLayers.isEmpty()) && !isExcludedServer && isAppFound && applicationSubsystems!=null && !applicationSubsystems.trim().equals("") && compType.indexOf("Agg_") == -1)
	{
		layer.add("Application");
		layerStr+="Application";
		layerStr+=",";
		basic=false;
		basicWithApplication=true;
	}
	if(supported_types_list!=null && supported_types_list.contains(compType) && isVirtualDashboardEnabled)
	{
		hasVMTab=true;
		layer.add("Virtual");
		layerStr+="Virtual";
		layerStr+=",";

		basicWithVirtual=true;
	}

	layerStr+="Layers,";
	layer.add("Layers");

	if(!isCustomDashboard.equalsIgnoreCase("No"))
	{
		layerStr+="Custom";
		layerStr+=",";
		layer.add("Custom");
	}


	if(isMoreInfosTreeView)
	{
		layer=new Vector();
		layerStr ="";
		layerStr+="Layers,";
		layer.add("Layers");
	}

	if(layerStr!=null && layerStr.indexOf(",")>0)
		layerStr=layerStr.substring(0,layerStr.lastIndexOf(","));


	if(isExcludedServer)
	{
		hasAppTab=false;
	}

	String defualtTab=tabPriority;
	String layerModelQstr="", applicationQstr = "",networkQstr="";
	String interfaceQstr="";
	if ( !StringUtils.isNull(tab) )
	{
		if( tab.equals("LayerModel") )
		{
			String layerqstr=request.getQueryString();
			if(layerqstr!=null && layerqstr.indexOf("comesFrom=LayerModel")>-1)
			{
				layerModelQstr=layerqstr.substring(layerqstr.indexOf("comesFrom=LayerModel"));
			}
		}
		else if ( tab.equalsIgnoreCase("application") )
		{
			applicationQstr = "/final/monitor/egAppDashboardJSON.jsp?"+request.getQueryString();
		}
		else if ( tab.equalsIgnoreCase("network") )
		{
			networkQstr = "/final/monitor/egNetDashboardJSON.jsp?"+request.getQueryString();
		}
		else if ( tab.equalsIgnoreCase("interface") )
		{
			interfaceQstr = "/final/monitor/egSysDashBoardJSON.jsp?"+request.getQueryString();
		}
		
	}

	String defaultMGraphDuration=inifile.getValue("Default_MeasureGraph_Duration","duration");
	String defaultSGraphDuration=inifile.getValue("Default_SummaryGraph_Duration","duration");
	String defaultTGraphDuration=inifile.getValue("Default_TrendGraph_Duration","duration");
	String defaultDDDuration=inifile.getValue("Default_DD_Duration","duration");
	String timelineForMeasure=egDashboard.convertDurtionIntoTimeline(defaultMGraphDuration,false);
	String timelineForSummary=egDashboard.convertDurtionIntoTimeline(defaultSGraphDuration,false);
	String timelineForTrend=egDashboard.convertDurtionIntoTimeline(defaultTGraphDuration,false);
	String timelineForDD=egDashboard.convertDurtionIntoTimeline(defaultDDDuration,false);
	String descript=egMappingInfo.getTextDescription("monitor.common.Description");
	String s_time=egMappingInfo.getTextDescription("monitor.common.Start time");
	backText = egMappingInfo.getTextDescription("monitor.common.Back");
	String compForPopup=compType+":"+hostName;
	String siteName=request.getParameter("site");
	if(siteName == null || siteName.equals("null"))
	{
		siteName="NULL";
	}
	String QryStr="";
	String selectedTreeNode = request.getParameter("selected");
	String componentTree = request.getParameter("ComponentTree"); // Prem
	if(hostName!=null && compType!=null && compForPopup!=null)
	
	QryStr=response.encodeURL("/final/monitor/egComponentDetails.jsp?")+"hostName="+EgURLEncoder.encode(hostName,"UTF-8")+"&hostType="+EgURLEncoder.encode(compType,"UTF-8")+"&compForPopup="+EgURLEncoder.encode(compForPopup,"UTF-8")+"&siteName=NULL";

	String newWindow=request.getParameter("newWindow");
	
	String fromPage=request.getParameter("fromPage");
	String GlobalSearchBackBtnLink = "";
	String search_info = "";
	if(fromPage!=null && fromPage.equalsIgnoreCase("globalsearch"))
	{
		String search_Type = request.getParameter("searchtype");
		String component_Name = request.getParameter("componentName");
		String user_name = request.getParameter("username");
		String search_val = request.getParameter("searchval");
		String comp_Name = request.getParameter("compName");
		search_info = request.getParameter("info");
		String searchuser = request.getParameter("searchuser");
		String isUser = request.getParameter("isUser");
		String eg_stdate = request.getParameter("eg_stdate");
		String eg_enddate = request.getParameter("eg_enddate");
		String starthr = request.getParameter("starthr");
		String endhr = request.getParameter("endhr");
		String startmin_h = request.getParameter("startmin_h");
		String endmin_h = request.getParameter("endmin_h");
		
		if(search_Type !=null && search_Type.equalsIgnoreCase("vm"))
		{
			GlobalSearchBackBtnLink = "/final/monitor/eGVMDetails.jsp?comp="+EgURLEncoder.encode(hostName,"UTF-8")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&compName="+EgURLEncoder.encode(comp_Name,"UTF-8")+"&componentName="+EgURLEncoder.encode(component_Name,"UTF-8")+"&username="+EgURLEncoder.encode(user_name,"UTF-8")+"&searchval="+EgURLEncoder.encode(search_val,"UTF-8")+"&searchtype="+EgURLEncoder.encode(search_Type,"UTF-8")+"&msmt_host="+EgURLEncoder.encode(msmt_host,"UTF-8")+"&searchuser="+searchuser+"&isUser="+isUser+"&eg_stdate="+eg_stdate+"&eg_enddate="+eg_enddate+"&starthr="+starthr+"&endhr="+endhr+"&startmin_h="+startmin_h+"&endmin_h="+endmin_h;
		}
		else if(search_Type !=null && search_Type.equalsIgnoreCase("user"))
		{
			GlobalSearchBackBtnLink = "/final/monitor/eGUserDetails.jsp?comp="+EgURLEncoder.encode(hostName,"UTF-8")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&compName="+EgURLEncoder.encode(comp_Name,"UTF-8")+"&componentName="+EgURLEncoder.encode(component_Name,"UTF-8")+"&username="+EgURLEncoder.encode(user_name,"UTF-8")+"&searchval="+EgURLEncoder.encode(search_val,"UTF-8")+"&searchtype="+EgURLEncoder.encode(search_Type,"UTF-8")+"&msmt_host="+EgURLEncoder.encode(msmt_host,"UTF-8");
		}
	}
	String globalSearchListUrl = "";
	String myDashboardBackUrl="";
	String SAPDashboardBackUrl="";
	String netscalerBackUrl = "";
	String SapPlatformDashboardBackUrl="";
	String office365DashboardLink="";

	boolean isFromNetscaler = false;
	boolean isFromO365Dashboard = false;

	if(fromPage!=null && fromPage.equalsIgnoreCase("fromO365Dashboard"))
	{
		isFromO365Dashboard = true;

		String selectedDashboard = request.getParameter("selectedDashboard");
		String selectedTab = request.getParameter("selectedTab");
		String accountName = request.getParameter("accountName");	
		String officeCompType = request.getParameter("comptype");	
		String isFromMetrics = request.getParameter("isFromMetrics");
		if(isFromMetrics!= null && isFromMetrics.equalsIgnoreCase("true"))
		{
			from="metricsView";
		}
		else if(fromHomepage!= null && fromHomepage.equalsIgnoreCase("true") && officeCompType!=null && officeCompType.equalsIgnoreCase("MS_Office_365"))
		{
			from="";
		}
		office365DashboardLink = "/final/monitor/microsoftDashboard.jsp?iniName=eg_msdashboard&userBased=true&fromMenu="+fromMenu+"&fromHomepage="+fromHomepage+"&from="+from+"&showConfig=true&active_view="+selectedTab+"&firstTimeHit=true&dashboard_name="+selectedDashboard+"&compType="+officeCompType+"&accountName="+accountName+"&selectedState="+selectedState;
	}
	else if(fromPage!=null && fromPage.equalsIgnoreCase("GlobalSearchList"))
	{
		String searchValueandType = request.getParameter("searchValueandType");
		globalSearchListUrl = "/final/monitor/eGSearch.jsp?genParams="+searchValueandType;
	}
	else if(fromPage!=null && fromPage.equalsIgnoreCase("mydashboard"))
	{
		String myDashboardUrlParams=request.getParameter("backBtnUrl");
		myDashboardUrlParams=StringUtils.decodeSecurityChar(myDashboardUrlParams);
		myDashboardBackUrl="/final/monitor/MyDashboard.jsp?comesFrom=myDashboard&action=showMyDashboard"+myDashboardUrlParams;
	}
	else if(fromPage!=null && fromPage.equalsIgnoreCase("SAP"))
	{
		String SAPDashboardBackUrlVal=request.getParameter("backBtnUrl");
		SAPDashboardBackUrlVal=StringUtils.decodeSecurityChar(SAPDashboardBackUrlVal);
		String selectedComp = compType+":"+hostName;
		SAPDashboardBackUrl="/final/monitor/ABAPDashboard.jsp?selectedComp="+EgURLEncoder.encode(selectedComp,"UTF-8");
	}
	else if(fromPage!=null && fromPage.equalsIgnoreCase("netscaler"))
	{
		netscalerBackUrl="/final/monitor/netScaler.jsp?isFromMenu=true&compName="+request.getParameter("compName");
		isFromNetscaler = true;
	}
	else if(fromPage!=null && fromPage.equalsIgnoreCase("SapPlatformDashboard"))
	{
		String SapPlatformDashboardUrlParams=request.getParameter("backBtnUrl");

		SapPlatformDashboardUrlParams=StringUtils.decodeSecurityChar(SapPlatformDashboardUrlParams);
		SapPlatformDashboardBackUrl="/final/monitor/EgSapPlatformDashboard.jsp?"+SapPlatformDashboardUrlParams;
	}
	String backNavDashboard = request.getParameter("backNav");
	String backDashboardURL="";
	if(backNavDashboard!=null && backNavDashboard.equalsIgnoreCase("cmpDashboard") )
	{
		if(fromPage!=null && fromPage.equalsIgnoreCase("system_dashboard"))
		{
			backDashboardURL="/final/monitor/egSysDashBoardJSON.jsp?tab=System&hostName="+EgURLEncoder.encode(hostName,"UTF-8")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&subsystem="+request.getParameter("subsystem")+"&screenWidth=1012&screenHeight=570&host="+EgURLEncoder.encode(hostName,"UTF-8")+"&time_line=&starttime=&endtime=&starthr=&endhr=";
		}
		else if(fromPage!=null && fromPage.equalsIgnoreCase("network_dashboard"))
		{
			backDashboardURL="/final/monitor/egNetDashBoardJSON.jsp?tab=Network&hostName="+EgURLEncoder.encode(hostName,"UTF-8")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&subsystem="+request.getParameter("subsystem")+"&screenWidth=1012&screenHeight=570&host="+EgURLEncoder.encode(hostName,"UTF-8")+"&time_line=&starttime=&endtime=&starthr=&endhr=";
		}
		else if(fromPage!=null && fromPage.equalsIgnoreCase("application_dashboard"))
		{
			backDashboardURL="/final/monitor/egAppDashboardJSON.jsp?tab=Application&hostName="+EgURLEncoder.encode(hostName,"UTF-8")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&subsystem="+request.getParameter("subsystem")+"&screenWidth=1012&screenHeight=570&host="+EgURLEncoder.encode(hostName,"UTF-8")+"&time_line=&starttime=&endtime=&starthr=&endhr=";
		}
		else if(fromPage!=null && fromPage.equalsIgnoreCase("interfaces_dashboard"))
		{
			backDashboardURL="/final/monitor/EgInterfacesTab.jsp?tab=Interfaces&hostName="+EgURLEncoder.encode(hostName,"UTF-8")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&screenWidth=1012&screenHeight=570&host="+EgURLEncoder.encode(hostName,"UTF-8")+"&time_line=&starttime=&endtime=&starthr=&endhr=";
		}
		else if(fromPage!=null && fromPage.equalsIgnoreCase("cisco_Dashboard"))
		{
			backDashboardURL="/final/monitor/EgCiscoDashboardJSON.jsp?tab=Network&hostName="+EgURLEncoder.encode(hostName,"UTF-8")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&ciscoSelectedType="+request.getParameter("subsystem")+"&screenWidth=1012&screenHeight=570&host="+EgURLEncoder.encode(hostName,"UTF-8");
		}		
		else if(fromPage!=null && fromPage.equalsIgnoreCase("cluster"))
		{
			backDashboardURL="/final/monitor/clusterDashboard.jsp?host="+request.getParameter("compName")+"&comptype="+EgURLEncoder.encode(compType,"UTF-8")+"&tab=cluster";
		}
	}

	String pageComesfrom=request.getParameter("pageComesfrom");
	String queryString =request.getQueryString();
	String dispValue = request.getParameter("compDiv");
	if(dispValue==null)
		dispValue="none";

	

	String ua = request.getHeader( "User-Agent" );	
	boolean isFirefox2 = ( ua != null && ua.indexOf( "Firefox2/" ) != -1 );
	boolean isFirefox3 = ( ua != null && ua.indexOf( "Firefox3/" ) != -1 );
	boolean isFirefox = ( ua != null && ua.indexOf( "Firefox3/" ) != -1 );
	boolean isMSIE = ( ua != null && ua.indexOf( "MSIE" ) != -1 );
	boolean isIE6=( ua != null && ua.indexOf("MSIE 6.0") != -1 );
	boolean isChrome = ( ua != null && ua.indexOf( "Chrome/" ) != -1 );
	String  state=egDashboard.getServerState(hostName,compType,siteName);

	EgMaintenanceInfo maintenanceInfo = new EgMaintenanceInfo("manager");
	EgDateInfo dateInfo = new EgDateInfo();
	String dispDate=dateInfo.egetDate();
	String portNo="NULL";
	String sidForMaintenance="";
	String hostForMaintenance=hostName;
	if(hostName!=null && hostName.indexOf(":")!=-1)
	{
		StringTokenizer stkHostName=new StringTokenizer(hostName,":");
		if(stkHostName.hasMoreTokens())
			hostForMaintenance=stkHostName.nextToken();
		if(stkHostName.hasMoreTokens())
			portNo=stkHostName.nextToken();
		if(stkHostName.hasMoreTokens())
			sidForMaintenance=stkHostName.nextToken();
	}
	if(isPickInfoAutomatically)
	{
		String testNameVal=request.getParameter("test");
		if(testNameVal!=null && testNameVal.indexOf("-")>0)
			testNameVal=testNameVal.substring(0,testNameVal.indexOf("-"));

	//	Vector testInfos=dashboardDAO.getDescriptorsForTest(hostName,compType,testNameVal,"custom");
		Vector testInfos=dashboardDAO.getInfosForMyDashboard(compType,hostForMaintenance,portNo,sidForMaintenance,testNameVal);
		if(testInfos!=null && !testInfos.isEmpty())
		{
			testNameVal=testNameVal+"-"+((String)testInfos.get(0));
		}
		StringTokenizer stkQryString=new StringTokenizer(queryString,"&");
		String Qstring="";
		while(stkQryString.hasMoreTokens())
		{
			String param = stkQryString.nextToken();
			int ind = param.indexOf("=");
			if (ind < 0)
				continue;
			String reqparam =param.substring(0,ind);
			String value = param.substring(ind+1);
			
			if(reqparam.equals("test"))
			{
				value=testNameVal;
			}

			Qstring=Qstring+reqparam+"="+value+"&";
		}
		queryString=Qstring;
	}
	boolean	isHostinMaintenance = maintenanceInfo.isItMaintenanceTime(dispDate,hostForMaintenance,"","",true);
	boolean	isComponentinMaintenance = maintenanceInfo.isItMaintenanceTime(dispDate,hostForMaintenance,portNo,sidForMaintenance,true);
	boolean showMaintenanceIcon=(isHostinMaintenance || isComponentinMaintenance);
	String componentDetailsIcon="jvm_"+state;
	
	if(showMaintenanceIcon)
	{
		componentDetailsIcon="comp_maintenance_"+state;
	}
	String temp1="";
	String temp2="";
	String temp3="";
	if(request.getParameter("subsystem")!=null)
	{
		temp1=request.getParameter("subsystem");
		temp2=request.getParameter("defaultTabb");
	}
	else
	{
		temp1="Analysis";
	}
	if(request.getParameter("s_info")!=null)
	{
		temp3=request.getParameter("s_info");
	}
	String info=request.getParameter("info");
	if(info==null)
	{
		info="";
	}
	
	String qryStr = response.encodeURL("/final/monitor/egDashboardSettings.jsp?")+"compType="+compType+"&compName="+EgURLEncoder.encode(hostName,"UTF-8")+"&from=dashboard&tab="+tab+"&moduleType="+request.getParameter("modType")+"&submoduleType="+request.getParameter("submodType")+"&chartType="+request.getParameter("crtType")+"&testName="+request.getParameter("testName")+"&measureName="+request.getParameter("measureName")+"&graphType="+request.getParameter("grpType")+"&duration="+request.getParameter("duration");
	String tabCellWidth="530px";
	
	if (isMSIE)
		{

			tabCellWidth="100%";

		}
		else
		{
			tabCellWidth="100%";
		}
		String TreeUrl="componentTree.jsp?tree=ServicesTreeModel&width=220&str=sessionID&node=Components&treeTitle=Components";

if(componentTree == null || componentTree.equals("true"))
{
	String openNodeValue=request.getParameter("openNode");
	openNodeValue=(openNodeValue==null)?"":openNodeValue;
	openNodeValue=com.egurkha.util.StringUtils.replace(openNodeValue, "\"", "&#34");

	String selectedNode=null;
	if(compType!=null && compType.trim().length()>0 && hostName!=null && hostName.trim().length()>0)
	{
		selectedNode=compType+":"+hostName;
	}
	String strName=hostName;
	if (strName!=null && strName.endsWith(EgConstants.NULL_PORT) && (strName.indexOf(EgConstants.NULL_PORT) > -1))  
	{
		strName = Server.getServerNameWithoutPort(strName, false);
	}

	TreeUrl="componentTree.jsp?tree=ServicesTreeModel&width=220&str="+EgURLEncoder.encode(selectedNode,"UTF-8")+"&node=Components&treeTitle=Components&compNickName="+EgURLEncoder.encode(strName,"UTF-8");


}

	String tdWidth="";
	if(layer.size()==5)
		tdWidth="6%";
	else if(layer.size()==4 && (compType!=null && compType.equalsIgnoreCase("VmEsx_i_server")))
		tdWidth="17%";
	else if(layer.size()==4)
		tdWidth="13%";
	else if(layer.size()==3)
		tdWidth="20%";
	else if(layer.size()==2)
		tdWidth="29%";
	else if(layer.size()==1)
		tdWidth="35%";

	if(!isCustomDashboard.equalsIgnoreCase("No"))
	{ 

	}
	else
	{

	}

	qryStr = response.encodeURL("/final/monitor/egDashboardSettings.jsp?")+"compType="+compType+"&compName="+EgURLEncoder.encode(hostName,"UTF-8")+"&from=dashboard&firstTime=true&tab="+tab;

	if(adminPermission==true)
	{
		if(allComp)
		{
			dashboardConfigQry = qryStr;
		}
	}
	String trgthost=hostName.substring(0,hostName.indexOf(":"));
	trgthost=trgthost+":NULL";

	if(compCount >= maxComp)
	{
		if(isHostlevelTest!=null && isHostlevelTest.equals("true"))
		{
			String dashBoardCompName=request.getParameter("dashBoardCompName");
			String dashBoardCompType=request.getParameter("dashBoardCompType");
			hostName=dashBoardCompName;
			compType=dashBoardCompType;
		}

		Iterator itr = compType_Name.keySet().iterator();
		Vector compType_vec = new Vector(compType_Name.keySet());
		Vector compType_mapping=new Vector();
		itr = compType_vec.iterator();
		while(itr.hasNext())
		{
			String temp_name=(String)itr.next();
			String mappingName=egMappingInfo.getComponentTypeDescription(temp_name);
			compType_mapping.add(mappingName);
		}
		Collections.sort(compType_mapping,String.CASE_INSENSITIVE_ORDER);
		Iterator mappingItr=compType_mapping.iterator();
		if ( !compType_Name.contains( compType ) )
		{

		}
		while (mappingItr.hasNext()) 
		{
			String compType_dispName=(String)mappingItr.next();
			String componentType=egMappingInfo.getReverseComponentTypeDescription(compType_dispName);
			if(compType!=null && compType.equals(componentType))
			{

			}
			else
			{

			}
		}

		Vector comp_Names = (Vector)compType_Name.get(compType);
		if ( comp_Names == null || comp_Names.isEmpty() )
		{

		}
		else
		{
			Collections.sort(comp_Names, String.CASE_INSENSITIVE_ORDER);
			String nick="";
			for(int i=0;i<comp_Names.size();i++)
			{
				String component_Name = (String)comp_Names.get(i);
				if(component_Name.indexOf(":")!=-1)
				{
					StringTokenizer st = new StringTokenizer(component_Name,":");
					int count = st.countTokens();
					nick=st.nextToken();
					String port=st.nextToken();

					if(count>2 && port!=null && !port.equals("NULL"))
					{
						String sid=st.nextToken();
						nick=nick+":"+port+":"+sid;
					}
					else if(port!=null && !port.equals("NULL"))
					{
						nick=nick+":"+port;
					}
				}

				if(hostName!=null && hostName.equals(component_Name))
				{

				}
				else
				{

				}
			}
		}

		if((ht_changeHash.containsKey(hostName.trim()) || ht_changeHash.containsKey(trgthost)) && EgInstallInfo.isConfigSupported && hasConfigSupport)//  Configuraion Image changes 111
		{
			String dashBoardCompName=request.getParameter("dashBoardCompName");
			String dashBoardCompType=request.getParameter("dashBoardCompType");
			dashBoardComponentName=hostName+":"+compType;

			String temp_type=dashBoardCompType;
			if(temp_type==null || temp_type.trim().length()==0)
				temp_type=compType;

			boolean isTestRelevantForServer = false;
			boolean configChanged = true;
			ArrayList temp_list=(ArrayList) ht_changeHash.get(hostName.trim());
			if(temp_list==null || temp_list.size()==0)
				temp_list= (ArrayList) ht_changeHash.get(trgthost);
			
			if(temp_list!=null && temp_list.size()>0)
			{
				for(int k2=0;k2<temp_list.size();k2++)
				{
					String temp_test_name=(String)temp_list.get(k2);
					if(temp_test_name!=null && temp_test_name.trim().length()>0)
					{
						isTestRelevantForServer = specsInfo.isTestRelevantForServer(temp_type,temp_test_name);
					}
					if(isTestRelevantForServer)
						break;
				}
				
				if(isTestRelevantForServer)
					configChanged=true;
				else
					configChanged=false;
			}
			else
				configChanged=false;

			if(configChanged)
			{
				configChangeIcon = true;

			}
			else
			{
				configChangeIcon = false;

			}
		}

	}
	else
	{
		String tool="";
		String tooltip="";
		String mapType="";
		if(componentName!=null && !componentName.equalsIgnoreCase("null") && !componentName.equals(""))
		{
			if(componentName.indexOf(":NULL")!=-1)
			{
				tool=componentName.substring(0,componentName.indexOf(":NULL"));
				String cotype=tool.substring(0,tool.indexOf(":"));
				String coname=tool.substring(tool.indexOf(":")+1,tool.length());
				mapType=egMappingInfo.getComponentTypeDescription(cotype);
				tooltip=mapType+":"+coname;
			}
			else
			{
				tool=componentName;
				String cotype=tool.substring(0,tool.indexOf(":"));
				String coname=tool.substring(tool.indexOf(":")+1,tool.length());
				mapType=egMappingInfo.getComponentTypeDescription(cotype);
				tooltip=mapType+":"+coname;
			}
		}

		componentName=compType+":"+hostName;
		if(isHostlevelTest!=null && isHostlevelTest.equals("true"))
		{
			String dashBoardCompName=request.getParameter("dashBoardCompName");
			String dashBoardCompType=request.getParameter("dashBoardCompType");
			componentName=dashBoardCompType+":"+dashBoardCompName;
			compType=dashBoardCompType;
		}

		ArrayList serversMapping=new ArrayList(component_mapping.keySet());
		Collections.sort(serversMapping,String.CASE_INSENSITIVE_ORDER);
		//CASE_INSENSITIVE_ORDER 

		Iterator serverItr=serversMapping.iterator();
		while(serverItr.hasNext())
		{
			String serverMapping=(String)serverItr.next();
			String server=(String)component_mapping.get(serverMapping);
			String selected="";

			if(server!=null && server.equals(componentName))
				selected="selected";


		}

		String comname="";
		if(hostName.indexOf(":NULL")!=-1)
		{
			comname=hostName.substring(0,hostName.indexOf(":"));
		}
		else
		{
			comname=hostName;
		}

		if((ht_changeHash.containsKey(hostName.trim()) || ht_changeHash.containsKey(trgthost)) && EgInstallInfo.isConfigSupported && hasConfigSupport)//  Configuraion Image changes 111
		{
			String dashBoardCompName=request.getParameter("dashBoardCompName");
			String dashBoardCompType=request.getParameter("dashBoardCompType");
			dashBoardComponentName=hostName+":"+compType;

			String temp_type=dashBoardCompType;
			if(temp_type==null || temp_type.trim().length()==0)
				temp_type=compType;

			boolean isTestRelevantForServer = false;
			boolean configChanged = true;
			ArrayList temp_list=(ArrayList) ht_changeHash.get(hostName.trim());
			if(temp_list==null || temp_list.size()==0)
				temp_list= (ArrayList) ht_changeHash.get(trgthost);
			
			if(temp_list!=null && temp_list.size()>0)
			{
				for(int k2=0;k2<temp_list.size();k2++)
				{
					String temp_test_name=(String)temp_list.get(k2);
					if(temp_test_name!=null && temp_test_name.trim().length()>0)
					{
						isTestRelevantForServer = specsInfo.isTestRelevantForServer(temp_type,temp_test_name);
					}
					if(isTestRelevantForServer)
						break;
				}
				
				if(isTestRelevantForServer)
					configChanged=true;
				else
					configChanged=false;
			}
			else
				configChanged=false;

			if(configChanged)
			{
				configChangeIcon = true;

			}
			else
			{
				configChangeIcon = false;

			}
		}

	}

	boolean hasTransactions = false;
	boolean hasEmulatedTransactions = false;
	boolean hasLogonSimulations = false;
	if(newWindow==null || (newWindow!=null && !newWindow.equalsIgnoreCase("true")))
	{
		String from_page=request.getParameter("from_page");

		if(from_page!=null && from_page.equalsIgnoreCase("insideviewDashboard"))
		{
			String backLoc="javascript:window.location.href=\"../monitor/egInsideviewDashboard.jsp?"+request.getQueryString()+"\"";
		}
		else
		{
			backButtonFunction="javascript:history.back();";
			if(fromDesignDashboard!=null && fromDesignDashboard.equalsIgnoreCase("true"))
			{
				backButtonFunction="javascript:window.location.href=\"/final/monitor/egDesignDashboard.jsp?compType="+compType+"&profileName="+profileName+"\"";
			}
			String isFromAdmin = (String) session.getAttribute("fromAdmin");
			session.removeAttribute("fromAdmin");
			if(StringUtils.isNull(isFromAdmin))
			{

			}
			String aggComponent = request.getParameter("aggComponent");	
			if(!StringUtils.isNull(aggComponent))
			{

			}
			String fromDashboardSettings = request.getParameter("fromDashboardSettings");
			if(fromDashboardSettings!=null && fromDashboardSettings.equalsIgnoreCase("true"))
			{
				backButtonFunction="javascript:window.history.go(-3)";
			}
			treeSession=(String)session.getAttribute("monitorLastSession");
			treeSession=(treeSession!=null)? treeSession:"";
			if(csrfToken!=null && csrfToken.trim().length()>0)
			{
				treeSession = treeSession +"&com.eg.CSRF_NONCE="+csrfToken;
			}
			if(treeSession.indexOf("monCmd=serviceList")>0 || treeSession.indexOf("serviceDashboard")>0  || treeSession.indexOf("zoneDash")>0 || treeSession.indexOf("segmentDashboard")>0 || treeSession.indexOf("monCmd=segmentList")>0 || treeSession.indexOf("monCmd=zoneList")>0 || treeSession.indexOf("EgVmwareCompGraphApp.jsp")>0 || treeSession.indexOf("fromTopology=yes")>0)
			{
				backButtonFunction=treeSession;
				if(backButtonFunction.indexOf("serviceDashboard") > 0) 
				{
					StringTokenizer strtok = new StringTokenizer(backButtonFunction,"&");
					while(strtok.hasMoreTokens())
					{
						String param = strtok.nextToken();
						String reqparam =param.substring(0,param.indexOf("="));
						String value = param.substring(param.indexOf("=")+1,param.length());
						if(reqparam.equals("hasTransactions"))
						{
							if(value != null && value.trim().length() > 0 && (value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("true")))
								hasTransactions = true;
						}
						else if(reqparam.equals("hasEmulatedTransactions"))
						{
							if(value != null && value.trim().length() > 0 && (value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("true")))
								hasEmulatedTransactions = true;
						}
						else if(reqparam.equals("hasLogonSimulations"))
						{
							if(value != null && value.trim().length() > 0 && (value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("true")))
								hasLogonSimulations = true;
						}
					}
				}
			}
			if(StringUtils.isNull(isFromAdmin))
			{
			}
		}
	}
	if(fromPage!=null && fromPage.trim().length()>0 && fromPage.equalsIgnoreCase("vm"))
	{
		String usrSearchTreeSession = (String) session.getAttribute("userSearchMonLastSession");
		if ((treeSession!=null && treeSession.indexOf("eGSearch.jsp")==-1) && (usrSearchTreeSession!=null && usrSearchTreeSession.trim().length()>0 && usrSearchTreeSession.indexOf("eGSearch.jsp")>-1))
		{
			treeSession = usrSearchTreeSession;
			session.removeAttribute("userSearchMonLastSession");
		}
	}
	//Getting original port for component (only for OS Level Alarms)
	String portforHost = null;
	String originalhostName = null;
	if(hostName!=null && hostName.endsWith("NULL"))
	{
		StringTokenizer st = new StringTokenizer(hostName,":");
		String name = st.nextToken();
		String port = st.nextToken();
		if(port!=null && port.equalsIgnoreCase("NULL"))
		{
			portforHost = discInfo.getPortForHost(name,compType);
		}
		originalhostName = hostName.substring(0,hostName.lastIndexOf(":"))+":"+portforHost;
	}
	boolean hideAddCustomDashboardIcon=false;
	if(isCustomDashboard!=null && isCustomDashboard.equalsIgnoreCase("no"))
	{
		hideAddCustomDashboardIcon=true;
	}
	String unKnownStr = egMappingInfo.getTextDescription("monitor.common.Unknown");
	if(fromPage!=null && fromPage.trim().length()>0 && fromPage.equalsIgnoreCase("vm"))
	{
		if(treeSession!=null && treeSession.trim().length()>0 && treeSession.indexOf("eGSearch.jsp")>-1)
			session.setAttribute("userSearchMonLastSession",treeSession);
	}
	String userName = (String)session.getAttribute("sess_userid");
	String userLoginID = u_ser.getLoginID();
	EgRoleInfo roleInfo = EgRoleInfo.getInstance(session.getId(),userName);
	boolean isLimitedAdmin = false;
	if (!roleInfo.hasAllComponentAccess())
	{
		isLimitedAdmin = true;
	}
%>

<html>
<head>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> -->
<meta charset="utf-8">
<egui:skin ui="monitor"/>

<style>
.iconIstamDashboardAdd{
	background:url('/final/monitor/eg_images/Light/icon_build.png') center center no-repeat;
	width:21px !important;
	height:19px !important;
}
</style>

<style>
	.threshold_table{
		table-layout: fixed !important;
	}

	.threshold_table td{
		word-wrap: break-word !important;
		white-space: normal !important;
		padding:2px 5px 2px 5px !important;
	}

	.gridSkin .threshold_tdcls div.x-grid-cell-inner{
	
		padding:0px !important;
	}
</style>

<script src="/final/jquery/jquery.js"></script>
<script type="text/javascript" src="../styles/jscrollpane/jquery.mousewheel.js"></script>
<script type="text/javascript" src="../styles/jscrollpane/mwheelIntent.js"></script>
<script type="text/javascript" src="../styles/jscrollpane/jquery.jscrollpane.js"></script>
<script type="text/javascript" src="/final/jquery/jquery.jcarousel-core.min.js"></script>

<script src="../scripts/<%=script_src%>"></script>

<script src="/final/monitor/eg_scripts/ajaxutils.js" type="text/javascript"></script>
<!-- <script language="JavaScript1.2" src="/final/monitor/eg_scripts/eg_serverdashboard.js"></script> -->
<%=isfromSuper ?"<script language='javascript' src='/final/monitor/eg_scripts/sm_utils.js' type='text/javascript'></script>":""%>

<script src="/final/monitor/eg_scripts/eg_date.js"></script> 
<script src="/final/scripts/eg_DateUtil.js"></script>
<script type="text/javascript">
	var isLicenseViolatedType = <%=isLicenseViolatedType%>;
	var hideAddCustomDashboardIcon=eval('<%=hideAddCustomDashboardIcon%>');
	var netflowSelectedTabIndex =0;
	var requestParams=new Object();
	requestParams.backHidden=<%=backHidden%>
	requestParams.ltest="<%=ltest%>";
	requestParams.monitorsBy="<%=monitorsBy%>";
	requestParams.toBckComp="<%=toBckComp%>";
	requestParams.gauageClick ='<%=gauageClick%>'; 
	requestParams.gauageClickUrl ='<%=gauageClick%>'; 
	var myDashboardBackUrl = '<%=myDashboardBackUrl%>';
	var netscalerBackUrl = '<%=netscalerBackUrl%>';
	
	var isFromNetscaler=('<%=isFromNetscaler%>'=='true'?true:false);

	var isFromO365Dashboard=<%=isFromO365Dashboard%>;
	
	var office365DashboardLink = '<%=office365DashboardLink%>';
	var SAPDashboardBackUrl = '<%=SAPDashboardBackUrl%>';
	var SapPlatformDashboardBackUrl = '<%=SapPlatformDashboardBackUrl%>';
	var GlobalSearchBackBtnLink = '<%=GlobalSearchBackBtnLink%>';
	var backDashboardURL = '<%=backDashboardURL%>';
	var globalSearchListUrl = '<%=globalSearchListUrl%>';
	var search_info = '<%=search_info%>';
	var setActiveTab = '<%=setActiveTab%>';
	var fromp = '<%=fromp%>';
	var fromServiceDashboard = '<%=fromServiceDashboard%>';
	var valueFusion=<%=isFusion%>;

	var requiresBasic=<%=basic%>;
	var requiresWithVirtual=<%=basicWithVirtual%>;
	var requiresWithApplication=<%=basicWithApplication%>;
	var requiresWithInterface=<%=basicWithInterface%>;

	var showKeyUser=<%=showKeyUser%>;
	var uedOverviewType='<%=uedOverviewType%>';
	
	var backNavDashboard = '<%=backNavDashboard%>';
	var isLimitedAdmin='<%=isLimitedAdmin%>';
	var userLoginID = '<%=userLoginID%>';
	//var mgr_dateFormat= getExtjsDateFormat('<%=currentDateFormat%>');
	var mgr_dateFormat= getExtjsDateFormat('<%=dateFormatForDatePicker%>');
	var mgr_currentDateFormat= getExtjsDateFormat('<%=currentDateFormat%>');
	var currentDateFormat_js= '<%=currentDateFormat%>';
	var remoteURL="../servlet/com.eg.EgMonRemoteScriptingServlet";
	var fromComponentHealth='<%=fromComponentHealth%>';
	var showAssetInfoInLayers = ('<%=showAssetInfoInLayers%>' === 'yes') ? true : false; //To enable or disable asset icon in layer page.
	var isDisableTrendComputation = ('<%=isDisableTrendComputation%>' === 'yes') ? true : false;
	var tabsInfo=new Array();
	var isIncludedNetflowDeviceAvailable = eval('<%=isIncludedNetflowDeviceAvailable%>');
	var isExcludedNetflowDeviceAvailable = eval('<%=isExcludedNetflowDeviceAvailable%>');
	var servBusiDetails_csrfToken = '<%=csrfToken%>';
	var isServiceBusiViewMetrics = '<%=isServiceBusiViewMetrics%>';
	var userType = '<%=userType%>';
	var tab_view_array = new Array();
	var infoName = '<%=info%>';
	var insideVMrefresh = false;
<%
		if(tab_view_list != null ){
			for(int c=0;c<tab_view_list.size();c++){
				String tabListName = (String) tab_view_list.get(c);
				String tabListNameMapping = (String)egMappingInfo.getLayerDescription(tabListName);
%>
					var tabListName = '<%=tabListName%>';
					var tabListNameMapping = '<%=tabListNameMapping%>';
					tab_view_array.push(
						{
							rname:'<%=tabListName%>',
							title:tabListNameMapping
						}
					);
<%
			}
		}
%>
	requestParams.tab_view_list=tab_view_array;
	<%
		for(int i=0;i<layer.size();i++)  
		{
			String layerName=(String)layer.get(i);
			if(layerName!=null && compType!=null && (compType.equals("Cisco_router") && layerName.equals("Network")))
			{
				layerName="Cisco";
%>
				tabsInfo.push({
					  type:'<%=(String)layer.get(i)%>',
					  index:<%=i%>,
					  name:'<%=egMappingInfo.getComponentTypeDescription("monitor.dashboard."+layerName)%>'
				 });
<%
			}
			else if(layerName!=null && compType!=null && (compType.equals("NetflowDevice") && layerName.equals("Network")))
			{
				layerName="NetFlow";
%>
				tabsInfo.push({
					  type:'NetFlow',
					  index:<%=i%>,
					  name:'<%=egMappingInfo.getComponentTypeDescription("monitor.dashboard."+layerName)%>'
				 });
<%
			}
			else
			{
%>
				tabsInfo.push({
					  type:'<%=(String)layer.get(i)%>',
					  index:<%=i%>,
					  name:'<%=egMappingInfo.getComponentTypeDescription("monitor.dashboard."+layerName)%>'
				 });
<%
			}
		}
%>

			<%--var layerStateArray = [];
			var measuresURL = '';
			var boldAnchorObject = null;
			var boldAnchorSub = '';
			var firstLoadFlag = 1;
			var isChrome='<%=isChrome%>';
			var isWindowResize=false;
			var dividerShow = '<%=request.getParameter("ComponentTree")%>';
/*
		documentView(object) is used to gets the document(screen) height and width by checking browser types itself----- start here---  Muniraj and Jaiwin
		(e.g) var docView =documentView.getObject(); height =docView.height;
	*/
	function clearLayerStateArray()
	{
		layerStateArray = [];
	}
	function getLayerStateArray()
	{
		return layerStateArray;
	}
	function setLayerStateArray(layerArray)
	{
		layerStateArray.push(layerArray);
	}
	
	documentView ={
		getObject: function()
		{
			if(typeof( window.innerWidth) == 'number')
			{//Firefox
				this.height = window.innerHeight;
				this.width = window.innerWidth;
				this.fireFox = true;
			}
			else if( document.documentElement && ( document.documentElement.clientWidth
				|| document.documentElement.clientHeight ))
			{//IE 6 + in 'standards compliant mode'
				this.height = document.documentElement.clientHeight;
				this.width = document.documentElement.clientWidth;
				this.ie = true;
			}
			else if(document.body && document.body.clientHeight)
			{ //IE 4 compatible
				this.height = document.body.clientHeight;
				this.width = document.body.clientWidth;
				this.ie = true;
			}
			return this;
		},
		getHeight: function()
		{
			return this.getObject().height;
		},
		getWidth: function()
		{
			return this.getObject().width;
		},
		isIE: function()
		{
			return this.getObject().ie;
		},
		isFireFox: function()
		{
			return this.getObject().fireFox;
		}
	};

	function egSelectDragDivVertical(e)
	{
		var listPageTreeObj=$j("#componentTreeList").css("display");
		if (listPageTreeObj!=null && listPageTreeObj=='block')
		{
			$j("#componentTreeList").animate({width:'hide'});
			$j("#listPageRight").css('width','99%');
			$j("#dividerImgChange").attr('class','dividerRight');
		}
		else
		{
			$j("#componentTreeList").animate({width:'show'});
			$j("#listPageRight").css('width','80%');
			$j("#dividerImgChange").attr('class','dividerLeft');
		}
	}

	function egRemoveDragDivVertical(e)
	{
		$j("#listPageRight").unbind('mousemove',egDragVertical);
	}

	function egDragVertical(e)
	{
		var winWidth = $j(window).width();
		var winHeight = $j(window).height();
		var lrImageDivPos= e.pageX;
		if((lrImageDivPos<220) || (winWidth - lrImageDivPos)<600)
		{
			//return false;
		}
		else
		{
			$j("#componentTreeList").width(lrImageDivPos-6);
			$j("#listPageRight").width(winWidth-(lrImageDivPos+6));
			//$j(".loadPagesDiv").width(winWidth-(lrImageDivPos+6));

			/*$j(".transTopDiv").width (winWidth-(lrImageDivPos+6));
			$j(".transGraphDiv").width (winWidth-(lrImageDivPos+6));
			$j(".graphDiv").width (winWidth-(lrImageDivPos+6));
			$j(".timelineDiv").width (winWidth-(lrImageDivPos+6));

			$j(".listComp").width (winWidth-(lrImageDivPos+6));
			$j(".innerTabPagesDiv").width (winWidth-(lrImageDivPos+6));
			$j(".innerTabTransDiv").width (winWidth-(lrImageDivPos+6));
			$j(".associateWidth").width (winWidth-(lrImageDivPos+210));
			$j(".associateDataWidth").width (winWidth-(lrImageDivPos+224));
			//alert("assoiateWidth===>"+$j(".associateWidth").width());
			//alert("listComp===>"+$j(".listComp").width());
			//$j(document).listpageResize();*/
		}
	}

var old_width=0;
var $j = jQuery.noConflict();
--%>

var simulatedTransactionFlow='<egui:intnl text="monitor.common.Simulated Transaction Flow" />';
var noMeasure='<egui:intnl text="monitor.common.No Measures Available" />';
var netscalerLbl='<egui:intnl text="monitor.common.Netscaler Load Balancing Flow" />';
var loadingLbl='<egui:intnl text="monitor.common.Loading" />';
var testExcludedorDisabledMsg = '<%=egMappingInfo.getTextDescription("monitor.dashboard.Test has been excluded or disabled!")%>';

var recentCompType="";
var recentComp="";
var hostNameEncoded="<%=EgURLEncoder.encode(hostName,"UTF-8")%>";
var hostTypeEncoded="<%=EgURLEncoder.encode(compType,"UTF-8")%>";
var hostTypewithNameEncoded="<%=EgURLEncoder.encode(hostNameWithType,"UTF-8")%>";
var isHostlevelTest="<%=isHostlevelTest%>";

// Added by Anthoni Lawrance STARTS
var componentName = '<%=hostName%>';
var componentType = '<%=compType%>';
var subject = '<%=subject%>';
var subSys = '<%=subSys%>';
var currentDateFormat = '<%=currentDateFormat1%>';

var selectedInterface = null;
var selectedParentID = null;

var systemPublicJSON = '';
var systemController = '';
var sysCurrentTabId = '';
var netCurrentTabId = '';
var appCurrentTabId = '';
var sysLastLoadedURL = '';
var netLastLoadedURL = '';
var appLastLoadedURL = '';
var appSQLLastLoadedURL = '';
var interfaceLastLoadedURL = '';
var ciscoLastLoadedURL ='';
var netflowLastLoadedURL ='';
var jsonAreaChartData='';
var applicationPublicJSON = '';
var appInnerPublicJSON = '';
var applicationController = '';
var isNetworkTabSelected = false;
var protocolLastLoadedURL = null;
var flowsDetailsLastLoadedURL = null;

var networkPublicJSON = '';
var netInnerPublicJSON = '';
var networkController = '';
var publicJSON = '';
var monitorLastSession = '<%=monitorLastSession%>';
var lastSession = new Array();
var timelineVals = new Array();
var appLastGraphTypeLoaded = '';
var sysLastGraphTypeLoaded = '';
var netLastGraphTypeLoaded = '';

// Added by Anthoni Lawrance ENDS


// for Measures Tab
var interfacePublicJson = '';
var subsystem_change='';
var Vm_val="";
var sub_systemTab='Overview';//sarav to maintain sybystem in systemTab
var sub_netwokTab='Overview';//sarav to maintain sybystem in NetworkTab
var refreshPageFreq='<%=refreshFrequency%>';
var newDateOnTabOrSubsystem=new Date();
var defTab='';//sarav var for tab selected during refresh
var lastRefreshDate=new Date(newDateOnTabOrSubsystem.getTime()-refreshPageFreq);
		
//---end---
var grptyp='';//sarav var to main VM
var graphtp='';//sarav var to main VM
var subsystemUrl='';//to maintain the susystem ulr during refresh
var xmlHttp;
var isImageLoaded=false;
var refpagurl="";
var isGraphFullViewEnabled=false;
var componentDetailsQryStr="<%=QryStr%>+&state=<%=state%>";
var currentComponentState = "<%=state%>";
var layermodeltab=false;
var intervalId;
var valHeight=0;
var valwidth=0;
var zoomStartX=0;
var zoomStartY=0;
var previousTab="";
var pageQryString='<%=response.encodeURL("/final/monitor/egDashBoardLayers.jsp?")%>'+"adjustdashBoardDivHeight=true&<%=queryString%>";
var isTabORSubsystemChanged=false;
var lastLoadedGraphTab="";
var lastLoadedInfos="";
var exprofile="";
var profilex="";
var loadPageForDialUrl="";
var currentSubSystem="";
var currentTab="";
var aggregateTab="";
var openNode="";
var treeFlag="";
var fromHomepage="";
var zoneName="";

var isMaximizedTable=false;
var dashTimelineEncodedURL='<%=response.encodeURL("/final/monitor/egDashTimeline.jsp?")%>';
var appDashboardEncodedURL='<%=response.encodeURL("/final/monitor/egAppDashboard.jsp?")%>';
var appDashboardEncodedURLforXen='<%=response.encodeURL("/final/monitor/egXenBrokerOverview.jsp?")%>';
var sysDashboardEncodedURL='<%=response.encodeURL("/final/monitor/egSysDashBoard.jsp?")%>';
var sqlProcessEncodedURL='<%=response.encodeURL("/final/monitor/sqlProcess.jsp?details=")%>';
var infraAlarmsEncodedURL='<%=response.encodeURL("/final/monitor/egInfraAlarmDetails.jsp?")%>';
var virtualDashboardTimelineEncodedURL='<%=response.encodeURL("/final/monitor/egDashBoardTimeline.jsp?")%>';
//var dashboardControllerTimelineEncodedURL='<%=response.encodeURL("/final/servlet/com.eg.EgDashboardController?")%>';
var egDashGraphInfoEncodedURL='<%=response.encodeURL("/final/monitor/egDashGraphInfo.jsp?")%>';
var virtualTabSsystemAnalysisEncodedURL='<%=response.encodeURL("/final/monitor/egSystemAnalysis.jsp?")%>';
var virtualTabSystemAnalysisVmDetailsEncodedURL='<%=response.encodeURL("/final/monitor/egSystemAnalysisVmDetails.jsp?")%>';
var insideViewMFlag ='<%=insideViewMFlag%>';
var ciscoSelectedType="<%=ciscoSelectedType%>";
var subSystemFromRequest="<%=subsystem%>";
var compTypeFromRequest="<%=compType%>";
var mgrCurrentDateFormat='<%=currentDateFormat%>';
var toDashBoardLayer = '<%=toDashBoardLayer%>';
var fromAlarms='<%=fromAlarms%>';
var defaultTabFromRequest='<%=defualtTab%>';
var totalLayerSize='<%=layer.size()%>';
var serverdashboard_skin='<%=monitor_Skin%>';
var display ='<%=display%>';
var startMinsAtPageStartup='<%=new Date().getMinutes()%>';
var endMinsAtPageStartup='<%=new Date().getMinutes()%>';
var descript='<%=descript%>';
var s_time='<%=s_time%>';
var graphTypeFromRequest='<%=graphType%>';
var profilex='<%=profileName%>';
var networkDashBoardVMTabEncodedURL='<%=response.encodeURL("/final/monitor/egNetworkDashBoardVMTab.jsp?")%>';
var maxComp = "<%=maxComponent%>";
var compCount="<%=compCount%>";
var netDashboardEncodedURL='<%=response.encodeURL("/final/monitor/egNetDashBoard.jsp?")%>';
var systemVMTabEncodedURL='<%=response.encodeURL("/final/monitor/egSystemDashBoardVMTab.jsp?")%>';
var measureControllerEncodedURL='<%=response.encodeURL("../servlet/com.eg.EgMeasureController?")%>';
var selectedTabFromRequest='<%=tab%>';
var dashboardLayersEncodedURL='<%=response.encodeURL("/final/monitor/egDashBoardLayers.jsp?")%>';
var queryStringFromRequest='<%=queryString%>';
var showMaintenanceIcon='<%=showMaintenanceIcon%>';
var componentDetailsQueryStringWithoutState='<%=QryStr%>';
var threadTypeFromRequest='<%=threadType%>';
var selectedInfoFromRequest='<%=selectedInfo%>';
var temp1ForVirtualTab='<%=temp1%>';
var defTabForVirtualTab='<%=temp2%>';
var tmp="<%=info%>";
var customDashboardEncodedURL='<%=response.encodeURL("/final/monitor/egCustomDashboard.jsp?")%>';
var isFromSuperMGR='<%=isfromSuper%>';
var layerStr='<%=layerStr%>';
var sysflag='<%=hasSystemTab%>';
var nwflag='<%=hasNetworkTab%>';
var clusterflag='<%=hasClusterTab%>';
var vmflag='<%=hasVMTab%>';
var isExcludedServer='<%=isExcludedServer%>';
var isFromComponentSelect='<%=request.getParameter("comesFrom")%>';
var isBackToDashBoard='<%=request.getParameter("backtoDashBoard")%>';
var tab="<%=defualtTab%>";
var siteFromRequest='<%=site%>';
var compNameEncoded='<%=EgURLEncoder.encode(comp_name,"UTF-8")%>';
var calendarEncodedURL='<%= response.encodeURL("../monitor/EgCalendar.jsp?")%>';
var dashboardOverviewURL='<%=response.encodeURL("/final/monitor/egDashboardOverview.jsp?")%>';
var citirixUsersEncodedURL='<%=response.encodeURL("/final/monitor/egCitrixUsers.jsp?")%>';
var sqlDatabasesEncodedURL='<%=response.encodeURL("/final/monitor/egSQLDatabases.jsp?")%>';
var oracleDatabasesEncodedURL='<%=response.encodeURL("/final/monitor/egOracleDashboard.jsp?")%>';
var weblogicDashboardEncodedURL='<%=response.encodeURL("/final/monitor/egWeblogicDashboard.jsp?")%>';
var layerModelQstr='<%=layerModelQstr%>';
var applicationQstr='<%=applicationQstr%>';
var networkQstr = '<%=networkQstr%>';
var interfaceQstr = '<%=interfaceQstr%>';
var dashboardConfigureControlActionEncodedURL='<%=response.encodeURL("/final/monitor/egDashBoardConfigureControlAction.jsp?")%>';
var customDashboardControllerEncodedURL='<%=response.encodeURL("/final/servlet/com.eg.egCustomDashController?")%>';
var dashboardHistoryEncodedURL='<%=response.encodeURL("/final/monitor/egDashboardHistory.jsp?")%>';
var summaryEncodedURL='<%=response.encodeURL("/final/monitor/egSummary.jsp?")%>';
var customDashboardpEncodedURL='<%=response.encodeURL("/final/monitor/egCustomDashboardp.jsp")%>';
var isApp='<%=isApplicationDashboardEnabled%>';
var hasInterfaceTab = '<%=hasInterfaceTab%>';
var ciscoDashboardUrl ='<%=response.encodeURL("/final/monitor/EgCiscoDashboard.jsp?")%>';
var ciscoDashboardHelperUrl = '<%=response.encodeURL("/final/monitor/EgCiscoDashHelper.jsp?")%>';
//var interfaceTabEncodedURL='<%=response.encodeURL("/final/monitor/EgInterfaces.jsp?")%>';


//Added by NirmalaGenesann starts
var interfaceTabDefaultEncodedURL='<%=response.encodeURL("/final/monitor/EgInterfacesTab.jsp?")%>';
var 
infaceDefaultURL=interfaceTabDefaultEncodedURL+"&tab=Network&hostName="+hostNameEncoded+"&compType="+hostTypeEncoded+"&screenWidth=1024&screenHeight=625";
//Added by NirmalaGenesann ends

var isF5Refresh=true;
var isNet='<%=isNetworkDashboardEnabled%>';
var isApp='<%=isApplicationDashboardEnabled%>';
var _noMeasuresMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.No details for this measure")%>';
var _noComponentMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Please select a Component")%>';
var _noComponentTypeMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Please select a Component type")%>';
var _stDateLessThanEndDateMsg='<%=egMappingInfo.getTextDescription("monitor.common.Start date/time should be lesser than end date/time")%>';
var _fromdatelesserThanMsg='<%=egMappingInfo.getTextDescription("monitor.common.From date should be lesser than Current date")%>';
var _timelineTwoWeeksMsg='<%=egMappingInfo.getTextDescription("monitor.common.Timeline allowed only for two weeks")%>';
var _chooseStDateFirstMsg='<%=egMappingInfo.getTextDescription("monitor.detaileddiagnosis.Please choose Start Date and End Date before choosing Time")%>!';
var _chooseStDateMsg='<%=egMappingInfo.getTextDescription("monitor.detaileddiagnosis.Please choose a Start Date")%>!';
var _chooseEndDateMsg='<%=egMappingInfo.getTextDescription("monitor.detaileddiagnosis.Please choose an End Date")%>!';
var _historyPageTitle='<%=egMappingInfo.getTextDescription("monitor.history.Page")%>!';
var _historyPageDoesNotExistTitle='<%=egMappingInfo.getTextDescription("monitor.history.Page does not exist")%>!';
var _searchValidStringMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Please enter the valid search string")%>!';
var _enterStringMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Please enter the search string")%>!';
var _enterStringWithoutSpecialCharsMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Please enter the search string without special characters")%>!';
var _noStringFoundMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.No Database found for your search string")%>!';
var _enableCustomDashMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Please enable custom dashboard")%>!';
var _measureViewMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Measure view")%>!';
var _barViewMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Bar view")%>!';
var _alarmTitleMsg='<%=egMappingInfo.getTextDescription("monitor.dashboard.Alarms")%>!';

var applicationLbl='<%=egMappingInfo.getTextDescription("monitor.common.Application")%>';
var systemLbl='<%=egMappingInfo.getTextDescription("monitor.common.System")%>';
var interfacesLbl='<%=egMappingInfo.getTextDescription("monitor.common.Interfaces")%>';
//thresholds labels
var testInfoGlobalURL = '';
var threshTypeVar = '';
var pageName = 'Configure thresholds';
var staticMinCriticalErrMsg1 = '<egui:intnl text="admin.threshold.Invalid threshold entry : Critical - Static minimum threshold"/>';
var staticMaxCriticalErrMsg1 = '<egui:intnl text="admin.threshold.Invalid threshold entry : Critical - Static maximum threshold"/>';
var staticMinMajorErrMsg1 = '<egui:intnl text="admin.threshold.Invalid threshold entry : Major - Static minimum threshold"/>';
var staticMaxMajorErrMsg1 = '<egui:intnl text="admin.threshold.Invalid threshold entry : Major - Static maximum threshold"/>';
var staticMinMinorErrMsg1 = '<egui:intnl text="admin.threshold.Invalid threshold entry : Minor - Static minimum threshold"/>';
var staticMaxMinorErrMsg1 = '<egui:intnl text="admin.threshold.Invalid threshold entry : Minor - Static maximum threshold"/>';
var errMsg1 = '<egui:intnl text="admin.threshold.Possible reasons could be"/>';
var errMsg2 = '<egui:intnl text="admin.threshold.Threshold is set with a negative value"/>';
var errMsg3 = '<egui:intnl text="admin.threshold.The integer part contains more than 10 digits"/>';
var errMsg4 = '<egui:intnl text="admin.threshold.The fractional part contains more than 4 digits"/>';
var errMsg5 = '<egui:intnl text="admin.threshold.Static minimum threshold"/> <egui:intnl text="admin.threshold.for"/>';
var errMsg6 = '<egui:intnl text="admin.threshold.should not contain negative values"/>.';
var errMsg7 = '<egui:intnl text="admin.threshold.Static minimum threshold values representing Critical/Major/Minor should be in ascending order"/>.';
var errMsg8 = '<egui:intnl text="admin.threshold.Automatic minimum threshold values representing Critical/Major/Minor should be in ascending order"/>';
var errMsg9 = '<egui:intnl text="admin.threshold.Static maximum threshold values representing Critical/Major/Minor should be in descending order"/>';
var errMsg10 = '<egui:intnl text="admin.threshold.Automatic maximum threshold values representing Critical/Major/Minor should be in descending order"/>';
var errMsg11 = '<egui:intnl text="admin.threshold.Static maximum threshold"/> <egui:intnl text="admin.threshold.for"/>';
var deleteConfirmMsg = '<egui:intnl text="admin.threshold.Are you sure you want to delete specific thresholds for this descriptor"/>?';
var deleteSpecTestConfirmMsg = '<egui:intnl text="admin.threshold.Are you sure you want to delete specific thresholds for this test"/>?';
var selectTestAlert = '<egui:intnl text="admin.threshold.Please select a group thresholds test"/>.';
var selectSpecificTestAlert = '<egui:intnl text="admin.threshold.Please select a specific thresholds test"/>.';
var selectDefaultTestAlert = '<egui:intnl text="admin.threshold.Please select a default thresholds test"/>.';
var applyOtherCompAlert = '<egui:intnl text="admin.test.Please specify component(s) for configuration"/>';
var successAlert = '<egui:intnl text="admin.threshold.Thresholds have been applied successfully"/>'+'.';
var tabMsg1 = '<egui:intnl text="admin.threshold.Descriptors with specific threshold settings"/>';
var tabMsg2 = '<egui:intnl text="admin.threshold.Descriptors with component threshold settings"/>';
var successAlert1 = '<egui:intnl text="admin.threshold.Threshold updated successfully"/>'+'.';

var label1 = '<egui:intnl text="admin.threshold.Component type"/>';
var label2 = '<egui:intnl text="admin.threshold.Test name"/>';
var label3 = '<egui:intnl text="admin.threshold.Descriptor name"/>';
var label4 = '<egui:intnl text="admin.threshold.Configure thresholds for multiple servers"/>';
var label5 = '<egui:intnl text="admin.threshold.Component name"/>';
var label6 = '<egui:intnl text="admin.threshold.TESTS WITH GLOBAL THRESHOLD"/>';
var label7 = '<egui:intnl text="admin.threshold.TESTS WITH SPECIFIC THRESHOLD"/>';
var label8 = '<egui:intnl text="admin.threshold.TESTS WITH GROUP THRESHOLD"/>';
var label9 = '<egui:intnl text="admin.threshold.TESTS WITH DEFAULT THRESHOLD"/>';
var searchEmptyTxt = '<egui:intnl text="admin.threshold.No decriptors available for this Search"/>';
var label10 = '<egui:intnl text="admin.threshold.Apply to other components"/>';
var label11 = '<egui:intnl text="admin.threshold.View By"/>';
var label12 = '<egui:intnl text="admin.threshold.Add to existing components"/>';
var label13 = '<egui:intnl text="admin.threshold.Remove from existing components"/>';
var label14 = '<egui:intnl text="admin.threshold.Components to be configured"/>';
var label15 = '<egui:intnl text="admin.threshold.Existing components"/>';

var heapMemTitle = '<egui:intnl text="monitor.dashboard.Heap Memory Usage"/>';
var nonHeapMemTitle = '<egui:intnl text="monitor.dashboard.Non Heap Memory Usage"/>';
var noMeasureExcl='<egui:intnl text="monitor.common.No measures available!" />';
var titleGrid1 = '<egui:intnl text="admin.threshold.Measures with thresholds"/>';
var titleGrid2 = '<egui:intnl text="admin.threshold.Measures without thresholds"/>';
var alarmPolText = '<egui:intnl text="admin.threshold.Alarm Policy"/>';
var btnText1 = '<egui:intnl text="admin.common.Back"/>';
var btnText2 = '<egui:intnl text="admin.common.Update"/>';
var btnText3 = '<egui:intnl text="admin.common.Configure thresholds for descriptors"/>';
var btnText4 = '<egui:intnl text="admin.common.Modify"/>';
var btnText5 = '<egui:intnl text="admin.common.Descriptors"/>';
var btnText6 = '<egui:intnl text="admin.common.Apply"/>';
var delText = '<egui:intnl text="admin.common.Delete"/>';
var historyViewText = '<egui:intnl text="admin.common.History View"/>';
var summaryViewText = '<egui:intnl text="admin.common.Summary View"/>';
var trendViewText = '<egui:intnl text="admin.common.Trend View"/>';
var minThreshText = '<egui:intnl text="admin.threshold.Minimum Threshold"/>';
var maxThreshText = '<egui:intnl text="admin.threshold.Maximum Threshold"/>';
var minRegExpText = '<egui:intnl text="admin.threshold.Alphabets or special characters are not allowed"/>';
var minThreshTipText = '*&nbsp;'+'<egui:intnl text="admin.threshold.Specify minimum threshold values (Critical, Major, and Minor) in ascending order"/>';
var maxThreshTipText = '*&nbsp;'+'<egui:intnl text="admin.thresholds.Specify maximum threshold values (Critical, Major, and Minor) in descending order"/>';
var hostTestMsg = '*&nbsp;'+'<egui:intnl text="admin.thresholds.Changes made to specific thresholds will be applied to all components with the same nick name"/>';
var measureText = '<egui:intnl text="admin.threshold.Measure"/>';
var thresholdText = '<egui:intnl text="admin.threshold.Threshold"/>';
var criticalText = '<egui:intnl text="admin.threshold.Critical"/>';
var majorText = '<egui:intnl text="admin.threshold.Major"/>';
var minorText = '<egui:intnl text="admin.threshold.Minor"/>';
var maxminText = '<egui:intnl text="admin.threshold.Min/Max"/>';
var staticText = '<egui:intnl text="admin.threshold.Static"/>';
var autoText = '<egui:intnl text="admin.threshold.Automatic"/>';
var descText = '<egui:intnl text="admin.threshold.Description"/>';
var polText = '<egui:intnl text="admin.threshold.Policy"/>';
var allMeasureText = '<egui:intnl text="admin.threshold.Apply to other measures"/>';
var autoCriText = '<egui:intnl text="admin.threshold.Critical (% Tolerance)"/>';
var autoMajorText = '<egui:intnl text="admin.threshold.Major (% Tolerance)"/>';
var autoMinorText = '<egui:intnl text="admin.threshold.Minor (% Tolerance)"/>';
var testNameDesc_cx='<%=egMappingInfo.getTextDescription("monitor.dashboard.Test Name")%>';
var startDlessE ='<egui:intnl text="admin.sla.Start date should be lesser than end date"/>';
var settingsLbl ='<egui:intnl text="monitor.common.Settings"/>';
var settingLbl ='<egui:intnl text="monitor.common.SETTINGS"/>';
var durationLbl ='<egui:intnl text="monitor.common.Duration"/>';
var showLbl ='<egui:intnl text="monitor.common.Show"/>';
var timelineLbl ='<egui:intnl text="monitor.common.Timeline"/>';
var fromLbl ='<egui:intnl text="monitor.common.From"/>';
var HrLbl ='<egui:intnl text="monitor.common.Hr"/>';
var modeLbl ='<egui:intnl text="monitor.common.Mode"/>';
var graphLbl ='<egui:intnl text="monitor.common.Graph"/>';
var goLbl ='<egui:intnl text="monitor.common.Go"/>';
var submitLbl ='<egui:intnl text="monitor.common.Submit"/>';
var ToLbl ='<egui:intnl text="monitor.common.To"/>';
var DDLbl ='<egui:intnl text="monitor.common.DD"/>';
var minimizeLbl ='<egui:intnl text="monitor.common.Minimize"/>';
var alertLbl ='<egui:intnl text="monitor.common.Alert"/>';
var defSettingsLbl ='<egui:intnl text="monitor.common.Default Settings"/>';
var searchLbl ='<egui:intnl text="monitor.common.Search"/>';
var SQLNavigationLbl ='<egui:intnl text="monitor.dashboard.SQL Databases Navigation"/>';
var stackTraceLbl ='<egui:intnl text="monitor.dashboard.StackTrace"/>';
var threadAnalysisLbl ='<egui:intnl text="monitor.dashboard.Thread Analysis"/>';
var measurementTimeLbl ='<egui:intnl text="monitor.dashboard.Measurement Time"/>';
var measurementLbl ='<egui:intnl text="monitor.dashboard.Measurement"/>';
var sortByLbl ='<egui:intnl text="monitor.dashboard.Sort By"/>';
var oracleNavigationsLbl ='<egui:intnl text="monitor.dashboard.Oracle Tablespaces Navigation"/>';
var oracleUsersNavigationsLbl ='<egui:intnl text="monitor.dashboard.Oracle Users Navigation"/>';
var subsysLbl ='<egui:intnl text="monitor.dashboard.Subsystem"/>';
var topInterfacesLbl ='<egui:intnl text="monitor.dashboard.Top Interfaces"/>';
var dataViewLbl ='<egui:intnl text="monitor.dashboard.Data view"/>';
var graphicalViewLbl ='<egui:intnl text="monitor.dashboard.Graphical view"/>';
var displayTopicsLbl ='<egui:intnl text="monitor.dashboard.Displaying topics {0} - {1} of {2}"/>';
var noTopicsLbl ='<egui:intnl text="monitor.dashboard.No topics to display"/>';
var topInterfacesLbl ='<egui:intnl text="monitor.dashboard.Top interfaces by portion of current traffic"/>';
var protocolBandWidthLbl ='<egui:intnl text="monitor.dashboard.Protocol distribution by bandwidth usage"/>';
var interfacesLbl ='<egui:intnl text="monitor.dashboard.Interfaces"/>';
var networkInterfacesLbl ='<egui:intnl text="monitor.dashboard.Network Interfaces Summary"/>';
var overviewLbl ='<egui:intnl text="monitor.dashboard.Overview"/>';
var protocolsLbl ='<egui:intnl text="monitor.dashboard.Protocols"/>';
var sourcesLbl ='<egui:intnl text="monitor.dashboard.Top Sources"/>';
var destinationsLbl ='<egui:intnl text="monitor.dashboard.Top Destinations"/>';
var conversationsLbl ='<egui:intnl text="monitor.dashboard.Top Conversations"/>';
var maximizeViewLbl ='<egui:intnl text="monitor.dashboard.Maximize View"/>';
var protocolsLbl ='<egui:intnl text="monitor.dashboard.Protocols"/>';
var bandwidthAppLbl ='<egui:intnl text="monitor.dashboard.Bandwidth usage (%) distribution per Application/ Protocols"/>';
var remoteControlLbl ='<egui:intnl text="admin.user.Remote control"/>';
var unKnownStr = '<%=unKnownStr%>';
var addPolicyLbl ='<egui:intnl text="admin.mpolicy.Add Policy"/>';
var instMainPlcyTitle ='<egui:intnl text="monitor.common.Maintenance Policy"/>';
var spaceMsg = '<egui:intnl text="admin.mpolicy.Space not allowed"/>.';
var emptyPolicyName = '<egui:intnl text="admin.mpolicy.Please enter the policy name"/>.';
var specialcharacterMsg = '<egui:intnl text="admin.mpolicy.Special characters are not allowed"/>.';
var DateErrorMsg = '<egui:intnl text="monitor.common.Start date/time should be lesser than end date/time" />';
var timeErrorMsg = '<egui:intnl text="monitor.common.Start date/time should be greater than current date/time" />';
var endDateErrorMsg = '<egui:intnl text="monitor.common.End date should be greater than current date" />';
var endDateLtStDateMsg = '<egui:intnl text="monitor.common.End date should be greater than start date" />';
var mpolicyLbl = '<egui:intnl text="monitor.common.Policy Name" />';
var applyMainForLbl = '<egui:intnl text="monitor.common.Apply Maintenance for" />';
var componentNameLbl = '<egui:intnl text="monitor.common.Component" />';
var policyCreationMsg = '<egui:intnl text="admin.mpolicy.Policy created successfully" />!';
</script>
<!--<script type="text/javascript" src="/final/FusionCharts/scripts/FusionCharts.js"></script>-->
<script language="JavaScript1.2" src="/final/monitor/eg_scripts/eg_serverdashboard.js"></script>
<!--  <script language="JavaScript1.2" src="/final/scripts/eg_DateUtil.js"></script> -->
<script type="text/javascript">
 //var requestParams=new Object();
	// var mgrDateFormat = dateFormatForTimeline;
	 //mgrDateFormat = getExtjsDateFormat(mgrDateFormat);

	var mgrDateFormat=getExtjsDateFormat('<%=dateFormatForDatePicker%>');
	var currentDateFormat = '<%=dateFormatForDatePicker%>';
	var mgrDisplayDateFormat='<%=dateFormatNew%>';
	var refreshFrequency=<%=refreshFrequency%>;
	var curViewTab = '<%=curViewTab%>';
	 requestParams.tabsInfo=tabsInfo;
	 requestParams.isMoreInfosTreeView=<%=isMoreInfosTreeView%>;
	 var styleforMoreInfos="<%=styleforMoreInfos%>";
	 requestParams.isInterface="<%=isInterface%>";
	 requestParams.selectedInterface="<%=selectedInterface%>";

	 requestParams.ComponentTree="<%=componentTree%>";
	 requestParams.selectedTreeNode="<%=selectedTreeNode%>";
	 requestParams.backButtonFunction="<%=backButtonFunction%>";
	 requestParams.treeSession="<%=treeSession%>";
	 requestParams.backText="<%=backText%>";
	 requestParams.site="<%=site%>";
	 requestParams.tstate="<%=tstate%>";
	 requestParams.hostName="<%=hostName%>";
	 requestParams.originalhostName="<%=originalhostName%>";
	 var selectedSystemCompType = '<%=selectedSystemCompType%>';
	 if(selectedSystemCompType!=null && selectedSystemCompType=='TreeSystem')
		requestParams.compType=selectedSystemCompType;
	 else
		 requestParams.compType="<%=compType%>";

	 requestParams.doubleSelectBox = "<%=doubleSelectBox%>";
	 requestParams.componentDetailsIcon="<%=componentDetailsIcon%>";
	 requestParams.compname="<%=compName%>";

	 requestParams.zoneName="<%=zoneName%>";
	 requestParams.currentTab="<%=currentTab%>";
	 requestParams.aggregateTab="<%=aggregateTab%>";
	 requestParams.openNode="<%=openNode%>";
	 requestParams.treeFlag="<%=treeFlag%>";
	 requestParams.fromHomepage="<%=fromHomepage%>";
	 requestParams.isEndUserIcon="<%=isEndUserIcon%>";
	 requestParams.comeFrom="<%=comeFrom%>";
	 requestParams.Vmhost="<%=Vmhost%>";
	 requestParams.vmcomp_type="<%=vmcomp_type%>";
	 requestParams.vmstate="<%=vmstate%>";
	 requestParams.vmport="<%=vmport%>";
	 requestParams.monCmdFrom="<%=monCmdFrom%>";
	 requestParams.pageComesfrom="<%=pageComesfrom%>";
	 requestParams.monCmdComeFrom="<%=monCmdComeFrom%>";
	 requestParams.topologyType="<%=topologyType%>";
	 requestParams.isFromMenu="<%=isFromMenu%>";
	 requestParams.PagesComesfrom="<%=PagesComesfrom%>";
	 requestParams.actionFrom="<%=actionFrom%>";
	 requestParams.componenttype="<%=componenttype%>";
	 requestParams.isAggregate="<%=isAggregate%>";
	 requestParams.isServiceBusiDash="<%=isServiceBusiDash%>";
	 requestParams.isServiceBusiDetails="<%=isServiceBusiDetails%>";
	 requestParams.action="<%=action%>";
	 requestParams.treeAction="<%=treeAction%>";
	 requestParams.treeFlag_SBD="<%=treeFlag_SBD%>";
	 requestParams.toBackUED2="<%=toBackUED2%>";
	 requestParams.toBackUED2_url="<%=toBackUED2_url%>";
	 requestParams.outsideService_SBD="<%=outsideService_SBD%>";
	 requestParams.titleText_SBD="<%=titleText_SBD%>";
	 requestParams.selectNode_SBD="<%=selectNode_SBD%>";
	 requestParams.isEmulTrans_SBD="<%=isEmulTrans_SBD%>";
	 requestParams.serviceState_SBD="<%=serviceState_SBD%>";
	 requestParams.vdiType_SBD="<%=vdiType_SBD%>";
	 requestParams.serviceName="<%=serviceName%>";
	 requestParams.serviceState="<%=serviceState%>";
	 requestParams.compState="<%=compState%>";
	 requestParams.treeComeFrom="<%=treeComeFrom%>";
	 requestParams.fromUserView="<%=fromUserView%>";

	 requestParams.isLogonType="<%=isLogonType%>";
	 
	 requestParams.egQuickLaunch="<%=egQuickLaunch%>"; //murugan
	 requestParams.hasTransactions = <%=hasTransactions%>;
	 requestParams.hasEmulatedTransactions = <%=hasEmulatedTransactions%>;
	 requestParams.hasLogonSimulations = <%=hasLogonSimulations%>;
	
	 requestParams.treeTitle="<%=treeTitle%>";
	 requestParams.ltype="<%=ltype%>";
	 requestParams.filterBy="<%=filterBy%>";
	 requestParams.subFilter="<%=subFilter%>";
	 requestParams.componentNameSearch="<%=componentNameSearch%>";
	 requestParams.fromp="<%=fromp%>";
	 requestParams.fromServiceDashboard = '<%=fromServiceDashboard%>';
	 requestParams.externalAgent="<%=externalAgent%>";
	 requestParams.isFromInfraHome="<%=isFromInfraHome%>";
	 requestParams.isFromZoneInfra="<%=isFromZoneInfra%>";
	 requestParams.fromPageView="<%=fromPageView%>";
	 requestParams.selectedState="<%=selectedState%>";
	 requestParams.viewPageTitle="<%=viewPageTitle%>";
	 requestParams.stateName="<%=stateName%>";
	 requestParams.selectNode="<%=selectNode%>";
	 requestParams.selectedParam="<%=selectedParam%>";
	 requestParams.testForVM="<%=testForVM%>";
	 requestParams.layerForVM="<%=layerForVM%>";
	 requestParams.infoForVm="<%=infoForVmNew%>";

	 requestParams.fromPages="<%=fromPages%>";
	 requestParams.from="<%=from%>";
	 requestParams.parentZone="<%=parentZone%>";
	 requestParams.infoVMCombo="<%=infoVMCombo%>";
	 requestParams.showAlarms="<%=showAlarms%>";
	 requestParams.fromalarmWindow="<%=fromalarmWindow%>";
	 requestParams.arrangeAlarms="<%=arrangeAlarms%>";

	 var selectedSubFilterOption_temp = "<%=selectedSubFilterOption%>";
	 if(selectedSubFilterOption_temp != null && selectedSubFilterOption_temp != '')
		selectedSubFilterOption_temp = '<%=EgURLEncoder.encode(selectedSubFilterOption,"UTF-8")%>';

	 requestParams.selectedSubFilterOption=selectedSubFilterOption_temp;
	 requestParams.FromDashBoard="<%=FromDashBoard%>";
	 requestParams.fromPage="<%=fromPage%>";
	 requestParams.toDashBoardLayer="<%=toDashBoardLayer%>";
	 requestParams.fromSystemTab="<%=fromSystemTab%>";

	 requestParams.configChangeIcon="<%=configChangeIcon%>";
	 requestParams.configChangeLink="/final/monitor/EgConfigChange.jsp?componentName=<%=dashBoardComponentName%>&fromLayerModel=yes";
	 requestParams.dashBoardComponentName="<%=dashBoardComponentName%>";
	 requestParams.isCustomDashboard = "<%=isCustomDashboard%>";
	 requestParams.buildDashboardText = "<%=egMappingInfo.getTextDescription("monitor.dashboard.Build Dashboard")%>";
	 requestParams.dashboardConfigQry = "<%=dashboardConfigQry%>";
	 requestParams.customDashboardText = "<%=egMappingInfo.getTextDescription("monitor.dashboard.Dashboard Settings")%>";
	var testStatusInfoTitle="<egui:intnl text='monitor.dashboard.Component Details'/>";
	var testStatusInfoT1="<egui:intnl text='monitor.common.Measure'/>";
	var testStatusInfoT2="<egui:intnl text='monitor.common.Max/Min'/>";
	var testStatusInfoT3="<egui:intnl text='monitor.common.Critical'/>";
	var testStatusInfoT4="<egui:intnl text='monitor.common.Major'/>";
	var testStatusInfoT5="<egui:intnl text='monitor.common.Minor'/>";
	var testStatusInfoT6="<egui:intnl text='monitor.common.Alarm policy'/>";
	var testStatusInfoT7="<egui:intnl text='monitor.common.Measures without Thresholds'/>";

		var alarmDetailsTitle1="<egui:intnl text='monitor.common.Alarm Details'/>";
		var alarmDetailsTitle2="<egui:intnl text='monitor.common.Event Details'/>";
		var alarmDetailsT1="<egui:intnl text='monitor.common.Description'/>";
		var alarmDetailsT2="<egui:intnl text='monitor.common.Start Time'/>";
		var alarmDetailsT3="<egui:intnl text='monitor.common.User'/>";
		var alarmDetailsT4="<egui:intnl text='monitor.common.Time of Acknowledgement'/>";
		var serviceLbl="<egui:intnl text='monitor.common.service'/>";
		var assetInfoLbl="<egui:intnl text='monitor.common.Asset Info'/>";
		var remoteControlLbl="<egui:intnl text='monitor.common.Remote Control'/>";
		var detailInfoLbl="<egui:intnl text='monitor.common.Detail Info'/>";
		var stackTraceLbl="<egui:intnl text='monitor.common.Stack Trace'/>";
		var infoLbl="<egui:intnl text='monitor.common.Info'/>";
		var helpLbl="<egui:intnl text='monitor.common.Help'/>";
		var extMonitorsLbl="<egui:intnl text='monitor.common.External Monitors:'/>";
		var virTopoLbl="<egui:intnl text='monitor.common.Virtual Topology'/>";
		var HisofAlarmsLbl="<egui:intnl text='monitor.common.History of Alarms'/>";
		var rumDashBoardLbl="<egui:intnl text='monitor.common.Rum DashBoard'/>";
		var settingsLbl="<egui:intnl text='monitor.common.Settings'/>";
		var configLbl="<egui:intnl text='monitor.common.Config'/>";
		var serverLbl="<egui:intnl text='monitor.common.Server'/>";
		var topologyLbl="<egui:intnl text='monitor.common.Topology'/>";
		var desktopLbl="<egui:intnl text='monitor.common.Desktop'/>";
		var moreDetLbl="<egui:intnl text='monitor.common.More details'/>";
		var lastTwoFourLbl="<egui:intnl text='monitor.common.DURING LAST 24 hrs'/>";
		var configChangeLbl="<egui:intnl text='monitor.common.CONFIGURATION CHANGES FOR '/>";
		var transactionsLbl="<egui:intnl text='monitor.common.Transactions'/>";
		var emulTransLbl="<egui:intnl text='monitor.common.Emulated Transactions'/>";
		var NetReqFlowLbl="<egui:intnl text='monitor.common.Netscaler Request Flow'/>";
		var fusionChartsApiEnabled=eval('<%=isFusion%>');
	
	
	// RUM App Flow Back Handling..
	requestParams.isFrom="<%=isFrom%>";
	requestParams.activeView="<%=activeView%>";
	//Metrics View Back handling start
	requestParams.isfromCitrix="<%=isfromCitrix%>";
	requestParams.isfromRum="<%=isfromRum%>";
	requestParams.isFromZone="<%=isFromZone%>";
	requestParams.iszoneName="<%=iszoneName%>";
	//requestParams.parentZone="<%=parentZone%>";
	requestParams.appliesTo="<%=appliesTo%>";
	requestParams.selectedRum="<%=selectedRum%>";
	requestParams.fromServiceHomePage="<%=fromServiceHomePage%>";
	requestParams.fromSerComboChange="<%=fromSerComboChange%>";
	requestParams.iniName="<%=iniName%>";
	requestParams.dashboard_mapping="<%=dashboard_mapping%>";
	requestParams.dashboard_name="<%=dashboard_name%>";
	requestParams.userBased="<%=userBased%>";
	requestParams.user_name="<%=user_name1%>";
	requestParams.view_name="<%=view_name%>";
	requestParams.isRumTitle="<%=isRumTitle%>";

	requestParams.manyComponentTypes="<%=manyComponentTypes%>";
	requestParams.manyComponentTitle="<%=manyComponentTitle%>";
	requestParams.selTypeString="<%=selTypeString%>";
	requestParams.searchStateString="<%=searchStateString%>";
	requestParams.searchNameString="<%=searchNameString%>";
	requestParams.searchIndComps="<%=searchIndComps%>";

	
	requestParams.service_aggregate="<%=service_aggregate%>";
	requestParams.simulationName="<%=simulationName%>";
	requestParams.service_system="<%=service_system%>";
	requestParams.service_component="<%=service_component%>";
	requestParams.service_Topology="<%=service_Topology%>";
	requestParams.virtualTopology="<%=virtualTopology%>";
	requestParams.isToLayerModel="<%=isToLayerModel%>";
	requestParams.fromCompGroup="<%=fromCompGroup%>";
	requestParams.group="<%=group%>";
	requestParams.segmentName="<%=segmentName%>";	
	requestParams.msmt_host="<%=msmt_host%>";
	var parentZone = '<%=parentZone%>';
	var isLogonType = '<%=isLogonType%>';
	var fromHomepage = '<%=fromHomepage%>';
	var zoneName = '<%=zoneName%>';
	var isFromInfraHome = '<%=isFromInfraHome%>';
	var isFromZoneInfra = '<%=isFromZoneInfra%>';
	var zoneAggregate = '<%=zoneAggregate%>';
	var isFromServiceMenu = '<%=isFromServiceMenu%>';
	var isFromZoneMain = '<%=isFromZoneMain%>';
	var isFromZoneMenu = '<%=isFromZoneMenu%>';
	var isFromServiceGroup = '<%=isFromServiceGroup%>';
	var fromMenu = '<%=fromMenu%>';

	var isFromSessionSim = '<%=isFromSessionSim%>';
	var isFromSessionToplogy = '<%=isFromSessionToplogy%>';
	var isFromMetricsPage = '<%=isFromMetricsPage%>';
	var isFromList = '<%=isFromList%>';
	var isRumLogon = '<%=isRumLogon%>';
	var isCitrixLogon = '<%=isCitrixLogon%>';
	var virtualIconBack = '<%=virtualIconBack%>';
	
	//Metrics View Back handling ends
	var rumAppBackObject = new Object();
	rumAppBackObject.iniName="<%=iniName%>";
	rumAppBackObject.userBased="<%=userBased%>";
	rumAppBackObject.fromMenu="<%=fromMenu%>";
	rumAppBackObject.showConfig="<%=showConfig%>";
	rumAppBackObject.iniName="<%=iniName%>";
	rumAppBackObject.dashboard_name="<%=dashboard_name%>";
	rumAppBackObject.appliesTo="<%=appliesTo%>";
	rumAppBackObject.isBackFromRUM="<%=isBackFromRUM%>";
	var probsErrorMessage = '<egui:intnl text="admin.error.Problem encountered while loading the user interface"/>.';
	var requestTimeOut = '<egui:intnl text="admin.error.Response timed out"/>.';
	var errorTitle = '<egui:intnl text="admin.user.Error"/>';

</script>

<!--<link rel="stylesheet" href="../resources/css/ext-eg.css" />
<link rel="stylesheet" href="../styles/ext-custom-com.css" />
<link rel="stylesheet" href="../styles/egIcons.css" /> -->

<link type="text/css" href="../styles/jscrollpane/jquery.jscrollpane.css" rel="stylesheet" media="all" />


<script language="JavaScript1.2" src="/final/Highcharts/js/highstock.js"></script>
<script src="/final/Highcharts/js/highcharts-more.js"></script>
<script src="/final/Highcharts/js/solid-gauge.src.js"></script>
<style>
	#threadnameSelect ul {
		display:grid;
	}

	#body_bg1 .x-tip {
		width:auto !important;
	}
</style>

<!-- <script type="text/javascript" src="/final/FusionCharts/scripts/FusionCharts.js"></script> -->
<script src="../monitor/eg_scripts/EgHighChart.js"></script>
<link type="text/css" href="/final/styles/jcarousel.responsive.css" rel="stylesheet" media="all" />
<egui:loadApp baseDir="/final/monitor/eg_scripts" appName="componentDashboard" appFile="componentDashboard.js" />
<script type="text/javascript">

	function showMoreInfos(url,event)
	{
		//var descComparisionUrl = url.substring(url.indexOf('?')+1);
		if(url!=null && url.indexOf("?")<0)
		{
			var descComparisionUrl = url;
			if(!window.moreinfos)
			{
				moreinfos = window.openWindow('/final/monitor/EgMoreInfosApp.jsp?'+descComparisionUrl+"&page=More Infos","MoreInfos","toolbar=no,menubar=no,location=no,status=no,width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,screenx=0,screeny=0,resizable=yes");
			}
			else
			{
				if(window.moreinfos != null)
				{
					moreinfos = null;
				}
				
				moreinfos = window.openWindow('/final/monitor/EgMoreInfosApp.jsp?'+descComparisionUrl+"&page=More Infos","MoreInfos","toolbar=no,menubar=no,location=no,status=no,width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,screenx=0,screeny=0,resizable=yes");
			}
			event.stopPropagation();
			moreinfos.focus();
		}
		else
		{
			var descComparisionUrl = url.substring(url.indexOf('?')+1);
			if(!window.desccomp)
			{
				desccomp = window.openWindow('/final/monitor/descComparisonApp.jsp?'+descComparisionUrl,"Comparison","toolbar=no,menubar=no,location=no,status=no,width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,screenx=0,screeny=0,resizable=yes");
			}
			else
			{
				if(window.desccomp != null)
				{
					desccomp = null;
				}
				
				desccomp = window.openWindow('/final/monitor/descComparisonApp.jsp?'+descComparisionUrl,"Comparison","toolbar=no,menubar=no,location=no,status=no,width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,screenx=0,screeny=0,resizable=yes");
			}
			event.stopPropagation();
			desccomp.focus();
		}
		return false;
	}

	function showDescriptorComparison(url,event)
	{
		var descComparisionUrl = url.substring(url.indexOf('?')+1);
		if(!window.desccomp)
		{
			desccomp = window.openWindow('/final/monitor/descComparisonApp.jsp?'+descComparisionUrl,"Comparison","toolbar=no,menubar=no,location=no,status=no,width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,screenx=0,screeny=0,resizable=yes");
		}
		else
		{
			if(window.desccomp != null)
			{
				desccomp = null;
			}
			
			desccomp = window.openWindow('/final/monitor/descComparisonApp.jsp?'+descComparisionUrl,"Comparison","toolbar=no,menubar=no,location=no,status=no,width=1012,height=603,left=0,top=105,scrollbars=1,scrollbars=yes,screenx=0,screeny=0,resizable=yes");
		}
		event.stopPropagation();
		desccomp.focus();
	}
	function openRemoteControl(url)
	{
		var agentIP;
		if(url.indexOf("ipaddress=")>-1){
			agentIP = url.substr(url.indexOf("ipaddress=")+10);
			if(agentIP.indexOf("&")>-1){
				agentIP= agentIP.substr(0,agentIP.indexOf("&"));
			}
		}
		var fontColorCode =(serverdashboard_skin=="Light")?"#6c6c6c":"#7d7d7d";
		var rca=Ext.widget("window",{
			extend: 'utilities.OuterPanel',
			title: '<egui:intnl text="admin.common.Remote Control Actions"/>',
			id:'remoteControl',
			height: '90%',
			width: '90%',
			resizable:false,
			border:false,
			modal: true,
			bodyPadding:0,
			padding:'4 10 10 10',
			ghost:false,
			closeAction:'destroy',
			modal:true,
			html: '<iframe src='+url+' frameborder="0" width="100%" height="100%" ></iframe>',
			listeners:{
				show: function(win) {
					if (this.modal) {
						var doms = Ext.dom.Query.select('.x-mask'); 
						for (var key in doms)
						{
							this.dom=doms[key];
							if (!Ext.isEmpty(this.dom.offsetParent))
							{
								if (this.dom.offsetParent.tagName=='BODY')
								{
									Ext.fly(this.dom).addCls('windowModal');
								}
							} 
						} 
					}
				},
				hide:  function(win) {
					if (this.modal) { 
						Ext.fly(this.dom).removeCls('windowModal');
					}
				},
				destroy:  function(win) {
					Ext.Ajax.request({
						url : "/final/monitor/RemoteControlActionUtils.jsp?action=delete&agentIP="+agentIP,
						method : 'POST',
						scope:this,
						success: function(response)
						{
							//alert("deleted");	
						},
						failure:function()
						{
						}
					});
				}
			},
		}).show();
	}
	function gotoTopology(url){
		var uio = url+"&fromPage="+"<%=fromPage%>";
		window.location = uio;
	}
	function goToLiveGraph(url)
	{
		window.openWindow(url,"VMLiveGraph","toolbar=no,menubar=no,location=no,scrolling=yes,status=no,width=1012,height=660,left=0,top=0,screenx=0,screeny=0,resizable=yes");
	}

	function setHighChart(url,divId,height,width,maxURL,isAxisTimeReq,legendPos,isMaximizedView,chartType)
	{
		Ext.onReady(function() 
		{
			var containerId = divId;
			var containerObj = '';
			var errMsg = '';
			if (isMaximizedView)
			{
				containerObj=Ext.get(containerId);
				errMsg = '<table width="100%" height="450px"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>';
			}
			else
			{
				containerObj=Ext.getCmp(containerId);
				errMsg = '<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>';
			}
			if(!Ext.isEmpty(url))
			{
				Ext.Ajax.request(
				{
					url : url,
					scope:this,
					success: function(response) 
					{
						containerObj=Ext.getCmp(containerId);
						if ( response.status == 200 && !Ext.isEmpty( response.responseText ) )
						{
							var tmpJsonTxt=response.responseText;							
							
							if ( tmpJsonTxt.indexOf('png') == -1 && tmpJsonTxt.indexOf('PNG') == -1 && tmpJsonTxt.indexOf('gif') == -1 && tmpJsonTxt.indexOf('GIF') == -1 && (tmpJsonTxt.indexOf('iconExclamation') == -1 && tmpJsonTxt.indexOf('iconInformation') == -1) && tmpJsonTxt.indexOf('<div') == -1)
							{
								var chartData=Ext.decode(tmpJsonTxt);							
								if(chartData!=null && chartData.hasOwnProperty('DataSet'))
								{
									try
									{
										var lineChart = {};	
										/*if(chartType!=null && chartType=="area")
										{
											lineChart = jQuery.extend(true, {}, getHighStockAreaChartForMyDashboard(containerId,height,width,maxURL,chartData['DataSet']), lineChart);
										}*/
									/*	else
										{*/
											lineChart = jQuery.extend(true, {}, getHighCharts(containerId,height,width,maxURL), lineChart);
										//}
										if (!isMaximizedView && chartData.hasOwnProperty('title'))
										{
											chartData.title='';
										}
										
										lineChart.setData(chartData,'<%=mgrDateFormat%>',maxURL,isAxisTimeReq,legendPos);
										lineChart.drawChart();
									}
									catch (e)
									{
										alert("exception in highchart method::"+e)
									}
								}
								else
								{								
									containerObj.update('<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
								}
							}
							else
							{		
								containerObj.update(tmpJsonTxt);
								//containerObj.update('<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconExclamation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
							}
						}
					}
				});
			}
		});
	}
	function setAreaHighChart(url,divId,legendId,height,width,maxURL,isAxisTimeReq,legendPos,isMaximizedView,chartType,view,my_id)
	{
		Ext.onReady(function() 
		{
			var containerId = divId;
			var containerObj = '';
			var errMsg = '';
			if (isMaximizedView)
			{
				containerObj=Ext.get(containerId);
				errMsg = '<table width="100%" height="450px"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>';
			}
			else
			{
				containerObj=Ext.getCmp(containerId);
				errMsg = '<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>';
			}
			if(!Ext.isEmpty(url))
			{
				Ext.Ajax.request(
				{
					url : url,
					scope:this,
					success: function(response) 
					{						
						containerObj=Ext.getCmp(containerId);
						if ( response.status == 200 && !Ext.isEmpty( response.responseText ) )
						{							
							var tmpJsonTxt=response.responseText;
							if ( tmpJsonTxt.indexOf('png') == -1 && tmpJsonTxt.indexOf('PNG') == -1 && tmpJsonTxt.indexOf('gif') == -1 && tmpJsonTxt.indexOf('GIF') == -1 && (tmpJsonTxt.indexOf('iconExclamation') == -1 && tmpJsonTxt.indexOf('iconInformation') == -1) && tmpJsonTxt.indexOf('<div') == -1)
							{
								var chartData=Ext.decode(tmpJsonTxt);							
								if(chartData!=null && chartData.hasOwnProperty('DataSet'))
								{
									var liveMeasHtml = "";
									var dataSetObj = chartData['DataSet'];
									if ((dataSetObj != null && !Ext.isEmpty(dataSetObj))) 
									{
										if(view!=null && view=="protocol")
										{
											liveMeasHtml += '<div class="chartCount"  style="position:relative;z-index:88;margin-top:0px"><div class="inner">';
											liveMeasHtml += '<ul>';
											for ( var dObj in dataSetObj) 
											{
												var seriesObj = dataSetObj[dObj];
												if (seriesObj != null && seriesObj.hasOwnProperty('dispLegend')) 
												{												
													var legndName = seriesObj['dispLegend'];
													
													var measVal = seriesObj['measVal'];
													if(measVal!=null && measVal!="NA")
													{
														var layerModelUrl = seriesObj['layerModelUrl'];
														var legndColor=seriesObj['color'];
														var unitForMeas=seriesObj['unit'];
														liveMeasHtml += '<li style="display:block">';
														liveMeasHtml += '<div style="margin-top:-8px;float:left"><span class="chartLegend" style="color:'+legndColor+'">.</span>';
														var legend_store = legndName;
														if(legend_store.length > 8){
															var legndName = legndName.substr(0,6)+'...';
														}
														if(legndName!=null && legndName!="-" && measVal!=null && measVal!="-")
														{
															liveMeasHtml += '<a  href=\'javascript:wayToLayerModelForArea("' + encodeURIComponent(layerModelUrl) + '")\'><span class="status font_bold" data-qtip="'+legend_store+'&nbsp('+unitForMeas+')&nbsp&nbsp'+measVal+'">'+legndName+'</span></a>';
														}
														else
														{
															liveMeasHtml += '<span class="status font_bold" data-qtip="'+legend_store+'&nbsp('+unitForMeas+')&nbsp&nbsp'+measVal+'">'+legndName+'</span>';
														}
														if(unitForMeas!=null && unitForMeas!="-" && measVal!=null && measVal!="-")
														{
															liveMeasHtml += '<a href=\'javascript:wayToLayerModelForArea("' + encodeURIComponent(layerModelUrl) + '")\'><span class="matric font_bold" data-qtip="'+legend_store+'&nbsp('+unitForMeas+')&nbsp&nbsp'+measVal+'"> ('+unitForMeas+')</span></a>';
														}
														else
														{
															liveMeasHtml += '<span class="matric font_bold" data-qtip="'+legend_store+'&nbsp('+unitForMeas+')&nbsp&nbsp'+measVal+'"> ('+unitForMeas+')</span>';
														}
														liveMeasHtml+='</div>';
														if(measVal!=null && measVal!="-" )
														{
															liveMeasHtml += '<div class="font_bold" style="padding-left:8px;float:left" data-qtip="'+legend_store+'&nbsp('+unitForMeas+')&nbsp&nbsp'+measVal+'"><a href=\'javascript:wayToLayerModelForArea("' + encodeURIComponent(layerModelUrl) + '")\'>'+measVal+'</a></div>';	
														}
														else
														{
															liveMeasHtml += '<div class="font_bold" style="padding-left:8px" data-qtip="'+legend_store+'&nbsp('+unitForMeas+')&nbsp&nbsp'+measVal+'">'+measVal+'</div>';
														}
														liveMeasHtml+='<div style="clear:both"></div>';
														liveMeasHtml+='</li>';
													}
												}
											}
											liveMeasHtml += '</ul>';
											liveMeasHtml += '</div></div>';
											Ext.defer(function(){
												Ext.getCmp(legendId).update(liveMeasHtml);	
											},250);
											
										}
										else if(view!=null && view=="overview")
										{
											liveMeasHtml += '<div class="chartCount" style="position:relative;z-index:88"><div class="inner">';
											liveMeasHtml += '<ul>';
											for ( var dObj in dataSetObj) 
											{
												var seriesObj = dataSetObj[dObj];
												if (seriesObj != null && seriesObj.hasOwnProperty('dispLegend')) 
												{												
													var legndName = seriesObj['dispLegend'];
													//legndName = '+serial_192.168.9.113';
													//legndName = legndName.substring(legndName.indexOf("-")+1);
													//console.log("legndName",legndName);
													var measVal = seriesObj['measVal'];
													if(measVal!=null && measVal!="NA")
													{
														var layerModelUrl = seriesObj['layerModelUrl'];
														var legndColor=seriesObj['color'];
														var unitForMeas=seriesObj['unit'];
														liveMeasHtml += '<li style="display:block;text-align: left;padding-left: 20px;">';
														liveMeasHtml += '<div style="margin-top:-8px;display:inline-block"><span class="chartLegend" style="color:'+legndColor+';display:inline-block !important;;">.</span>';
														var legend_store = legndName;
														/*if(legend_store.length > 6){
															var legndName = legndName.substr(0,6)+'...';
														}*/
														if(legndName!=null && legndName!="-" && measVal!=null && measVal!="-")
														{
															liveMeasHtml += '<a  href=\'javascript:wayToLayerModelForArea("' + encodeURIComponent(layerModelUrl) + '")\'><span  data-qtip="'+legend_store+'" class="status font_bold netflowLabel">'+legndName+'</span></a>';
														}
														else
														{
															liveMeasHtml += '<span class="status font_bold netflowLabel">'+legndName+'</span>';
														}
														/*if(unitForMeas!=null && unitForMeas!="-" && measVal!=null && measVal!="-")
														{
															liveMeasHtml += '<a href=\'javascript:wayToLayerModelForArea("' + encodeURIComponent(layerModelUrl) + '")\'><span class="matric font_bold"> ('+unitForMeas+')</span></a>';
														}
														else
														{
															liveMeasHtml += '<span class="matric font_bold"> ('+unitForMeas+')</span>';
														}*/
														liveMeasHtml+='</div>';
														if(measVal!=null && measVal!="-" )
														{
															liveMeasHtml += '<div class="font_bold netflowFont" style="text-align:center;padding:5px 0px 5px 8px;display:inline-block"><a href=\'javascript:wayToLayerModelForArea("' + encodeURIComponent(layerModelUrl) + '")\'>'+measVal+'</a></div>';	
														}
														else
														{
															liveMeasHtml += '<div class="font_bold netflowFont" style="padding-left:8px">'+measVal+'</div>';
														}
														
														liveMeasHtml+='</li>';
													}
												}
											}
											liveMeasHtml += '</ul>';
											liveMeasHtml += '</div></div>';
											//Ext.get(legendId).setHeight('')
											Ext.fly(legendId).update(liveMeasHtml);	
										}
										try
										{
											var lineChart = {};											
											lineChart = jQuery.extend(true, {}, getHighCharts(containerId,height,width,maxURL), lineChart);										
											if (!isMaximizedView && chartData.hasOwnProperty('title'))
											{
												chartData.title='';
											}
											
											lineChart.setData(chartData,'<%=mgrDateFormat%>',maxURL,isAxisTimeReq,legendPos);
											lineChart.drawChart();
										}
										catch (e)
										{
											alert("exception in highchart method::"+e)
										}
									}
									else
									{		
										if(view!=null && view=="overview")
										{
											var containerObj_1 = '';
											containerObj_1 = my_id;
											containerObj_1.removeAll();
											containerObj_1.update('<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
										}
										else if(view!=null && view=="protocol")
										{
											var containerObj_1 = '';
											containerObj_1 = my_id;
											containerObj_1.removeAll();
											//var containerObj_1 = Ext.getCmp('netProtoareablock0');
											//containerObj_1.removeAll();
											containerObj_1.update('<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
										}
									}									
								}
								else
								{		
									if(view!=null && view=="overview")
									{
										var containerObj_1 = '';
										containerObj_1 = my_id;
										containerObj_1.removeAll();
										containerObj_1.update('<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
									}
									else if(view!=null && view=="protocol")
									{
										var containerObj_1 = '';
										containerObj_1 = my_id;										
										containerObj_1.removeAll();
										//var containerObj_1 = Ext.getCmp('netProtoareablock0');
										//containerObj_1.removeAll();
										containerObj_1.update('<table width="100%" height="180px"><tr><td valign="middle" align="center"><div class="iconInformation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
									}
								}
							}
							else
							{
								var containerObj_1 = '';
								containerObj_1 = my_id;
								containerObj_1.removeAll();
								containerObj_1.update(tmpJsonTxt);
								/*if(view!=null && view=="overview")
								{
									var containerObj_1 = '';
									containerObj_1 = my_id;
									containerObj_1.removeAll();
									containerObj_1.update('<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconExclamation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
								}
								else if(view!=null && view=="protocol")
								{
									var containerObj_1 = '';
									containerObj_1 = my_id;
									containerObj_1.removeAll();
									//var containerObj_1 = Ext.getCmp('netProtoareablock0');
									//containerObj_1.removeAll();
									containerObj_1.update('<table width="100%" height="180px"><tr><td valign="middle" align="center"><div class="iconExclamation" ></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>');
								}*/
							}
						}
					}
				});
			}
		});
	}
	function parseScript(_source)
	{
		var source = _source;
		var scripts = new Array();
			
		// Strip out tags
		if(source != null && source != undefined)
		{
			while(source.indexOf("<script") > -1 || source.indexOf("</script") > -1) {
				var s = source.indexOf("<script");
				var s_e = source.indexOf(">", s);
				var e = source.indexOf("</script", s);
				var e_e = source.indexOf(">", e);			
				// Add to scripts array
				scripts.push(source.substring(s_e+1, e));
				// Strip from source
				source = source.substring(0, s) + source.substring(e_e+1);
			}
		}
		// Loop through every script collected and eval it
		for(var i=0; i<scripts.length; i++) {
			try {
				eval(scripts[i]);
			}
			catch(ex) {
				return;
			}
		}
		// Return the cleaned source
		return source;
	}
Ext.onReady(function(){
	//	Ext.state.Manager.setProvider(new Ext.state.LocalStorageProvider());
	
	 Ext.Ajax.on('requestexception', function (conn, response, options) {
		var errorStr = response.responseText;
		parseScript(errorStr);
		if (errorStr != undefined && errorStr != 'undefined' && errorStr.indexOf("customerror") != -1)
		{
			if (errorStr.indexOf("user-session-invalid") != -1)
			{
				callWindow(1);
			}
			else if (errorStr.indexOf("user-deleted") != -1)
			{
				callWindow(2);
			}
			else if (errorStr.indexOf("user-timedout") != -1)
			{
				callWindow(3);
			}
		}
		else
		{
			if (response.status == 302 || (response.timedout != undefined && response.timedout == true))
			{
				Ext.Msg.show({
					title : errorTitle,
					msg : requestTimeOut,
					buttons : Ext.Msg.OK,
					icon : 'iconError'
				});
			}
			else
			{
				console.log(response.responseText);
				Ext.Msg.show({
					title : errorTitle,
					msg : probsErrorMessage,
					buttons : Ext.Msg.OK,
					icon : 'iconError'
				});
			}
		}
	});

	initLdgMask = new Ext.LoadMask(Ext.getBody(),{msg : loadingLbl+"..."});
});
// for Measures Tab
	var noMeasures = '<egui:intnl text="monitor.vmmeasures.No measures available" />!';
		var newWindow = false;
		var win = null;
		function openHelpWin( link )
		{
			Ext.onReady(function(){
				var tmpURL = link;
				var URL = '';
				var params = '';
				var genQstr = '';
				if ( !Ext.isEmpty( tmpURL ) )
				{
					if ( tmpURL.indexOf('?') > -1 )
					{
						URL = tmpURL.substring(0, tmpURL.indexOf('?'));
						params = tmpURL.substring( tmpURL.indexOf('?') + 1 );
					}
					else
					{
						URL = tmpURL;
					}
				}
				if ( !Ext.isEmpty( params ) )
				{
					var split = params.split('&');
					for ( var i = 0; i < split.length ; i++ )
					{
						var text = split[i].replace('=', '|equal|');
						if ( i == split.length - 1 )
						{
							genQstr += text;
						}
						else
						{
							genQstr += text+'|amp|';
						}
					}
				}
				Ext.widget('window', {
					title: 'Help',
					resizable:false,
					width:1000,
					frame:false,
					constrain:true,
					height:550,
					scroll:false,
					autoScroll:false,
					border:false,
					layout:'fit',
					padding:'0 0 0 0',
					margin:'0 10 0 0',
					html:'<iframe width="100%" height="100%" scrolling="no" frameborder="0" src="/final/eghelp/EgHelpApp.jsp?forwardPage='+URL+'&params='+genQstr+'"></iframe>'
				}).show()
			});
		}
	
		function openInfoLink( link )
		{
			testStatusInfoTitle="<egui:intnl text='monitor.dashboard.Test Status Details'/>";
			/*Ext.widget('window', {
							title: 'Test Measure Status Info',
							resizable:false,
							width:1000,
							frame:false,
							constrain:true,
							height:550,
							scroll:false,
							autoScroll:false,
							border:false,
							layout:'fit',
							padding:'0 0 0 0',
							margin:'0 10 0 0',
							html:'<iframe width="100%" height="100%" scrolling="no" frameborder="0" src="'+link+'"></iframe>'
						}).show();*/
			Ext.onReady(function(){
				testInfoGlobalURL = link;
				componentDashboard.app.getController('VirtualController').openTestInfoWindow(link);
			});
		}
		function chekWindow(QueryString,windowName)
		{
			Ext.onReady(function(){
				newWindow = true;
				var isNewWindow = newWindow;
				if(isNewWindow && QueryString!=null && QueryString.indexOf("/final/monitor/EgSiteInfraView.jsp")>-1)
				{
					isNewWindow=null;
				}
				QueryString = QueryString+"&newWindow="+isNewWindow+"&fromPage=measures";//modified on 17/10/07
				if(windowName=="TESTSTATUSINFOWINDOW" || windowName=="HelpWindow")
				{
					if(windowName=="TESTSTATUSINFOWINDOW")
					{
						windowName = 'Test Measure Status Info';
					}
					if(win==null)
					{
					  win = window.openWindow(QueryString,windowName,'toolbar=no,menubar=no,location=no,status=no,width=980,height=603,left=0,top=105,screenx=0,screeny=0,scrollbars=yes,resizable=no');
						win.focus();
						/*Ext.widget('window', {
							title: windowName,
							resizable:false,
							width:1000,
							frame:false,
							constrain:true,
							height:550,
							scroll:false,
							autoScroll:false,
							border:false,
							layout:'fit',
							padding:'0 0 0 0',
							margin:'0 10 0 0',
							html:'<iframe width="100%" height="100%" scrolling="no" frameborder="0" src="'+QueryString+'"></iframe>'
						}).show();*/
					}
					else if(win!=null)
					{
						win.close();
						win=null;
						win = window.openWindow(QueryString,windowName,'toolbar=no,menubar=no,location=no,status=no,width=980,height=603,left=0,top=105,screenx=0,screeny=0,scrollbars=yes,resizable=no');
						win.focus(); 
						/*Ext.widget('window', {
							title: windowName,
							resizable:false,
							width:1000,
							frame:false,
							constrain:true,
							height:550,
							scroll:false,
							autoScroll:false,
							border:false,
							layout:'fit',
							padding:'0 0 0 0',
							margin:'0 10 0 0',
							html:'<iframe width="100%" height="100%" scrolling="no" frameborder="0" src="'+QueryString+'"></iframe>'
						}).show();*/
					}
				}
				else
				{
					if(isNewWindow!=null && isNewWindow!='undefined' && isNewWindow)
					{
						if(win==null)
						{
							win = window.openWindow(QueryString,windowName,'toolbar=no,menubar=no,location=no,status=no,width=980,height=603,left=0,top=105,screenx=0,screeny=0,scrollbars=no,resizable=no');
							win.focus();
							/*Ext.widget('window', {
								title: windowName,
								resizable:false,
								width:1000,
								frame:false,
								constrain:true,
								height:550,
								scroll:false,
								autoScroll:false,
								border:false,
								layout:'fit',
								padding:'0 0 0 0',
								margin:'0 10 0 0',
								html:'<iframe width="100%" height="100%" scrolling="no" frameborder="0" src="'+QueryString+'"></iframe>'
							}).show();*/
						}
						else if(win!=null)
						{
							win.close();
							win=null;
							win = window.openWindow(QueryString,windowName,'toolbar=no,menubar=no,location=no,status=no,width=980,height=603,left=0,top=105,screenx=0,screeny=0,scrollbars=no,resizable=no');
							win.focus();
							/*Ext.widget('window', {
								title: windowName,
								resizable:false,
								width:1000,
								frame:false,
								constrain:true,
								height:550,
								scroll:false,
								autoScroll:false,
								border:false,
								layout:'fit',
								padding:'0 0 0 0',
								margin:'0 10 0 0',
								html:'<iframe width="100%" height="100%" scrolling="no" frameborder="0" src="'+QueryString+'"></iframe>'
							}).show();*/
						}
					}
					else
					{
						window.location.href=QueryString;
					}
				}
			});
		}
</script>
<Script>

var onSystemComboChangeUrl="";
var onNetworkComboChangeUrl="";
var networkComboValue="";
var systemComboValue="";
var vmComboValue = "";
var isDouble = <%=isDouble%>;
function bigHighChart(url,divId,height,width,maxURL,isAxis,legendP,legfrVTab,clusterView)
{
	if(maxURL.indexOf("hasTitle") > -1)
	{
		var maxUrlValue = maxURL.substring(0,maxURL.indexOf("^eg^"));
		bigHighChartView(url,divId,height,width,maxUrlValue,isAxis,legendP,true,legfrVTab,clusterView);
	}
	else
		bigHighChartView(url,divId,height,width,maxURL,isAxis,legendP,false,legfrVTab,clusterView);
}

function bigHighChartView(url,divId,height,width,maxURL,isAxis,legendP,hasTitle,legfrVTab,clusterView)
{
	Ext.onReady(function() 
	{
		var isAxisTimeReq = isAxis;
		var legendPos = legendP;
		if(maxURL == "close")
		{
			isAxisTimeReq = true;
			legendPos = "right";
		}
		var containerId = divId;
		var containerObj=Ext.get(containerId);
		//alert("insideView containerObj ---->"+containerObj);
		//alert("insideView maxURL ---->"+maxURL);
		//var errMsg = "<table border='0' height='100%' width='100%'><tr><td align='center'><img src='/final/monitor/eg_images/gray/graph_error_message.gif'></td></tr></table>";
		var errMsg = '<center><div style="margin:12% 0 auto 0"><img class="iconInformation" src="/final/images/spacer.gif"/><div >No measures available</div></div></center>';
		if(!Ext.isEmpty(url))
		{
			Ext.Ajax.request(
			{
				url : url,
				async: false,
				scope:this,
				success: function(response) 
				{
					if(response.status == 200 && !Ext.isEmpty(response))
					{
						var jsonText = response.responseText;
						jsonText=Ext.String.trim(jsonText);
						
						if(jsonText != null && jsonText != 'null' && jsonText != 'undefined' && jsonText != undefined && (!Ext.isEmpty(jsonText)))
						{
							var chartData=Ext.decode(jsonText);
							try
							{
								var lineChart = {};
								chartData['enableTitle']=hasTitle;
								chartData['fromVirtual']=true;
								if(legfrVTab != undefined && legfrVTab == 'up')
									chartData['legVerAlign'] = true;
								else
									chartData['legVerAlign'] = false;

								if(legfrVTab != undefined && legfrVTab == 'upper')
									chartData['legVerAlignWBottom'] = true;
								else
									chartData['legVerAlignWBottom'] = false;								
								
								if(clusterView != undefined && clusterView == 'true')
									chartData['clusterView'] = true;
								else
									chartData['clusterView'] = false;

								lineChart = jQuery.extend(true, {}, getHighCharts(containerId,height,width,maxURL), lineChart);
								lineChart.setData(chartData,'<%=dateFormatForDatePicker%>',maxURL,isAxisTimeReq,legendPos);
								lineChart.drawChart();
							}
							catch (e)
							{
								alert("e::"+e)
							}
						}
						else
							Ext.get(containerId).update(errMsg);
					}
					else
						Ext.get(containerId).update(errMsg);
				}
			});
		}
		else
		{
			Ext.get(containerId).update(errMsg);
		}
	});
}
//layer model link
var layerModelURL = null;
function wayToLayerModel(dashLayerUrl)
{
	Ext.onReady(function(){
		//var dashLayerUrl = layerModelURL[layerId];

		if(dashLayerUrl!=null && dashLayerUrl.indexOf("?")>0)
		{
			dashLayerUrl = dashLayerUrl.substring(dashLayerUrl.indexOf("?")+1);
		}
		window.location.href="/final/servlet/com.eg.EgDashboardController?from=list&"+dashLayerUrl+"&newWindow=false&tab=LayerModel&toDashBoardLayer=true";		
	});	
}
function wayToLayerModelForArea(layerUrl)
{
	Ext.onReady(function(){		
		if(layerUrl!=null && layerUrl.indexOf("?")>0)
		{
			layerUrl = layerUrl.substring(layerUrl.indexOf("?")+1);
		}
		window.location.href="/final/servlet/com.eg.EgDashboardController?from=list&"+layerUrl+"&newWindow=false&tab=LayerModel&toDashBoardLayer=true";		
	});	
}
function wayToLayerModelForNetflowsProtocols(layerUrl)
{
	Ext.onReady(function(){
		window.location.href=layerUrl+"&newWindow=false";		
	});	
}
function showMaximizedView(url)
{
	componentDashboard.app.getController("SystemController").DialChartFullView(url);
}
var graphUrl = null;
var netgraphUrl = null;
var sysgraphUrl = null;
var comboChangeURL = '';
var ddLinkURL = '';
function ddOnclick(idxp)  //Bar graph -->DD
{
	Ext.onReady(function(){		
		if(selectedTab.toLowerCase() == 'application')
		{
			var grpURL = graphUrl[idxp];		
			componentDashboard.app.getController("ApplicationController").ddOnclick(grpURL);			
		}
		else if (selectedTab.toLowerCase() == 'network')
		{
			var grpURL = netgraphUrl[idxp];	
			componentDashboard.app.getController("NetworkController").ddOnclick(grpURL);
		}
		else if (selectedTab.toLowerCase() == 'system')
		{
			var grpURL = sysgraphUrl[idxp];	
			componentDashboard.app.getController("SystemController").ddOnclick(grpURL);
		}
	});
}
function setDDDataURL(url)
{
	ddLinkURL = url;
}
function openDDInNewWin(qstr)
{
	qstr = qstr+'&isglobalsearchType=dd';
	window.open(qstr,'GRAPHS','toolbar=no,menubar=no,location=no,status=no,width=1014,height=603,left=0,top=80,screenx=0,screeny=0,resizable=yes,scrollbars=yes'); 
}
function comparisionBarOnclick(idxp)   // //Bar graph -->comparision
{	
	Ext.onReady(function(){
		if(selectedTab.toLowerCase() == 'application')
		{
			var grpURL = graphUrl[idxp];
			componentDashboard.app.getController("ApplicationController").comparisionBarOnclick(grpURL);	
		}
		else if(selectedTab.toLowerCase() == 'network')
		{
			var grpURL = netgraphUrl[idxp];	
			componentDashboard.app.getController("NetworkController").comparisionBarOnclick(grpURL);
		}
		else if(selectedTab.toLowerCase() == 'system')
		{
			var grpURL = sysgraphUrl[idxp];	
			componentDashboard.app.getController("SystemController").comparisionBarOnclick(grpURL);
		}
	});
}
function trendGraphOnclick(idxp)  
{
	Ext.onReady(function(){		
		if(selectedTab.toLowerCase() == 'application')
		{
			var grpURL = graphUrl[idxp];
			componentDashboard.app.getController("ApplicationController").trendGraphOnclick(grpURL);	
		}
		else if (selectedTab.toLowerCase() == 'network')
		{
			var grpURL = netgraphUrl[idxp];	
			componentDashboard.app.getController("NetworkController").trendGraphOnclick(grpURL);
		}
		else if (selectedTab.toLowerCase() == 'system')
		{
			var grpURL = sysgraphUrl[idxp];	
			componentDashboard.app.getController("SystemController").trendGraphOnclick(grpURL);
		}
	});
}
function summaryGraphOnclick(idxp)
{
	Ext.onReady(function(){
		if(selectedTab.toLowerCase() == 'application')
		{
			var grpURL = graphUrl[idxp];
			componentDashboard.app.getController("ApplicationController").summaryGraphOnclick(grpURL);	
		}
		else if (selectedTab.toLowerCase() == 'network')
		{
			var grpURL = netgraphUrl[idxp];	
			componentDashboard.app.getController("NetworkController").summaryGraphOnclick(grpURL);
		}
		else if (selectedTab.toLowerCase() == 'system')
		{
			var grpURL = sysgraphUrl[idxp];	
			componentDashboard.app.getController("SystemController").summaryGraphOnclick(grpURL);
		}
	});
}

function component_layer_model_page(siteStr,ctypeStr,hostStr)
{
	Ext.onReady(function(){
		window.location.href="/final/servlet/com.eg.EgDashboardController?site="+encodeURIComponent(siteStr)+"&from=list&comptype="+encodeURIComponent(ctypeStr)+"&host="+encodeURIComponent(hostStr)+"&tab=LayerModel";
	});
}
function MeasureGraphOnClick(url)
{
	Ext.onReady(function(){
		if(selectedTab.toLowerCase() == 'application')
		{
			componentDashboard.app.getController("ApplicationController").MeasureGraphOnClick(url);	
		}
		else if (selectedTab.toLowerCase() == 'network')
		{
			componentDashboard.app.getController("NetworkController").MeasureGraphOnClick(url);
		}
		else if (selectedTab.toLowerCase() == 'system')
		{
			componentDashboard.app.getController("SystemController").MeasureGraphOnClick(url);
		}
	});
}
function AreaGraphOnClick(url)
{
	if(selectedTab.toLowerCase() == 'interfaces')
	{
		componentDashboard.app.getController("InterfaceController").AreaGraphOnClick(url);
	}
	else if(selectedTab.toLowerCase() == 'network' && (isIncludedNetflowDeviceAvailable || isExcludedNetflowDeviceAvailable))
	{
		componentDashboard.app.getController("NetworkController").AreaGraphOnClick(url);
	}
}
function sparklineOnclick(idxp)
{

	Ext.onReady(function(){		
		if(selectedTab.toLowerCase() == 'application')
		{
			var grpURL = graphUrl[idxp];
			componentDashboard.app.getController("ApplicationController").MeasureGraphOnClick(grpURL);	
		}
		else if (selectedTab.toLowerCase() == 'network')
		{
			var grpURL = netgraphUrl[idxp];	
			componentDashboard.app.getController("NetworkController").MeasureGraphOnClick(grpURL);
		}
		else if (selectedTab.toLowerCase() == 'system')
		{
			var grpURL = sysgraphUrl[idxp];	
			componentDashboard.app.getController("SystemController").MeasureGraphOnClick(grpURL);
		}
	});	
}
function sparklineOnclickForJavaThread(url,timeVal)
{
	Ext.onReady(function(){
		componentDashboard.app.getController("ApplicationController").showThreadDetails(url,timeVal);
	});	
}
//Asset info popup window in Layer page.
function loadPopup(qUrl)
{
	if(!Ext.isEmpty(qUrl))
	{
		if(qUrl.indexOf('egShowAssetInformation') > -1)
		{
			var asmPopupWindow = window.parent.loadPopup();//loadPopup() function is available inside final\egIndex.jsp;
			if(asmPopupWindow) {
				asmPopupWindow.removeAll();
				asmPopupWindow.add({
					xtype: "component",
					width: '100%',
					cls: 'outerpanel',
					autoScroll: true,
					scroll: true,
					border: false,
					id: 'assertPopup',
					autoEl: {
							tag: "iframe",
							src: encodeURI(qUrl)	// Reffers egShowAssetInformation.jsp  
							}
				});
				asmPopupWindow.show();
			} else {
				//console.log('Some problem while loading loadPopup() function inside final\egIndex.jsp');
			}
		} 
	}
}
function showAlert(event,msg,measure_desc)
{
	var alertDiv=document.getElementById("alertDiv");
	if(alertDiv!=null) {
		if(navigator.appName=="Microsoft Internet Explorer") {
			event=window.event;
		}
		var	windowHeight=document.body.clientHeight+document.body.scrollTop-90;
		var windowWidth=document.body.clientWidth+document.body.scrollLeft-330;
		var	divLocation=event.clientY+document.body.scrollTop;
		var	clickLocation=event.clientX+document.body.scrollLeft;
		if(clickLocation>windowWidth) {
			alertDiv.style.left=clickLocation-330;
		}
		else {
			alertDiv.style.left=(event.clientX)+document.body.scrollLeft;
		}
		if(divLocation>windowHeight) {
			alertDiv.style.top=divLocation-120;
		}
		else {
			alertDiv.style.top=(event.clientY)+document.body.scrollTop;
		}
		alertDiv.style.visibility='visible';
		alertDiv.style.display='block';

		var from = msg.substring(msg.indexOf("From :")+6, msg.indexOf("To :"));
		var to = msg.substring(msg.indexOf("To :")+4);
		msg=msg.substring(0,msg.indexOf("From :"));
		msg = replaceAll(msg,'0.0000','0');
		msg = replaceAll(msg,'.0000','');
		var temp = msg.split(',');

		var mtable=null;
		if(msg.indexOf('|')>-1)
		{
			var col_1 = measure_desc.substring(0,measure_desc.indexOf(","));
			var col_2 = measure_desc.substring(measure_desc.indexOf(",")+1);
			var head_1 = col_1.substring(0,col_1.indexOf("("));
			var head_2 = col_2.substring(0,col_2.indexOf("("));
			mtable ='<div class="plainTable" style="width:100%"><table cellspacing="0" cellpadding="0" border="0" width="100%"><thead><tr><th colspan="2" class="plainTable">'+head_1+' and '+head_2+' between '+from+'&nbsp;to&nbsp;'+to+'&nbsp;'+'</th></tr></table><table cellspacing="0" cellpadding="0" border="0" width="100%"><thead><tr><th width="40%" class="plainTable">Measurement Time</th><th width="30%" class="plainTable">'+col_1+'</th><th width="30%" class="plainTable">'+col_2+'</th></tr></thead>';
		}
		else
		{
			mtable ='<div class="plainTable" style="width:100%"><table cellspacing="0" cellpadding="0" border="0" width="100%"><thead><tr><th colspan="2" class="plainTable">'+measure_desc.substring(0,measure_desc.indexOf("(")-1)+' between '+from+'&nbsp;to&nbsp;'+to+'&nbsp;'+'</th></tr></table><table cellspacing="0" cellpadding="0" border="0" width="100%"><thead><tr><th width="50%" class="plainTable">Measurement Time</th><th  width="50%" class="plainTable">'+measure_desc+'</th></tr></thead>';
		}
		mtable += '<tbody>';
		for(var i=0;i<temp.length;i++) {
			var d_msg = replaceAll(temp[i],'#',',');
			var m_val = d_msg.substring(0,d_msg.indexOf("-")).trim();
			var second_column_value = null;
			if(m_val.indexOf('|')>-1)
			{
				second_column_value = m_val.substring(m_val.indexOf('|')+1);
				m_val = m_val.substring(0,m_val.indexOf('|'));
			}
			var m_time = d_msg.substring(d_msg.indexOf("-")+1).trim();
			if(second_column_value != null)
			{
				mtable += '<tr><td width="40%" >'+m_time+'</td><td width="30%" >'+m_val+'</td><td width="30%" >'+second_column_value+'</td></tr>';
			}
			else
			{
				mtable += '<tr><td width="50%" >'+m_time+'</td><td width="50%" >'+m_val+'</td></tr>';
			}
		}
		mtable += '</tbody></table></div>';
		alertTd.innerHTML = mtable;
		alertDiv.style.visibility='visible';
		alertDiv.style.display='block';
	}
}
function replaceAll(txt, replace, with_this)
{
	return txt.replace(new RegExp(replace, 'g'),with_this);
}
function removeAlert(event)
{
	var alertDiv=document.getElementById("alertDiv");
	if(alertDiv!=null) {
		alertDiv.style.visibility='hidden';
		alertDiv.style.display='none';
	}
}
function showDiv()
{
	alertDiv.style.visibility='visible';
	alertDiv.style.display='block';
}
function isContainsOnlyDigits( str ) {
 return /^[0-9]+$/.test(str);
}
function threadLinkWindow(val,mt)
{
		var heading="";
		if(!Ext.isEmpty(val) && val.indexOf('#~#')>-1)
		{
			heading=val.substring(0,val.indexOf('#~#'));
		}
		var rand = Math.random();
		var divId = heading+"_"+rand;
		var me=this;
		var win = Ext.create('Ext.window.Window', {
		title: heading,
		height: 400,
		width: 680,
		shadow:true,
		bodyPadding:'10',
		scroll:false,
		autoScroll:true,
		modal: true,
		ghost: false,
		html:"<div id='"+divId+"'></div>",
		//id:'windowValue',
		//selectedValue:val,
		closeAction: "destroy",
		constrain: true,
		//iconCls:'iconClose2',
		closable:true,
		unformatVal:val,
		mtime:mt,
		layout:{
			type:'fit',
			//align:'stretch'
			pack: 'center'
		},
			listeners : {
				 afterrender: function (thisobj) {
					me.threadLinkWindow1(thisobj.unformatVal,thisobj.mtime,divId);
				}
		}
	}).show();
}
function threadLinkWindow1(val,measureTime,divId) 
	{
		//var divId = "linkDiv";
		var linkDiv = document.getElementById(divId);
		var title ="";
		if(val.indexOf("#~#,") > 0)
			title = val.substring(0,val.indexOf("#~#,"));
		//var url ='<%//=response.encodeURL("../monitor/jvmThreads.jsp?details=")%>'+encodeURIComponent(details)+"&time="+encodeURIComponent(measuretime);

		var popup_topright= (navigator.appVersion.toLowerCase().indexOf("msie 6.0"))==-1?"popup_topright":"popup_topright_noshade";
		var popup_rightbg = (navigator.appVersion.toLowerCase().indexOf("msie 6.0"))==-1?"popup_rightbg":"popup_rightbg_noshade";
		var popup_bottomleft = (navigator.appVersion.toLowerCase().indexOf("msie 6.0"))==-1?"popup_bottomleft":"popup_bottomleft_noshade";
		var popup_bottombg = (navigator.appVersion.toLowerCase().indexOf("msie 6.0"))==-1?"popup_bottombg":"popup_bottombg_noshade";
		var popup_bottomright = (navigator.appVersion.toLowerCase().indexOf("msie 6.0"))==-1?"popup_bottomright":"popup_bottomright_noshade";

		if(linkDiv!=null)
		{
			//alert('12');
			var str='<table border="0" bordercolor="blue" cellpadding="0" cellspacing="0">';
					str+='<tr>';
						str+='<td colspan="3" width="100%" onmousedown="dragOBJ(linkDiv,event); return false;">';
							str+='<table border="0"  cellpadding="0" cellspacing="0" width="100%" >';
								str+='<tr>';
								str+='</tr>';
							str+='</table>';
						str+='</td>';
					str+='</tr>';
					str+='<tr>';
						str+='<td class="popup_leftbg"  width="7px"><img src="/final/monitor/eg_images/spacer.gif" width="7"></td>';
						str+='<td align="center" valign="top" >';
							//str+='<div  class="div_scroll">';
								str+='<table border="0" bordercolor="green" cellpadding="0" cellspacing="0" width="100%" height="100%">';
									str+='<tr>';
										str+='<td class="white_bg">';
											 //str+='<iframe src="'+url+'" width="635" height="250" frameborder="0" leftmargin="0" marginwidth="0" marginheight="0" rightmargin="0"> </iframe>';
											str+='<div class="div_scroll" id="innerDiv_'+divId+'"  name="innerDiv" style="left:0px;top:0px;width:635px;height:250px;border:0px solid #ff0000;"> </div>';
										str+='</td>';
									str+='</tr>';
								str+='</table>';
							//str+='</div>';
						str+='</td>';
						str+='<td class="'+popup_rightbg+'" width="14px"><img src="/final/monitor/eg_images/spacer.gif" width="14"></td>';
					str+='</tr>';
					str+='<tr>';
						str+='<td class="'+popup_bottomleft+'"><img src="/final/monitor/eg_images/spacer.gif" width="7" height="16"></td>';
						str+='<td  class="'+popup_bottombg+'" height="16"><img src="/final/monitor/eg_images/spacer.gif"></td>';
						str+='<td class="'+popup_bottomright+'"><img src="/final/monitor/eg_images/spacer.gif" width="14" height="16"></td>';
					str+='</tr>';
				str+='</table>';
			linkDiv.innerHTML=str;
			fillTabs('innerDiv_'+divId,'<%=response.encodeURL("../monitor/jvmThreads.jsp?")%>'+"&details="+encodeURIComponent(val)+"&time="+encodeURIComponent(measureTime)+"&onlyData=true");
		}
	}
	function showMaintenanceOpts(entityType,entityDispName,entityInternalName,instantMaintenanceConfigURL)
	{
		componentDashboard.app.getController('LayersController').showMaintenanceWindow(entityType,entityDispName,entityInternalName,instantMaintenanceConfigURL);
	}
	function showMaintenanceOptsForComp(hostNam,prtNo,sid,entityDispName)
	{
		componentDashboard.app.getController('LayersController').showMaintenanceWindowForComp(hostNam,prtNo,sid,entityDispName);
	}
Ext.data.Types.FLOATORSTRING = {
		convert : function(v) {

			if(!isContainsOnlyDigits(v))
			{
				return v;
			}
			if(v.lastIndexOf(".") > v.indexOf(".")) // this is to fix ip addr values sorting
			{
				return v;
			}
			var n = parseFloat(String(v).replace(Ext.data.Types.stripRe, ''), 10);
			return isNaN(n) ? v : n;
		},
		sortType : function(cellVal)
		{
			if(cellVal=="-")
			{
				return -1;
			}
			else
			{
				var parsedStrng = (String(cellVal).replace(Ext.data.Types.stripRe, ''));
				var n1 = parseFloat(parsedStrng, 10);
				if( isNaN(n1))
				{
					var cVal = parsedStrng;
					if(cVal!=null && cVal!='')
					{
						return cVal;
					}
					else
					{
						return 0;
					}
				}
				else
				{
					return n1;
				}
			}

		}
		
};
Ext.state.Manager.setProvider(new Ext.state.LocalStorageProvider());
</script>
</head>
<!--<body style="overflow:hidden" onload="init();" id="body_bg" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" scroll="no" class="content-frame">-->
<%
	if(isMoreInfosTreeView)
	{
%>
		<body style="background-color:transparent !important;overflow:hidden;" id="body_bg1" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" scroll="no" class="background-color:transparent !important;">
<%
	}
	else
	{
%>
		<body style="overflow:hidden" id="body_bg" marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" scroll="no" class="content-frame">
<%
	}
%>
<div id="alertDiv" style="display:none" name="alertDiv" class="aggregates_popup" onmouseover="javascript:showDiv()"; onmouseout="javascript:removeAlert();">
<div class="header" style="height:24px">Measures</div>
	<div class="aggregates_popup_body">
		<div id="alertTd" style="border:0px" ></div>
	</div>
</div>
</body>
<input type="hidden" id="datefld" name="datefld">
<input type="hidden" id="datefld_hidden" name="datefld_hidden">
</html>




