<%@ page import = "java.util.*" %>
<%@ page import = "java.io.*" %>
<%@ page import = "java.net.*" %>
<%@ page import = "com.eg.EgInstallInfo" %>
<%@ page import = "com.eg.IniFile" %>
<%@ page import ="com.egurkha.util.StringUtils"%>
<%@ page import = "egurkha.reporter.ErUtils"%>
<%@ page import = "egurkha.reporter.ErUserData"%>
<%@ page import = "com.egurkha.ini.IniUI"%>
<%@ page import = "com.eg.*"%>
<%@ page import = "com.egurkha.*"%>
<%@ page import="com.egurkha.monitor.*"%>
<%@ page import = "com.egurkha.monitor.VmDashboardHelper"%>
<%@ page import="com.eg.EgExternalInfo"%>
<%@ page import = "com.eg.EgDateInfo" %>
<%@ page import = "com.egurkha.EgTimeZoneConverter"%>
<%@ page import = "java.util.TimeZone"%>
<%@ page import = "java.util.Calendar"%>
<%@ page import = "com.egurkha.util.DateUtil"%>
<%@ page import="egurkha.config.EcUtils"%>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld" %>

<%

	IniFile endUserIniUpdate = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_endUserDetails.ini",true);
%>

<%
	MonitorDAOFactory monitorDaoFactory = MonitorDAOFactory.getInstance();
	EgServerDashBoardDAO eGSerDashDAO=monitorDaoFactory.getServerDashBoardDAO();
	
	String strCsrfToken = "";
	String strEncodedUrl = response.encodeURL(((HttpServletRequest)pageContext.getRequest()).getRequestURI());
	if(strEncodedUrl != null)
	{
		int idx_A = strEncodedUrl.indexOf("?");
		if(idx_A != -1)
		{
			String queryString = strEncodedUrl.substring(idx_A+1);
			HashMap hashMapParameters = EcUtils.parseQueryString(queryString);
			if(hashMapParameters != null && hashMapParameters.containsKey("com.eg.CSRF_NONCE"))
			{
				strCsrfToken = (String)hashMapParameters.get("com.eg.CSRF_NONCE");
			}
		}
	}
	if(session!=null)
	{
		session.setAttribute("Page_IdentifierM", request.getRequestURI());
		session.setAttribute("toBackUED2_url", request.getRequestURI()+"?"+request.getQueryString());
	}
	String treeSession=(String)session.getAttribute("monitorLastSession");
	UserRegistry registry = UserRegistry.getInstance();
	User user = null; //registry.getUser(session.getId());
	boolean isFromMenu=false;
	String fromMenuStr = request.getParameter("fromMenu");
	String fromCompName = request.getParameter("comp");
	String fromTest = request.getParameter("fromTest");
	String fromLayerName = request.getParameter("fromLayerName");
	if(fromTest != null)
	{
		if(fromTest.indexOf("\\") > -1)
		  fromTest = StringUtils.replace(fromTest, "\\", "\\\\");
		fromTest = StringUtils.decodeSecurityChar(fromTest);
		fromTest = EgURLEncoder.encode(fromTest,"UTf-8");
	}
	boolean isFromLayerModel = false;
	String fromLayerModel = request.getParameter("fromLayerModel");
	if(fromLayerModel != null && fromLayerModel.equalsIgnoreCase("true"))
		isFromLayerModel = true;
	if(fromMenuStr!=null && (fromMenuStr.equalsIgnoreCase("true") || fromMenuStr.equalsIgnoreCase("yes")))
	{
		isFromMenu=true;
	}

	boolean isFromGeo=false;
	String fromGeoStr = request.getParameter("fromGeo");
	if(fromGeoStr!=null && (fromGeoStr.equalsIgnoreCase("true") || fromGeoStr.equalsIgnoreCase("yes")))
		isFromGeo=true;	

	boolean isfromf5=false;
	String fromf5 = request.getParameter("fromf5");
	if(fromf5!=null && (fromf5.equalsIgnoreCase("true") || fromf5.equalsIgnoreCase("yes")))
		isfromf5=true;

	if(isFromMenu || isFromGeo)
	{
		user = registry.getUser(session.getId(),true);
	}
	else
	{
		user = registry.getUser(session.getId());
	}

	EgUserRole userRole = null;
	boolean isAllCompAccess=false;
	boolean isDetailsManagerLogin=false;
	String userType = request.getParameter("userType");
	if(userType==null || userType.trim().length()==0)
		userType = request.getParameter("usertype");

	String orgUserType = request.getParameter("orgUserType");
	if(orgUserType==null || orgUserType.trim().length()==0)
		orgUserType="";

	String fromVCDSDrilldown = request.getParameter("fromVCDSDrilldown");
	if(fromVCDSDrilldown==null || fromVCDSDrilldown.trim().length()==0)
		fromVCDSDrilldown="";

	String dscomp = request.getParameter("dscomp");
	if(dscomp==null || dscomp.trim().length()==0)
		dscomp="";

	String dscomptype = request.getParameter("dscomptype");
	if(dscomptype==null || dscomptype.trim().length()==0)
		dscomptype="";
	
	String dsInfo = request.getParameter("dsInfo");
	if(dsInfo==null || dsInfo.trim().length()==0)
		dsInfo="";
	else
		dsInfo =com.egurkha.util.StringUtils.decodeSecurityChar(dsInfo);

	String dsmsmt_host = request.getParameter("dsmsmt_host");
	if(dsmsmt_host==null || dsmsmt_host.trim().length()==0)
		dsmsmt_host="";

	String userName = "admin";
	String fileName="eg_endUserDetails.ini";
	IniFile endUserIni = new IniFile(EgInstallInfo.getInstallDir()+ "/manager/config/"+fileName);
	IniFile reportIni = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_report.ini");

	String strYaxisBasedOnData = reportIni.getValue("CHART_TYPE","YaxisBasedOnData");
	boolean isYaxisBasedOnData=false;
	if(strYaxisBasedOnData!=null && (strYaxisBasedOnData.equalsIgnoreCase("yes") || strYaxisBasedOnData.equalsIgnoreCase("true")))
		isYaxisBasedOnData = true;

	String strEGManagerUser=endUserIni.getValue("END_USER_DASHBOARD_SETTINGS","eGManagerUser");

	String noPanelsPerRow = endUserIni.getValue("END_USER_DASHBOARD_SETTINGS","NoOfPanelsPerRow");
	if(noPanelsPerRow==null || noPanelsPerRow.trim().equals("")) 
		noPanelsPerRow = "9";
	int panelsPerRowCount = Integer.parseInt(noPanelsPerRow);
	boolean isDebugEnabled = false;
	int logFileSize = 30;

	String userExpLogging = endUserIni.getValue("Logging","enableLogging");
	if(userExpLogging!=null && (userExpLogging.equalsIgnoreCase("true") || userExpLogging.equalsIgnoreCase("yes")))
		isDebugEnabled = true;

	String uedExternalAccess = endUserIni.getValue("END_USER_DASHBOARD_SETTINGS","EndUserDashboardExternalAccess");
	uedExternalAccess=(uedExternalAccess==null || uedExternalAccess.trim().length()==0)?"false":uedExternalAccess.toLowerCase();

	boolean isUEDExternalAccess=false;
	if(uedExternalAccess!=null && (uedExternalAccess.equalsIgnoreCase("yes") || uedExternalAccess.equalsIgnoreCase("true")))
		isUEDExternalAccess=true;
	
	if(isDebugEnabled){
		String fileSize = endUserIni.getValue("Logging","fileSize");
		try{
			if(fileSize != null && fileSize.trim().length() > 0)
				logFileSize = Integer.parseInt(fileSize);

		}catch(Exception e){
			logFileSize = 30;
		}
	}

	String showKeyUserStr = request.getParameter("showKeyUser");
	boolean showKeyUser=false;
	if(showKeyUserStr!=null && (showKeyUserStr.equalsIgnoreCase("true") || showKeyUserStr.equalsIgnoreCase("yes")))
	{
		showKeyUser=true;
	}

	strEGManagerUser=(strEGManagerUser==null || strEGManagerUser.trim().length()==0)?"false":strEGManagerUser;
	boolean isEGManagerUser = strEGManagerUser.equalsIgnoreCase("true")?true:false;
	String desktopName = request.getParameter("info");
	if(desktopName.indexOf("*")>=0)
	{
		desktopName = desktopName.substring(desktopName.indexOf("*")+1);
	}
	String org_desktopName = desktopName;
	desktopName=StringUtils.replace(desktopName, "\\", "\\\\");
	boolean isHidePanel=false;
	
	if(user==null && (!isFromMenu || !isFromGeo))
	{
		isHidePanel=true;
		String login_user ="";
		if(isEGManagerUser)
			login_user = request.getParameter("user");

		userName=(login_user==null || login_user.trim().length()==0)?"admin":login_user;
		ErUserData userData = new ErUserData(userName,false);
		if(userData==null)
		{
			userName="admin";
			userData = new ErUserData(userName,false);
			user = userData.usr;
		}
		else if(userData!=null)
		{
			user = userData.usr;
		}

		if(user!=null)
		{
			userRole = user.getUserRole();
			isAllCompAccess = userRole.hasAllComponentAccess();
		}
	}
	else if(user!=null)
	{
		userName = user.getLoginID();
		userRole = user.getUserRole();
		isAllCompAccess = userRole.hasAllComponentAccess();
		isDetailsManagerLogin = true;
	}

	boolean isOnlyVMAssigned=false;
	boolean isVMAssigned=false;
	if(user!=null && user.isOnlyVMAssigned() && (!user.isVMAssigned()) && user.getOnlyVMs().size()>0)
	{
		isOnlyVMAssigned=true;
	}
	else if(user!=null && (!user.isOnlyVMAssigned()) && user.isVMAssigned() && user.getOnlyVMs().size()>0)
	{
		isVMAssigned=true;
	}
	else if(user!=null && user.isOnlyVMAssigned() && user.isVMAssigned() && user.getOnlyVMs().size()>0)
	{
		isOnlyVMAssigned=true;
		isVMAssigned=true;
	}
	
	writeLog(" :::::::::::::::::::::::::::::::::::::::::::::STARTS::::::::::::::::::::::::::::::::::::::::::::::::::: ",isDebugEnabled,logFileSize);
	writeLog(" {userName : "+userName+ " } --   {desktopName :"+desktopName+" }",isDebugEnabled,logFileSize);
	String roleName     = userRole.getRoleName();
	//boolean isAdminRole = (roleName.equals("Admin") || roleName.equals("Supermonitor"));
	boolean isAdminRole = roleName.equals("Admin");

	String strDirectEndDetail = request.getParameter("directEndDetail");
	strDirectEndDetail=(strDirectEndDetail==null || strDirectEndDetail.trim().length()==0)?"false":strDirectEndDetail;

	boolean isDirectEndDetails = strDirectEndDetail.equalsIgnoreCase("true")?true:false;
	IniUI iniUI = IniUI.getInstance();
	/*if(isAllCompAccess && (!isDirectEndDetails))
	{
		isAdminRole = true;
	}
	else
	{
		isAdminRole = false;
	}*/
	if(isDirectEndDetails)
	{
		isAdminRole = false;
	}
	else
	{
		isAdminRole = true;
	}
	String timezoneOffsetValue ="";
	EgDateInfo tracker_tdateInfo = new EgDateInfo();
	TimeZone tracker_tz = null;
	Calendar cal = Calendar.getInstance();
	java.util.Date local_date = new java.util.Date(tracker_tdateInfo.egetUTCDate());
	cal.setTime(local_date);
	cal.setTimeZone(tracker_tdateInfo.getRealTimeZone());
	String temp1 = (cal.get(cal.MONTH)+1) + "/" + cal.get(cal.DAY_OF_MONTH) + "/" +cal.get(cal.YEAR);
	String mgr_time = cal.get(cal.HOUR_OF_DAY)+":"+cal.get(cal.MINUTE)+":"+cal.get(cal.SECOND);
	String trac_currentDateFormat = iniUI.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
	String dispDate = DateUtil.changeDateFormat(temp1,"MM/dd/yyyy",trac_currentDateFormat);
	EgTimeZoneConverter tracker_timeZoneConverter = new EgTimeZoneConverter(dispDate+" "+mgr_time,user);
	tracker_tz = tracker_timeZoneConverter.getTimeZone();

	long timezoneinMins = (Math.abs((tracker_tz.getRawOffset() / (60 * 1000))));
	long daylighttime = (tracker_tz.getDSTSavings() / (60 * 1000));
	timezoneOffsetValue = String.valueOf(Math.abs(timezoneinMins-daylighttime));

	Calendar cal3 = GregorianCalendar.getInstance(tracker_tz);
	int offsetInMillis = tracker_tz.getOffset(cal3.getTimeInMillis());
	int offsetmin = 0;
	if(offsetInMillis<0)
		offsetmin =(Math.abs(offsetInMillis)/1000)/60;
	else
		offsetmin = (offsetInMillis/1000)/60;
	String offset = String.valueOf(offsetmin);

	if(tracker_tz.getRawOffset()>=0)
		timezoneOffsetValue="-"+offset;
	else
		timezoneOffsetValue="+"+offset;

	long refreshFrequency = 60 * 1000L;
	String refFreq = user.getRefreshFrequency();
	if(refFreq!=null && refFreq.length()>0)
	{
		refreshFrequency =  Long.valueOf(refFreq).longValue() * 1000L;
	}

	String thisLanguage = iniUI.getDefaultLanguage();
	if (user!=null)
	{
		String userLang = user.getLanguage();
		if (userLang!=null && !userLang.equalsIgnoreCase("NULL"))
		{
			thisLanguage=userLang;
		}
	}
	String iniName = null,user_name = null,isUserBased = null,dashboard_name = null,view_name = null,time_line = null,geoInfo = null,usercountval=null,filterName=null,filterViewName=null,countryCode = null,regionName = null,fromServiceHomePage = null,fromZonePage = null,selectedTest=null,selectedMeasure=null,isFromServiceMenu=null,isFromZone=null,iszoneName=null,parentZone=null,isFromZoneMenu=null;
	boolean isDirectLinkfromCtx = false;
	if(isFromGeo){
		iniName = request.getParameter("iniName");
		user_name = request.getParameter("user_name");
		isUserBased = request.getParameter("isUserBased");
		dashboard_name = request.getParameter("dashboard_name");
		view_name = request.getParameter("view_name");
		time_line = request.getParameter("time_line");
		geoInfo = request.getParameter("ginfo");
		usercountval = request.getParameter("usercountval");
		filterName = request.getParameter("filterName");
		filterViewName = request.getParameter("filterViewName");
		fromServiceHomePage = request.getParameter("fromServiceHomePage");
		fromZonePage = request.getParameter("fromZonePage");
		isFromServiceMenu = request.getParameter("isFromServiceMenu");
		isFromZone = request.getParameter("isFromZone");
		parentZone = request.getParameter("parentZone");
		iszoneName = request.getParameter("iszoneName");
		isFromZoneMenu = request.getParameter("isFromZoneMenu");

		if(filterViewName == null || filterViewName.trim().length() == 0 || filterViewName.equalsIgnoreCase("null"))
			filterViewName= "";
		String strDirectLinkfromCtx = request.getParameter("isDirectLinkfromCtx");
		if(strDirectLinkfromCtx != null && strDirectLinkfromCtx.trim().length() > 0 && (strDirectLinkfromCtx.equalsIgnoreCase("true") || strDirectLinkfromCtx.equalsIgnoreCase("yes")))
			isDirectLinkfromCtx = true;

		selectedTest = request.getParameter("selectedTest");
		selectedTest=(selectedTest==null)?"":selectedTest;
		selectedMeasure = request.getParameter("selectedMeasure");
		selectedMeasure=(selectedMeasure==null)?"":selectedMeasure;
		if(filterName != null && filterName.trim().length() > 0 && filterName.indexOf("-") > 0){
			IniFile geoIni = new IniFile(EgInstallInfo.getInstallDir()+"/manager/config/eg_geodetails.ini",true);
			regionName = filterName.substring(0,filterName.indexOf("-"));
			regionName = regionName.trim();
			String countryInfo = filterName.substring(filterName.indexOf("-")+1);
			String locCode = geoIni.getValue("COUNTRY_NAME_TO_CODE_MAPPING",countryInfo.trim());
			if(locCode == null || locCode.trim().length() == 0)
				locCode = countryInfo;
			countryCode = locCode;
		}
	}
	selectedMeasure = (selectedMeasure==null || selectedMeasure.trim().length() == 0)?"":EgURLEncoder.encode(selectedMeasure,"UTf-8");
	String isFusionEnabled = iniUI.getValue("GRAPHS","EnableFusion");
	boolean isFusion = (isFusionEnabled!=null && isFusionEnabled.length()>0 && (isFusionEnabled.equalsIgnoreCase("true") || isFusionEnabled.equalsIgnoreCase("yes")))?true:false;
	EgExternalInfo egExternalInfo=new EgExternalInfo("manager");
	VmDashboardHelper vmDashHelper=new VmDashboardHelper(user);
	ErUtils erUtils = new ErUtils();
	String monitor_Skin = user.getMonitorSkin();
	String  script_src="script_item_"+thisLanguage+".js";
	EgMappingInfo mappingInfo = new EgMappingInfo(thisLanguage);
	String queryStringForNewUI = (String) ErUtils.prepareQueryString(request.getParameterMap());
	String currentDateFormatForJS = iniUI.getValue("CURRENT_DATE_FORMAT","selectedDateFormat");
	String mgrDateFormat = currentDateFormatForJS;
	String dateFormatNew = mgrDateFormat;

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

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

	String searchString = request.getParameter("searchString");
	searchString=com.egurkha.util.StringUtils.decodeSecurityChar(searchString);
	searchString=(searchString==null || searchString.trim().length()==0)?"":searchString;
	searchString=com.egurkha.util.StringUtils.replace(searchString, "\\", "\\\\");

	String adtnlSearchStr = request.getParameter("adtnlSearchStr");
	adtnlSearchStr=com.egurkha.util.StringUtils.decodeSecurityChar(adtnlSearchStr);
	adtnlSearchStr=(adtnlSearchStr==null || adtnlSearchStr.trim().length()==0)?"":adtnlSearchStr;

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

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

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

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

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

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

	String selectedElement = request.getParameter("info");
	String selectedElementUrl="";
	String selectedElementCompUrl="";
	String titleInfo ="";
	String getInfoTitle = "";
	if(selectedElement!=null && selectedElement.trim().length()>0)
	{
		titleInfo = StringUtils.replace(selectedElement, '*', '+');
		titleInfo=com.egurkha.util.StringUtils.replace(titleInfo, "\\", "\\\\");
		getInfoTitle = StringUtils.replace(titleInfo, "+", "");
	}

	String loginTime = request.getParameter("loginTime");
	String logoutTime = request.getParameter("logoutTime");
	String o_loginTime = null;
	String o_logoutTime = null;

	String isHistory = "false";

	if(loginTime!=null && loginTime.trim().length()>0 && logoutTime!=null && logoutTime.trim().length()>0)
	{
		isHistory = "true";
		o_loginTime = loginTime;
		o_logoutTime =logoutTime;
		loginTime=DateUtil.changeDateFormat(loginTime,"dd/MM/yyyy HH:mm:ss","MMM dd, yyyy HH:mm:ss");
		logoutTime=DateUtil.changeDateFormat(logoutTime,"dd/MM/yyyy HH:mm:ss","MMM dd, yyyy HH:mm:ss");
	}
	//String titleSting=mappingInfo.getTestDescription("monitor.common.USER EXPERIENCE DASHBOARD for")+" '"+getInfoTitle+"' ";
	String titleSting=mappingInfo.getTestDescription("monitor.common.User Experience Dashboard for")+" : "+getInfoTitle;
	if(isHistory != null && isHistory.trim().length()>0 && isHistory.equalsIgnoreCase("true"))
	{
		titleSting = mappingInfo.getTestDescription("monitor.common.User Experience Dashboard for")+" "+getInfoTitle +" for session from "+loginTime+" to "+logoutTime;
	}
	String logonTitleSting=mappingInfo.getTestDescription("monitor.common.Logon Details for User")+" : "+getInfoTitle;

	selectedElement=(selectedElement==null || selectedElement.trim().length()==0)?"":selectedElement;	
	String overviewSearchStr = request.getParameter("overviewsearchstr");
	overviewSearchStr = (overviewSearchStr==null || overviewSearchStr.trim().length()==0)?"":overviewSearchStr;
	String isFromUEDOverview = request.getParameter("isfromuedoverview");
	isFromUEDOverview = (isFromUEDOverview==null || isFromUEDOverview.trim().length()==0)?"false":isFromUEDOverview;
	String enableBackButton = request.getParameter("enableBackButton");
	enableBackButton=(enableBackButton==null || enableBackButton.trim().length()==0)?"false":enableBackButton;
	boolean isShowBackButton=true;
	if(enableBackButton!=null && enableBackButton.equalsIgnoreCase("false") && (isFromUEDOverview.equalsIgnoreCase("true")||isFromUEDOverview.equalsIgnoreCase("true")))
	{
		isShowBackButton=false;
	}

	String filterFlag = request.getParameter("filterFlag");
	String searchFilter = request.getParameter("searchFilter");
	String nextSearch = request.getParameter("nextSearch");
	String nextSubSearch = request.getParameter("nextSubSearch");
	String priorityFilter = request.getParameter("priorityFilter");
	String gatewayFilter = request.getParameter("gatewayFilter");
	String normalBack = request.getParameter("normalBack");
	normalBack=(normalBack==null || normalBack.trim().length()==0)?"":normalBack;
	boolean isNormalBack=false;
	if(normalBack!=null && normalBack.equalsIgnoreCase("true"))
	{
		isNormalBack=true;
	}
	String usersearch = request.getParameter("usersearch");
	usersearch=(usersearch==null || usersearch.equalsIgnoreCase("null") || usersearch.trim().length()==0)?"":usersearch;
	boolean isUserSearch=false;
	if(usersearch!=null && usersearch.equalsIgnoreCase("true"))
	{
		isUserSearch=true;
	}

	String userSearchParams = (String)request.getQueryString();
	userSearchParams=(userSearchParams==null || userSearchParams.equalsIgnoreCase("null") || userSearchParams.trim().length()==0)?"":userSearchParams;

	if(userSearchParams!=null && userSearchParams.trim().length()>0)
	{
		userSearchParams=com.egurkha.util.StringUtils.replace(userSearchParams, "\\", "\\\\");
		userSearchParams=com.egurkha.util.StringUtils.decodeSecurityChar(userSearchParams);
	}
	String chartTimeline = endUserIni.getValue("Default_Duration","Timeline");
	if(chartTimeline==null || chartTimeline.length()==0)
		chartTimeline="1 hour";

	String sessionDetailsTimeline = endUserIni.getValue("SESSION_DETAILS","Timeline");
	if(sessionDetailsTimeline==null || sessionDetailsTimeline.length()==0)
		sessionDetailsTimeline="24 hours";

	String sessionDetailsTopN = endUserIni.getValue("SESSION_DETAILS","TopN");
	if(sessionDetailsTopN==null || sessionDetailsTopN.length()==0)
		sessionDetailsTopN="5";

	String userAlertsNop = endUserIni.getValue(userName+":"+userType+"_User_Alerts","No_Of_Records");
	if(userAlertsNop==null || userAlertsNop.length()==0)
		userAlertsNop="Top-10";

	String strModifyPanels=endUserIni.getValue("END_USER_DASHBOARD_SETTINGS","ModifyPanels");
	strModifyPanels=(strModifyPanels==null || strModifyPanels.trim().length()==0)?"false":strModifyPanels;
	boolean isModifyPanels = (strModifyPanels.equalsIgnoreCase("true") || strModifyPanels.equalsIgnoreCase("yes"))?true:false;
	if(isAdminRole)
	{
		if(!isModifyPanels)
		{
			isAdminRole = false;
		}
	}
	String strShowUserCombo=endUserIni.getValue("END_USER_DASHBOARD_SETTINGS","showUserCombo");
	strShowUserCombo=(strShowUserCombo==null || strShowUserCombo.trim().length()==0)?"false":strShowUserCombo;

	boolean isShowUserCombo = strShowUserCombo.equalsIgnoreCase("true")?true:false;

	String strShowUserCompsCombo=endUserIni.getValue("END_USER_DASHBOARD_SETTINGS","showUserCompsCombo");
	strShowUserCompsCombo=(strShowUserCompsCombo==null || strShowUserCompsCombo.trim().length()==0)?"false":strShowUserCompsCombo;

	boolean isShowUserCompsCombo = strShowUserCompsCombo.equalsIgnoreCase("true")?true:false;

	if(selectedElement!=null && selectedElement.trim().length()>0)
	{
		selectedElement = selectedElement.substring(selectedElement.indexOf("*")+1);
		selectedElement=com.egurkha.util.StringUtils.replace(selectedElement, "\\", "\\\\");
	}

	if(currentDateFormatForJS!=null && currentDateFormatForJS.indexOf("MMM") >= 0)
	{
		for(int i=0; i < currentDateFormatForJS.length();i++)
		{
			if(String.valueOf(currentDateFormatForJS.charAt(i)).equals("M"))
			{
				currentDateFormatForJS = currentDateFormatForJS.replace('M','N');
			}
		}
	}

	String dateFormatForDatePicker=(String)user.getUserDateFormat();
	//String dateFormatForDatePicker="default";
	if(dateFormatForDatePicker!=null && (dateFormatForDatePicker.equalsIgnoreCase("default") || com.egurkha.util.StringUtils.isNull(dateFormatForDatePicker)))
	{
		dateFormatForDatePicker = mgrDateFormat;
	}
	queryStringForNewUI = queryStringForNewUI.replace("\\","\\\\");
	
	String userTypeTypes = endUserIni.getValue("COMP_TYPE_TYPES",compType);
	String tempUserType=userType;
	if(userTypeTypes!=null && userTypeTypes.trim().length()>0)
	{
		tempUserType = userTypeTypes;
	}

	String st_based_test = endUserIni.getValue("SessionTopology_BASED_TEST",userType);
	ArrayList stBasedTestList = new ArrayList();
	boolean isSTBasedUserType=false;
	if(st_based_test!=null && st_based_test.trim().length()>0)
	{
		isSTBasedUserType = true;
		stBasedTestList =  com.egurkha.util.StringUtils.egTokenizer(st_based_test.trim(), ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
	}

	String newpanel = request.getParameter("isNewpanel");

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

	String showBackBtn = request.getParameter("showBackBtn");
	if(compName==null || compName.trim().length()==0)
	{
%>

<!DOCTYPE html>
<html class="content-frame">
<meta charset="utf-8" http-equiv="X-UA-Compatible" content="IE=edge" >
<meta name="viewport" content="width=device-width,initial-scale=1">
<head>
<script src="/final/scripts/eg_DateUtil.js"></script>
<script>
	var fromf5=<%=isfromf5%>;
	var treeSession="<%=treeSession%>";
	var fromCompName="<%=fromCompName%>";
	var fromLayerName="<%=fromLayerName%>";
	var fromTest="<%=fromTest%>";
	var strSkin="<%=monitor_Skin%>";
	var isFromLayerModel=<%=isFromLayerModel%>
	var titleSting="<%=titleSting%>";
	var logonTitleSting="<%=logonTitleSting%>";
	var isFusion=<%=isFusion%>;
	var userType='<%=tempUserType%>';
	var orgUserType='<%=orgUserType%>';
	var fromVCDSDrilldown='<%=fromVCDSDrilldown%>';
	var dscomp='<%=dscomp%>';
	var dscomptype='<%=dscomptype%>';
	var dsInfo='<%=dsInfo%>';
	var dsmsmt_host='<%=dsmsmt_host%>';
	var detail='<%=detail%>';
	var compCombo='<%=compCombo%>';
	var timeZoneOffsetVal='<%=timezoneOffsetValue%>';
	var noMeasure='<egui:intnl text="monitor.common.No Measures Available" />';
	var noDetails='<egui:intnl text="monitor.common.No details found" />';
	var searchMess='<egui:intnl text="monitor.layermodel.No details found!" />';
	var hidePMess='<egui:intnl text="monitor.layermodel.No panels are configured!" />';
	var toolMinimize='<egui:intnl text="monitor.dashboard.Minimize" />';
	var diagnosisTitle='<egui:intnl text="monitor.common.DIAGNOSIS" />';
	var measGraphTitle='<egui:intnl text="monitor.layermodel.Measure Graph" />';
	var goBtn='<egui:intnl text="monitor.common.Go" />';
	var isMaximizedView = false;
	var mgrDateFormatTemp = '<%=mgrDateFormat%>';
	var mgrDateFormat=getExtjsDateFormat('<%=dateFormatForDatePicker%>');
	var currentDateFormat = '<%=dateFormatForDatePicker%>';
	var mgrDisplayDateFormat='<%=dateFormatNew%>';
	var appCnt = '';
	var publicJson = '';
	var dialonurl="";
	var fullviewapp="";
	var layerStr="";
	var defaultParams="<%=queryStringForNewUI%>";
	var publicJsonData;
	var fromDashBoardLink=false;
	var httpRequest = false;
	var isSearchUser = false;
	var refreshURL ="";
	var pageURL = "";
	var monitorSkin = "<%=monitor_Skin%>";
	var isIE = false;
	var isFireFox = false;
	var isChrome = false;	
	var refreshFrequency='<%=refreshFrequency%>';
	var filterBy='<%=filterBy%>';
	var enableBackButton = '<%=enableBackButton%>';
	var overviewSearchStr = '<%=overviewSearchStr%>';
	var isFromUEDOverview = '<%=isFromUEDOverview%>';
	var searchFilter = '<%=searchFilter%>';
	var nextSearch = '<%=nextSearch%>';
	var nextSubSearch = '<%=nextSubSearch%>';
	var priorityFilter = '<%=priorityFilter%>';
	var gatewayFilter = '<%=gatewayFilter%>';
	var filterFlag = '<%=filterFlag%>';
	var isHistory = '<%=isHistory%>';
	var loginTime = '<%=o_loginTime%>';
	var logoutTime = '<%=o_logoutTime%>';
	var maxiView='';
	var maximizedFunction='';
	var maxChartId='';
	var maxChartName='';
	var requestParams=new Object();
	var userCombo=new Array();
	var compArray = new Array();
	var userArray = new Array();
	var userCompsArray = new Array();
	var userName = '<%=userName%>';
	var hideConfigFlag = true;
	var isModifyEnable = true;
	var isUEDExternalAccFlg=<%= ((!isDetailsManagerLogin) && isUEDExternalAccess)%>;
	var isDirectEndDetails=<%=isDirectEndDetails%>;
	var chartTimeline='<%=chartTimeline%>';
	var sessionDetailsTimeline='<%=sessionDetailsTimeline%>';
	var sessionDetailsTopN='<%=sessionDetailsTopN%>';
	var userAlertsNop='<%=userAlertsNop%>';
	var panelTitleLabel = '<egui:intnl text="monitor.endUserDashboard.Panel Title"/>';
	var timelineLabel = '<egui:intnl text="monitor.endUserDashboard.Timeline"/>';
	var removeExisting='<egui:intnl text="monitor.endUserDashboard.Remove Measures" />';
	var addNew='<egui:intnl text="monitor.endUserDashboard.Add Measures" />';	
	var processNameLabel='<egui:intnl text="monitor.endUserDashboard.Process Name" />';	
	var processLabel='<egui:intnl text="monitor.endUserDashboard.Process" />';	
	var panelsLabel='<egui:intnl text="monitor.endUserDashboard.Panels" />';	
	var sessionDetailsTimelineLabel='<egui:intnl text="monitor.endUserDashboard.Timeline" />';	
	var sessionDetailsTopNLabel='<egui:intnl text="monitor.endUserDashboard.Top N" />';	
	var userAlertsNopLabel='<egui:intnl text="monitor.endUserDashboard.No of Records" />';	
	var updateExisting='<egui:intnl text="monitor.endUserDashboard.Update Titles" />';	
	var modifyOptions='<egui:intnl text="monitor.endUserDashboard.Modify Options" />';
	var optionsLabel = '<egui:intnl text="monitor.endUserDashboard.What would you like to do?"/>';
	var showHideLabel = '<egui:intnl text="monitor.endUserDashboard.Show/Hide default panels"/>';
	var configuration ='<egui:intnl text="monitor.endUserDashboard.Configuration"/>';
	var addDeleteLabel = '<egui:intnl text="monitor.endUserDashboard.Add/Delete measures"/>';
	var addLabel = '<egui:intnl text="monitor.endUserDashboard.Add"/>';
	var modifyLabel = '<egui:intnl text="monitor.endUserDashboard.Modify"/>';
	var deleteLabel = '<egui:intnl text="monitor.endUserDashboard.Delete"/>';
	var groupLabel = '<egui:intnl text="monitor.endUserDashboard.Group"/>';
	var groupNameLabel = '<egui:intnl text="monitor.endUserDashboard.Group name"/>';
	var TestLabel = '<egui:intnl text="monitor.endUserDashboard.Test"/>';
	var metricsLabel = '<egui:intnl text="monitor.endUserDashboard.Panel"/>';
	var MeasureLabel = '<egui:intnl text="monitor.endUserDashboard.Measure"/>';
	var DisplayLabel = '<egui:intnl text="monitor.endUserDashboard.Display Name"/>';
	var UpdateLabel = '<egui:intnl text="monitor.endUserDashboard.Update"/>';
	var PleaseSelectTest = '<egui:intnl text="monitor.endUserDashboard.Please select the Test"/>';
	var PleaseSelectMeasure = '<egui:intnl text="monitor.endUserDashboard.Please select the Measure"/>';
	var PleaseEnterDisplayName = '<egui:intnl text="monitor.endUserDashboard.Please enter the Display Name"/>';
	var tipSpe='<egui:intnl text="monitor.services.Special characters are not allowed"/>';
	var defultSettings='<egui:intnl text="monitor.Ack.Default Settings" />';
	//var defaultSettings='<egui:intnl text="monitor.Ack.Default Settings" />';
	var selectUserDesk='<egui:intnl text="monitor.endUserDashboard.User/Desktop" />';
	var labelUserComps='<egui:intnl text="monitor.endUserDashboard.Session on" />';
	var showUserCombo=false;
	var showUserCompsCombo=false;
	var showBackButon=<%=!isShowBackButton%>;
	var isNormalBack=true;
	var isUserSearch=<%=isUserSearch%>;
	var showKeyUser=<%=showKeyUser%>;
	var userSearchParams='<%=userSearchParams%>';
	var timelineLbl='Timeline';
	var fromLbl='From';
	var hrLbl='Hr';
	var Tolbl='To';
	var graphLbl='View';
	var er_modeInTracker='2D';
	var UpdateError = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Already Exists")%>';
	var panelOrder=new Array();
	var panelPosOrderArray=new Array();
	var outerPanelPosOrderArray=new Array();
	var outerAppPanelPosOrderArray=new Array();
	var panelProperties=new Array();
	var enabledDefaultPanels=new Array();
	var disabledDefaultPanels=new Array();
	var customPanels=new Array();
	var desktopName ='<%=desktopName%>';
	var compName ='<%=compName%>';
	var compType ='<%=compType%>';
	var msmt_host ='<%=msmt_host%>';
	var isNewpanel = '<%=newpanel%>';
	var isFromMenu=<%=isFromMenu%>;
	var isFromGeo=<%=isFromGeo%>;
	var scrollTopVal=<%=scrollTopVal%>;
	var isOnlyVMAssigned=<%=isOnlyVMAssigned%>;
	var isVMAssigned=<%=isVMAssigned%>;
	function obj(){
		obj=new Object();
		this.put=function(key,value){
			obj[""+key+""]=value;
		}
		this.obj=obj
	}
	var panelPositionsMapping=new obj();
	var panelsPerRow = <%=panelsPerRowCount%>;
	var isYaxisBasedOnData=<%=isYaxisBasedOnData%>;
	var csrfToken = '<%=strCsrfToken%>';
	var searchString = '<%=searchString%>';
	var adtnlSearchStr = '<%=adtnlSearchStr%>';
	var showBackBtn = '<%=showBackBtn%>';
	var isVDISessionTopologyEnabled=false;
</script>

<script language = "javascript">
	
	function filterEncode(text)
	{
		//['%;()=]
		var filterEncodeChar = ['[',']','(',')','=','%','\''];
		var filterDecodeText = ['|lsbr|','|rsbr|','|lbr|','|rbr|','|eq|','|per|','|squot|'];
		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|','|per|','|squot|'];
		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;
	}

	</script>
<link rel="stylesheet" href="../resources/css/ext-eg.css"/>

<!--<link rel="stylesheet" type="text/css" href="/final/styles/eGDarkTheme.css" />
<link rel="stylesheet" type="text/css" href="/final/styles/eGDarkThemeIcons.css" />-->

<script src="../extjs/ext-all.js"></script>
<!--<link rel="stylesheet" href="/final/styles/ext-custom-com-uxdashboard.css" />-->

<egui:skin ui="monitor"/>
<%
	if (monitor_Skin.equalsIgnoreCase("light"))
	{
%>
	<link rel="stylesheet" href="/final/styles/uxDashboardLight.css" media="all"  />
<%
	}
	else
	{
%>
	<link rel="stylesheet" href="/final/styles/uxDashboardDark.css" media="all"  />
<%
	}
%>
<!-- fancy Scroll -->

<!-- <script src="/final/jquery/jquery.min.js"></script> -->
<!--<script src="/final/FusionCharts/scripts/FusionCharts.js"></script>-->

<!--<script language="JavaScript1.2" src="/final/scripts/jquery-1.8.2.min.js"></script>-->
<!--<script language="JavaScript1.2" src="/final/jquery/jquery.js"></script>-->

<!--Old Jquery refering in the name of highchart_export.js -->
<script src="/final/jquery/highchart_export.js"></script>
<script src="/final/styles/jscrollpane/jquery.jscrollpane.min.js" ></script>
<script src="/final/styles/jscrollpane/jquery.mousewheel.js" ></script>
<script src="/final/styles/jscrollpane/mwheelIntent.js" ></script>
<link rel="stylesheet" href="/final/styles/jscrollpane/jquery.jscrollpane.css"/>

<script language="JavaScript1.2" src="eg_scripts/eg_date.js"></script>
<script language="JavaScript1.2" src="/final/Highcharts/js/highstock.js"></script>
<script src="/final/monitor/eg_scripts/EgHighChart.js"></script>
<script src="/final/monitor/eg_scripts/egDashboardHighChart.js"></script>
<script src="/final/Highcharts/js/highcharts-more.js"></script>
<script src="/final/Highcharts/js/solid-gauge.src.js"></script>
<script type="text/javascript" src="/final/jquery/jquery-ui.js"></script>
<!-- Grid ster ----------->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/jquery.gridster.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/demo.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/digitalfont/stylesheet.css"><!-- Added -->
		<script type="text/javascript" src="/final/jquery/jquery.scrollTo.js"></script> <!--Added -->
		<script type="text/javascript" src="/final/jquery/jquery.gridster.js"></script><!-- Added -->

<script src="/final/monitor/eg_scripts/endUserDashboardDetails/app.js"></script>

<!-- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8; IE=edge;"> -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title><egui:intnl text="monitor.endUserDashboard.User Experience Dashboard Details"/></title>
</head>
<body style="overflow:hidden"  marginwidth="0" marginheight="0" topmargin="0" leftmargin="0" scroll="no" class="content-frame">
	<div id="uedLoadMask" class="x-mask-msg x-layer x-mask-msg-default" style="z-index: 19001;left:45%;top:35%;">
		<div class="x-mask-loading" style="position:relative">
			Loading...
		</div>
	 </div>
<script>
isSearchUser = true;
/*Ext.onReady(function() {
    new Ext.Panel({
        renderTo: Ext.getBody(),
		floating:true,
		floatable:true,
		autoShow:true,
		border:false,
		height:300,
		width:500,
		frame:false,
		cls:'outerpanel',
		style:{'border':'none','margin':'0'},
        //title: '<egui:intnl text="monitor.common.END USER DASHBOARD"/>&nbsp;<%//=selectedElement%>',
        html: '<table border="0" width="100%" height="300" bordercolor="green"><tr><td align="center" id="eg_errorsmall" width="100%" height="100%"><img src = "/final/images/spacer.gif" class="iconInformation" align = "center" border = "0"  vspace = "10"/><div style="color:#fff"><egui:intnl text="monitor.endUserDashboard.No details found"/>&nbsp;!</div></td></tr></table>'
    }).center();
});*/
</script>

</body>

</html>
<%
	}
	else if(compName!=null && compName.trim().length()>0)
	{
%>

<!DOCTYPE html>

<html class="content-frame">
<head>
<!-- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8; IE=edge;"> -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<script src="/final/scripts/eg_DateUtil.js" ></script>
<script>
	var fromf5=<%=isfromf5%>;
	var treeSession="<%=treeSession%>";
	var fromCompName="<%=fromCompName%>";
	var fromLayerName="<%=fromLayerName%>";
	var fromTest="<%=fromTest%>";
	var desktopName ='<%=desktopName%>';
	var isFromLayerModel=<%=isFromLayerModel%>
	var chartTimeline='<%=chartTimeline%>';
	var sessionDetailsTimeline='<%=sessionDetailsTimeline%>';
	var sessionDetailsTopN='<%=sessionDetailsTopN%>';
	var userAlertsNop='<%=userAlertsNop%>';
	var strSkin="<%=monitor_Skin%>";
	var titleSting="<%=titleSting%>";
	var logonTitleSting="<%=logonTitleSting%>";
	var isFusion=<%=isFusion%>;
	var userType='<%=tempUserType%>';
	var orgUserType='<%=orgUserType%>';
	var fromVCDSDrilldown='<%=fromVCDSDrilldown%>';
	var dscomp='<%=dscomp%>';
	var dscomptype='<%=dscomptype%>';
	var dsInfo='<%=dsInfo%>';
	var dsmsmt_host='<%=dsmsmt_host%>';
	var detail='<%=detail%>';
	var compCombo='<%=compCombo%>';
	var timeZoneOffsetVal='<%=timezoneOffsetValue%>';
	var noMeasure='<egui:intnl text="monitor.common.No Measures Available" />';
	var noDetails='<egui:intnl text="monitor.common.No details found" />';
	var searchMess='<egui:intnl text="monitor.layermodel.No details found!" />';
	var hidePMess='<egui:intnl text="monitor.layermodel.No panels are configured!" />';
	var toolMinimize='<egui:intnl text="monitor.dashboard.Minimize" />';
	var diagnosisTitle='<egui:intnl text="monitor.common.DIAGNOSIS" />';
	var measGraphTitle='<egui:intnl text="monitor.layermodel.Measure Graph" />';
	var goBtn='<egui:intnl text="monitor.common.Go" />';
	var isMaximizedView = false;
	var mgrDateFormatTemp = '<%=mgrDateFormat%>';
	var mgrDateFormat=getExtjsDateFormat('<%=dateFormatForDatePicker%>');
	var currentDateFormat = '<%=dateFormatForDatePicker%>';
	var mgrDisplayDateFormat='<%=dateFormatNew%>';
	var filterBy='<%=filterBy%>';
	var searchFilter = '<%=searchFilter%>';
	var nextSearch = '<%=nextSearch%>';
	var nextSubSearch = '<%=nextSubSearch%>';
	var priorityFilter = '<%=priorityFilter%>';
	var gatewayFilter = '<%=gatewayFilter%>';
	var filterFlag = '<%=filterFlag%>';
	var enableBackButton = '<%=enableBackButton%>';
	var overviewSearchStr = '<%=overviewSearchStr%>';
	var isFromUEDOverview = '<%=isFromUEDOverview%>';
	var appCnt = '';
	var publicJson = '';
	var isHistory = '<%=isHistory%>';
	var loginTime = '<%=o_loginTime%>';
	var logoutTime = '<%=o_logoutTime%>';
	var dialonurl="";
	var fullviewapp="";
	var layerStr="";
	var defaultParams="<%=queryStringForNewUI%>";
	var publicJsonData;
	var fromDashBoardLink=false;
	var httpRequest = false;
	var isSearchUser = false;
	var refreshURL ="";
	var pageURL = "";
	var monitorSkin = "<%=monitor_Skin%>";
	var isIE = false;
	var isFireFox = false;
	var isChrome = false;	
	var refreshFrequency='<%=refreshFrequency%>';
	var maxiView='';
	var maximizedFunction='';
	var maxChartId='';
	var maxChartName='';
	var requestParams=new Object();
	var userCombo=new Array();
	var compArray = new Array();
	var userArray = new Array();
	var userCompsArray = new Array();
	var userName = '<%=userName%>';
	var hideConfigFlag = <%=!isAdminRole%>;
	var isModifyEnable = <%=!isModifyPanels%>;

	var isUEDExternalAccFlg=<%= ((!isDetailsManagerLogin) && isUEDExternalAccess)%>;
	var isDirectEndDetails=<%=isDirectEndDetails%>;
	var configuration ='<egui:intnl text="monitor.endUserDashboard.Configuration"/>';
	var optionsLabel = '<egui:intnl text="monitor.endUserDashboard.What would you like to do?"/>';
	var metricsLabel = '<egui:intnl text="monitor.endUserDashboard.Panel Type"/>';
	var addLabel = '<egui:intnl text="monitor.endUserDashboard.Add a panel"/>';
	var modifyLabel = '<egui:intnl text="monitor.endUserDashboard.Modify an existing panel"/>';
	var deleteLabel = '<egui:intnl text="monitor.endUserDashboard.Delete custom panels"/>';
	var showHideLabel = '<egui:intnl text="monitor.endUserDashboard.Show/Hide default panels"/>';
	var panelTitleLabel = '<egui:intnl text="monitor.endUserDashboard.Panel Title"/>';
	var timelineLabel = '<egui:intnl text="monitor.endUserDashboard.Timeline"/>';
	var groupLabel = '<egui:intnl text="monitor.endUserDashboard.Group"/>';
	var groupNameLabel = '<egui:intnl text="monitor.endUserDashboard.Group name"/>';
	var TestLabel = '<egui:intnl text="monitor.endUserDashboard.Test"/>';
	var MeasureLabel = '<egui:intnl text="monitor.endUserDashboard.Measure"/>';
	var DisplayLabel = '<egui:intnl text="monitor.endUserDashboard.Display Name"/>';
	var UpdateLabel = '<egui:intnl text="monitor.endUserDashboard.Update"/>';
	var PleaseSelectTest = '<egui:intnl text="monitor.endUserDashboard.Please select the Test"/>';
	var PleaseSelectMeasure = '<egui:intnl text="monitor.endUserDashboard.Please select the Measure"/>';
	var PleaseEnterDisplayName = '<egui:intnl text="monitor.endUserDashboard.Please enter the Display Name"/>';
	var tipSpe='<egui:intnl text="monitor.services.Special characters are not allowed"/>';
	var defultSettings='<egui:intnl text="monitor.endUserDashboard.Dashboard Settings" />';
	//var defaultSettings='<egui:intnl text="monitor.Ack.Default Settings" />';
	var selectUserDesk='<egui:intnl text="monitor.endUserDashboard.User/Desktop" />';
	var labelUserComps='<egui:intnl text="monitor.endUserDashboard.Session on" />';
	var modifyOptions='<egui:intnl text="monitor.endUserDashboard.Modify Options" />';
	var removeExisting='<egui:intnl text="monitor.endUserDashboard.Remove Measures" />';
	var updateExisting='<egui:intnl text="monitor.endUserDashboard.Update Titles" />';	
	var addNew='<egui:intnl text="monitor.endUserDashboard.Add Measures" />';	
	var processNameLabel='<egui:intnl text="monitor.endUserDashboard.Process Name" />';	
	var processLabel='<egui:intnl text="monitor.endUserDashboard.Process" />';	
	var panelsLabel='<egui:intnl text="monitor.endUserDashboard.Panels" />';	
	var sessionDetailsTimelineLabel='<egui:intnl text="monitor.endUserDashboard.Timeline" />';	
	var sessionDetailsTopNLabel='<egui:intnl text="monitor.endUserDashboard.Top N" />';	
	var userAlertsNopLabel='<egui:intnl text="monitor.endUserDashboard.No of Records" />';	
	var showUserCombo=<%=!isShowUserCombo%>;
	var showUserCompsCombo=<%=!isShowUserCompsCombo%>;
	var showBackButon=<%=!isShowBackButton%>;
	var isNormalBack=<%=isNormalBack%>;
	var isUserSearch=<%=isUserSearch%>;
	var showKeyUser=<%=showKeyUser%>;
	var userSearchParams='<%=userSearchParams%>';
	var timelineLbl='Timeline';
	var fromLbl='From';
	var hrLbl='Hr';
	var Tolbl='To';
	var graphLbl='View';
	var er_modeInTracker='2D';
	var UpdateError = '<%= mappingInfo.getTextDescription("monitor.endUserDashboard.Already Exists")%>';
	var panelOrder=new Array();
	var panelPosOrderArray=new Array();
	var outerPanelPosOrderArray=new Array();
	var outerAppPanelPosOrderArray=new Array();
	var enabledDefaultPanels=new Array();
	var disabledDefaultPanels=new Array();
	var customPanels=new Array();
	var isNewpanel = '<%=newpanel%>';
	var isFromMenu=<%=isFromMenu%>;
	//Citrix dashboard params
	var isFromGeo=<%=isFromGeo%>;
	var iniName="<%=iniName%>";
	var user_name="<%=user_name%>";
	var isUserBased="<%=isUserBased%>";
	var dashboard_name="<%=dashboard_name%>";
	var view_name="<%=view_name%>";
	var time_line="<%=time_line%>";
	var geoInfo="<%=geoInfo%>";
	var usercountval="<%=usercountval%>";
	var filterName="<%=filterName%>";
	var filterViewName="<%=filterViewName%>";
	var countryCode="<%=countryCode%>";
	var regionName="<%=regionName%>";
	var fromServiceHomePage="<%=fromServiceHomePage%>";
	var fromZonePage="<%=fromZonePage%>";
	var isFromServiceMenu="<%=isFromServiceMenu%>";
	var isFromZone="<%=isFromZone%>";
	var iszoneName="<%=iszoneName%>";
	var parentZone="<%=parentZone%>";
	var isFromZoneMenu="<%=isFromZoneMenu%>";
	var selectedTest="<%=selectedTest%>";
	var selectedMeasure="<%=selectedMeasure%>";
	var isDirectLinkfromCtx=<%=isDirectLinkfromCtx%>;
	//end
	var scrollTopVal=<%=scrollTopVal%>;
	var compName ='<%=compName%>';
	var compType ='<%=compType%>';
	var msmt_host ='<%=msmt_host%>';
	var isYaxisBasedOnData=<%=isYaxisBasedOnData%>;
	var isOnlyVMAssigned=<%=isOnlyVMAssigned%>;
	var isVMAssigned=<%=isVMAssigned%>;
	function obj(){
		obj=new Object();
		this.put=function(key,value){
			obj[""+key+""]=value;
		}
		this.obj=obj
	}
	var panelPositionsMapping=new obj();
	var panelsPerRow = <%=panelsPerRowCount%>;
	var csrfToken = '<%=strCsrfToken%>';
	var detail = '<%=detail%>';
	var compCombo = '<%=compCombo%>';
	var dashboard_mapping = '<%=dashboard_mapping%>';
	var searchString = '<%=searchString%>';
	var adtnlSearchStr = '<%=adtnlSearchStr%>';
	var showBackBtn = '<%=showBackBtn%>';

	var grppanelData=new Array();
</script>
<script language = "javascript">
	
	function filterEncode(text)
	{
		//['%;()=]
		var filterEncodeChar = ['[',']','(',')','=','%','\''];
		var filterDecodeText = ['|lsbr|','|rsbr|','|lbr|','|rbr|','|eq|','|per|','|squot|'];
		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|','|per|','|squot|'];
		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;
	}

	</script>
<%
	if(isShowUserCombo)
	{
		//EgList vdiDesktopsList = (EgList)vmDashHelper.getVmDesktopsForTheComponent(searchString,priority,vdiType);
		//Hashtable finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponent(searchString,priority,vdiType);
		EgList vdiDesktopsList= new EgList();
		Hashtable finalEndUserDatas = (Hashtable)vmDashHelper.getEndUserDatas(userType);
		Hashtable infoResHash = new Hashtable();
		if(finalEndUserDatas!=null && finalEndUserDatas.size()>0)
		{
			infoResHash = (Hashtable)finalEndUserDatas.get("users");
		}
		//Hashtable infoResHash = (Hashtable)finalEndUserDatas.get("data1");
		Hashtable finalDesktopVmsHash=new Hashtable();
		if(infoResHash!=null && infoResHash.size()>0)
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getAllUsersDesktopsForUED(searchString,priority,userType,vdiType,0,infoResHash,null);
		}
		else
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponentForGenericEUD(searchString,priority,userType,vdiType,0);
		}
		if(finalDesktopVmsHash!=null && finalDesktopVmsHash.size()>0)
		{
			vdiDesktopsList = (EgList)finalDesktopVmsHash.get("EgList");
		}

		if(vdiDesktopsList!=null && vdiDesktopsList.size()>1)
		{
			EgTablesInfo tablesInfo = new EgTablesInfo("manager");

			for(int z=0;z<vdiDesktopsList.size();z++)
			{
				EgService tempServ = (EgService)vdiDesktopsList.get(z);
				String tempDesktopComponent = tempServ.getName();
				String tempDesktopState = tempServ.getState().getName();
				String tempDesktopName = "";
				String tempComp = "";
				String tempCompValue = "";
				String tempCompName = "";
				String tempCompNameWithOutPort = "";
				if(tempDesktopComponent!=null && tempDesktopComponent.indexOf("^")>-1){
					tempDesktopName = tempDesktopComponent.substring(0,tempDesktopComponent.indexOf("^"));
					tempComp = tempDesktopComponent.substring(tempDesktopComponent.indexOf("^")+1);
				}
				if(tempComp!=null && tempComp.indexOf(":")>-1){
					tempCompValue = tempComp.substring(0,tempComp.indexOf(":"));
					tempCompName = tempComp.substring(tempComp.indexOf(":")+1);
				}
				if(tempCompName!=null && tempCompName.indexOf(":")>-1){
					tempCompNameWithOutPort = tempCompName.substring(0,tempCompName.indexOf(":"));
				}
				String tempMsmtHost = "";
				String ctype_layer=endUserIni.getValue("USER_DESKTOP_LAYERS",tempCompValue);
				ctype_layer=(ctype_layer==null || ctype_layer.trim().length()==0)?"VIRTUAL_DESKTOP":ctype_layer;
				ArrayList arr = tablesInfo.getTestsForLayer(ctype_layer);
				//ArrayList arr = tablesInfo.getTestsForLayer("VIRTUAL_DESKTOP");
				if(arr!=null && arr.size()>0)
				{
					boolean flag=true;
					for (int t=0;t<arr.size();t++)
					{
						String insideviewTest=(String) arr.get(t);
						if(insideviewTest!=null && insideviewTest.trim().length()>0)
						{
							List tempAgents=egExternalInfo.getAgentsFor(insideviewTest.trim(),tempCompValue,tempCompNameWithOutPort);

							if(tempAgents!=null && tempAgents.size()>0)
							{
								tempMsmtHost=(String)tempAgents.get(0);
								flag=false;
								break;
							}
						}
					}

					if(flag)
						tempMsmtHost=tempCompNameWithOutPort;
				}
				else
					tempMsmtHost=tempCompNameWithOutPort;

				/*List tempAgents=egExternalInfo.getAgentsFor("",tempCompValue,tempCompNameWithOutPort);
				if(tempAgents!=null && tempAgents.size()>0)
					tempMsmtHost=(String)tempAgents.get(0);
				else
					tempMsmtHost=tempCompNameWithOutPort;*/

				String temp_url_desktopName=com.egurkha.util.StringUtils.replace(tempDesktopName, "\\", "\\\\");
				String searchString_EN=com.egurkha.util.StringUtils.encodeSecurityChar(searchString);
				String url = "?comp="+tempCompName+"&comptype="+tempCompValue+"&info=*"+temp_url_desktopName+"&compName="+tempCompName+":"+tempCompValue+"&componentName="+tempCompNameWithOutPort+"&msmt_host="+tempMsmtHost+"&user="+userName+"&searchString="+searchString_EN+"&priority="+priority+"&vdiType="+vdiType+"&enableBackButton="+isShowBackButton+"&normalBack="+isNormalBack+"&directEndDetail="+strDirectEndDetail+"&userType="+userType;

				if(fromMenuStr!=null && fromMenuStr.trim().length()>0)
				{
					url=url+"&fromMenu="+fromMenuStr;
				}
				
				if(selectedElement!=null && selectedElement.equals(temp_url_desktopName))
					selectedElementUrl = url;
%>
				<script>
					var temp=new Object();
					temp.name='<%=temp_url_desktopName%>';
					temp.value='<%=url%>';
					userArray.push(temp);
				</script>
<%
			}
		}
		else
		{
			isShowUserCombo=false;
		}
%>
		<script>
		userCombo.push({
			//name: "componentName" ,
			name: "userNameCombo" ,
			value: userArray,
			selected:'<%=selectedElementUrl%>'
		});
		requestParams.userCombo=userCombo;
		showUserCombo=<%=!isShowUserCombo%>;
		</script>
<%
	}

	if(isShowUserCompsCombo)
	{
		EgList vdiDesktopsList= new EgList();
		Hashtable finalEndUserDatas = (Hashtable)vmDashHelper.getEndUserDatas(userType);
		Hashtable infoResHash = new Hashtable();
		if(finalEndUserDatas!=null && finalEndUserDatas.size()>0)
		{
			infoResHash = (Hashtable)finalEndUserDatas.get("users");
		}
		Hashtable finalDesktopVmsHash=new Hashtable();
		if(infoResHash!=null && infoResHash.size()>0)
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getAllUsersDesktopsForUED(searchString,priority,userType,vdiType,0,infoResHash,null);
		}
		else
		{
			finalDesktopVmsHash = (Hashtable)vmDashHelper.getVmDesktopsForTheComponentForGenericEUD(searchString,priority,userType,vdiType,0);
		}
		if(finalDesktopVmsHash!=null && finalDesktopVmsHash.size()>0)
		{
			vdiDesktopsList = (EgList)finalDesktopVmsHash.get("EgList");
		}

		if(vdiDesktopsList!=null && vdiDesktopsList.size()>1)
		{
			EgTablesInfo tablesInfo = new EgTablesInfo("manager");
			int countUserComps=0;
			for(int z=0;z<vdiDesktopsList.size();z++)
			{
				EgService tempServ = (EgService)vdiDesktopsList.get(z);
				String tempDesktopComponent = tempServ.getName();
				String tempDesktopState = tempServ.getState().getName();
				String tempDesktopName = "";
				String tempComp = "";
				String tempCompValue = "";
				String tempCompName = "";
				String tempCompNameWithOutPort = "";
				String tempCompNameType = "";
				if(tempDesktopComponent!=null && tempDesktopComponent.indexOf("^")>-1){
					tempDesktopName = tempDesktopComponent.substring(0,tempDesktopComponent.indexOf("^"));
					tempComp = tempDesktopComponent.substring(tempDesktopComponent.indexOf("^")+1);
				}
				if(tempComp!=null && tempComp.indexOf(":")>-1){
					tempCompValue = tempComp.substring(0,tempComp.indexOf(":"));
					tempCompName = tempComp.substring(tempComp.indexOf(":")+1);

					tempCompNameType=tempCompName+":"+tempCompValue;
				}
				if(tempCompName!=null && tempCompName.indexOf(":")>-1){
					tempCompNameWithOutPort = tempCompName.substring(0,tempCompName.indexOf(":"));
				}

				String display_host_name=tempCompName;
				if (display_host_name!=null && display_host_name.endsWith(EgConstants.NULL_PORT) && (display_host_name.indexOf(EgConstants.NULL_PORT) > -1))
				{
					display_host_name = Server.getServerNameWithoutPort(display_host_name, false);
				}

				String tempMsmtHost = "";
				String ctype_layer=endUserIni.getValue("USER_DESKTOP_LAYERS",tempCompValue);
				ctype_layer=(ctype_layer==null || ctype_layer.trim().length()==0)?"VIRTUAL_DESKTOP":ctype_layer;
				ArrayList arr = tablesInfo.getTestsForLayer(ctype_layer);
				//ArrayList arr = tablesInfo.getTestsForLayer("VIRTUAL_DESKTOP");
				if(arr!=null && arr.size()>0)
				{
					boolean flag=true;
					for (int t=0;t<arr.size();t++)
					{
						String insideviewTest=(String) arr.get(t);
						if(insideviewTest!=null && insideviewTest.trim().length()>0)
						{
							List tempAgents=egExternalInfo.getAgentsFor(insideviewTest.trim(),tempCompValue,tempCompNameWithOutPort);

							if(tempAgents!=null && tempAgents.size()>0)
							{
								tempMsmtHost=(String)tempAgents.get(0);
								flag=false;
								break;
							}
						}
					}

					if(flag)
						tempMsmtHost=tempCompNameWithOutPort;
				}
				else
					tempMsmtHost=tempCompNameWithOutPort;

				String temp_url_desktopName=com.egurkha.util.StringUtils.replace(tempDesktopName, "\\", "\\\\");
				String searchString_EN=com.egurkha.util.StringUtils.encodeSecurityChar(searchString);
				String url = "?comp="+tempCompName+"&comptype="+tempCompValue+"&info=*"+temp_url_desktopName+"&compName="+tempCompName+":"+tempCompValue+"&componentName="+tempCompNameWithOutPort+"&msmt_host="+tempMsmtHost+"&user="+userName+"&searchString="+searchString_EN+"&priority="+priority+"&vdiType="+vdiType+"&enableBackButton="+isShowBackButton+"&normalBack="+isNormalBack+"&directEndDetail="+strDirectEndDetail+"&userType="+userType;

				if(fromMenuStr!=null && fromMenuStr.trim().length()>0)
				{
					url=url+"&fromMenu="+fromMenuStr;
				}

				if(selectedElement!=null && selectedElement.equals(temp_url_desktopName))
				{
					//compName-->DEVCVAD1909XA1:1494:Citrix_XcXenApp_server
					if(compName!=null && compName.equals(tempCompNameType))
						selectedElementCompUrl = url;

%>
					<script>
						var temp=new Object();
						temp.name='<%=display_host_name%>';
						temp.value='<%=url%>';
						userCompsArray.push(temp);
					</script>
<%
					countUserComps++;
				}
			}

			if(countUserComps<=1)
				isShowUserCompsCombo=false;
		}
		else
		{
			isShowUserCompsCombo=false;
		}
