<!DOCTYPE html>
<%
   /*******************************************************************************
   *	File name		: componentMeasureTabSet.jsp
   *	Purpose			: link page to get Detailed Diagnosis, Graph, History and Feedback.
   *	Version			: eG 4.0
   *	Creation Date	: 2/15/2007
   *	Authtor			: James Thomas & Nagarajan

   *  GUI Changes		:	Vijaykumar
						:	Adding Tabs 16.2.2007
							20/12/2011  Sri Devi G User - VM Changes
   ******************************************************************************/
%>
<%@ include file = "EgLoginTracker.jsp" %>
<%@ page errorPage = "EgProbsM.jsp" %>
<%@ page import = "com.egurkha.monitor.MonitorDAOFactory"%>
<%@ page import = "com.eg.EgInstallInfo"%>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "java.util.StringTokenizer"%>
<%@ page import = "java.util.TreeMap"%>
<%@ page import = "java.util.Map.Entry"%>
<%@ page import = "java.net.URLEncoder"%>
<%@ page import = "java.net.URLDecoder"%>
<%@ page import = "com.eg.EgURLEncoder" %>
<%@ page import = "com.eg.EgURLDecoder" %>
<%@ page import = "com.eg.EgTesterInfo"%>
<%@ page import = "com.eg.EgDateInfo"%>
<%@ page import = "com.eg.EgDbInfo"%>
<%@ page import="com.eg.EgMappingInfo"%>
<%@ page import = "java.text.SimpleDateFormat"%>
<%@ page import = "com.egurkha.util.StringUtils"%>
<%@ page import="com.eg.EgTablesInfo"%>
<%@ page import = "com.eg.EgFormatInfo"%>
<%@page import="egurkha.reporter.ErUtils"%>
<%@ page import="com.eg.supermanager.EgElementInfo"%>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
String fromReporterHis = request.getParameter("fromReporterHis");
UserRegistry registry = UserRegistry.getInstance();
User user = registry.getUser(session.getId());


boolean isDouble=EgDbInfo.doubleByteEnabled;
EgDateInfo egDt = new EgDateInfo();
java.util.Date local_date = new java.util.Date(egDt.egetUTCDate());
Calendar cal = Calendar.getInstance();
cal.setTime(local_date);
if(!(user.getUserTimeZone().equalsIgnoreCase("default")))
{
	cal.setTimeZone(TimeZone.getTimeZone(user.getUserTimeZone()));
}
String cdate = (cal.get(Calendar.MONTH)+1)+"/"+cal.get(Calendar.DAY_OF_MONTH)+"/"+cal.get(Calendar.YEAR);

String info = null;
int cyear =cal.get(Calendar.YEAR);
int cmon = cal.get(Calendar.MONTH)+1;
int cday = cal.get(Calendar.DAY_OF_MONTH);
int chr = cal.get(Calendar.HOUR_OF_DAY);
int cmin = cal.get(Calendar.MINUTE)+1;
int csec = cal.get(Calendar.SECOND);
boolean isRUM = false;
String newWindow = request.getParameter("newWindow");//modifide on 18/09/07
String siteName = request.getParameter("site");
String hostName = request.getParameter("host");
String port = request.getParameter("port");
info = request.getParameter("info");
String org_info="";
String state = request.getParameter("state");
String messy = request.getParameter("messy");
String type=request.getParameter("type");
String show=request.getParameter("show");
String screenShotEnabled=request.getParameter("isScreenShotEnabled");
String successScreenshot=request.getParameter("isForSuccessScreenshot");
String appendHostinKey=request.getParameter("appendHostinKey");
boolean  isShowDD = false;
if(show != null && show.trim().length()>0 && show.trim().equalsIgnoreCase("dd"))
	isShowDD = true;
boolean  isScreenShotEnabled = false;
if(screenShotEnabled != null && screenShotEnabled.trim().length()>0 && screenShotEnabled.trim().equalsIgnoreCase("true"))
	isScreenShotEnabled = true;