%>
		<script>
		compArray.push({
			name: "userCompNameCombo" ,
			value: userCompsArray,
			selected:'<%=selectedElementCompUrl%>'
		});
		requestParams.userCompsCombo=compArray;
		showUserCompsCombo=<%=!isShowUserCompsCombo%>;
		</script>
<%
	}
	
	Object[] panelOrderArray=endUserIni.getVariables(userName+":"+tempUserType+"_Panels");

	String supportTypeStr = endUserIni.getValue("USER_TYPE_COMPONENTS",tempUserType);
	ArrayList supportTypeList = new ArrayList();
	if(supportTypeStr!=null && supportTypeStr.trim().length()>0)
	{
		supportTypeList =  com.egurkha.util.StringUtils.egTokenizer(supportTypeStr.trim(), ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
	}
	
	String broker_types=endUserIni.getValue("Enable_Director_Link",userType+":Broker");
	broker_types=(broker_types==null || broker_types.trim().length()==0)?"Citrix_XcXenDesktop_server":broker_types;
	if(broker_types!=null && broker_types.trim().length()>0)
		broker_types = broker_types.trim();
	ArrayList brokerSupportedTypes =  com.egurkha.util.StringUtils.egTokenizer(broker_types.trim(), ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim

	String storefront_types=endUserIni.getValue("Enable_Director_Link",userType+":StoreFront");
	storefront_types=(storefront_types==null || storefront_types.trim().length()==0)?"Citrix_StoreFront_server":storefront_types;
	if(storefront_types!=null && storefront_types.trim().length()>0)
		storefront_types = storefront_types.trim();
	ArrayList storefrontSupportedTypes =  com.egurkha.util.StringUtils.egTokenizer(storefront_types.trim(), ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim

	boolean isBrokerOk=false;

	if(brokerSupportedTypes!=null && brokerSupportedTypes.size()>0)
	{
		for(int ff=0;ff<brokerSupportedTypes.size();ff++)
		{
			ArrayList tmp_serverTypes = (ArrayList)user.getServersForType((String)brokerSupportedTypes.get(ff));
			if(tmp_serverTypes!=null && tmp_serverTypes.size()>0)
			{
				isBrokerOk=true;
				break;
			}
		}
	}

	boolean isSFOk=false;
	if(storefrontSupportedTypes!=null && storefrontSupportedTypes.size()>0)
	{
		for(int ff=0;ff<storefrontSupportedTypes.size();ff++)
		{
			ArrayList tmp_serverTypes = (ArrayList)user.getServersForType((String)storefrontSupportedTypes.get(ff));
			if(tmp_serverTypes!=null && tmp_serverTypes.size()>0)
			{
				isSFOk=true;
				break;
			}
		}
	}
	
	boolean isSessionTopoEnabled=true;
	if(isSTBasedUserType && stBasedTestList!=null && stBasedTestList.size()>0)
	{
		String temp_CompName=compName;
		if(compName!=null && compName.indexOf(":")>-1){
			temp_CompName = compName.substring(0,compName.lastIndexOf(":"));
		}
		boolean isSTForUserType=false;

		if(isBrokerOk && isSFOk)
		{
			for(int bt=0;bt<stBasedTestList.size();bt++)
			{
				String st_test_name=(String)stBasedTestList.get(bt);
				if(st_test_name!=null && st_test_name.trim().length()>0)
				{
					Vector info_list=new Vector();
					info_list = (Vector)eGSerDashDAO.getDescriptorsForTest(temp_CompName,compType,st_test_name,"custom");
					if(info_list!=null && info_list.size()>0)
					{
						for(int d=0;d<info_list.size();d++)
						{
							String st_info_name=(String)info_list.get(d);
							if(st_info_name!=null && st_info_name.indexOf(":")>-1)
							{
								st_info_name = st_info_name.substring(0,st_info_name.indexOf(":"));
							}
							if(st_info_name!=null && org_desktopName!=null && st_info_name.equalsIgnoreCase("+"+org_desktopName))
							{
								isSTForUserType=true;
								break;
							}
						}
					}
					if(isSTForUserType)
						break;
				}

				if(isSTForUserType)
					isSessionTopoEnabled=true;
				else
					isSessionTopoEnabled=false;
			}
		}
		else
			isSessionTopoEnabled=false;
	}

	String Hide_Panels_When_External_Access="";
	ArrayList Hide_PanelsList=new ArrayList();
	ArrayList Hide_PanelIdList=new ArrayList();
	ArrayList Hide_PanelNameList=new ArrayList();
	if(isHidePanel)
	{
		String strExternal_Access=endUserIni.getValue("Hide_Panels_When_External_Access",userType);
		if(strExternal_Access!=null && strExternal_Access.length()>0)
		{
			StringTokenizer strExternal_AccessTok = new StringTokenizer(strExternal_Access,",");
			if(strExternal_AccessTok!=null)
			{
				while(strExternal_AccessTok.hasMoreTokens())
				{
					Hide_Panels_When_External_Access = strExternal_AccessTok.nextToken();
					if(Hide_Panels_When_External_Access!=null && Hide_Panels_When_External_Access.indexOf(":")>-1)
					{
						String str_PanelName=Hide_Panels_When_External_Access.substring(Hide_Panels_When_External_Access.indexOf(":")+1);
						String str_PanelId=Hide_Panels_When_External_Access.substring(0,Hide_Panels_When_External_Access.indexOf(":"));

						Hide_PanelIdList.add(str_PanelId);
						Hide_PanelNameList.add(str_PanelName);
					}
					else
					{
						Hide_PanelsList.add(Hide_Panels_When_External_Access);
					}
					
				}
			}
		}
	}

	ArrayList outerPanelsList = new ArrayList();
	ArrayList outerPanelsAppDetailsList = new ArrayList();

	String panel_ids_str = endUserIni.getValue(userName+":"+tempUserType+"_Outer_Panels","OuterPanel");
	String panel_apd_str = endUserIni.getValue(userName+":"+tempUserType+"_Outer_Panels","ApplicationDetailsPanel");
	
	if(panel_ids_str!=null && panel_ids_str.trim().length()>0)
	{
		outerPanelsList =  com.egurkha.util.StringUtils.egTokenizer(panel_ids_str.trim(), ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
	}

	if(panel_apd_str!=null && panel_apd_str.trim().length()>0)
	{
		outerPanelsAppDetailsList =  com.egurkha.util.StringUtils.egTokenizer(panel_apd_str.trim(), ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
	}

	List usrGrpMetricsSubjects = Arrays.asList(endUserIni.getSubjects());
	if (usrGrpMetricsSubjects!=null && !usrGrpMetricsSubjects.contains(userName+":"+tempUserType+"_Group_Metrics_Details"))
	{
		Object[] grouMetricsArray = endUserIni.getVariables(tempUserType+"_Group_Metrics_Details");
		if(grouMetricsArray!=null && grouMetricsArray.length>0)
		{
			boolean saveInFlag =false;
			for (int p=0;p<grouMetricsArray.length;p++)
			{
				String metricKey = (String)grouMetricsArray[p];
				if (metricKey!=null && metricKey.trim().length()>0 && !metricKey.equalsIgnoreCase("NULL"))
				{
					String grpMetricVal = endUserIni.getValue(tempUserType+"_Group_Metrics_Details",metricKey);
					if (grpMetricVal!=null && grpMetricVal.trim().length()>0 && !grpMetricVal.equalsIgnoreCase("NULL"))
					{
						endUserIniUpdate.setValue(userName+":"+tempUserType+"_Group_Metrics_Details",metricKey,grpMetricVal);
						saveInFlag = true;
					}
				}
			}
			if(saveInFlag)
				endUserIniUpdate.saveFile();
		}
	}
	String groupWidgetDetails = endUserIni.getValue(userName+":"+tempUserType+"_Panel_grouping_details","Group");

	if(isSessionTopoEnabled && isSTBasedUserType)
		groupWidgetDetails = endUserIni.getValue(userName+":"+tempUserType+"_Panel_grouping_details","Group");
	else
		groupWidgetDetails = endUserIni.getValue(tempUserType+"_Panel_grouping_details","Group");

	ArrayList groupWidgetDetailsList =  com.egurkha.util.StringUtils.egTokenizer(groupWidgetDetails, ",",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim

	if(panelOrderArray!=null && panelOrderArray.length>0)
	{
		boolean saveFlge=false;
		
		for(int p=0;p<panelOrderArray.length;p++)
		{
			String panelId=(String)panelOrderArray[p];
			String isEnabled = endUserIni.getValue(userName+":"+tempUserType+"_Default_Panels",panelId);

			boolean ifGroupedNeeded = false;
			if(groupWidgetDetailsList!=null && groupWidgetDetailsList.size()>1 && groupWidgetDetailsList.contains(panelId))
				ifGroupedNeeded = true;

			if(!ifGroupedNeeded)
			{
				if(isEnabled!=null && isEnabled.length()>0 && isEnabled.equals("false"))
					continue;
			}			

			String panelMetrics=endUserIni.getValue(userName+":"+tempUserType+"_Panels",panelId);
			String panelProps=endUserIni.getValue(userName+":"+tempUserType+"_Panel_Properties",panelId);
			if(isSessionTopoEnabled && isSTBasedUserType)
				panelProps=endUserIni.getValue(userName+":"+tempUserType+"_SessionTopology_Panel_Properties",panelId);
			if(panelProps==null || panelProps.trim().length()==0)
			{
				if(isSessionTopoEnabled && isSTBasedUserType)
				{
					panelProps=endUserIni.getValue(tempUserType+"_SessionTopology_Panel_Properties",panelId);
					endUserIniUpdate.setValue(userName+":"+tempUserType+"_SessionTopology_Panel_Properties",panelId,panelProps);
				}
				else
				{
					panelProps=endUserIni.getValue(tempUserType+"_Panel_Properties",panelId);
					endUserIniUpdate.setValue(userName+":"+tempUserType+"_Panel_Properties",panelId,panelProps);
				}
				saveFlge=true;
			}
			if(supportTypeList!=null && supportTypeList.size()>0)
			{
				for(int q=0;q<supportTypeList.size();q++)
				{
					String serverType=(String)supportTypeList.get(q);
					if(serverType==null || serverType.trim().length()==0)
						continue;

					String panel_bankendApp_Type = endUserIni.getValue(userName+":USER_BACKEND_APP_TYPES",tempUserType+":"+serverType);

					if(panel_bankendApp_Type==null || panel_bankendApp_Type.equals(""))
					{
						String subBankendAppSub=userName+":USER_BACKEND_APP_TYPE_TESTS";

						String panel_bankendAppType = endUserIni.getValue("USER_BACKEND_APP_TYPES",tempUserType+":"+serverType);
						ArrayList BackendAppTestValuesList =  com.egurkha.util.StringUtils.egTokenizer(panel_bankendAppType, ",",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
						if(BackendAppTestValuesList!=null && BackendAppTestValuesList.size()>1)
						{
							StringTokenizer BackendAppValTok = new StringTokenizer(panel_bankendAppType,",");
							while(BackendAppValTok.hasMoreTokens())
							{
								String wholevalueToken = BackendAppValTok.nextToken();
								if(wholevalueToken!=null && wholevalueToken.length()>0 )
								{
									String panel_bankendAppTestVal = endUserIni.getValue("USER_BACKEND_APP_TYPE_TESTS",tempUserType+":"+serverType+":"+wholevalueToken);
									endUserIniUpdate.setValue(subBankendAppSub,tempUserType+":"+serverType+":"+wholevalueToken,panel_bankendAppTestVal);
									//endUserIniUpdate.saveFile();
								}
							}
						}
						else
						{
							String panel_bankendAppTestVal = endUserIni.getValue("USER_BACKEND_APP_TYPE_TESTS",tempUserType+":"+serverType+":"+panel_bankendAppType);
							if(panel_bankendAppTestVal!=null && panel_bankendAppTestVal.trim().length()>0)
							{
								endUserIniUpdate.setValue(subBankendAppSub,tempUserType+":"+serverType+":"+panel_bankendAppType,panel_bankendAppTestVal);
								//endUserIniUpdate.saveFile();
							}
						}
						String subBankendApp=userName+":USER_BACKEND_APP_TYPES";
						if(panel_bankendAppType!=null && panel_bankendAppType.trim().length()>0)
						{
							endUserIniUpdate.setValue(subBankendApp,tempUserType+":"+serverType,panel_bankendAppType);
							panel_bankendApp_Type = panel_bankendAppType;
							//endUserIniUpdate.saveFile();
						}
						saveFlge=true;
					}

					if(panel_bankendApp_Type!=null && panel_bankendApp_Type.trim().length()>0)
					{
						ArrayList backendAppTypelist =  com.egurkha.util.StringUtils.egTokenizer(panel_bankendApp_Type, ",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
						if(backendAppTypelist!=null && backendAppTypelist.size()>0)
						{
							for(int kk=0;kk<backendAppTypelist.size();kk++)
							{
								String bakendAppToken = (String)backendAppTypelist.get(kk);
								if(bakendAppToken!=null && bakendAppToken.trim().length()>0)
								{
									String panel_bankendApp_Test = endUserIni.getValue(userName+":USER_BACKEND_APP_TYPE_TESTS",tempUserType+":"+serverType+":"+bakendAppToken);

									if(panel_bankendApp_Test==null || panel_bankendApp_Test.equals(""))
									{
										String subBankendAppSub=userName+":USER_BACKEND_APP_TYPE_TESTS";
										String panel_bankendAppType = endUserIni.getValue("USER_BACKEND_APP_TYPES",tempUserType+":"+serverType);
										ArrayList BackendAppTestValuesList =  com.egurkha.util.StringUtils.egTokenizer(panel_bankendAppType, ",",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
										if(BackendAppTestValuesList!=null && BackendAppTestValuesList.size()>1)
										{
											StringTokenizer BackendAppValTok = new StringTokenizer(panel_bankendAppType,",");
											while(BackendAppValTok.hasMoreTokens())
											{
												String wholevalueToken = BackendAppValTok.nextToken();
												if(wholevalueToken!=null && wholevalueToken.length()>0 )
												{
													String panel_bankendAppTestVal = endUserIni.getValue("USER_BACKEND_APP_TYPE_TESTS",tempUserType+":"+serverType+":"+wholevalueToken);
													endUserIniUpdate.setValue(subBankendAppSub,tempUserType+":"+serverType+":"+wholevalueToken,panel_bankendAppTestVal);
													//endUserIniUpdate.saveFile();
												}
											}
										}
										else
										{
											String panel_bankendAppTestVal = endUserIni.getValue("USER_BACKEND_APP_TYPE_TESTS",tempUserType+":"+serverType+":"+panel_bankendAppType);
											if(panel_bankendAppTestVal!=null && panel_bankendAppTestVal.trim().length()>0)
											{
												endUserIniUpdate.setValue(subBankendAppSub,tempUserType+":"+serverType+":"+panel_bankendAppType,panel_bankendAppTestVal);
												//endUserIniUpdate.saveFile();
											}
										}
										saveFlge=true;
									}
								}
							}
						}
					}
				}
			}

			String toolIcon="iconClose3";
			String toolIconText="Remove Panel";
			String toolIconId="closeWinId";
			if(isEnabled!=null && isEnabled.length()>0)
			{
				toolIcon="iconHide";
				toolIconText="Hide Panel";
				toolIconId="hideWinId";
			}

			String panelName="";
			if(panelMetrics!=null && panelMetrics.trim().length()>0 && panelMetrics.indexOf(":")>-1)
				panelName = panelMetrics.substring(0,panelMetrics.indexOf(":"));
			else
			{
				if(panelMetrics!=null && panelMetrics.trim().length()>0 && panelMetrics.indexOf("~!~")>-1)
					panelName = panelMetrics.substring(0,panelMetrics.indexOf("~!~"));
			}
			
			if(!ifGroupedNeeded)
			{
				if(panelName!=null && panelName.length()>0 && Hide_PanelsList!=null && Hide_PanelsList.size()>0 && Hide_PanelsList.contains(panelName))
					continue;
				else if(panelName!=null && panelName.length()>0 && Hide_PanelIdList!=null && Hide_PanelIdList.contains(panelId) && Hide_PanelNameList!=null && Hide_PanelNameList.contains(panelName))
					continue;
			}
			
			if(ifGroupedNeeded)
				panelProps = "1,1,1,1";

			if(panelProps!=null && panelProps.trim().length()>0)
			{
				ArrayList panelPosList =  com.egurkha.util.StringUtils.egTokenizer(panelProps.trim(), ",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim

				if(panelPosList!=null && panelPosList.size()>=4)
				{
					String colPos = (String)panelPosList.get(0);
					String rowPos = (String)panelPosList.get(1);
					String sizeX = (String)panelPosList.get(2);
					String sizeY = (String)panelPosList.get(3);

					int sizeXInt = 0;
					int sizeYInt = 0;
					try
					{
						Double dValX = new Double(sizeX);
						sizeXInt = dValX.intValue();

						Double dValY = new Double(sizeY);
						sizeYInt = dValY.intValue();
					}
					catch(Throwable thr)
					{
						thr.printStackTrace();
						sizeXInt = 0;
						sizeYInt = 0;
					}
					
					if(panelId!=null && panelId.length()>0 && (outerPanelsList==null || !outerPanelsList.contains(panelId)))
					{
						if(ifGroupedNeeded)
						{
%>
							<script>

								grppanelData.push({
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>",
								});								
							</script>						
<%

						}
						else
						{						
%>
							<script>

								panelPosOrderArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
								});

								var panelTmpArray=new Array();
								panelTmpArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>",
								});
								panelPositionsMapping.put('<%=new Integer(colPos)%>,<%=new Integer(rowPos)%>:<%=new Integer(sizeXInt)%>,<%=new Integer(sizeYInt)%>',panelTmpArray);
							</script>
<%
						}
					}

					if(isSessionTopoEnabled && panelId!=null && panelId.length()>0 && outerPanelsList!=null && outerPanelsList.size()>0 && outerPanelsList.contains(panelId) && (outerPanelsAppDetailsList==null || outerPanelsAppDetailsList.size()==0 || !outerPanelsAppDetailsList.contains(panelId)))
					{
						if(ifGroupedNeeded)
						{
%>
							<script>
								grppanelData.push({
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>",
								});								
							</script>						
<%

						}
						else
						{						
%>
							<script>

								outerPanelPosOrderArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
								});

								var outerPanelTmpArray=new Array();
								outerPanelTmpArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>",
								});
								panelPositionsMapping.put('<%=new Integer(colPos)%>,<%=new Integer(rowPos)%>:<%=new Integer(sizeXInt)%>,<%=new Integer(sizeYInt)%>',outerPanelTmpArray);
							</script>
<%
						}
					}

					if(panelId!=null && panelId.length()>0 && outerPanelsAppDetailsList!=null && outerPanelsAppDetailsList.size()>0 && outerPanelsAppDetailsList.contains(panelId))
					{
						if(ifGroupedNeeded)
						{
%>
							<script>
								grppanelData.push({
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>",
								});								
							</script>						
<%

						}
						else
						{						
%>
							<script>

								outerAppPanelPosOrderArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
								});

								var outerAppPanelTmpArray=new Array();
								outerAppPanelTmpArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>",
								});
								panelPositionsMapping.put('<%=new Integer(colPos)%>,<%=new Integer(rowPos)%>:<%=new Integer(sizeXInt)%>,<%=new Integer(sizeYInt)%>',outerAppPanelTmpArray);
							</script>						
<%
						}
					}
				}
			}
%>
			<script>
				panelOrder.push({
					PanelId:"<%=panelId%>" ,
					Metrics:"<%=panelMetrics%>",
					Props:"<%=panelProps%>",
					ToolIcon:"<%=toolIcon%>",
					ToolIconText:"<%=toolIconText%>",
					ToolIconId:"<%=toolIconId%>",
					PanelName:"<%=panelName%>"
				});
			</script>
<%
		}

		if(saveFlge)
			endUserIniUpdate.saveFile();
	}
	else
	{
		panelOrderArray=endUserIni.getVariables(tempUserType+"_Panels");
		if(panelOrderArray!=null && panelOrderArray.length>0)
		{
			boolean saveFlge=false;
			String outerPanelIds=endUserIni.getValue(tempUserType+"_Outer_Panels","OuterPanel");
			if(outerPanelIds!=null && outerPanelIds.trim().length()>0)
			{
				endUserIniUpdate.setValue(userName+":"+tempUserType+"_Outer_Panels","OuterPanel",outerPanelIds);
	
				outerPanelsList =  com.egurkha.util.StringUtils.egTokenizer(outerPanelIds.trim(),",",false,true,true);//param 3-->includeEmpty,4-->unique,5-->trim
			}

			for(int p=0;p<panelOrderArray.length;p++)
			{
				String panelId=(String)panelOrderArray[p];

				if(panelId!=null && panelId.trim().length()>0)
				{
					String panelMetrics=endUserIni.getValue(tempUserType+"_Panels",panelId);
					String panelProps=endUserIni.getValue(tempUserType+"_Panel_Properties",panelId);
					String panelPropsSessionTopology=null;
					if(isSessionTopoEnabled && isSTBasedUserType)
						panelPropsSessionTopology=endUserIni.getValue(tempUserType+"_SessionTopology_Panel_Properties",panelId);

					String isEnabled = endUserIni.getValue(tempUserType+"_Default_Panels",panelId);
					String panel_timeline = endUserIni.getValue(tempUserType+"_Timelines",panelId);
					String panel_Palette = endUserIni.getValue(tempUserType+"_Palette",panelId);
					String panel_norec = endUserIni.getValue(tempUserType+"_User_Alerts","No_Of_Records");
					String panel_showall = endUserIni.getValue(tempUserType+"_User_Alerts","ShowAll");

					String subPanel=userName+":"+tempUserType+"_Panels";
					String subPanelPro=userName+":"+tempUserType+"_Panel_Properties";
					String subPanelProSessionTopology=null;
					if(isSessionTopoEnabled && isSTBasedUserType)
						subPanelProSessionTopology=userName+":"+tempUserType+"_SessionTopology_Panel_Properties";

					String subDefPanel=userName+":"+tempUserType+"_Default_Panels";
					String subTimeline=userName+":"+tempUserType+"_Timelines";
					String subPalette=userName+":"+tempUserType+"_Palette";
					String subAlert=userName+":"+tempUserType+"_User_Alerts";
					String subBankendApp=userName+":USER_BACKEND_APP_TYPES";

					if(supportTypeList!=null && supportTypeList.size()>0)
					{
						for(int q=0;q<supportTypeList.size();q++)
						{
							String serverType=(String)supportTypeList.get(q);
							if(serverType==null || serverType.trim().length()==0)
								continue;

							String panel_bankendAppType = endUserIni.getValue("USER_BACKEND_APP_TYPES",tempUserType+":"+serverType);
							
							if(panel_bankendAppType!=null && panel_bankendAppType.trim().length()>0)
								endUserIniUpdate.setValue(subBankendApp,tempUserType+":"+serverType,panel_bankendAppType);

							String subBankendAppSub=userName+":USER_BACKEND_APP_TYPE_TESTS";
							ArrayList BackendAppTestValuesList =  com.egurkha.util.StringUtils.egTokenizer(panel_bankendAppType, ",",false,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
							if(BackendAppTestValuesList!=null && BackendAppTestValuesList.size()>1)
							{
								StringTokenizer BackendAppValTok = new StringTokenizer(panel_bankendAppType,",");
								while(BackendAppValTok.hasMoreTokens())
								{
									String wholevalueToken = BackendAppValTok.nextToken();
									if(wholevalueToken!=null && wholevalueToken.length()>0 )
									{
										String panel_bankendAppTestVal = endUserIni.getValue("USER_BACKEND_APP_TYPE_TESTS",tempUserType+":"+serverType+":"+wholevalueToken);
										endUserIniUpdate.setValue(subBankendAppSub,tempUserType+":"+serverType+":"+wholevalueToken,panel_bankendAppTestVal);
									}
								}
							}
							else
							{
								String panel_bankendAppTestVal = endUserIni.getValue("USER_BACKEND_APP_TYPE_TESTS",tempUserType+":"+serverType+":"+panel_bankendAppType);
								if(panel_bankendAppTestVal!=null && panel_bankendAppTestVal.trim().length()>0)
								{
									endUserIniUpdate.setValue(subBankendAppSub,tempUserType+":"+serverType+":"+panel_bankendAppType,panel_bankendAppTestVal);
								}
							}
						}
					}

					if(panelMetrics!=null && panelMetrics.trim().length()>0)
						endUserIniUpdate.setValue(subPanel,panelId,panelMetrics);

					if(panelProps!=null && panelProps.trim().length()>0)
						endUserIniUpdate.setValue(subPanelPro,panelId,panelProps);

					if(panelPropsSessionTopology!=null && panelPropsSessionTopology.trim().length()>0)
						endUserIniUpdate.setValue(subPanelProSessionTopology,panelId,panelPropsSessionTopology);

					if(isEnabled!=null && isEnabled.trim().length()>0)
						endUserIniUpdate.setValue(subDefPanel,panelId,isEnabled);

					if(panel_timeline!=null && panel_timeline.trim().length()>0)
						endUserIniUpdate.setValue(subTimeline,panelId,panel_timeline);

					if(panel_Palette!=null && panel_Palette.trim().length()>0)
						endUserIniUpdate.setValue(subPalette,panelId,panel_Palette);

					if(panel_norec!=null && panel_norec.trim().length()>0)
						endUserIniUpdate.setValue(subAlert,"No_Of_Records",panel_norec);

					if(panel_showall!=null && panel_showall.trim().length()>0)
						endUserIniUpdate.setValue(subAlert,"ShowAll",panel_showall);

					//endUserIniUpdate.saveFile();
					saveFlge=true;

					if(isEnabled!=null && isEnabled.length()>0 && isEnabled.equals("false"))
						continue;

					String toolIcon="iconClose3";
					String toolIconText="Remove Panel";
					String toolIconId="closeWinId";
					if(isEnabled!=null && isEnabled.length()>0)
					{
						toolIcon="iconHide";
						toolIconText="Hide Panel";
						toolIconId="hideWinId";
					}

					String panelName="";
					if(panelMetrics!=null && panelMetrics.trim().length()>0 && panelMetrics.indexOf(":")>-1)
						panelName = panelMetrics.substring(0,panelMetrics.indexOf(":"));
					else
					{
						if(panelMetrics!=null && panelMetrics.trim().length()>0 && panelMetrics.indexOf("~!~")>-1)
							panelName = panelMetrics.substring(0,panelMetrics.indexOf("~!~"));
					}

					if(panelName!=null && panelName.length()>0 && Hide_PanelsList!=null && Hide_PanelsList.size()>0 && Hide_PanelsList.contains(panelName))
						continue;
					else if(panelName!=null && panelName.length()>0 && Hide_PanelIdList!=null && Hide_PanelIdList.contains(panelId) && Hide_PanelNameList!=null && Hide_PanelNameList.contains(panelName))
						continue;

					if(panelProps!=null && panelProps.trim().length()>0)
					{
						ArrayList panelPosList =  com.egurkha.util.StringUtils.egTokenizer(panelProps.trim(), ",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim

						if(panelPropsSessionTopology!=null)
						{
							panelProps = panelPropsSessionTopology;
							panelPosList =  com.egurkha.util.StringUtils.egTokenizer(panelPropsSessionTopology.trim(), ",",true,false,true);//param 3-->includeEmpty,4-->unique,5-->trim
						}

						if(panelPosList!=null && panelPosList.size()>=4)
						{
							String colPos = (String)panelPosList.get(0);
							String rowPos = (String)panelPosList.get(1);
							String sizeX = (String)panelPosList.get(2);
							String sizeY = (String)panelPosList.get(3);

							int sizeXInt = 0;
							int sizeYInt = 0;
							try
							{
								Double dValX = new Double(sizeX);
								sizeXInt = dValX.intValue();

								Double dValY = new Double(sizeY);
								sizeYInt = dValY.intValue();
							}
							catch(Throwable thr)
							{
								thr.printStackTrace();
								sizeXInt = 0;
								sizeYInt = 0;
							}

							if(panelId!=null && panelId.length()>0 && (outerPanelsList==null || !outerPanelsList.contains(panelId)))
							{
%>
							<script>
								panelPosOrderArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
								});

								var panelTmpArray=new Array();
								panelTmpArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>"
								});
								panelPositionsMapping.put('<%=new Integer(colPos)%>,<%=new Integer(rowPos)%>:<%=new Integer(sizeXInt)%>,<%=new Integer(sizeYInt)%>',panelTmpArray);
							</script>
<%
							}

							if(isSessionTopoEnabled && panelId!=null && panelId.length()>0 && outerPanelsList!=null && outerPanelsList.size()>0 && outerPanelsList.contains(panelId) && (outerPanelsAppDetailsList==null || outerPanelsAppDetailsList.size()==0 || !outerPanelsAppDetailsList.contains(panelId)))
							{
%>
							<script>
								outerPanelPosOrderArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
								});

								var outerPanelTmpArray=new Array();
								outerPanelTmpArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>"
								});
								panelPositionsMapping.put('<%=new Integer(colPos)%>,<%=new Integer(rowPos)%>:<%=new Integer(sizeXInt)%>,<%=new Integer(sizeYInt)%>',outerPanelTmpArray);
							</script>
<%
							}

							if(isSessionTopoEnabled && panelId!=null && panelId.length()>0 && outerPanelsAppDetailsList!=null && outerPanelsAppDetailsList.size()>0 && outerPanelsAppDetailsList.contains(panelId))
							{
%>
							<script>
								outerAppPanelPosOrderArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
								});

								var outerAppPanelTmpArray=new Array();
								outerAppPanelTmpArray.push({
									col:<%=new Integer(colPos)%>,
									row:<%=new Integer(rowPos)%>,
									size_x:<%=new Integer(sizeXInt)%>,
									size_y:<%=new Integer(sizeYInt)%>,
									PanelId:"<%=panelId%>",
									Metrics:"<%=panelMetrics%>",
									Props:"<%=panelProps%>",
									ToolIcon:"<%=toolIcon%>",
									ToolIconText:"<%=toolIconText%>",
									ToolIconId:"<%=toolIconId%>",
									PanelName:"<%=panelName%>"
								});
								panelPositionsMapping.put('<%=new Integer(colPos)%>,<%=new Integer(rowPos)%>:<%=new Integer(sizeXInt)%>,<%=new Integer(sizeYInt)%>',outerAppPanelTmpArray);
							</script>