boolean  isForSuccessScreenshot = false;
if(successScreenshot != null && successScreenshot.trim().length()>0 && successScreenshot.trim().equalsIgnoreCase("true"))
	isForSuccessScreenshot = true;

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

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

	if(!isLicenseViolatedType && type !=null && type.equalsIgnoreCase("Host_system"))
	{
		com.eg.EgDiscInfo discInfo=new com.eg.EgDiscInfo("manager");
		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(info!=null)
{
	org_info=info;
	info = com.egurkha.util.StringUtils.replace(info,"|hash|","#");
	info=com.egurkha.util.StringUtils.replace(info,"|plus|","+");
	info=com.egurkha.util.StringUtils.replace(info,"|amp|","&");
	info=com.egurkha.util.StringUtils.replace(info,"|pct|","%");
	info=com.egurkha.util.StringUtils.replace(info,"|equ|","=");
	info = com.egurkha.util.StringUtils.decodeSecurityChar(info);
}

if(type!=null && type.equalsIgnoreCase("Real_user_monitor"))
{
	isRUM=true;
}

String s_mes = request.getParameter("measure");
boolean isfromSuper = session.getAttribute("fromSuper") != null &&
session.getAttribute("fromSuper").toString().equalsIgnoreCase("yes");

boolean isVM = false;
String s_isVM = request.getParameter("isVM");
isVM = (new Boolean(s_isVM)).booleanValue();

String source = request.getParameter("source");
boolean reporter_evtHstry = false;

// START OF WORK BY JAMES THOMAS
String temp = request.getParameter("clicked");
if(temp != null && temp.trim().length()>0 && temp.trim().equalsIgnoreCase("dd"))
	isShowDD = true;

String ddDisplay = request.getParameter("dd_disp");
if(ddDisplay != null && ddDisplay.trim().length()>0 && (ddDisplay.trim().equalsIgnoreCase("yes") || ddDisplay.trim().equalsIgnoreCase("true")))
	isShowDD = true;
String currentTab=null;
if(temp!=null)
	currentTab =temp;
String uiFile = "eg_ui.ini";
String s_iniFile_dir = EgInstallInfo.getInstallDir()+ "/manager/config/";
String formatIni = EgInstallInfo.getInstallDir()+ "/manager/config/eg_format.ini";
String dashboardconfigIni = EgInstallInfo.getInstallDir()+ "/manager/config/eg_dashboardConfig.ini";
IniFile egUI = new IniFile(s_iniFile_dir + uiFile);
IniFile egFormatIni = new IniFile(formatIni);
IniFile egDashboardConfIni = new IniFile(dashboardconfigIni);
boolean hideTrendTab = false;
boolean fromCtxDash = false;
boolean isSSType = false;
String serviceFile = "eg_services.ini";
IniFile egserviceIni = new IniFile(s_iniFile_dir + serviceFile);
String trendFlag = egserviceIni.getValue("MISC_ARGS","DisableTrendComputation");
if(trendFlag != null && trendFlag.trim().length() > 0 && (trendFlag.equalsIgnoreCase("true") || trendFlag.equalsIgnoreCase("yes")))
	hideTrendTab = true;

String csvHideValues = egFormatIni.getValue("CSV_HIDE_DDTests","Tests");
String pdfHideValues = egFormatIni.getValue("PDF_HIDE_DDTests","Tests");
String seqNoHandling = egFormatIni.getValue("PAGINATION_SEQ_NO_HANDLING_TESTS","Tests");
ArrayList seqList = new ArrayList();
ArrayList seqNoHandlingList = null;
if(seqNoHandling!=null && seqNoHandling.trim().length()>0)
{
	seqNoHandlingList = new ArrayList();
	seqNoHandlingList =  com.egurkha.util.StringUtils.egTokenizer(seqNoHandling.trim(),",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
	if(seqNoHandlingList != null)
	{
		for(int p=0;p<seqNoHandlingList.size();p++){
			String testNamee = (String) seqNoHandlingList.get(p);
			String measureValues = egFormatIni.getValue("PAGINATION_SEQ_NO_HANDLING", testNamee);
			
			if(measureValues!=null && measureValues.trim().length()>0)
			{
				seqList.add(testNamee);
			}
		}
	}
}
ArrayList csvHideList = null,pdfHideList = null;
if(csvHideValues != null && csvHideValues.trim().length() > 0){
	csvHideList = new ArrayList();
	csvHideList = com.egurkha.util.StringUtils.egTokenizer(csvHideValues, ",", true,false,true);
}
if(pdfHideValues != null && pdfHideValues.trim().length() > 0){
	pdfHideList = new ArrayList();
	pdfHideList = com.egurkha.util.StringUtils.egTokenizer(pdfHideValues, ",", true,false,true);
}

String sortbyTests = egFormatIni.getValue("DD_SORTBY_ENABLE_TESTS","Tests");
String searchFilter[] = egFormatIni.getVariables("DD_Search_Filter");
Hashtable search_el  = new Hashtable();
if(searchFilter != null && searchFilter.length > 0){
	for(int i=0;i<searchFilter.length;i++){
		String key = searchFilter[i];
		String searchParam = egFormatIni.getValue("DD_Search_Filter",key);
		if(searchParam != null && searchParam.trim().length() > 0)
			search_el.put(key,searchParam);
	}
}
ArrayList sortList = new ArrayList();
if(sortbyTests!=null && sortbyTests.trim().length()>0)
{
	sortList =  com.egurkha.util.StringUtils.egTokenizer(sortbyTests.trim(),",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
}

EgMappingInfo egMappingInfo=new EgMappingInfo(trackerLanguage);
String currentDateFormat = egUI.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
String nofhours=egDashboardConfIni.getValue("NO_OF_HOURS_TO_BACKLIFT","NO_OF_HOURS");

if(nofhours == null || nofhours.trim().length() == 0)
	nofhours="3";
boolean fusionChartsEnabled=false;
String enableFusionChartsStr=egUI.getValue("GRAPHS","EnableFusion");
if(enableFusionChartsStr!=null && (enableFusionChartsStr.equalsIgnoreCase("yes") || enableFusionChartsStr.equalsIgnoreCase("true")))
{
	fusionChartsEnabled=true;
}
String userDateFormat = u_ser.getUserDateFormat();
if ( userDateFormat != null && userDateFormat.equalsIgnoreCase("Default"))
{
	userDateFormat = currentDateFormat;
}
// END OF WORK
String tmp_measureTextt = egMappingInfo.getTextDescription("monitor.common.Measure");

String strExportViaHighchart = egUI.getValue("CHART_TYPE","exportViaHighchart");
boolean exportViaHighchart=false;
if(strExportViaHighchart!=null && (strExportViaHighchart.equalsIgnoreCase("yes") || strExportViaHighchart.equalsIgnoreCase("true")))
{
	exportViaHighchart=true;
}
EgFormatInfo formatInfo = new EgFormatInfo("manager");
ArrayList excludeDDTestList = formatInfo.getHideDDTestList();
if(fromReporterHis!=null && fromReporterHis.equalsIgnoreCase("true"))
{
	String test=request.getParameter("test");
	String measure=request.getParameter("messy");
	String measureDisp=request.getParameter("measureDisp");
	info = request.getParameter("info");
	if(info!=null)
	{
		org_info=info;
		info = com.egurkha.util.StringUtils.replace(info,"|hash|","#");
		info=com.egurkha.util.StringUtils.replace(info,"|plus|","+");
		info=com.egurkha.util.StringUtils.replace(info,"|amp|","&");
		info=com.egurkha.util.StringUtils.replace(info,"|pct|","%");
		info=com.egurkha.util.StringUtils.replace(info,"|equ|","=");

	}
	String strTempHost=request.getParameter("host");
	String msmt_host=request.getParameter("msmt_host");
	String starttime=request.getParameter("starttime");
	String starthr=request.getParameter("starthr");
	String startmin=request.getParameter("startmin");
	String endtime=request.getParameter("endtime");
	String endhr=request.getParameter("endhr");
	String endmin=request.getParameter("endmin");
	String timelineVal=request.getParameter("timeline");
	String strtimeline ="";
	if(timelineVal == null || (timelineVal != null && !timelineVal.equalsIgnoreCase("latest"))){
		String stime = starttime+" "+starthr+":"+startmin;
		String sdate = stime.substring(0,stime.indexOf(" "));
		String stme = stime.substring(stime.indexOf(" ")).trim();
		sdate = DateUtil.changeDateFormat(sdate,currentDateFormat,userDateFormat);
		stime=sdate+" "+stme;
		/*String tempp = userDateFormat+" HH:mm";
		SimpleDateFormat sdf = new SimpleDateFormat(tempp);
		
		java.util.Date tmpday = new java.util.Date((endtime+" "+endhr+":"+endmin));
		String endDateTime = sdf.format(tmpday);
		int timeLine2 = 3600;
		tmpday.setTime(tmpday.getTime() + (timeLine2 * 1000));
		endDateTime = sdf.format(tmpday);*/
		String strEndtime = endtime+" "+endhr+":"+endmin;
		String stredate = strEndtime.substring(0,strEndtime.indexOf(" "));
		String etme = strEndtime.substring(strEndtime.indexOf(" ")).trim();
		String edate = DateUtil.changeDateFormat(stredate,currentDateFormat,userDateFormat);
		String endDateTime=edate+" "+etme;

		//change to user format....
		EgTimeZoneConverter startConverter = new EgTimeZoneConverter(stime,user);
		String sttime = (String)startConverter.getDate(false);
		String sthr = startConverter.getHour();
		String stmin = startConverter.getMinute();
		EgTimeZoneConverter endConverter = new EgTimeZoneConverter(endDateTime,user);
		String entime = (String)endConverter.getDate(false);
		String enhr = endConverter.getHour();
		String enmin = endConverter.getMinute();
		strtimeline ="&timeline=Any"+ "&starttime="+sttime+"&starthr="+sthr+"&startmin="+stmin+"&endtime="+entime+"&endhr="+enhr+"&endmin="+enmin;
	}
	com.eg.EgExternalInfo externalInfo = new com.eg.EgExternalInfo("manager");
	com.eg.EgSpecsInfo specsInfo= new com.eg.EgSpecsInfo("manager");
	String msmt_host_1 = request.getParameter("host");
	String strCompType = request.getParameter("comptype");
	String strPort = request.getParameter("port");
	if((strCompType == null || strCompType.length()==0) || (strCompType!=null && strCompType.equalsIgnoreCase("Host_system")))
	{
			com.eg.EgDiscInfo discInfo = new com.eg.EgDiscInfo("manager");
			List aList = discInfo.getServerTypesForNick(request.getParameter("host"));
			for(int v=0; v<aList.size();v++)
			{
				String server_typ = (String)aList.get(v);
				if(specsInfo.isTestRelevantForServer(server_typ,test))
				{
					strCompType = server_typ;
					break;
				}
			}
			strPort = discInfo.getPortForHost(request.getParameter("host"),strCompType);
	}
	if(msmt_host == null || msmt_host.length() ==0)
	{
		List mHostList = externalInfo.getAgentsForHost(strTempHost);
		boolean isExternalTest = false;
		boolean isexternalCheckwithServer = specsInfo.isTestExternal(test+":"+strCompType);
		if(isexternalCheckwithServer)
			isExternalTest = specsInfo.isTestExternal(test);
		if(isExternalTest )
		{
			if(mHostList!=null && mHostList.size()>0)
				msmt_host_1 = (String)mHostList.get(mHostList.size()-1);
		}
		else
		{
			if(mHostList!=null && mHostList.size()>0)
				msmt_host_1 = (String)mHostList.get(0);
		}
	}else
		msmt_host_1 = msmt_host;
	
	String dLink = "/final/monitor/EgDiagnosis.jsp?site="+request.getParameter("site")+"&host="+request.getParameter("host")+"&port="+strPort+"&test="+test+"&isPopUp=true&comptype="+strCompType+"&info="+com.eg.EgURLEncoder.encode((info), "UTF-8")+"&msmt_host="+msmt_host_1+"&measure="+measureDisp+"&from=0&firsttime=true&flag=1"+strtimeline+"&inidate="+userDateFormat+"&dummy=$";

	//System.out.println("Tablinks selfie--------	"+session.getAttribute("Tablinks"));
	//System.out.println("dLink selfie--------	"+dLink);
	//System.out.println("keyyyyyy selfie--------	"+test+"#"+measureDisp+"#"+info+"#"+msmt_host+"compddlink");
	Object Tablinks=session.getAttribute("Tablinks");
	if(Tablinks==null)
	{	
		TreeMap linksMap = new TreeMap();
		linksMap.put(test+"#"+measure+"#"+info+"#"+msmt_host+"compddlink", dLink);
		session.setAttribute("Tablinks", linksMap);
	}
	else
	{
		TreeMap linksMap = (TreeMap)Tablinks;
		linksMap.put(test+"#"+measure+"#"+info+"#"+msmt_host+"compddlink", dLink);
		session.setAttribute("Tablinks", linksMap);
	}
}
boolean isCTX = false;
boolean isCTXComp = false;
String isFromMISC=request.getParameter("isFromMISC");
boolean isMisc = false;
String miscUrl="";
if(isFromMISC != null && isFromMISC.equalsIgnoreCase("true"))
	isMisc = true;

if(isMisc)
{
	String queryString = request.getQueryString();
	miscUrl = "/final/monitor/EgDiagnosis.jsp?"+queryString;
}
boolean isUserHaveDirector=true;
ArrayList simulationTypes = new ArrayList();
String[] s_types = egDashboardConfIni.getVariables("SIMULATION_SUPPORT");
if(s_types != null && s_types.length > 0){
	for(int k=0;k<s_types.length;k++){
		String ctype = s_types[k];
		if(ctype != null && ctype.length() > 0)
			simulationTypes.add(ctype);
	}
}

ArrayList sstypesList = null;
String sstypes = egFormatIni.getValue("SS_DD_Handled","Types");
if(sstypes != null && sstypes.trim().length() > 0){
	sstypesList = new ArrayList();
	sstypesList = com.egurkha.util.StringUtils.egTokenizer(sstypes, ",", true,false,true);
}
if(type!=null && sstypesList != null && sstypesList.size() > 0 && sstypesList.contains(type))
{
	isSSType = true;
	isCTXComp = true;
}

if(type!=null && simulationTypes != null && simulationTypes.size() > 0 && simulationTypes.contains(type))
{
	isCTXComp = true;
	List ls = new LinkedList();
	if(user != null)
		ls = user.getServerTypes();
	
	String enduser = "eg_endUserDetails.ini";
	com.eg.IniFile egINI = new com.eg.IniFile(s_iniFile_dir + enduser);
	String director_types=egINI.getValue("Enable_Director_Link","XenApp7");
	director_types=(director_types==null || director_types.trim().length()==0)?"":director_types;
	ArrayList directorSupportedTypes =  com.egurkha.util.StringUtils.egTokenizer(director_types.trim(), ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
	if(directorSupportedTypes!=null && directorSupportedTypes.size()>0)
	{
		for (int i=0;i<directorSupportedTypes.size() ; i++)
		{
			String supp_type=(String)directorSupportedTypes.get(i);
			if(ls!=null && supp_type!=null && ls.contains(supp_type))
			{
				isUserHaveDirector = false;
				break;
			}
		}
	}
}

/*String sim_type = egFormatIni.getValue("SIMULATION","Types");
ArrayList simTypeList = new ArrayList();
if(sim_type != null && sim_type.trim().length() > 0)
	simTypeList =  com.egurkha.util.StringUtils.egTokenizer(sim_type.trim(),",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim

if(type!=null && (simTypeList!= null && simTypeList.contains(type)  ) && currentTab != null && currentTab.equalsIgnoreCase("dd"))
{
	//isCTX = true;
	fromCtxDash = true;
}*/

String sim_test = egFormatIni.getValue("SIMULATION","Tests");
ArrayList simTestList = new ArrayList();
if(sim_test != null && sim_test.trim().length() > 0)
	simTestList =  com.egurkha.util.StringUtils.egTokenizer(sim_test.trim(),",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim

/*if(type!=null && type.equalsIgnoreCase("Real_user_monitor"))
{
	isRUM=true;
}*/

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

//int id = info.indexOf("etouq");

//if (id > 0)
//{
//	info = info.substring(0,info.indexOf("etouq"))+ "\"" +info.substring(info.indexOf("etouq")+5,info.length());
//}
EgTesterInfo testerInfo = new EgTesterInfo("manager");
ArrayList disabledTrendTest=testerInfo.getDisabledTrendTests();
 EgDbInfo dbInfo = new EgDbInfo("manager");
TreeMap linksMap = (TreeMap)request.getAttribute("linksMap");

String temptestValue = request.getParameter("test");
if(state==null || state.equals(""))
 state="GOOD";

if (linksMap!=null)
	request.setAttribute("linksMap", linksMap);

String tabQS = (String)session.getAttribute("curTabQS");

String ddLink="";
String graphLink = "";
String histLink="";
String feedLink = "";
String aggregateLink="";
String from = request.getParameter("from");
String fromPage = request.getParameter("fromPage");
String dd = request.getParameter("dd");
String fromMyDashboard = request.getParameter("fromMyDashboard");
String isHistory = request.getParameter("isHistory");
String fromUEDAlerts = request.getParameter("fromUEDAlerts");
String userAlertsFromToplogy = request.getParameter("userAlertsFromToplogy");
boolean ShowAnyTimeline =false;
if(fromUEDAlerts!=null && fromUEDAlerts.trim().length()>0 && fromUEDAlerts.equalsIgnoreCase("true"))
	ShowAnyTimeline=true;	
String trendGraphLink="";
String summaryGraphLink="";
IniUI iniUI = IniUI.getInstance();
String thisLanguage = iniUI.getDefaultLanguage();
boolean isUserLanguageEnglish=true;
if(thisLanguage!=null && !thisLanguage.equals("en_US"))
{
	isUserLanguageEnglish=false;
}
boolean displayWhiteBg=false;
boolean onlyDDTab=false;
String ddTabName=egMappingInfo.getTextDescription("monitor.layermodel.Detailed Diagnosis");
boolean isFromUserSession = false;
if(fromPage!=null && fromPage.equals("UserSessionDetails"))
	isFromUserSession = true;
if(from!=null && from.equals("measurespage"))
{
	displayWhiteBg=true;
	String userID = request.getParameter("userID");
	if(userID!=null)
	{
		userID=com.egurkha.util.StringUtils.replace(userID,"|plus|","+");
		userID=com.egurkha.util.StringUtils.replace(userID,"|amp|","&");
		userID=com.egurkha.util.StringUtils.replace(userID,"|pct|","%");
		userID=com.egurkha.util.StringUtils.replace(userID,"|hash|","#");
	}
	
	if(isHistory!=null && isHistory.equals("true"))
	{
		if(userAlertsFromToplogy!=null &&  userAlertsFromToplogy.trim().length()>0 && userAlertsFromToplogy.equalsIgnoreCase("true"))
			linksMap = (TreeMap)session.getAttribute("linksMap_historyForTopology");
		else
			linksMap = (TreeMap)session.getAttribute("linksMap_history");
	}
	else
	{
		if (linksMap==null)
			linksMap = (TreeMap)session.getAttribute("Tablinks");
	}
	
	if(fromMyDashboard!=null && fromMyDashboard.equals("true"))
	{
		linksMap = (TreeMap)session.getAttribute("TabSeslinks");
	}
	// Rights Symbol replace
	info = com.egurkha.util.StringUtils.replace(info,"\u00AE","|rights|");
	info = com.egurkha.util.StringUtils.replace(info,"\u00C2","");
	String msmthost = request.getParameter("msmt_host");
	String dd_display=request.getParameter("dd_disp");
	String testValue = request.getParameter("test");
	String stTime = request.getParameter("stTime");
	String mapHostKey = request.getParameter("mapHostKey");

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

	String key =null;
	String en_key =null;
	String key1 =null;
	if(isHistory!=null && isHistory.equals("true"))
	{
		key =testValue+"#"+messy+"#"+info+"#"+msmthost+"#"+stTime;
		en_key =testValue+"#"+messy+"#"+org_info+"#"+msmthost+"#"+stTime;
		if(mapHostKey!=null && mapHostKey.trim().length()>0)
		{
			key = key+"#"+mapHostKey;
			en_key = en_key+"#"+mapHostKey;
		}
	}
	else
	{
		key1 = testValue+"#"+messy+"#"+info+"#"+msmthost;
		en_key = testValue+"#"+messy+"#"+org_info+"#"+msmthost;
		if(stTime == null || stTime.equals(""))
		{
			key = testValue+"#"+messy+"#"+info+"#"+msmthost;
			en_key = testValue+"#"+messy+"#"+org_info+"#"+msmthost;
			if(mapHostKey!=null && mapHostKey.trim().length()>0)
			{
				key = key+"#"+mapHostKey;
				en_key = en_key+"#"+mapHostKey;
			}
		}
		else
		{
			key =testValue+"#"+messy+"#"+info+"#"+msmthost+"#"+stTime;
			en_key =testValue+"#"+messy+"#"+org_info+"#"+msmthost+"#"+stTime;
			if(mapHostKey!=null && mapHostKey.trim().length()>0)
			{
				key = key+"#"+mapHostKey;
				en_key = en_key+"#"+mapHostKey;
			}
		}
	}
	
	if(appendHostinKey!= null && appendHostinKey.equals("true"))
	{
		key+="#"+hostName;
		en_key+="#"+hostName;
	}
	ddLink =(String)linksMap.get(key+"compddlink");
	if(ddLink==null)
		ddLink = (String)linksMap.get(en_key+"compddlink");
		
	ddLink = com.egurkha.util.StringUtils.replace(ddLink,"\u00AE","|rights|");
	if(dd_display!=null&&dd_display.equalsIgnoreCase("no"))
		ddLink=null;
	if(fromReporterHis!=null && !fromReporterHis.equals("") && fromReporterHis.equals("true"))
	{
		reporter_evtHstry=true;
		onlyDDTab=true;
	}
	else
	{
		graphLink = (String)linksMap.get(key+"compgraphlink");
		if(graphLink == null)
			graphLink = (String)linksMap.get(en_key+"compgraphlink");
		histLink = (String)linksMap.get(key+"comphistorylink");
		if(histLink == null)
			histLink = (String)linksMap.get(key1+"comphistorylink");
		if(histLink == null)
			histLink = (String)linksMap.get(en_key+"comphistorylink");
		feedLink = (String)linksMap.get(key+"compfeedbacklink");
		if(feedLink == null)
			feedLink = (String)linksMap.get(key1+"compfeedbacklink");
		if(feedLink == null)
			feedLink = (String)linksMap.get(en_key+"compfeedbacklink");
		aggregateLink=(String)linksMap.get(key+"aggregateLink");
		if(aggregateLink == null)
			aggregateLink=(String)linksMap.get(key1+"aggregateLink");
		if(aggregateLink == null)
			aggregateLink=(String)linksMap.get(en_key+"aggregateLink");
		trendGraphLink=(String)linksMap.get(key+"comptrendgraphlink");
		if(trendGraphLink == null)
			trendGraphLink=(String)linksMap.get(key1+"comptrendgraphlink");
		if(trendGraphLink == null)
			trendGraphLink=(String)linksMap.get(en_key+"comptrendgraphlink");
		summaryGraphLink=(String)linksMap.get(key+"compsummarygraphlink");
		if(summaryGraphLink == null)
			summaryGraphLink=(String)linksMap.get(key1+"compsummarygraphlink");
		if(summaryGraphLink == null)
			summaryGraphLink=(String)linksMap.get(en_key+"compsummarygraphlink");
		
		if(directClick == null || directClick.equals(""))
		{
			if(ddLink==null||ddLink.equals(""))
				temp="graph";
			if(dd_display!=null&&dd_display.equals("yes"))
				temp="graph";
		}
	}
	info = msmthost;
	if(fromPage !=null && fromPage.trim().length()>0 && !fromPage.equalsIgnoreCase("NULL") && fromPage.equalsIgnoreCase("btmHealthTime"))
		ddLink = ddLink +"&isFromReport=btmHealthTime";
}
else if(from!=null && from.equals("av"))
{
	displayWhiteBg=true;
	String userID = request.getParameter("userID");
	if(userID!=null)
	{
		userID=com.egurkha.util.StringUtils.replace(userID,"|plus|","+");
		userID=com.egurkha.util.StringUtils.replace(userID,"|amp|","&");
		userID=com.egurkha.util.StringUtils.replace(userID,"|pct|","%");
		userID=com.egurkha.util.StringUtils.replace(userID,"|hash|","#");
	}
	if (linksMap==null)
		linksMap = (TreeMap)session.getAttribute("Tablinks");
	String msmthost = request.getParameter("msmt_host");
	String dd_display=request.getParameter("dd_disp");
	String testValue = request.getParameter("test");
	String mapHostKey = request.getParameter("mapHostKey");
	String msmt_host_1 = request.getParameter("host");	
	String strPort = request.getParameter("port");
	info = URLDecoder.decode(info, "UTF-8");
	String key =testValue+"#"+messy+"#"+info+"#"+msmthost;
	String en_key =testValue+"#"+messy+"#"+org_info+"#"+msmthost;
	if(mapHostKey!=null && mapHostKey.trim().length()>0)
	{
		mapHostKey = URLDecoder.decode(mapHostKey, "UTF-8");
		en_key = en_key+"#"+mapHostKey;
		key = key+"#"+mapHostKey;
	}
	else
	{
		key = key+"#"+msmt_host_1+":"+strPort;
		en_key = en_key+"#"+msmt_host_1+":"+strPort;
	}
	graphLink = (String)linksMap.get(key+"compgraphlink");
	if(graphLink==null)
		graphLink = (String)linksMap.get(en_key+"compgraphlink");
	histLink = (String)linksMap.get(key+"comphistorylink");
	if(histLink==null)
		histLink = (String)linksMap.get(en_key+"comphistorylink");
	feedLink = (String)linksMap.get(en_key+"compfeedbacklink");
	if(feedLink==null)
		feedLink = (String)linksMap.get(en_key+"compfeedbacklink");
	aggregateLink=(String)linksMap.get(key+"aggregateLink");
	if(aggregateLink==null)
		aggregateLink = (String)linksMap.get(en_key+"aggregateLink");
	trendGraphLink=(String)linksMap.get(key+"comptrendgraphlink");
	if(trendGraphLink==null)
		trendGraphLink = (String)linksMap.get(en_key+"comptrendgraphlink");
	summaryGraphLink=(String)linksMap.get(key+"compsummarygraphlink");
	if(summaryGraphLink==null)
		summaryGraphLink = (String)linksMap.get(en_key+"compsummarygraphlink");
}
else if(from!=null && from.equals("0") && fromPage!=null && fromPage.equals("fromRUMDashboard"))
{
	String queryString = request.getQueryString();
	ddLink = "/final/monitor/EgDiagnosis.jsp?"+queryString;
	//ddTabName=egMappingInfo.getTextDescription("monitor.layermodel.Detailed Diagnosis");
	ddTabName=egMappingInfo.getTextDescription("monitor.layermodel.RUM Transaction Details");
	temp="dd";
	onlyDDTab=true;
	graphLink = "";
	histLink = "";
	feedLink = "";
	aggregateLink = "";
	trendGraphLink = "";
	summaryGraphLink = "";
	isShowDD = true;
}
else if(from!=null && from.equals("allEvents") && fromPage!=null && fromPage.equals("fromO365Dashboard"))
{
	String userID = request.getParameter("userID");
	if(userID!=null)
	{
		userID=com.egurkha.util.StringUtils.replace(userID,"|plus|","+");
		userID=com.egurkha.util.StringUtils.replace(userID,"|amp|","&");
		userID=com.egurkha.util.StringUtils.replace(userID,"|pct|","%");
		userID=com.egurkha.util.StringUtils.replace(userID,"|hash|","#");
	}
	
	linksMap = (TreeMap)session.getAttribute("TabSeslinks");
	
	// Rights Symbol replace
	info = com.egurkha.util.StringUtils.replace(info,"\u00AE","|rights|");
	info = com.egurkha.util.StringUtils.replace(info,"\u00C2","");
	String msmthost = request.getParameter("msmt_host");
	String dd_display=request.getParameter("dd_disp");
	String testValue = request.getParameter("test");
	String stTime = request.getParameter("stTime");
	String mapHostKey = request.getParameter("mapHostKey");
	String key =null;
	String key1 =null;
	String tempinfo = request.getParameter("info");
	if(tempinfo != null && tempinfo.trim().length() == 0)
		tempinfo = "+";
	key1 = testValue+"#"+messy+"#"+tempinfo+"#"+msmthost;

	if(linksMap.containsKey(key1+"compddlink")){
		ddLink = (String)linksMap.get(key1+"compddlink");

		ddLink = com.egurkha.util.StringUtils.replace(ddLink,"\u00AE","|rights|");
	}
	
	graphLink = (String)linksMap.get(key1+"compgraphlink");

	histLink = (String)linksMap.get(key1+"comphistorylink");
	feedLink = (String)linksMap.get(key1+"compfeedbacklink");
	aggregateLink=(String)linksMap.get(key1+"aggregateLink");		
	trendGraphLink=(String)linksMap.get(key1+"comptrendgraphlink");
	summaryGraphLink=(String)linksMap.get(key1+"compsummarygraphlink");		
}
else if(from!=null && from.equals("0") && fromPage!=null && fromPage.equals("fromO365Dashboard"))
{
	String queryString = request.getQueryString();
	ddLink = "/final/monitor/EgDiagnosis.jsp?"+queryString;

	ddTabName=egMappingInfo.getTextDescription("monitor.layermodel.Detailed Diagnosis");
	//ddTabName=egMappingInfo.getTextDescription("monitor.layermodel.Details");
	temp="dd";
	onlyDDTab=true;
	graphLink = "";
	histLink = "";
	feedLink = "";
	aggregateLink = "";
	trendGraphLink = "";
	summaryGraphLink = "";
	isShowDD = true;
}
else
{

	if (linksMap==null)
	linksMap = (TreeMap)session.getAttribute("linksMap");

	try
	{

		if(from != null && from.equalsIgnoreCase("cls"))
		{
			linksMap = (TreeMap)session.getAttribute("ctxlinksMap");
			String orgInfo = request.getParameter("orgInfo");
			String ctx_info = request.getParameter("info");
			if(ctx_info!=null)
			{
				ctx_info = com.egurkha.util.StringUtils.replace(ctx_info,"|hash|","#");
				ctx_info=com.egurkha.util.StringUtils.replace(ctx_info,"|plus|","+");
				ctx_info=com.egurkha.util.StringUtils.replace(ctx_info,"|amp|","&");
				ctx_info=com.egurkha.util.StringUtils.replace(ctx_info,"|pct|","%");
			}
			if(orgInfo!=null && orgInfo.trim().length()>0)
			{
				orgInfo = com.egurkha.util.StringUtils.replace(orgInfo,"|hash|","#");
				orgInfo=com.egurkha.util.StringUtils.replace(orgInfo,"|plus|","+");
				orgInfo=com.egurkha.util.StringUtils.replace(orgInfo,"|amp|","&");
				orgInfo=com.egurkha.util.StringUtils.replace(orgInfo,"|pct|","%");
			}
			String ctx_temp_host = request.getParameter("host");
			messy = ctx_temp_host+ctx_info+orgInfo+messy;
			fromCtxDash = true;
		}

		ddLink = (String)linksMap.get(messy+"compddlink");

		graphLink = (String)linksMap.get(messy+"compgraphlink");
		histLink = (String)linksMap.get(messy+"comphistorylink");
		feedLink = (String)linksMap.get(messy+"compfeedbacklink");
		aggregateLink=(String)linksMap.get(messy+"aggregateLink");
		trendGraphLink=(String)linksMap.get(messy+"comptrendgraphlink");
		summaryGraphLink=(String)linksMap.get(messy+"compsummarygraphlink");
	}
	catch(Exception ee){

	}

	
}

	if(onlyDDTab){
		isCTXComp = false;
		isCTX = false;
		fromCtxDash =false;
	}

	boolean isModify = true;
	String s_modify=request.getParameter("modify");
	if(s_modify!=null && s_modify.equalsIgnoreCase("false"))
		isModify=false;
	String back_times ="1";
	String lback = request.getParameter("l_back");
	String s_lback = request.getParameter("l_back");
	s_lback = (lback!=null && lback.equalsIgnoreCase("true"))?lback:s_lback;
	int l_times = 1;
	String lTimes = request.getParameter("l_times");
	l_times = (lTimes ==null)?l_times:Integer.parseInt(lTimes);
	String look_back = "60";
	String linterval = request.getParameter("l_interval");
	linterval = (linterval ==null)?look_back:linterval;
	String otherTimeline = request.getParameter("otherTimeline");
	String otherTimeInterval = request.getParameter("otherTimeInterval");
	String [] lookbk_arr = {"Hour","Day","Week","Others"};
	String [] lookbk_valarr = {1*60+"",1*24*60+"",1*24*7*60+"",3*60+""};
	String [] other_tline_valarr = {"3 hrs", "6 hrs", "9 hrs", "12 hrs", "15 hrs", "18 hrs"};

String grMode = egUI.getValue("GRAPHS","3D_MONITOR");
String isFixedByEditable = egUI.getValue("FIX_FEEDBACK","isEditable");
boolean isFixedByReadOnly = true;
if(isFixedByEditable!=null && "true".equalsIgnoreCase(isFixedByEditable) || "yes".equalsIgnoreCase(isFixedByEditable))
	isFixedByReadOnly = false;
if (grMode!=null && grMode.length()>0)
{
	grMode = grMode.trim();
	if (grMode.equalsIgnoreCase("true"))
		grMode = "3D";
	else
		grMode = "2D";
}
else
{
	grMode= "3D";
}
graphLink +="&mode="+grMode+"&showRange=Range&monitorSkin=" + monitor_Skin;
trendGraphLink+="&mode="+grMode+"&period=H";
summaryGraphLink+="&mode="+grMode+"&period=H";

String wname="";
String sendSite = "";
String sendHost = "";
String sendPort = "";
String sendTest = "";
String sendInfo = "";
String sendMsmtHost = "";

String sendLayer="";
String sendGrpInfo ="";
String sendCompType ="";

if(ddLink !=null && !ddLink.equalsIgnoreCase("null") && ddLink.length() >0)
{
	StringTokenizer st = new StringTokenizer(ddLink,"&");
	while(st.hasMoreTokens())
	{
		String str = (String) st.nextToken();
		if(str.startsWith("site"))
			sendSite = str.substring(str.indexOf("=")+1);
		if(sendSite.length()==0)
			sendSite="null";
		if(str.startsWith("host"))
			sendHost = str.substring(str.indexOf("=")+1);
		if(str.startsWith("port"))
			sendPort = str.substring(str.indexOf("=")+1);
		if(str.startsWith("test"))
			sendTest = str.substring(str.indexOf("=")+1);
		if(str.startsWith("info"))
		{
			
			sendInfo = str.substring(str.indexOf("=")+1);
			
		}
		if(str.startsWith("info"))
	   sendGrpInfo =str.substring(str.indexOf("=")+1);
		if(str.startsWith("msmt_host"))
			sendMsmtHost = str.substring(str.indexOf("=")+1);
	}
}

if(graphLink!=null && !graphLink.equals(""))
{
	StringTokenizer st1 = new StringTokenizer(graphLink,"&");

	while(st1.hasMoreTokens())
	{
		String str = (String) st1.nextToken();

		if(str.startsWith("site"))
			sendSite = str.substring(str.indexOf("=")+1);
		if(sendSite.length()==0)
			sendSite="null";
		if(str.startsWith("host"))
			sendHost = str.substring(str.indexOf("=")+1);
		if(str.startsWith("port"))
			sendPort = str.substring(str.indexOf("=")+1);
		if(str.startsWith("test"))
			sendTest = str.substring(str.indexOf("=")+1);
		if(str.startsWith("info"))
		{
			sendInfo = str.substring(str.indexOf("=")+1);
			//int ii = sendInfo.indexOf("etouq");
			//if (ii > 0)
			//{
			//sendInfo = sendInfo.substring(0,sendInfo.indexOf("etouq"))+ "\"" +sendInfo.substring(sendInfo.indexOf("etouq")+5,sendInfo.length());
			//}

		}
		if(str.startsWith("msmt_host"))
			sendMsmtHost = str.substring(str.indexOf("=")+1);	
		if(str.startsWith("layer"))
			sendLayer = str.substring(str.indexOf("=")+1);

		if(str.startsWith("comptype"))
			sendCompType = str.substring(str.indexOf("=")+1);

		if(str.startsWith("info"))
		   sendGrpInfo =str.substring(str.indexOf("=")+1);
		
	}
}

if(trendGraphLink!=null && !trendGraphLink.equals(""))
{
	StringTokenizer st2 = new StringTokenizer(trendGraphLink,"&");

	while(st2.hasMoreTokens())
	{
		String str = (String) st2.nextToken();

		if(str.startsWith("site"))
			sendSite = str.substring(str.indexOf("=")+1);
		if(sendSite.length()==0)
			sendSite="null";
		if(str.startsWith("host"))
			sendHost = str.substring(str.indexOf("=")+1);
		if(str.startsWith("port"))
			sendPort = str.substring(str.indexOf("=")+1);
		if(str.startsWith("test"))
			sendTest = str.substring(str.indexOf("=")+1);
		if(str.startsWith("info"))
			sendInfo = str.substring(str.indexOf("=")+1);
		if(str.startsWith("msmt_host"))
			sendMsmtHost = str.substring(str.indexOf("=")+1);	
		if(str.startsWith("layer"))
			sendLayer = str.substring(str.indexOf("=")+1);

		if(str.startsWith("comptype"))
			sendCompType = str.substring(str.indexOf("=")+1);

		if(str.startsWith("info"))
			sendGrpInfo =str.substring(str.indexOf("=")+1);
	}
}

if(summaryGraphLink!=null && !summaryGraphLink.equals(""))
{
	StringTokenizer st3 = new StringTokenizer(summaryGraphLink,"&");

	while(st3.hasMoreTokens())
	{
		String str = (String) st3.nextToken();

		if(str.startsWith("site"))
			sendSite = str.substring(str.indexOf("=")+1);
		if(sendSite.length()==0)
			sendSite="null";
		if(str.startsWith("host"))
			sendHost = str.substring(str.indexOf("=")+1);
		if(str.startsWith("port"))
			sendPort = str.substring(str.indexOf("=")+1);
		if(str.startsWith("test"))
			sendTest = str.substring(str.indexOf("=")+1);
		if(str.startsWith("info"))
			sendInfo = str.substring(str.indexOf("=")+1);
		if(str.startsWith("msmt_host"))
			sendMsmtHost = str.substring(str.indexOf("=")+1);	
		if(str.startsWith("layer"))
			sendLayer = str.substring(str.indexOf("=")+1);

		if(str.startsWith("comptype"))
			sendCompType = str.substring(str.indexOf("=")+1);

		if(str.startsWith("info"))
			sendGrpInfo =str.substring(str.indexOf("=")+1);
		}
}
StringTokenizer st4 = null;
String sendGrpMeasure="";

if(aggregateLink!=null)
{
	st4 = new StringTokenizer(aggregateLink,"&");
	while(st4.hasMoreTokens())
	{
		String str = (String) st4.nextToken();

		if(str.startsWith("site"))
			sendSite = str.substring(str.indexOf("=")+1);
		if(sendSite.length()==0)
			sendSite="null";
		if(str.startsWith("host"))
			sendHost = str.substring(str.indexOf("=")+1);
		else if(str.startsWith("port"))
			sendPort = str.substring(str.indexOf("=")+1);
		else if(str.startsWith("test"))
			sendTest = str.substring(str.indexOf("=")+1);
		else if(str.startsWith("info"))
			sendInfo = str.substring(str.indexOf("=")+1);
		else if(str.startsWith("msmt_host"))
			sendMsmtHost = str.substring(str.indexOf("=")+1);	
		else if(str.startsWith("layer"))
			sendLayer = str.substring(str.indexOf("=")+1);
		else if(str.startsWith("comptype"))
			sendCompType = str.substring(str.indexOf("=")+1);
		else if(str.startsWith("info"))
			sendGrpInfo =str.substring(str.indexOf("=")+1);
		else if(str.startsWith("measure"))
			sendGrpMeasure =str.substring(str.indexOf("=")+1);

	}
}
String feedLinkValue="";
if(feedLink!=null && feedLink.trim().length()>0 && feedLink.indexOf("?")>-1)
{
	feedLinkValue=feedLink.substring(feedLink.indexOf("?")+1);
}
else if(feedLink!=null && feedLink.trim().length()>0)
{
	feedLinkValue=feedLink;
}
if(feedLink!=null && !feedLink.equals(""))
{
	st4 = new StringTokenizer(feedLinkValue,"&");
	String QstringValue="";
	while(st4.hasMoreTokens())
	{
		String str = (String) st4.nextToken();
		String reqparam =str.substring(0,str.indexOf("="));
		String value = str.substring(str.indexOf("=")+1,str.length());
		QstringValue=QstringValue+reqparam+"="+value+"&";

	}
}

if(sendTest!=null && (simTestList!= null && simTestList.contains(sendTest)  )&& currentTab != null && currentTab.equalsIgnoreCase("dd"))
{
	//isCTX = true;
	fromCtxDash = true;
}
if(sendTest.equalsIgnoreCase("GenericLogonSimTest") && !isScreenShotEnabled)
{
	fromCtxDash = false;
}
	String curFormat = userDateFormat;
	if(curFormat.indexOf("MMM") >= 0)
	{
		for(int i=0; i < curFormat.length();i++)
		{
			if(String.valueOf(curFormat.charAt(i)).equals("M"))
			{
				curFormat = curFormat.replace('M','N');
			}
		}
	}
	boolean isDDAllowed = ddLink!=null && !ddLink.equals("");
	boolean isGraphAllowed = graphLink!=null && !graphLink.equals("");
	boolean isHistoryAllowed = histLink!=null && !histLink.equals("");
	boolean isFeedAllowed = feedLink!=null && !feedLink.equals("");
	boolean isTrendGraphAllowed = trendGraphLink!=null && !trendGraphLink.equals("");
	boolean isSummaryGraphAllowed = summaryGraphLink!=null && !summaryGraphLink.equals("");
	//if(from!=null&&from.equals("measurespage")&&dd!=null&&dd.equals("yes"))
		//isDDAllowed=true;
	//else if(from!=null&&from.equals("measurespage")&&dd!=null&&dd.equals("no"))
		//isDDAllowed=false;

	if(isFromUED!=null && isFromUED.trim().length()>0 && !isFromUED.equalsIgnoreCase("true"))
		ddLink=ddLink+"&comptype="+sendCompType;

	//add start time and end time...
	String userFormat = (String)user.getUserDateFormat();
	String stime = request.getParameter("stime");
	String fromSearch = request.getParameter("fromSearch");
	String latime = request.getParameter("latime");
	String louttime = request.getParameter("louttime");
	
	if(latime !=null && !latime.equals(""))
	{

		if(fromSearch != null && fromSearch.equalsIgnoreCase("true")){
			String ladate = latime.substring(0,latime.lastIndexOf(" "));
			String latme = latime.substring(latime.lastIndexOf(" ")).trim();
			ladate = DateUtil.changeDateFormat(ladate,currentDateFormat,userFormat);
			latime=ladate+" "+latme;
			String tempp = userFormat+" HH:mm";
			SimpleDateFormat sdf = new SimpleDateFormat(tempp);
			Date bltime = null;
			//Date bltime= sdf.parse(latime);//Date etime=stime;
			//String backLiftedTime = sdf.format(bltime);
			if(louttime!=null && louttime.trim().length()>0 && !louttime.equalsIgnoreCase("NULL"))
			{
				Date lin_time = sdf.parse(latime);
				lin_time.setTime(lin_time.getTime() - (10*60*1000));
				latime = sdf.format(lin_time);

				String lodate = louttime.substring(0,louttime.lastIndexOf(" "));
				lodate = DateUtil.changeDateFormat(lodate,currentDateFormat,userFormat);
				String loutme = louttime.substring(louttime.lastIndexOf(" ")).trim();
				loutme = lodate+" "+loutme;
				bltime = sdf.parse(loutme);
			}
			else
			{
				int timeLine2 = 3600;
				int no_of_hours = Integer.valueOf(nofhours);
				bltime = sdf.parse(latime);
				bltime.setTime(bltime.getTime() - ((timeLine2 * no_of_hours ) * 1000));
			}
			String backLiftedTime = sdf.format(bltime);

			//change to user format....
			EgTimeZoneConverter startConverter = new EgTimeZoneConverter(latime,user);
			String lattime = (String)startConverter.getDate(false);
			lattime = DateUtil.changeDateFormat(lattime,userFormat,"MM/dd/yyyy");
			String lathr = startConverter.getHour();
			String latmin = startConverter.getMinute();
			EgTimeZoneConverter endConverter = new EgTimeZoneConverter(backLiftedTime,user);
			String blttime = (String)endConverter.getDate(false);
			blttime = DateUtil.changeDateFormat(blttime,userFormat,"MM/dd/yyyy");
			String blhr = endConverter.getHour();
			String blmin = endConverter.getMinute();
			if(louttime!=null && louttime.trim().length()>0 && !louttime.equalsIgnoreCase("NULL"))
			{
				graphLink +="&timeLine=Any"+ "&starttime="+lattime+"&starthr="+lathr+"&startmin="+latmin+"&endtime="+blttime+"&endhr="+blhr+"&endmin="+blmin;
				ddLink +="&timeline=Any"+ "&starttime="+lattime+"&starthr="+lathr+"&startmin="+latmin+"&endtime="+blttime+"&endhr="+blhr+"&endmin="+blmin;
			}
			else
			{
				graphLink +="&timeLine=Any"+ "&starttime="+blttime+"&starthr="+blhr+"&startmin="+blmin+"&endtime="+lattime+"&endhr="+lathr+"&endmin="+latmin;
				ddLink +="&timeline=Any"+ "&starttime="+blttime+"&starthr="+blhr+"&startmin="+blmin+"&endtime="+lattime+"&endhr="+lathr+"&endmin="+latmin;
			}
			//graphLink +="&timeLine=Any"+ "&starttime="+sttime+"&starthr="+sthr+"&startmin="+stmin+"&endtime="+entime+"&endhr="+enhr+"&endmin="+enmin;
			//ddLink +="&timeline=Any"+ "&starttime="+sttime+"&starthr="+sthr+"&startmin="+stmin+"&endtime="+entime+"&endhr="+enhr+"&endmin="+enmin;
		}
	}
	else if(stime !=null && !stime.equals(""))
	{

		String sdate = stime.substring(0,stime.lastIndexOf(" "));
		String stme = stime.substring(stime.lastIndexOf(" ")).trim();
		sdate = DateUtil.changeDateFormat(sdate,currentDateFormat,userFormat);
		stime=sdate+" "+stme;
		String tempp = userFormat+" HH:mm";
		SimpleDateFormat sdf = new SimpleDateFormat(tempp);
		//java.util.Date tmpday = new java.util.Date(egDt.egetUTCDate());
		java.util.Date tmpday = egDt.egetRealDate();
		String endDateTime = sdf.format(tmpday);
		int timeLine2 = 3600;
		tmpday.setTime(tmpday.getTime() + (timeLine2 * 1000));
		endDateTime = sdf.format(tmpday);
		//change to user format....
		
		EgTimeZoneConverter startConverter = new EgTimeZoneConverter(stime,user);
		String sttime = (String)startConverter.getDate(false);
		sttime = DateUtil.changeDateFormat(sttime,userFormat,"MM/dd/yyyy");
		String sthr = startConverter.getHour();
		String stmin = startConverter.getMinute();
		EgTimeZoneConverter endConverter = new EgTimeZoneConverter(endDateTime,user);
		String entime = (String)endConverter.getDate(false);
		entime = DateUtil.changeDateFormat(entime,userFormat,"MM/dd/yyyy");
		String enhr = endConverter.getHour();
		String enmin = endConverter.getMinute();
		//graphLink +="&timeLine=Any"+ "&starttime="+sttime+"&starthr="+sthr+"&startmin="+stmin+"&endtime="+entime+"&endhr="+enhr+"&endmin="+enmin;
		graphLink +="&timeLine=Any"+ "&starttime="+sttime+"&starthr="+sthr+"&startmin="+stmin+"&endtime="+entime+"&endhr="+enhr+"&endmin="+enmin;
		//ddLink +="&timeline=Any"+ "&starttime="+sttime+"&starthr="+sthr+"&startmin="+stmin+"&endtime="+entime+"&endhr="+enhr+"&endmin="+enmin;
		ddLink +="&timeline=Any"+ "&starttime="+sttime+"&starthr="+sthr+"&startmin="+stmin+"&endtime="+entime+"&endhr="+enhr+"&endmin="+enmin;
	}
	else if(appendHostinKey != null && appendHostinKey.equalsIgnoreCase("true"))
	{
		String starttime=request.getParameter("starttime");
		String starthr=request.getParameter("starthr");
		String startmin=request.getParameter("startmin");
		String endtime=request.getParameter("endtime");
		String endhr=request.getParameter("endhr");
		String endmin=request.getParameter("endmin");
		ddLink+="&starttime="+starttime+"&starthr="+starthr+"&startmin="+startmin+"&endtime="+endtime+"&endhr="+endhr+"&endmin="+endmin+"&appendHostinKey="+appendHostinKey;
		graphLink+="&starttime="+starttime+"&starthr="+starthr+"&startmin="+startmin+"&endtime="+endtime+"&endhr="+endhr+"&endmin="+endmin;
	}
	

	ddLink			 = response.encodeURL(ddLink);
	graphLink		 = response.encodeURL(graphLink);

	histLink		 = response.encodeURL(histLink);
	feedLink		 = response.encodeURL(feedLink);
	aggregateLink	 = response.encodeURL(aggregateLink);
	trendGraphLink	 = response.encodeURL(trendGraphLink);
	summaryGraphLink = response.encodeURL(summaryGraphLink);
	
	long refreshFrequency = 60 * 1000L;
	String refFreq = u_ser.getRefreshFrequency();

	if(refFreq!=null && refFreq.length()>0)
	{
		refreshFrequency =  Long.valueOf(refFreq).longValue() * 1000L;
	}
	
	if(displayWhiteBg)
	{
%>
<html style="background-color:#000;" class="content-frame">
<%
	}
	else
	{
%>
<html>
<%
	}
%>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
	<title><%=(hostName!=null&&!hostName.equals("NULL"))?hostName+((port!=null && !port.equalsIgnoreCase("null"))?":"+port:"")+" > ":""%>
<%=(info!=null&&!info.equals("NULL"))?info +" > ":""%></title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
         <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
		<script>
			var isLicenseViolatedType = <%=isLicenseViolatedType%>;
			var ShowAnyTimeline = <%=ShowAnyTimeline%>;
			var currentDateFormat = '<%=currentDateFormat%>';
			var monitor_Skin = '<%=monitor_Skin%>';
			var exportViaHighchart = <%=exportViaHighchart%>;
			var refDate = new Date();
			var chr = '<%=chr%>';
			var cmin = '<%=cmin%>';
			var cyear = '<%=cyear%>';
			var cmon = '<%=cmon%>';
			var cday = '<%=cday%>';
			var csec = '<%=csec%>';
			var isRUM='<%=isRUM%>';
			var isCTX='<%=isCTX%>';
			var isCTXComp='<%=isCTXComp%>';
			var isUserHaveDirector=<%=isUserHaveDirector%>;
			var curDate;
			var fusionChartsApiEnabled=eval('<%=fusionChartsEnabled%>');
			var measurementtimeLbl ="";
			var measurementLbl = "";
			var sortByLbl = "";
			var er_RmDispName="";
			var appConstants="";
			var fromCtxDash = <%=fromCtxDash%>;
			var isSSType = <%=isSSType%>;
			var isFromUserSession = <%=isFromUserSession%>;
			var printwin = "";
			var isMisc = <%=isMisc%>;
			var linewin = "";
			var gdwin = "";
			var savepopwin = "";
			var savepop = "";
			var ddwin = "";
			var isFixedByReadOnly = <%=isFixedByReadOnly%>;
			var csrfToken = '<%=strCsrfToken%>';
			var strFromPage='<%=fromPage%>';
			var tmp_measureTextt='<%=tmp_measureTextt%>';
			var monitor_Skin='<%=monitor_Skin%>';
			var saveLbl= '<egui:intnl text="monitor.common.Save"/>';
			var updateLbl= '<egui:intnl text="monitor.common.Update"/>';
			var saveLocLbl= '<egui:intnl text="monitor.common.Save Location"/>';
			var invalLocLbl= '<egui:intnl text="monitor.common.Invalid Locations"/>';
			var valRegLbl= '<egui:intnl text="monitor.common.Please type valid Region"/>';
			var valCityLbl= '<egui:intnl text="monitor.common.Please type valid City"/>';
			var LocDetailLbl= '<egui:intnl text="monitor.common.Location Details"/>';
			var savSuccLbl= '<egui:intnl text="monitor.common.Saved successfully"/>';
			var failSavValLbl= '<egui:intnl text="monitor.common.Failure to save the values"/>';
			var dataLbl= '<egui:intnl text="monitor.common.Data"/>';
			var isScreenShotEnabled='<%=isScreenShotEnabled%>';
		</script>
        <egui:skin ui="monitor"/>
		<egui:loadApp baseDir="/final/monitor/eg_scripts" appName="ComponentMeasureTabSet" appFile="ComponentMeasureTabSet.js"/>
<%
if(monitor_Skin.toLowerCase().equalsIgnoreCase("light")){
%>
<link rel="stylesheet" type="text/css" href="/final/monitor/eg_styles/CitrixLogonLight.css" />
<%
}else{
%>
<link rel="stylesheet" type="text/css" href="/final/monitor/eg_styles/CitrixLogonDark.css" />
<%
}
%>
<!-- Jquery Drag & Drop Scripts (Begin) -->
<script src="/final/jquery/jquery.js"></script>
<script  src="/final/jquery/ui/jquery.ui.core.js"></script>
<script  src="/final/jquery/ui/jquery.ui.widget.js"></script> 
<script  src="/final/jquery/ui/jquery.ui.mouse.js"></script>
<script  src="/final/jquery/ui/jquery.ui.draggable.js"></script>
<!--  <link rel="stylesheet" type="text/css" href="/final/styles/eGDarkThemeIcons.css" /> -->
<!-- Jquery Drag & Drop Scripts (End) -->

<script type="text/javascript" src="/final/scripts/rgbcolor.js"></script> 

<script type="text/javascript" src="/final/scripts/StackBlur.js"></script>

<script type="text/javascript" src="/final/scripts/canvg.js"></script> 

<script type="text/javascript" src="/final/scripts/jsPDF.js"></script>

<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
<script language="javascript" src="/final/monitor/eg_scripts/ajaxutils.js" type="text/javascript"></script>
<style>
	.x-panel-newGridPanel .x-grid-row .x-grid-cell
	{
		vertical-align:top !important;
	}

	#threadnameSelect ul {
		display:grid;
	}
</style>

<script  type="text/javascript">
var csvHideTests = new Array();
var pdfHideTests = new Array();
var seqHideTests = new Array();
var search_el = new Object();
var search_el_key = new Array();
//ArrayList csvHideList = null,pdfHideList = null;
<%
	if(search_el != null && search_el.size() > 0){
		Iterator it = search_el.entrySet().iterator();
		while(it.hasNext()){
			Entry en = (Entry)it.next();
			String key = (String)en.getKey();
			String val = (String)en.getValue();
			if(key == null || val == null)
				continue;
			key = key.trim();
			val = val.trim();
			%>
				search_el_key.push('<%=key%>');
				search_el['<%=key%>']='<%=val%>';
			<%
			
		}
	}
	
	if(csvHideList != null ){
		for(int c=0;c<csvHideList.size();c++){
			String testName = (String) csvHideList.get(c);
			%>
				csvHideTests.push('<%=testName%>');
			<%
		}
	}

	if(pdfHideList != null ){
		for(int c=0;c<pdfHideList.size();c++){
			String testName = (String) pdfHideList.get(c);
			%>
				pdfHideTests.push('<%=testName%>');
			<%
		}
	}
	if(seqList != null){
		for(int c=0;c<seqList.size();c++){
			String testName = (String) seqList.get(c);
			%>
				seqHideTests.push('<%=testName%>');
			<%
		}
	}
	
%>
</script>


	<!--<link rel="stylesheet" type="text/css" href="../extjs/css/ext-all.css" />
	 <link rel="stylesheet" type="text/css" href="../monitor/eg_styles/common.css" />
	 <link rel="stylesheet" type="text/css" href="../monitor/eg_styles/ComponentMeasureTabSet.css" />-->
<%
	if(displayWhiteBg)
	{
%>

<%
	}
%>
	 <!-- <script src="../monitor/eg_scripts/build/component-measure-tabset-classes.js"></script> -->
	<!--load JQuery  -->
	<!-- <script src="/final/jquery/jquery.js"></script> -->
	<script language="JavaScript1.2" src="/final/jquery/jquery.js"></script>
	<script type="text/javascript" src="../styles/jscrollpane/jquery.jscrollpane.js"></script>
	<!-- <script language="JavaScript1.2" src="/final/jquery/jquery.min.js"></script> -->
	<!-- styles needed by jScrollPane -->
	<!-- the mousewheel plugin - optional to provide mousewheel support -->
	<script type="text/javascript" src="../styles/jscrollpane/jquery.mousewheel.js"></script>
	<script type="text/javascript" src="../styles/jscrollpane/mwheelIntent.js"></script>
	<!-- the jScrollPane script -->
	
	 <script src="/final/scripts/eg_DateUtil.js"></script>
	 <script src="/final/scripts/jspdf.min.js"></script>
	 <script src="/final/scripts/html2canvas.js"></script>
	 <script language="JavaScript1.2" src="eg_scripts/eg_date.js"></script>
	 <script language="JavaScript1.2" src="eg_scripts/eg_validate.js"></script>
	 <script type="text/javascript" src="/final/monitor/eg_scripts/eg_aggregate.js"></script>
	 <script language="JavaScript1.2" src="/final/Highcharts/js/highstock.js"></script>
	 <script type="text/javascript" src="/final/Highcharts/js/modules/exporting.js"></script>
	<!-- <script type="text/javascript" src="/final/FusionCharts/scripts/FusionCharts.js"></script>-->
	 <script src="../monitor/eg_scripts/EgHighChart.js"></script>
	 <script src="/final/monitor/eg_scripts/ajaxutils.js" type="text/javascript"></script>
	<Script type="text/javascript">
	var requestParams=new Object();
	var refreshFrequency=<%=refreshFrequency%>;
	var ddLink = '<%=ddLink%>';

	var filterByLbl = '<egui:intnl text="monitor.common.Filter by Measurement Time" />';
	var logouTitle = '<egui:intnl text="monitor.common.Logout" />';
	var webLogonTitle = '<egui:intnl text="monitor.common.Web Logon" />';
	var appTitle = '<egui:intnl text="monitor.common.Application/" />';
	var aDesTitle = '<egui:intnl text="monitor.common.Desktop" />';
	var succTitle = '<egui:intnl text="monitor.common.Success" />';
	var failTitle = '<egui:intnl text="monitor.common.Failure" />';
	var webURLTitle = '<egui:intnl text="monitor.common.Web URL" />';
	var sessionHostTitle = '<egui:intnl text="monitor.common.Session Host" />';
	var userTitle = '<egui:intnl text="monitor.common.User" />';
	var targetTitle = '<egui:intnl text="monitor.common.Target" />';
	var totalsimTitle = '<egui:intnl text="monitor.common.Total simulation time" />';
	var flowfortxt = '<egui:intnl text="monitor.common.flow for" />';
	var attext = '<egui:intnl text="monitor.common.at" />';
	var launchTitle = '<egui:intnl text="monitor.common.Launch" />';

	var inboxTitle = '<egui:intnl text="monitor.common.Inbox" />';
	var accessTitle = '<egui:intnl text="monitor.common.Access" />';
	var durationTitle = '<egui:intnl text="monitor.common.Duration" />';

	var minLbl = '<egui:intnl text="monitor.common.Min" />';
	var maxLbl = '<egui:intnl text="monitor.common.Max" />';
	measurementtimeLbl = '<egui:intnl text="monitor.common.Measurement Time" />';
	measurementLbl = '<egui:intnl text="monitor.common.Measurement" />';
	sortByLbl = '<egui:intnl text="monitor.common.Sort By" />';
	var descriptorRawData="";
	var chooseDescriptor = '<egui:intnl text="monitor.common.Please choose a Descriptor"/>';
	var page = '<egui:intnl text="monitor.common.Page"/>';
	requestParams.mgr_dateFormat= getExtjsDateFormat('<%=dateFormatForDatePicker%>');
	var reporter_evtHstry = <%=reporter_evtHstry%>;
	var tabsInfo=new Array();
	
	var isFromGraphData = false;
	var siteName= '<%=siteName%>';
	var s_compTy= '<%=sendCompType%>';
	var hostName= '<%=hostName%>';
	var port= '<%=port%>';
	var heading = '<%=hostName%>';
	var URLForSql="";
	var sortTestList = new Array();
	requestParams.isForSuccessScreenshot = 'false';
	<%
	if(sortList != null)
	{
		for(int c=0;c<sortList.size();c++){
			String testName = (String) sortList.get(c);
			%>
				sortTestList.push('<%=testName%>');
			<%
		}
	}
	%>
	function exportPdf(content)
	{
		var divHeight = $('#innerDiagram').height();
		var divWidth = $('#innerDiagram').width();
		var ratio = divHeight / divWidth;
		html2canvas(document.getElementById("innerDiagram"), {
			height: divHeight,
			width: divWidth,
			useCORS: true,
			allowTaint: false,
			letterRendering: true,
			logging:true,
			onrendered: function(canvas) {
				var image = canvas.toDataURL("image/jpeg");
				var doc = new jsPDF('l','mm', [divHeight, divWidth]); // using defaults: orientation=portrait, unit=mm, size=A4
				var width = doc.internal.pageSize.width;    
				var height = doc.internal.pageSize.height;
				height = ratio * width;
				doc.addImage(image, 'JPEG', 0, 0, width, height);
				doc.save('Logon_Simulator_data.pdf'); //Download the rendered PDF.		
			}
		});
	}
	function filterEncode(text)
	{
		var filterEncodeChar = ['[',']','(',')','=','&','%','\'',';','\\'];
		var filterDecodeText = ['|lsbr|','|rsbr|','|lbr|','|rbr|','|eq|','|ampsnd|','|per|','|squot|','|scol|','|slash|'];
		try
		{
			if(text != null && text != undefined && !Ext.isEmpty(text))
			{
				for(var a in filterEncodeChar)
				{
					var encode_char = filterEncodeChar[a];
					var decode_char = filterDecodeText[a];
					do
					{
						text=text.replace(encode_char,decode_char);
					}
					while (text.indexOf(encode_char)>-1);
				}
			}
		}
		catch (e)
		{
		}
		return text;
	}

	function filterDecode(text)
	{
		var filterEncodeChar = ['[',']','(',')','=','&','%','\'',';','\\'];
		var filterDecodeText = ['|lsbr|','|rsbr|','|lbr|','|rbr|','|eq|','|ampsnd|','|per|','|squot|','|scol|','|slash|'];
		try
		{
			if(text != null && text != undefined && !Ext.isEmpty(text))
			{
				for(var a in filterEncodeChar)
				{
					var encode_char = filterEncodeChar[a];
					var decode_char = filterDecodeText[a];
					do
					{
						text=text.replace(decode_char,encode_char);
					}
					while (text.indexOf(decode_char)>-1);
				}
			}
		}
		catch (e)
		{
		}
		return text;
	}

	function show_hide_centered_href(href,headtext,skin)
	{
		URLForSql = href;
		var win = Ext.create('Ext.window.Window', {
				title: 'Process Details - '+heading,
				height: 500,
				width: '80%',
				shadow:true,
				scroll:false,
				autoScroll:false,
				modal: true,
				ghost: false,
				id:'windowValue',
				style:{'min-width':'750px !important'},
				selectedValue:href,
				closeAction: "destroy",
				constrain: true,
				resizable: false,
				closable: true,
				layout:{
					type:'fit',
					//align:'stretch'
					pack: 'center'
				},
				items: [{ 
						//xtype:'container',
						//id:'Process_Details_Id',
						//html:'<iframe src='+href+' height="100%" width="100%"></iframe>'
						xtype:'processdetails',
						//url:val
				}]
			}).show();

			Ext.EventManager.onWindowResize(function (){
				if(Ext.getCmp('windowValue') != null && Ext.getCmp('windowValue') != undefined && Ext.getCmp('windowValue').hidden == false){
					Ext.getCmp('windowValue').center()
				}
			});
	}
	function threadWindow(val)/*-----------Vijay----------------*/
	{
			var win = Ext.create('Ext.window.Window', {
			title: 'Thread Diagnosis',
			height: 500,
			width: '90%',
			shadow:true,
			scroll:false,
			autoScroll:false,
			modal: true,
			ghost: false,
			id:'windowValue',
			selectedValue:val,
			closeAction: "destroy",
			constrain: true,
			//iconCls:'iconClose2',
			closable:true,
			layout:{
				type:'fit',
				//align:'stretch'
				pack: 'center'
			},
			items: { 
					xtype:'threaddetails'
			}
		}).show();
	}

	function heapWindow(val,href)/*-----------Vijay----------------*/
	{
			var win = Ext.create('Ext.window.Window', {
			title: 'Heap Analysis',
			height: 500,
			width: '90%',
			shadow:true,
			scroll:false,
			autoScroll:false,
			modal: true,
			ghost: false,
			id:'windowValue',
			selectedValue:val,
			selectedHref:href,
			closeAction: "destroy",
			constrain: true,
			//iconCls:'iconClose2',
			closable:true,
			layout:{
				type:'fit',
				//align:'stretch'
				pack: 'center'
			},
			items: { 
					xtype:'threaddetails'
			}
		}).show();
	}

	function JTMBase_Url_Tree(href,headtext,skin) //JavaTransactionsTest JTM tree method --- murugan
	{
		headtext="host";
		skin="gray";
		URLForSql = href;
		var heading = URLForSql.substring(URLForSql.indexOf('&host')+6);
		heading=heading.substring(0,heading.indexOf('&'));
		//console.log(URLForSql);
		var win = Ext.create('Ext.window.Window', {
		title: 'URL Tree-'+heading,
		height: 500,
		width: '90%',
		shadow:true,
		scroll:false,
		autoScroll:false,
		modal: true,
		ghost: false,
		id:'windowValue',
		//selectedValue:val,
		closeAction: "destroy",
		constrain: true,
		//iconCls:'iconClose2',
		closable:true,
		layout:{
			type:'fit',
			//align:'stretch'
			pack: 'center'
		},
		items: { 
				xtype:'container',
				id:'JTMBase_Id',
				html:'<iframe src='+URLForSql+' width="100%" height="100%" frameborder="0"></iframe>'
		}
		}).show();
	}

	//new block created by murugan for link thread
	function threadLinkWindow(val,mt)
	{
			val = filterDecode(val);
			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(filterEncode(val))+"&time="+encodeURIComponent(measureTime)+"&onlyData=true");
		}
	}
	//new block created by murugan for link thread

	function showDivs(divId)
	{
		var show_div = document.getElementById(divId);
		if(show_div!=null)
		{
			show_div.style.display = 'block';
			show_div.style.position = 'absolute';
			bringToFront(show_div);
		}
	}

	function hideDivs(divId)
	{
		var show_div = document.getElementById(divId);
		if(show_div!=null)
		{
			show_div.style.display="none";
		}
	}
		function check()
		{
			var currentQS = window.location.href;
			var lastIndex = currentQS.lastIndexOf('#');
			showTab = '<%=temp%>';
			var currentPage ='';
			if (lastIndex >-1)
				currentPage = currentQS.substring(lastIndex+1,currentQS.length);
			else
				currentPage = 'empty';
			if(isMisc == true || isMisc == 'true'){
				showMiscCtx('<%=miscUrl%>');
			}
			else if(fromCtxDash == true || fromCtxDash == 'true'){
				showctxLogonDia('<%=ddLink%>'+'&fromPage=layMod&newWindow=true&comeFrom=true&isFromCtxHist=true&isForSuccessScreenshot=<%=successScreenshot%>&isPopUp=<%=newWindow%>');
			}
			else if (currentPage=='empty')
			{
				if (showTab=='dd')
				{
					showDDiagnosis('<%=ddLink%>'+'&fromPage=layMod&newWindow=true&comeFrom=true&isForSuccessScreenshot=<%=successScreenshot%>&isPopUp=<%=newWindow%>');
				}
				else if(showTab=='graph')
				{
					showGraph('<%=graphLink%>');
				}
				else if(showTab=='history')
				{
					showHistory('<%=histLink%>');
				}
				else if(showTab=='trendgraph')
				{	
					showTrendGraph('<%=trendGraphLink%>');
				}
				else if(showTab=='summarygraph')
				{
					showSummaryGraph('<%=summaryGraphLink%>');
				}else if(showTab=='feedback')
				{
					showFeedBack('<%=feedLink%>');
				}
			}
			else if(currentPage=='DDiagnosis')
			{
				showDDiagnosis('../monitor/EgDiagnosis.jsp?<%=tabQS%>'+'&fromLayer=true&comeFrom=true&newWindow=true&isForSuccessScreenshot=<%=successScreenshot%>&isPopUp=<%=newWindow%>');
			}
			else if (currentPage=='Graph')
			{
				showGraph('../monitor/dispComponentGraphs.jsp?<%=tabQS%>');
			}
			else if (currentPage=='History')
			{
				showHistory('../monitor/dispComponentHistory.jsp?<%=tabQS%>');
			}
			else if (currentPage=='Feedback')
			{
				showFeedBack('../monitor/dispComponentFeedback.jsp?<%=tabQS%>');
			}
			else if (currentPage=='CGraph')
			{
				showCompGraph('../monitor/dispAggComponentGraphs.jsp?<%=tabQS%>');
			}
			else if(currentPage=='TrendGraph')
			{
				showTrendGraph('../monitor/dispComponentTrendGraphs.jsp?<%=tabQS%>');
			}
			else if(currentPage=='SummaryGraph')
			{
				showSummaryGraph('../monitor/dispComponentSummaryGraphs.jsp?<%=tabQS%>');
			}
		}

		var ddXmlRequest;
		var grXmlRequest;
		var hiXmlRequest;
		var feXmlRequest;
		function showMiscCtx(url)
		{
			requestParams.activeTab='tab0';
			requestParams.activeTabUrl=url;
		}
		function showctxLogonDia(url)
		{

			if(fromCtxDash == true || fromCtxDash == 'true')
				requestParams.activeTab='tab0';
			else
				requestParams.activeTab='tab9';

			requestParams.isForSuccessScreenshot='<%=successScreenshot%>';
			
			var logonUrl = url;
			try
			{
				if(logonUrl.indexOf('&fromPage=') != -1)
				{
					logonUrl = logonUrl.substring(0,logonUrl.indexOf('&fromPage='));
					logonUrl +="&clicked=dd&fromLayer=true&comeFrom=true&isForSuccessScreenshot=<%=successScreenshot%>&isPopUp=true";
				}
			}
			catch (e)
			{
				logonUrl = url;
			}
			requestParams.activeTabUrl=logonUrl+"&isFromCtxHist=true";
		}

		function showDDiagnosis(url)
		{
			requestParams.activeTab='tab1';
			requestParams.activeTabUrl=url+"&isVM=<%=isVM%>";
			if(isFromUserSession)
				requestParams.activeTabUrl = url+"&isFromUserSession=true&isVM=<%=isVM%>";

			requestParams.activeTabUrl = requestParams.activeTabUrl+"&isScreenShotEnabled=<%=isScreenShotEnabled%>";
		}
			
		function showGraph(url)
		{
			requestParams.activeTab='tab2';
			requestParams.activeTabUrl=url+"&tabSetPage=true&isVM=<%=isVM%>";
		}
		
		function showTrendGraph(url){
			requestParams.activeTab='tab4';
			requestParams.activeTabUrl=url+"&tabSetPage=true&isVM=<%=isVM%>";
		}
		
		function showSummaryGraph(url)
		{
			requestParams.activeTab='tab3';
			requestParams.activeTabUrl=url+"&tabSetPage=true&isVM=<%=isVM%>";
		}
		function showFeedBack(url){
			requestParams.activeTab='tab6';
			requestParams.activeTabUrl=url+"&tabSetPage=true&isVM=<%=isVM%>";
		}
		
		function showHistory(url)
		{
			requestParams.activeTab='tab5';
			requestParams.activeTabUrl=url+"&tabSetPage=true&isVM=<%=isVM%>";
		}
		function showCompGraph(url)
		{
			requestParams.activeTab='tab7';
			requestParams.activeTabUrl=url+"&tabSetPage=true";
		}
		
		
		var containsDD = false;
		/*DD tab*/
		<%
			if(isMisc)
			{
				%>
					tabsInfo.push({
						id:'tab0',
						name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Diagnosis")%>',
						misc:true,
						tabUrl:'<%=miscUrl%>',
						type:'ctxlogon'
					});
					requestParams.activeTab='tab0';
					requestParams.activeTabUrl='<%=miscUrl%>';
				<%
			}

			if (!isMisc && isDDAllowed && (excludeDDTestList != null && excludeDDTestList.size() > 0 && !excludeDDTestList.contains(sendTest)))
			{
				if(fromCtxDash)
				{
					//ddTabName="Details";
					//onlyDDTab = fromCtxDash ;

					%>
					containsDD = true;
					tabsInfo.push({
						id:'tab0',
						name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Diagnosis")%>',
						tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isFromCtxHist=true&isPopUp="+newWindow%>',
						type:'ctxlogon'
					});
					<%if(!isSSType && sendTest.equalsIgnoreCase("GenericLogonSimTest") && isScreenShotEnabled){ %>

						tabsInfo.push({
							id:'tab1',
							name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Details")%>',
							tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&needDetails=true&comeFrom=true&isPopUp="+newWindow%>',
							type:'DDiagnosis'
						});
					
						
					<%
					}
					else if(!isSSType && (!sendTest.equalsIgnoreCase("GenericLogonSimTest") && !isScreenShotEnabled && !sendTest.equalsIgnoreCase("CitraTest")) || (!sendTest.equalsIgnoreCase("GenericLogonSimTest") && !sendTest.equalsIgnoreCase("CitraTest") && isScreenShotEnabled))
					{%>
						tabsInfo.push({
							id:'tab1',
							name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Details")%>',
							tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isPopUp="+newWindow%>',
							type:'DDiagnosis'
						});
					<%}
				}else if(isCTX){
					%>
						containsDD = true;
						tabsInfo.push({
							id:'tab1',
							name:'<%=ddTabName%>',
							tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isPopUp="+newWindow%>',
							type:'DDiagnosis'
						});
					<%if(!isSSType){ %>
						tabsInfo.push({
							id:'tab9',
							name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Details")%>',
							tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isPopUp="+newWindow%>',
							type:'ctxlogon'
						});
					
					<%
					}
				}else{
					
		%>	
					if(isCTXComp == true || isCTXComp == 'true' ){
						containsDD = true;
						tabsInfo.push({
							id:'tab0',
							name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Diagnosis")%>',
							tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isFromCtxHist=true&isPopUp="+newWindow%>',
							type:'ctxlogon'
						});
						<%if(!isSSType){ %>
						tabsInfo.push({
							id:'tab1',
							name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Details")%>',
							tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isPopUp="+newWindow%>',
							type:'DDiagnosis'
						});
						
						<%}%>
					}else{
						containsDD = true;
						<%if(!isSSType && ((sendTest.equalsIgnoreCase("GenericLogonSimTest") && isScreenShotEnabled) || sendTest.equalsIgnoreCase("CitraTest"))){%>
							tabsInfo.push({
							id:'tab0',
							name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Diagnosis")%>',
							tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isFromCtxHist=true&isPopUp="+newWindow%>',
							type:'ctxlogon'
						});
						<%}%>
						
						<%if(!isSSType && sendTest.equalsIgnoreCase("GenericLogonSimTest") && isScreenShotEnabled){%>
							tabsInfo.push({
								id:'tab1',
								name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Details")%>',
								tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&needDetails=true&comeFrom=true&isPopUp="+newWindow%>',
								type:'DDiagnosis'
							});

						<%}else if((!sendTest.equalsIgnoreCase("GenericLogonSimTest") && !isScreenShotEnabled && !sendTest.equalsIgnoreCase("CitraTest") && isShowDD) || (sendTest.equalsIgnoreCase("GenericLogonSimTest") && !isScreenShotEnabled && isShowDD)){%>
							tabsInfo.push({
								id:'tab1',
								name:'<%=ddTabName%>',
								tabUrl:'<%=ddLink+"&clicked=dd&fromLayer=true&comeFrom=true&isPopUp="+newWindow%>',
								type:'DDiagnosis'
							});
						<%}%>
					}
				
		<%
				}
			}
			if(!isMisc && !onlyDDTab)
			{
		%>
		 tabsInfo.push({
             id:'tab2',
             name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Measure Graph")%>',
             tabUrl:'<%=graphLink%>',
		 containsDD:containsDD,
		 ddUrl:'<%=ddLink%>',
             type:'Graph'
         });
		 <%
			}
			if(!isMisc && (!onlyDDTab) && EgInstallInfo.isAggregationSupported() && type!=null && type.startsWith("Agg_"))
			{
		  %>
				 tabsInfo.push({
		             id:'tab7',
		             name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Comparison Graph")%>',
		             tabUrl:'<%=aggregateLink%>',
		             type:'CompGraph'
		         });
		<%
			}
		

			if (!isMisc && (!onlyDDTab) && !hideTrendTab && disabledTrendTest!=null && sendTest!=null && !sendTest.trim().equals("") && !disabledTrendTest.contains(sendTest))
			{
		%>
				 tabsInfo.push({
		             id:'tab3',
		             name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Summary Graph")%>',
		             tabUrl:'<%=summaryGraphLink%>',
		             type:'SummaryGraph'
		         });

				 tabsInfo.push({
		             id:'tab4',
		             name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Trend Graph")%>',
		             tabUrl:'<%=trendGraphLink%>',
		             type:'TrendGraph'
		         });
			<%
				}
				if(!isMisc && !onlyDDTab)
				{
			%>

			 tabsInfo.push({
	             id:'tab5',
	             name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Fix History")%>',
	             tabUrl:'<%=histLink%>',
	             type:'History'
	         });
 <%
				}
			if(!isMisc && (!onlyDDTab) && !EgInstallInfo.isSuperManager)
			{
%>
			 tabsInfo.push({
	             id:'tab6',
	             name:'<%=egMappingInfo.getTextDescription("monitor.layermodel.Fix Feedback")%>',
	             tabUrl:'<%=feedLink%>',
	             type:'FeedBack'
	         });
<%
			}
%>
			 requestParams.tabsInfo=tabsInfo;
			 <%
				if(currentTab!=null)
				{
					if(currentTab.equalsIgnoreCase("dd"))
					{
						if(tabQS!=null)
						{
							StringTokenizer st = new StringTokenizer(tabQS,"&");
							StringBuffer sb = new StringBuffer();
							String testtemp=null;
							while(st.hasMoreTokens())
							{
								String token = st.nextToken();
								if(token!=null)
								{
									if(token.startsWith("test"))
									{
										if(token.indexOf("=")>-1)
											testtemp = token.substring(token.indexOf("=")+1);
									}
									else if(token.startsWith("measure"))
									{
										String value =null;
										String measurevalue=null;

										if(token.indexOf("=")>-1)
											value=token.substring(token.indexOf("=")+1);
										if(value!=null)
											measurevalue=dbInfo.getMeasureForColumn(testtemp, value);
										if(measurevalue!=null)
										{
											sb.append("&measure="+measurevalue);
											continue;
										}
									}
									else  if(token.startsWith("component"))
									{
										String compNametemp = URLDecoder.decode(token, "UTF-8");
										if(compNametemp!=null)
											compNametemp = compNametemp.substring(compNametemp.indexOf("=")+1);
										String hostNameTemp = null;
										if(compNametemp!= null && compNametemp.indexOf(":")>-1)
											hostNameTemp = compNametemp.substring(0,compNametemp.indexOf(":"));
										String compTypeTemp = null;
										if(compNametemp!= null && compNametemp.lastIndexOf(":")>-1)
											compTypeTemp = compNametemp.substring(compNametemp.lastIndexOf(":")+1,compNametemp.length());
										if(hostNameTemp!=null && compTypeTemp!=null)
										{
											sb.append("&host="+hostNameTemp);
											sb.append("&comptype="+compTypeTemp);
											continue;
										}
									}
									else  if(token.startsWith("trgthost"))
									{
										String compNametemp = token;
										if(compNametemp!=null && compNametemp.indexOf("=") >-1)
										{
											compNametemp = compNametemp.substring(compNametemp.indexOf("=")+1);
											sb.append("&host="+compNametemp);
											continue;
										}
									}
									sb.append("&"+token);
								}
							}
							String temp_tabQS=sb.toString();
							if(temp_tabQS.indexOf("&from") == -1)
							{
								tabQS=temp_tabQS+"&from=0&flag=1&firsttime=true&fromPage=layMod&newWindow=true&comeFrom=true&isPopUp=true";
							}
							else 
							{
								
								tabQS = (temp_tabQS.indexOf("&isCountRecords") == -1)?temp_tabQS.substring(1):temp_tabQS.substring(1,temp_tabQS.indexOf("&isCountRecords"));
							}
							//tabQS=tabQS+"&from=0&flag=1&firsttime=true&fromPage=layMod&newWindow=true&comeFrom=true&isPopUp=true";
						}
%>
						requestParams.activeTab='tab1';
<%						
						String dd_url ="../monitor/EgDiagnosis.jsp?"+tabQS;
						if(dd_url.indexOf("&comeFrom") == -1)
						{
%>
							requestParams.activeTabUrl = '<%=dd_url%>&fromLayer=true&comeFrom=true&newWindow=true&isPopUp=<%=newWindow%>&tabSetPage=true';
<%
						}
						else
						{
%>
							requestParams.activeTabUrl = '<%=dd_url%>';
<%
						}
					}
					else if(currentTab.equalsIgnoreCase("history"))
					{
%>
			requestParams.activeTab='tab5';
			requestParams.activeTabUrl='../monitor/dispComponentHistory.jsp?<%=tabQS%>'+'&tabSetPage=true';
<%
					}
					else if(currentTab.equalsIgnoreCase("graph"))
					{
%>
			 requestParams.activeTab='tab2';
			 requestParams.activeTabUrl='../monitor/dispComponentGraphs.jsp?<%=tabQS%>'+'&tabSetPage=true&mode=3D';
<%
					}
					else if(currentTab.equalsIgnoreCase("feedback"))
					{
%>
			 requestParams.activeTab='tab6';
			 requestParams.activeTabUrl='../monitor/dispComponentFeedback.jsp?<%=tabQS%>'+'&tabSetPage=true';
<%
					}
				}
			 %>
			 //requestParams.activeTab='tab2';
			 //requestParams.activeTabUrl='../monitor/dispComponentGraphs.jsp?<%=tabQS%>'+'&tabSetPage=true';
			 <%
				if(newWindow != null && newWindow.equals("false"))// modified on 20/09/07
				{
					String isFromPage=request.getParameter("isFrom");
					if(isFromPage!=null && isFromPage.equalsIgnoreCase("insideviewDashboard"))
					{
						EgTablesInfo tablesInfo=new EgTablesInfo("manager");
						String Qstring=null;
						String host_name=request.getParameter("host");
						String port_no=request.getParameter("port");
						String info_name=request.getParameter("info");
						if(info_name!=null)
						{
							info_name = com.egurkha.util.StringUtils.replace(info_name,"|hash|","#");
							info_name=com.egurkha.util.StringUtils.replace(info_name,"|plus|","+");
							info_name=com.egurkha.util.StringUtils.replace(info_name,"|amp|","&");
							info_name=com.egurkha.util.StringUtils.replace(info_name,"|pct|","%");
						}
						String ctype=request.getParameter("type");
						String testname=request.getParameter("test");
						String s_checkVM=request.getParameter("isVM");
						String s_source=request.getParameter("source");
						if(ctype!=null && ctype.trim().length()>0 && host_name!=null && host_name.trim().length()>0 && testname!=null && port_no!=null && info_name!=null )
						{
							Qstring="/final/monitor/egInsideviewDashboard.jsp?getFor=measure";
							String comp=com.eg.EgURLEncoder.encode((host_name+":"+port_no), "UTF-8");
							String compName=com.eg.EgURLEncoder.encode((host_name+":"+port_no+":"+ctype), "UTF-8");

							String Layer_name_str=tablesInfo.getLayerForTest(testname);
							StringTokenizer tokenLayer=new StringTokenizer(Layer_name_str,",");
							String layerName="HOST";
							if(tokenLayer!=null)
							{
								while(tokenLayer.hasMoreTokens())
								{
									String l_name=(String)tokenLayer.nextToken();
									if(l_name!=null)
									{
										if(tablesInfo.isLayerRelevantForComponent(ctype,l_name))
										{
											layerName=l_name;
											break;
										}
									}
								}
							}
							if(info_name!=null && info_name.trim().length()>0 && info_name.indexOf(":")>-1)
								info_name=info_name.substring(0,info_name.indexOf(":"));
							info_name=com.egurkha.util.StringUtils.replace(((info_name==null)?"":info_name), "\\", "\\\\");

							if(info_name!=null && info_name.indexOf("+")>-1)
							{
								info_name=com.egurkha.util.StringUtils.replace(info_name,"+","|plus|");
							}
							if(info_name!=null && info_name.indexOf("&")>-1)
							{
								info_name=com.egurkha.util.StringUtils.replace(info_name,"&","|amp|");
							}
							if(info_name!=null && info_name.indexOf("%")>-1)
							{
								info_name=com.egurkha.util.StringUtils.replace(info_name,"%","|pct|");
							}
							if(info_name!=null && info_name.indexOf("#")>-1)
							{
								info_name=com.egurkha.util.StringUtils.replace(info_name,"#","|hash|");
							}
							Qstring=Qstring+"&comp="+EgURLEncoder.encode(comp,"UTF-8")+"&comptype="+com.eg.EgURLEncoder.encode(ctype,"UTF-8")+"&info="+com.eg.EgURLEncoder.encode(info_name,"UTF-8")+"&compName="+EgURLEncoder.encode(compName,"UTF-8")+"&Layer="+com.eg.EgURLEncoder.encode(layerName,"UTF-8")+"&isVM="+s_checkVM+"&source="+s_source;
						}
					}
				}
			 %>


	function getDateValue(chart){
		var d = null;
		try
		{
			var point = chart.category;
			var datas = chart.series.userOptions.data;
			for (var a in datas)
			{
				var points = datas[a];
				if(points[0] == point )
					return points[2];
			}
		}
		catch (e)
		{
			return null;
		}
	}

	function getParsedDateString (chart)
	{
		var date = getDateValue(chart);
		if(date != null)
			date = date.substring(0,date.lastIndexOf(":"));

		return date;
	}

	function redirectToDDTabOnThisTimeline(redirectObj,chart){

		try
		{
			isFromGraphData = true;
			var d_time = chart.category;
			if(d_time == undefined || d_time == null)
				return;
			var dateString = getParsedDateString(chart);
			
			var end_date='',end_hr='',end_min='',st_date='',st_hr='',st_min='',end_day='',end_mon='',end_yr='';
			try
			{
				if(dateString != null && dateString.indexOf(":") != -1)
				{
					end_date = dateString.substring(0,dateString.indexOf(" "));
					end_mon = end_date.substring(0,end_date.indexOf("/"));
					end_mon = end_mon-1;
					end_day = end_date.substring(end_date.indexOf("/")+1,end_date.lastIndexOf("/"));
					end_yr = end_date.substring(end_date.lastIndexOf("/")+1);
				
					end_hr = dateString.substring(dateString.indexOf(" ")+1,dateString.indexOf(":"));
					end_min = dateString.substring(dateString.indexOf(":")+1);
					
					var d = new Date(end_yr,end_mon,end_day,end_hr,end_min);
					d.setMinutes(d.getMinutes() - 30);
					
					var day=d.getDate();
					var mon=(d.getMonth()+1);
					var yr=d.getFullYear();

					if(day < 10)
						day = '0'+day;

					if(mon < 10)
						mon = '0'+mon;
						
					st_date = mon+'/'+day+'/'+yr;					

					if(d.getHours() > 9)
						st_hr = d.getHours();
					else
						st_hr = '0'+d.getHours();

					if(d.getMinutes() > 9)
						st_min = d.getMinutes();
					else
						st_min = '0'+d.getMinutes();
				}
				else
				{
					var st_time = d_time - (1000*60*30);
					var et = new Date(d_time);
					
					end_date =Ext.Date.format(et,'m/d/Y');
					end_hr =Ext.Date.format(et,'G');
					end_min =Ext.Date.format(et,'i');
					
					var st = new Date(st_time);
					st_date =Ext.Date.format(st,'m/d/Y');
					st_hr =Ext.Date.format(st,'G');
					st_min =Ext.Date.format(st,'i');
				}
			}
			catch (e)
			{
				var st_time = d_time - (1000*60*30);
				var et = new Date(d_time);
				
				//var el_date =Ext.Date.format(new Date(d_time),'m/d/Y G:i:s');
				end_date =Ext.Date.format(et,'m/d/Y');
				end_hr =Ext.Date.format(et,'G');
				end_min =Ext.Date.format(et,'i');
				
				st = new Date(st_time);
				st_date =Ext.Date.format(st,'m/d/Y');
				st_hr =Ext.Date.format(st,'G');
				st_min =Ext.Date.format(st,'i');
			}
			
			var re_url=redirectObj.ddUrl;
			if(re_url != undefined && re_url != null){
				var a_tab=Ext.getCmp('compMeasTabs');
				
				if(re_url.indexOf("&timeline") != -1)
					re_url = re_url.substring(0,re_url.indexOf("&timeline"));
				try
				{
					var currentInfo = a_tab.getActiveTab().currentInfo;
					if(currentInfo != undefined && currentInfo != '')
					{
						var pre_url = re_url.substring(0,re_url.indexOf('&info=')+6);
						var post_url = re_url.substring(re_url.indexOf('&info=')+6);
						post_url = post_url.substring(post_url.indexOf('&'));
						re_url=pre_url+''+currentInfo+post_url;
					}
				}
				catch (e)
				{
				}
				var redirectUrl=re_url+'&timeline=Any&starttime='+st_date+'&starthr='+st_hr+'&startmin='+st_min+'&endtime='+end_date+'&endhr='+end_hr+'&endmin='+end_min+'&endsec=59&fromPage=layMod&newWindow=true&comeFrom=true&isPopUp=null';
				
				var a_diagnosis=Ext.getCmp("innerPanel");
				a_diagnosis.tabUrl = redirectUrl;
				a_diagnosis.type = 'ddiagnosis';


				requestParams.activeTab='tab1';
				requestParams.activeTabUrl=redirectUrl;

				
				a_tab.setActiveTab("tab1");
			}
		}
		catch (ee)
		{
		}
	}

	var highChartIns = null;
	function loadHSChart(url,divId,height,width,maxURL,isAxisTimeReq,legendPos,title,isLookBack,mask,redirectObj)
	{
		Ext.onReady(function() 
		{
			var containerId = divId;
			var containerObj=Ext.getCmp(containerId);
			var errMsg = '<center><div style="text-align:center;border:0px solid red;padding:2% 0 1% 0;width:100%"><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,
					scope:this,
					success: function(response) 
					{
						if(response.status == 200 && !Ext.isEmpty(response))
						{
							var jsonText = response.responseText;
							if(!Ext.isEmpty(jsonText))
							{
								if(jsonText.indexOf("<HTML>") > -1 || jsonText.indexOf(".png") > -1 || jsonText.indexOf(".gif") > -1)
								{
									Ext.getCmp(containerId).update(errMsg);
								}
								else
								{
									try
									{
										var chartData=Ext.decode(jsonText);
										if( Ext.isEmpty(chartData))
										{
											Ext.getCmp(containerId).update(errMsg);
										}
										else
										{
											chartData['chartTitle'] = title+ " "+ chartData['title'] ;
											chartData['enableTitle'] = true;
											chartData['isLookBack'] = isLookBack;
											chartData['isTabsetPage'] = true;
											var lineChart = {};
											
											try
											{
												if(redirectObj.containsDD != undefined && redirectObj.containsDD != null && (redirectObj.containsDD == true || redirectObj.containsDD == 'true'))
													lineChart = jQuery.extend(true, {}, getHighCharts(containerId,height,width,maxURL,redirectObj), lineChart);	
												else
													lineChart = jQuery.extend(true, {}, getHighCharts(containerId,height,width,maxURL), lineChart);

											}
											catch (ee)
											{
												lineChart = jQuery.extend(true, {}, getHighCharts(containerId,height,width,maxURL), lineChart);
											}

											
											lineChart.setData(chartData,'<%=dateFormatForDatePicker%>',maxURL,isAxisTimeReq,legendPos);
											lineChart.drawChart();
											highChartIns = lineChart;
										}
									}
									catch (e)
									{
										if( Ext.isEmpty(Ext.getCmp(containerId)) )
										{
											var chartContObj=document.getElementById(containerId);
											if(!Ext.isEmpty(chartContObj))
												chartContObj.innerHTML = errMsg;
										}
										else
											Ext.getCmp(containerId).update(errMsg);
									}
								}
							}
							else
							{
								if(Ext.isEmpty(Ext.getCmp(containerId)))
								{
									var chartContObj=document.getElementById(containerId);
									if(!Ext.isEmpty(chartContObj))
										chartContObj.innerHTML=errMsg;
									
								}
								else
								{
									Ext.getCmp(containerId).update(errMsg);
								}
							}
						}
						else
						{
							if(Ext.isEmpty(Ext.getCmp(containerId)))
							{
								var chartContObj=document.getElementById(containerId);
								if(!Ext.isEmpty(chartContObj))
									chartContObj.innerHTML=errMsg;
								
							}
							else
							{
								Ext.getCmp(containerId).update(errMsg);
							}
						}
						if (!Ext.isEmpty(mask)) {
							mask.hide();
						}
					},
					failure: function(){
						if (!Ext.isEmpty(mask)) {
							mask.hide();
						}
					}
				});				
			}
		});

	}
	function resizeHighChart(id,adjWidth,adjHeight)
	{
		try
		{
			if( highChartIns != null )
			{
				var hCHart = highChartIns.highchart.chart;
				var renderTo = hCHart.renderTo;
				if (hCHart.container) {
					hCHart.width = adjWidth;
					hCHart.height = adjHeight;
				}
				hCHart.width = adjWidth;
				hCHart.height = adjHeight;
				highChartIns.drawChart();
			}		
		}
		catch (ee1)
		{
		}
	}
	function parseScript(_source)
	{
		var source = _source;
		var scripts = new Array();
		
		if(source == null || source == 'undefined' || source == undefined)
			return;
		// Strip out tags
		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.Ajax.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.Connection.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.ScriptTagProxy.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		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);
					}
				}
			});

		initLdgMask = new Ext.LoadMask(Ext.getBody(),{msg : "Loading ..."});
	});

	function HelpWin()
	{
		Ext.onReady(function(){


		 /*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=EgMHelp.jsp"></iframe>'
							}).show();*/

			 if (Ext.getBody().getViewSize().width < 1100)
			 {
			     var cwidth1=Ext.getBody().getViewSize().width-64; 
				 var leftPosition = 25;
				 var left = (Ext.getBody().getViewSize().width/2)-(cwidth1/2);						    
			 }
			 else
			 {
				 var cwidth1=Ext.getBody().getViewSize().width-154;
				 var leftPosition = 78;
				 var left = (Ext.getBody().getViewSize().width/2)-(cwidth1/2);
			 }
			 var cwidth2=(cwidth1/2);						
			 var cheight=Ext.getBody().getViewSize().height-240;
			 var top = (Ext.getBody().getViewSize().height/2)-(cheight/2);
			 var help_param = encodeURI('fromPopup|equal|true');
			 HelpWinOth("/final/eghelp/EgHelpApp.jsp?forwardPage=EgMHelp.jsp&params="+help_param, cwidth1, cheight, left, top, left, top);
		});
	}

	</script>