<%
							}
						}
					}
%>
				<script>
					panelOrder.push({
						PanelId:"<%=panelId%>" ,
						Metrics:"<%=panelMetrics%>",
						Props:"<%=panelProps%>",
						ToolIcon:"<%=toolIcon%>",
						ToolIconText:"<%=toolIconText%>",
						ToolIconId:"<%=toolIconId%>",
						PanelName:"<%=panelName%>"
					});
				</script>
<%
				}
			}

			if(saveFlge)
				endUserIniUpdate.saveFile();
		}
	}

	Object[] defaultPanelsArray=endUserIni.getVariables(userName+":"+tempUserType+"_Default_Panels");
	if(defaultPanelsArray!=null && defaultPanelsArray.length>0)
	{
		for(int p=0;p<defaultPanelsArray.length;p++)
		{
			String panelId=(String)defaultPanelsArray[p];
			
			if(groupWidgetDetailsList!=null && groupWidgetDetailsList.size()>1 && groupWidgetDetailsList.contains(panelId))
				continue;

			String panelmetrics = endUserIni.getValue(userName+":"+tempUserType+"_Panels",panelId);
			String panelTitle = "";
			String panelName = "";
			
			if(panelmetrics!=null && panelmetrics.indexOf("~!~")>-1)
			{
				if(panelmetrics!=null && panelmetrics.trim().length()>0 && panelmetrics.indexOf(":")>-1)
						panelName = panelmetrics.substring(0,panelmetrics.indexOf(":"));
				else
				{
					panelName=panelmetrics;
					if(panelName!=null &&  panelName.indexOf("~!~")>-1)
						panelName=panelName.substring(0,panelName.indexOf("~!~"));
				}
				panelTitle = panelmetrics.substring(panelmetrics.indexOf("~!~")+3);
			}
			else
			{
				panelTitle = panelmetrics;
				
				if(panelmetrics!=null && panelmetrics.trim().length()>0 && panelmetrics.indexOf("#")>-1)
						panelName = panelmetrics.substring(0,panelmetrics.indexOf(":"));
				
				if(panelTitle!=null && panelTitle.indexOf("#")>-1)
				{
					panelTitle = panelTitle.substring(0,panelTitle.indexOf("#"));
					if(panelTitle!=null && panelTitle.indexOf(":")>-1)
						panelTitle = panelTitle.substring(panelTitle.lastIndexOf(":")+1);
				}
			}
			
			if(panelName!=null && panelName.length()>0 && Hide_PanelsList!=null && Hide_PanelsList.size()>0 && Hide_PanelsList.contains(panelName))
				continue;
			else if(panelName!=null && panelName.length()>0 && Hide_PanelIdList!=null && Hide_PanelIdList.contains(panelId) && Hide_PanelNameList!=null && Hide_PanelNameList.contains(panelName))
				continue;

			//if(panelName!=null && (panelName.indexOf("Group_Metrics")>-1 || panelName.indexOf("SessionTopology")>-1 || panelName.indexOf("SessionDuration")>-1 || panelName.indexOf("UserDonutLoginInfo")>-1 || panelName.indexOf("SessionInfo")>-1 || (panelName.indexOf("LoginInfo")>-1 && !tempUserType.equalsIgnoreCase("VDI"))))
				//continue;
%>			
			<script>
				enabledDefaultPanels.push({
					valueField:'<%=panelId%>',
					displayField:"<%=panelTitle%>"
				});
			</script>

<%		
			String isEnabled = endUserIni.getValue(userName+":"+tempUserType+"_Default_Panels",panelId);
			if(isEnabled!=null && isEnabled.length()>0 && isEnabled.equals("false"))
			{
%>			
				<script>
					disabledDefaultPanels.push('<%=panelId%>');
				</script>
<%
			}

		}
	}
	else
	{
		defaultPanelsArray=endUserIni.getVariables(tempUserType+"_Default_Panels");
		if(defaultPanelsArray!=null && defaultPanelsArray.length>0)
		{
			for(int p=0;p<defaultPanelsArray.length;p++)
			{
				String panelId=(String)defaultPanelsArray[p];

				String panelmetrics = endUserIni.getValue(tempUserType+"_Panels",panelId);
				String panelTitle = "";
				String panelName = "";
				if(panelmetrics!=null && panelmetrics.indexOf("~!~")>-1)
				{
					if(panelmetrics!=null && panelmetrics.trim().length()>0 && panelmetrics.indexOf(":")>-1)
						panelName = panelmetrics.substring(0,panelmetrics.indexOf(":"));
					else
					{
						panelName=panelmetrics;
						if(panelName!=null &&  panelName.indexOf("~!~")>-1)
							panelName=panelName.substring(0,panelName.indexOf("~!~"));
					}
					panelTitle = panelmetrics.substring(panelmetrics.indexOf("~!~")+3);
				}
				else
				{
					panelTitle = panelmetrics;
					
					if(panelmetrics!=null && panelmetrics.trim().length()>0 && panelmetrics.indexOf("#")>-1)
						panelName = panelmetrics.substring(0,panelmetrics.indexOf(":"));
					
					if(panelTitle!=null && panelTitle.indexOf("#")>-1)
					{
						panelTitle = panelTitle.substring(0,panelTitle.indexOf("#"));
						if(panelTitle!=null && panelTitle.indexOf(":")>-1)
							panelTitle = panelTitle.substring(panelTitle.lastIndexOf(":")+1);
					}
				}

				if(panelName!=null && panelName.length()>0 && Hide_PanelsList!=null && Hide_PanelsList.size()>0 && Hide_PanelsList.contains(panelName))
					continue;
				else if(panelName!=null && panelName.length()>0 && Hide_PanelIdList!=null && Hide_PanelIdList.contains(panelId) && Hide_PanelNameList!=null && Hide_PanelNameList.contains(panelName))
					continue;
				
				//if(panelName!=null && (panelName.indexOf("Group_Metrics")>-1 || panelName.indexOf("SessionTopology")>-1||panelName.indexOf("SessionDuration")>-1 || panelName.indexOf("UserDonutLoginInfo")>-1 || panelName.indexOf("SessionInfo")>-1 || panelName.indexOf("LoginInfo")>-1))
					//continue;
	%>			
				<script>
					enabledDefaultPanels.push({
						valueField:'<%=panelId%>',
						displayField:"<%=panelTitle%>"
					});
				</script>

<%
				String isEnabled = endUserIni.getValue(tempUserType+"_Default_Panels",panelId);
				if(isEnabled!=null && isEnabled.length()>0 && isEnabled.equals("false"))
				{
%>
					<script>
						disabledDefaultPanels.push('<%=panelId%>');
					</script>
<%
				}
			}
		}
	}

	Object[] customPanelsArray=endUserIni.getVariables(userName+":"+tempUserType+"_Panels");
	if(customPanelsArray!=null && customPanelsArray.length>0)
	{
		for(int p=0;p<customPanelsArray.length;p++)
		{
			String panelId=(String)customPanelsArray[p];

			String panelmetrics = endUserIni.getValue(userName+":"+tempUserType+"_Panels",panelId);
			String panelTitle = "";
			if(panelmetrics!=null && panelmetrics.indexOf("~!~")>-1)
			{
				panelTitle = panelmetrics.substring(panelmetrics.indexOf("~!~")+3);
			}
			else
			{
				panelTitle = panelmetrics;
				if(panelTitle!=null && panelTitle.indexOf("#")>-1)
				{
					panelTitle = panelTitle.substring(0,panelTitle.indexOf("#"));
					if(panelTitle!=null && panelTitle.indexOf(":")>-1)
						panelTitle = panelTitle.substring(panelTitle.lastIndexOf(":")+1);
				}
			}

			String isDefault = endUserIni.getValue(userName+":"+tempUserType+"_Default_Panels",panelId);
			if(isDefault==null || isDefault.length()==0)
			{
%>			
				<script>
					customPanels.push({
						value:'<%=panelId%>',
						text:"<%=panelTitle%>"
					});
				</script>
<%
			}
		}
	}
	else
	{
		customPanelsArray=endUserIni.getVariables(tempUserType+"_Panels");
		if(customPanelsArray!=null && customPanelsArray.length>0)
		{
			for(int p=0;p<customPanelsArray.length;p++)
			{
				String panelId=(String)customPanelsArray[p];

				String panelmetrics = endUserIni.getValue(tempUserType+"_Panels",panelId);
				String panelTitle = "";
				if(panelmetrics!=null && panelmetrics.indexOf("~!~")>-1)
				{
					panelTitle = panelmetrics.substring(panelmetrics.indexOf("~!~")+3);
				}
				else
				{
					panelTitle = panelmetrics;
					if(panelTitle!=null && panelTitle.indexOf("#")>-1)
					{
						panelTitle = panelTitle.substring(0,panelTitle.indexOf("#"));
						if(panelTitle!=null && panelTitle.indexOf(":")>-1)
							panelTitle = panelTitle.substring(panelTitle.lastIndexOf(":")+1);
					}
				}

				String isDefault = endUserIni.getValue(tempUserType+"_Default_Panels",panelId);
				if(isDefault==null || isDefault.length()==0)
				{
	%>			
					<script>
						customPanels.push({
							value:'<%=panelId%>',
							text:"<%=panelTitle%>"
						});
					</script>
	<%
				}
			}
		}
	}
%>
	<script>
	var isVDISessionTopologyEnabled=<%=(isSessionTopoEnabled && isSTBasedUserType)%>;
	</script>
<link rel="stylesheet" href="../resources/css/ext-eg.css"/>

<!--<link rel="stylesheet" type="text/css" href="/final/styles/eGDarkTheme.css" />
<link rel="stylesheet" type="text/css" href="/final/styles/eGDarkThemeIcons.css" />-->

<script src="../extjs/ext-all.js"></script>

<egui:skin ui="monitor"/>
<%
	if (monitor_Skin.equalsIgnoreCase("light"))
	{
%>
<link rel="stylesheet" href="/final/styles/uxDashboardLight.css" media="all"  />
<%
	}
	else
	{
%>
	<link rel="stylesheet" href="/final/styles/uxDashboardDark.css" media="all"  />
<%
	}
%>
<!-- fancy Scroll -->
<!--<script src="/final/FusionCharts/scripts/FusionCharts.js"></script>-->
<!-- <script language="JavaScript1.2" src="/final/jquery/jquery.js"></script> -->
<!--Old Jquery refering in the name of highchart_export.js -->
<script src="/final/jquery/highchart_export.js"></script>
<script src="/final/styles/jscrollpane/jquery.jscrollpane.min.js" ></script>
<script src="/final/styles/jscrollpane/jquery.mousewheel.js" ></script>
<script src="/final/styles/jscrollpane/mwheelIntent.js" ></script>
<link rel="stylesheet" href="/final/styles/jscrollpane/jquery.jscrollpane.css"/>