<script src="/final/scripts/utilities/ScrollPanel.js"></script>
<script src="/final/scripts/utilities/CustomGrid.js"></script>
<script src="/final/scripts/utilities/ErrorPanel.js"></script>
</head>
<body onUnLoad="javascript:closePopupWindow()" class="content-frame">
<script>
	function closePopupWindow()
	{
		/*if(printdataObj!=null)
		{
			printdataObj.close();printdataObj=null;
		}*/
		<%
			if(!onlyDDTab)
			{
		%>
				try{
					if(printwin!=null && printwin!="" && printwin!=undefined){printwin.close();printwin=null;}
					if(linewin!=null && linewin!="" && linewin!=undefined){linewin.close();linewin=null;}
					if(gdwin!=null && gdwin!="" && gdwin!=undefined){gdwin.close();gdwin=null;}
					if(savepopwin!=null && savepopwin!="" && savepopwin!=undefined ){savepopwin.close();savepopwin=null;}
					if(savepop!=null && savepop!="" && savepop!=undefined){savepop.close();savepop=null;}
					if(ddwin!=null && ddwin!="" && ddwin!=undefined){ddwin.close();ddwin=null;}
				}catch(e)
				{
					console.log(e)
				}
		<%
			}
		%>
	}
</script>
<div id ="componentMeasureTabSet" style="position:absolute;top:0px;height: 100%; width: 100%;">
<div id="loadmask" class="maskLoader x-mask-msg x-layer x-mask-msg-default" style="z-index: 19001;left:45%;top:35%;">
	<div class="x-mask-loading maskText" style="position:relative">
		Loading...
	</div>
</div>
</div>
<%
	if(request.getParameter("newWindow")!=null && !request.getParameter("newWindow").equals("true"))
	{
		session.setAttribute("monitorLastSession","/final/monitor/componentMeasureTabSet.jsp?"+request.getQueryString());
	}
%>
</body>
</html>