<script language="JavaScript1.2" src="eg_scripts/eg_date.js"></script>
<script language="JavaScript1.2" src="/final/Highcharts/js/highstock.js"></script>
<script src="/final/monitor/eg_scripts/EgHighChart.js"></script>
<script src="/final/monitor/eg_scripts/egDashboardHighChart.js"></script>
<script src="/final/Highcharts/js/highcharts-more.js"></script>
<script src="/final/Highcharts/js/solid-gauge.src.js"></script>
<script type="text/javascript" src="/final/jquery/jquery-ui.js"></script>
<!-- Grid ster ----------->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/jquery.gridster.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/demo.css"><!-- Added -->
		<link rel="stylesheet" type="text/css" href="/final/styles/gridster/css/digitalfont/stylesheet.css"><!-- Added -->
		<script type="text/javascript" src="/final/jquery/jquery.scrollTo.js"></script> <!--Added -->
		<script type="text/javascript" src="/final/jquery/jquery.gridster.js"></script><!-- Added -->

<script src="/final/monitor/eg_scripts/endUserDashboardDetails/app.js"></script>
<style>
	/*.iconAdd{ background-position: -232px -1px !important}*/
	/*.iconHelp{ background-position: -212px -2px !important}*/
	.x-btn-default-toolbar-small .x-btn-inner{ font-weight:bold}
</style>
<title><egui:intnl text="monitor.endUserDashboard.User Experience Dashboard Details"/></title>
<script>
		
	function BarOnclick(i)
	{
		Ext.onReady(function(){

			fullviewapp.getController("Main").BarOnclick(i);
			
		})
	}

	function AreaOnclick(i)
	{
		Ext.onReady(function(){

			fullviewapp.getController("Main").AreaOnclick(i);
			
		})
	}

	function dialOnclick1(id)
	{
		Ext.onReady(function(){
			var dialonurl=publicJsonData['dialGraphLayerModelUrls'][id];
			if(dialonurl!=null)
				wayToLayerModel(dialonurl);
		});

		
	}
	
	function checkBrowserType()
	{
		Ext.onReady(function(){
			isIE =  Ext.isIE ||  Ext.isIE6 ||  Ext.isIE7 || Ext.isIE8;
			isFireFox =  Ext.isGecko ||  Ext.isGecko2 ||  Ext.isGecko3;
			isChrome =  Ext.isChrome;
		});
		
	}

	function wayToLayerModel(QryStr)
	{
		checkBrowserType();
		pageURL = QryStr;
		refreshURL = '/final/monitor/EgAlarmSessionDel.jsp';
		if (window.XMLHttpRequest)
		{
			httpRequest = new XMLHttpRequest();
			if (httpRequest.overrideMimeType)
			{
				httpRequest.overrideMimeType('text');
			}
		}
		else if (window.ActiveXObject)
		{
			try
			{
				httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{
				}
			}
		}
		if (!httpRequest)
		{
			return false;
		}

		httpRequest.onreadystatechange =  execute;
		httpRequest.open('POST',refreshURL, true);
		httpRequest.setRequestHeader("Content-Type","text/html;charset=UTF-8");
		httpRequest.send(null);		
	}

	function execute()
	{
		if (httpRequest.readyState == 4 || httpRequest.readyState=="complete")
		{
			var iframeDoc ='';
			try
			{
				try
				{
					iframeDoc = opener.document;
				}
				catch(e2)
				{
					iframeDoc = window.parent.document;
				}
				var iFrameId;
				
				if (isFireFox || isChrome)
				{
					iFrameId = iframeDoc.getElementById('main');
				}
				else if (isIE)
				{
					iFrameId = iframeDoc.all['main'];
				}
				if(pageURL.indexOf("EgConfigChange")>-1)
				{
					iFrameId.src=pageURL;
				}
				/*else if(pageURL.indexOf("layerTestMeasure")>-1)
				{
					iFrameId.src="/final/monitor/aggDashboard.jsp?"+encodeURI(pageURL);
				}*/
				else if(pageURL.indexOf("getFor")>-1)
				{
					iFrameId.src="/final/monitor/egInsideviewDashboard.jsp?"+encodeURI(pageURL);
				}
				else
				{
					iFrameId.src="/final/monitor/EgSiteInfraView.jsp?"+encodeURI(pageURL)+"&toDashBoardLayer=true&gotoLayerModel=true";
				}
			}
			catch (error)
			{
				alert(error);
				window.open("/final/monitor/EgSiteInfraView.jsp?"+encodeURI(pageURL))+"&toDashBoardLayer=true"; 
			}
			pageURL = null;
		}
	}

	
	function dialOnclick( qString )
	{
		//qStr = '/final/egIndex.jsp?pressed=monitor&accessPageName=egMonDashboard&entry=monitor&from=list&tab=LayerModel&toDashBoardLayer=true&qctr=2&fromPage=componentList&fromalarm=null';
		//window.parent.location.href = qStr;
		if(qString!=null && qString.indexOf("?")>0)
		{
			qString = qString.substr(qString.indexOf("?")+1);
		}
		//window.parent.location.href = "/final/egIndex.jsp?entry=monitor&qViewParam=" + encodeURI(qString) + "&fromPage=alarmQView&newwindow=false&displayTab=all&action=tabchange";
	}
	function maximizedView(id , graphFormat)
	{
		appCnt.showMaximizedView(id,graphFormat);
	}

	function maximizedFusion( chartName, id )
	{
		appCnt.showMaximizedFusion( chartName, id );
	}

	function openGraph( url, grp_title , graphFormat)
	{
		appCnt.showMaximizedGraphView( url,grp_title,graphFormat);
	}

	function showMaximizedAreaChart(id,graphFormat)
	{
		appCnt.showMaximizedAreaChart(id,graphFormat);
	}
	
	function openDDMaxBar( gtkey,dkey,gh)
	{	
		appCnt.showDDMaximizedFusion( gtkey,dkey,gh );
	}
	function openDD( url )
	{	
		var tmpUrl = url.substring(url.indexOf("?")+1);
		if(!Ext.isEmpty(url))
		{
			var show = "graph";
			if(url.indexOf("EgDiagnosis") > -1)
			{
				show = "diagnosis";
				tmpUrl = "EgDiagnosis.jsp?"+tmpUrl;
			}
			else
			{
				tmpUrl = "EgGraphs.jsp?"+tmpUrl;
			}
			tmpUrl = '/final/monitor/EventsGraph.jsp?pageToShow='+show+'&url='+encodeURI(tmpUrl)+'&isglobalsearchType=dd';
		}
		Ext.onReady(function(){
			var printObj = Ext.widget('print',{
					items:[{
						xtype : "component",
						id:"printContentDiv",
						title:diagnosisTitle,
						autoEl:{
						tag:'iframe',
						frameborder:'0',
						height:'100%',
						src : tmpUrl
						},
						listeners:{
							load: {
									element: 'el',
									fn: function () {
										this.parent().unmask();
									}
								},
								render: function () {
									this.up('window').body.mask('Loading...');
								}
						}
						}],
					
					}).show();

		});
	}
	function loadPopup(qUrl)
	{
		if(!Ext.isEmpty(qUrl))
		{
			if((typeof assetWin) == 'object') {
				assetWin.destroy(); 
			}
			if(qUrl.indexOf('egShowAssetInformation') > -1)
			{
				if(isPopupWindow != null && isPopupWindow == "true")
				{
					var asmPopupWindow = window.parent.loadPopup();//loadPopup() function is available inside final\egIndex.jsp
					asmPopupWindow.removeAll();
					asmPopupWindow.add(	{
						xtype: "component",
						width: '100%',
						cls: 'outerpanel',
						autoScroll: true,
						scroll: true,
						border: false,
						id: 'assertPopup',
						autoEl: {
								tag: "iframe",
								src: encodeURI(qUrl)		// Reffers egShowAssetInformation.jsp  
								}
						});
					asmPopupWindow.show();
				} else {
					assetWin = Ext.create('Ext.window.Window', {
						title: 'Asset Management',
						id: 'assetWindow',
						name: 'assetWindow',
						//cls: 'lightbox',
						ui: 'newPopupWindow assetAlarmPopupWinHeader',
						header: {
							height: 48,
							padding: '0 20',
							margin: 0
						},
						layout: 'fit',
						closeAction: 'destroy',
						shadow: 'sides',
						modal: true,
						draggable: true,
						resizable: true,
						constrain: true,
						ghost: false,
						height: 350,
						//width: 840,
						width: 605,
						items: [{
							xtype: "component",
							width: '100%',
							cls: 'outerpanel',
							autoScroll: true,
							scroll: true,
							border: false,
							id: 'assertPopup',
							autoEl: {
								tag: "iframe",
								src: encodeURI(qUrl)		// Reffers egShowAssetInformation.jsp  
								}
						}],
						listeners: {
							show: function(win) {
								if (this.modal) {
									var dom = Ext.dom.Query.select('.x-mask');
									var el = Ext.get(dom[0]);
									el.addCls('windowModal');
									
								}
							},
							hide: function(win) {
								if (this.modal) 
								{
									var dom = Ext.dom.Query.select('.x-mask');
									var el = Ext.get(dom[0]);
									el.removeCls('windowModal');
									
								}
							}
							}
						}).show();
					} 
				} 
				else {
					try{
						parent.openWindow(qUrl,'GRAPHS','toolbar=no,menubar=no,location=no,status=no,width=1014,height=603,left=0,top=80,screenx=0,screeny=0,resizable=yes,scrollbars=yes');
					}catch(ee)
					{
						parent.parent.openWindow(qUrl,'GRAPHS','toolbar=no,menubar=no,location=no,status=no,width=1014,height=603,left=0,top=80,screenx=0,screeny=0,resizable=yes,scrollbars=yes');
					}
				}
		}
	}
	Ext.onReady(function()
	{
		//initLdgMask = new Ext.LoadMask(Ext.getBody(),{msg : "Loading ..."});
		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};
	});
	function loadMaximizedView(imgid)
	{	
		appCnt.showMaximizedView( imgid );
	}
	function setHighChart(url,divId,height,width,maxURL,isAxisTimeReq,legendPos,isMaximizedView,showLegends)
	{
		Ext.onReady(function() 
		{
			var containerId = divId;
			var containerObj = '';
			var errMsg = '';
			if (isMaximizedView)
			{
				containerObj=Ext.get(containerId);
				errMsg = '<table width="100%" height="450px"><tr><td valign="middle" align="center"><div class="iconInformation" style=""></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>';
			}
			else
			{
				containerObj=Ext.getCmp(containerId);
				errMsg = '<table width="100%" height="100%"><tr><td valign="middle" align="center"><div class="iconInformation" style=""></div><div style="font-size:12px">'+noMeasure+'! </div></td></tr></table>';
			}
			if(!Ext.isEmpty(url))
			{
				Ext.Ajax.request(
				{
					url : url,
					scope:this,
					success: function(response) 
					{
						if(response.status == 200 && !Ext.isEmpty( response.responseText ) )
						{
							if(response.responseText.indexOf('.png')>=0)
							{
								if(!Ext.isEmpty( containerObj ))
								{
									containerObj.update(errMsg);
								}
							}
							else
							{
								var chartData=Ext.decode(response.responseText);
								if(!Ext.isEmpty(chartData) && chartData!='' && chartData.hasOwnProperty('DataSet') && !Ext.isEmpty(chartData["DataSet"]))
								{
									try
									{
										var lineChart = {
										};
										lineChart = jQuery.extend(true, {}, getHighStockAreaChartForUserExperienceDashboard(containerId,height,width,''), lineChart);
										if (!isMaximizedView && chartData.hasOwnProperty('title'))
										{
											chartData.title='';
										}
										if(!Ext.isEmpty(showLegends) && showLegends)
											chartData['legendEnableforMaxW'] = true;
										else
											chartData['legendEnableforMaxW'] = false;

										lineChart.setData(chartData,'<%=mgrDateFormat%>',maxURL,isAxisTimeReq,legendPos);
										lineChart.drawChart();
									}
									catch (e)
									{
										alert("exception in highchart method::"+e);
									}
								}
								else
								{
									if(!Ext.isEmpty( containerObj ))
									{
										containerObj.update(errMsg);
									}
								}
							}
						}
						else
						{
							if(!Ext.isEmpty( containerObj ))
							{
								containerObj.update(errMsg);
							}
						}
					}
				});
			}
		});
	}
	</script>
</head>

<body style="overflow:hidden" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" class="content-frame">
	<div id="uedLoadMask" class="x-mask-msg x-layer x-mask-msg-default" style="z-index: 19001;left:45%;top:35%;">
		<div class="x-mask-loading" style="position:relative">
			Loading...
		</div>
	 </div>
</body>

</html>
<%
		if(isDetailsManagerLogin)
		{
			if(request.getQueryString()!=null)
			{
				String qry=request.getQueryString();
				qry=com.egurkha.util.StringUtils.replace(qry, "\\", "\\\\");
				session.setAttribute("monitorLastSession","/final/monitor/endUserDashboardDetailsData.jsp?"+qry);
			}
			//else session.setAttribute("monitorLastSession","/final/monitor/endUserDashboardDetailsData.jsp");
		}
	}
%>

<%!
	public void writeLog(String content,boolean isDebugEnabledField,int logFileSizeField)
	{
		if(isDebugEnabledField)
		{
			boolean append = true;
				try
				{
					String path = EgInstallInfo.getInstallDir()+ "/manager/logs/userExpDashBoard.txt";
					File f = new File(path); 
					if(f.exists())
					{
						int size = new FileInputStream(f).available();
						if(size>(1024*1024*logFileSizeField))
						{
							append = false;
							content = "";
						}
					}
					PrintWriter pw = new PrintWriter(new FileWriter(path,append));
					pw.write(new java.util.Date()+" endUserDashboardDetailsData.jsp "+content);
					pw.write("\n");
					pw.flush();
					pw.close();
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
		}
	}
%>
