<!DOCTYPE html>

<%@ include file="EgTrackerA.jsp" %>
<%@ include file="listSearchJson.jsp" %>
<%@ taglib prefix="egui" uri="../WEB-INF/eg-taglib.tld"%>
<%@ page import = "com.eg.EgExternalInfo" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%
	IniFile testsIniwr = new IniFile(EgConfigInfo.egMgrConfigDir + "eg_tests.ini");
	response.setHeader("Cache-Control","no-store");
	response.setHeader("Pragma","no-cache");
	response.setDateHeader("Expires", -1);

	boolean isDouble = com.eg.EgDbInfo.doubleByteEnabled;
	com.eg.EgServicesInfo servicesInfo = new com.eg.EgServicesInfo("manager");
	boolean isAllowHostName = servicesInfo.isAllowHostNames();
	boolean autoIpNameCheck = servicesInfo.autoIpNameCheck();
	String currentAction = "";
	String hostName= request.getParameter("hostName");
	String portValue= request.getParameter("portValue");
	String host=hostName+":"+portValue;
	String tempVal = (request.getParameter("server")!=null?request.getParameter("server"):host);
	String compGUID=request.getParameter("nodeGUID");
	String agentHostIP= request.getParameter("agentHostIP");
	String agentHostPort=testsIniwr.getValue("AGENT_SOCKET_SETTINGS","NodeJSAgentServerSocketPortNo");
	String agentLess=request.getParameter("agentLess");
	String compVal=tempVal;
	String oldRemoteAgent=request.getParameter("oldRemoteAgent");
	String compName = tempVal;
	if (tempVal != null && tempVal.equalsIgnoreCase("new"))
		currentAction = "add";
	
	tempVal = request.getParameter("modifyserver");
	if (tempVal != null && tempVal.equalsIgnoreCase("true"))
		currentAction = "modify";

	EgExternalInfo extInfo = new EgExternalInfo("manager");

	if(compVal!=null && compVal.indexOf(":")>-1){
	String node_host=compVal.substring(0,compVal.indexOf(":"));
	String remoteAgent=extInfo.getRemoteAgentForHost(node_host);
		if(agentHostIP== null || agentHostIP.length()<=0){
			agentHostIP="localhost";
			if(remoteAgent!= null && remoteAgent.length()>0){
				agentHostIP=extInfo.getIpForRemoteAgent(remoteAgent);
			}
		}
		if(compGUID==null || compGUID.length()==0){
			compGUID=testsIniwr.getValue("NODE_COMPONENT_ID_MAPPING",compVal);
		}
	}
	String strrmtList = "";
	String strextList = "";
	String[] rmtAgents = extInfo.getAllRemoteAgents();
	if(rmtAgents != null)
	{
		List rmtList = Arrays.asList(rmtAgents);
		strrmtList = rmtList.toString();
		strrmtList = strrmtList.substring(1,strrmtList.length()-1);
	}

	String[] extAgents = extInfo.getAllExternalAgents();
	if(extAgents != null)
	{
		List extList = Arrays.asList(extAgents);
		strextList = extList.toString();
		strextList = strextList.substring(1,strextList.length()-1);
	}

	String serverCategory = request.getParameter("serverGategory");
	String serverType = request.getParameter("serverType");
	String from = request.getParameter("from");
	String requestType = request.getParameter("requestType");
	String fromAPP = request.getParameter("fromAPP");
	String servicePage = request.getParameter("servicePage");
	String onGoingSite = request.getParameter("onGoingSite");
	String fromTopology = request.getParameter("frmTopology");
	String frmPage = request.getParameter("frmPage");
	String queryString = "";
	if(servicePage==null)
	{
		servicePage="";
	}
	if(onGoingSite==null)
	{
		onGoingSite="";
	}
	if(fromTopology==null)
	{
		fromTopology="";
	}

	String node_Script="";
	if(serverType.equalsIgnoreCase("NodeJS")){
		StringBuffer sbfNode = new StringBuffer();
				sbfNode.append("/** eG Node Monitor Snippet **/ \\n");
				sbfNode.append("var egMonitor = require(\\'eg-node-monitor\\'); \\n");
				sbfNode.append("egMonitor.start({\\n");
				sbfNode.append("component_id : \\'[").append(compName).append("]\\',\\n");
				sbfNode.append("unique_component_id: \\'").append(compGUID).append("\\' ,\\n");
				sbfNode.append("agent_port:").append(agentHostPort).append(" ,\\n");
				sbfNode.append("agent_host: \\'").append(agentHostIP).append("\\' \\n");
				sbfNode.append("}); \\n");
				sbfNode.append("/** eG Node Monitor Snippet **/");
				node_Script=sbfNode.toString();
	}


	//System.out.println("servicePage inside EgNewServer.jsp page "+servicePage+"onGoingSite:: "+onGoingSite);
	if(from != null && from.equals("inventory")) // From Home>discovery pop-up
	{
		currentAction = "manage";
		queryString = request.getQueryString();
	}

	String compIp = request.getParameter("compIp");
	String compNick = request.getParameter("compNick");
	if (compIp == null) compIp="";
	if (compNick == null) compNick="";


	// for limited components
	String fromWizard = request.getParameter("fromWizard");
	if(com.egurkha.util.StringUtils.isNull(fromWizard))
	{
		fromWizard = "";
	}

	String initiate = "";
	String wizCType = serverType;
	if (!com.egurkha.util.StringUtils.isNull(fromAPP) && fromAPP.equals("wizard"))
	{
		initiate = fromWizard.substring(fromWizard.indexOf("_")+1);
	}

	if (!com.egurkha.util.StringUtils.isNull(serverType) && serverType.equals("-1"))
	{
		wizCType = request.getParameter("wizCType");
	}

	String remAgentForAgentlessDisc = "";
	String remAgentForAgentlessDiscStr = request.getParameter("remAgentForAgentlessDisc");
	if (remAgentForAgentlessDiscStr != null && remAgentForAgentlessDiscStr.trim().length() > 0)
	{
		remAgentForAgentlessDisc = remAgentForAgentlessDiscStr;
	}

	boolean isMspModel = EgUuidInfo.isMspModel();
%>
<html>
<head>
	<meta charset="utf-8">
	<title>Components List</title>

	<egui:skin ui="admin"/>

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

	<!-- Fancy Scroll-->
	<script src="/final/jquery/jquery.js"></script>
	<script src="/final/styles/jscrollpane/jquery.jscrollpane.js" ></script>
	<script src="/final/styles/jscrollpane/jquery.mousewheel.js" ></script>
	<script src="/final/styles/jscrollpane/mwheelIntent.js" ></script>
	<script src="/final/scripts/utilities/EncodeDecodeParams.js"></script>
	<link rel="stylesheet" href="/final/styles/jscrollpane/jquery.jscrollpane.css"/>

	<script language="JavaScript1.2" src="eg_scripts/validate.js"></script>
	<script language="JavaScript1.2" src="../scripts/<%=script_src%>"></script>
	<!-- Application folder -->
	<script type="text/javascript" src="NewComponent/app/app.js"></script>
	<script language="JavaScript1.2">
	var csrfToken = '<%=strCsrfToken%>';
	var remAgentForAgentlessDisc = '<%=remAgentForAgentlessDisc%>';
	var pageDesc2 = '<egui:intnl description="EgHostCheck.jsp"/>';
	
	var addButtonText = '<egui:intnl text="admin.server.Add New Component"/>';
	var noCompsAlert = '<egui:intnl text="admin.server.No components found"/>';
	var rumHiddenField = '';
	var rumCollectorCmp = '';
	var rumUsername= '';
	var ajaxCorrelationRule = '';
	var overwriteBtmUNameRule = '';
	var ajaxCallsRule = '';
	var resrcDetailsRule = '';
	var jsErrorInfoRule = '';
	var includeURLData = '';
	var excludeURLData = '';
	var ajaxExcludeURLData = '';
	var rumExpType = '';
	var rumSelectorPath = '';
	var rumSelectorPathIndex = '';
	var rumApplyCleanUp = '';
	var rumExtractionRule = '';
	var rumAlternateUrl = '';
	var collectorType = '';
	var selectedRemoteAgent = '';
	var jsonDataCache = '';
	var publicJSON = '';
	var ctrler = '';
	var rmtListStr = '<%=strrmtList%>';
	var rmtListArr = rmtListStr.split(",");
	var extListStr = '<%=strextList%>';
	var extListArr = extListStr.split(",");
	var fromTopology='<%=fromTopology%>';
	var frmPage='<%=frmPage%>';
	var qryStr = '<%=queryString%>';
	var fromAPP = '<%=fromAPP%>';
	var requestType = '<%=requestType%>';
	var server='<%=compVal%>';
	var currentAction = '<%=currentAction%>';
	var isDoubleByteMgr='<%=isDouble%>';
	var isAllowHostName='<%=isAllowHostName%>';
	var autoIpNameCheck='<%=autoIpNameCheck%>';
	var serverCategory = '<%=serverCategory%>';
	var serverType = '<%=serverType%>';
	var compName = '<%=compName%>';
	var servicePage = '<%=servicePage%>';
	var onGoingSite = '<%=onGoingSite%>';
	var addCompURL = '<%=request.getQueryString()%>';
	var rumOSCheck = '<%=System.getProperty("os.name")%>';
	var nodeScript='<%=node_Script %>';
	var agentLess='<%=agentLess %>';
	var oldRemoteAgent='<%=oldRemoteAgent%>';
	var isMspModel='<%=isMspModel%>';
	var alertMsg1 = '<egui:intnl text="admin.server.Nick name is not allowed in DBL(Chinese,Korean,Japanese),since manager is SingleByte"/>.';
	var alertMsg2 = '<egui:intnl text="admin.server.The Operating System must be selected"/>.';
	var alertMsg3 = '<egui:intnl text="admin.server.A mode must be selected for agentless monitoring"/>.';
	var alertMsg4 = '<egui:intnl text="admin.server.Perfmon is available only for Windows operating systems"/>.';
	var alertMsg5 = '<egui:intnl text="admin.server.is not available for Windows operating systems"/>.';
	var alertMsg6 = '<egui:intnl text="admin.server.Mode should be SNMP for this server type"/>.';
	var alertMsg7 = '<egui:intnl text="admin.server.Atleast one external agent must be selected"/>.';
	var alertMsg8 = '<egui:intnl text="admin.server.Please enter the port number"/>.';
	var alertMsg9 = '<egui:intnl text="admin.server.Port should be a valid number"/>.';
	var alertMsg10 = '<egui:intnl text="admin.server.Port numbers cannot have decimals"/>.';
	var alertMsg11 = '<egui:intnl text="admin.server.Only valid integers are allowed"/>.';
	var alertMsg12 = '<egui:intnl text="admin.common.Invalid port number"/>.';
	var alertMsg13 = '<egui:intnl text="admin.server.Spaces not allowed for port numbers"/>.';
	var alertMsg14 = '<egui:intnl text="admin.server.User field cannot have a null value"/>.';
	var alertMsg15 = '<egui:intnl text="admin.server.Password field cannot have a null value"/>.';
	var alertMsg16 = "<egui:intnl text='admin.test.Password data should not contain pipe and double quotes'/>.";
	var alertMsg17 = '<egui:intnl text="admin.server.Please do not leave blank space in the user field"/>.';
	var alertMsg18 = '<egui:intnl text="admin.server.Please enter the IP address of the host"/>.';
	var alertMsg19 = '<egui:intnl text="admin.server.Please enter the IP address/host name"/>.';
	var alertMsg20 = '<egui:intnl text="admin.server.Your host/nick name cannot be the same as one of the internal representation types used by eG Enterprise"/>.';
	var alertMsg21 = '<egui:intnl text="admin.server.Please choose another host/nick name"/>.';
	var alertMsg22 = '<egui:intnl text="admin.server.Please enter the nick name"/>.';
	var alertMsg23 = '<egui:intnl text="admin.server.Atleast one Esx Server Host must be selected"/>.';
	var alertMsg24 = '<egui:intnl text="admin.server.Atleast one cloud Server must be selected"/>.';
	var alertMsg25 = '<egui:intnl text="admin.server.Please enter the same IP address if you are entering IP address for the nick name field"/>.';
	var alertMsg26 = '<egui:intnl text="admin.server.Your nick name cannot be same as the component type"/>.';
	var alertMsg27 = '<egui:intnl text="admin.server.Please enter the port number"/>.';
	var alertMsg28 = '<egui:intnl text="admin.server.Port number should be numerical or NULL"/>.';
	var alertMsg29 = '<egui:intnl text="admin.server.Please enter the SID/Service name"/>.';
	var alertMsg30 = '<egui:intnl text="admin.server.Please enter unique SIDs/service names"/>.';
	var alertMsg31 = '<egui:intnl text="admin.server.Nickname should not start or end with a"/> '+" \'.\' ";
	var alertMsg32 = '<egui:intnl text="admin.server.Please select a type of component"/>.';
	var alertMsg33 = '<egui:intnl text="admin.server.Component has not been added properly"/>.';
	var alertMsg34 = '<egui:intnl text="admin.server.Component has been added successfully"/>.';
	var alertMsg35 = '<egui:intnl text="admin.server.Component has been modified successfully"/>.';
	var alertMsg36 = '<egui:intnl text ="admin.server.You are modifying an existing component"/>. <egui:intnl text ="admin.server.Please note that data already collected for this component will no longer be available after the modification"/>.';
	var alertMsg37 = '<egui:intnl text="admin.server.Removal of SID/Service name is not allowed"/>.';
	var alertMsg38 = '<egui:intnl text="admin.server.The nickname you are trying to modify is already mapped to an external agent"/>.';
	var alertMsg39 = '<egui:intnl text="admin.server.The nickname you are trying to modify is already mapped to a remote agent"/>.';
	var alertMsg40 = '<egui:intnl text="admin.common.Please enter the file name for Key file name"/>.';
	var alertMsg41 = '<egui:intnl text="admin.server.Cannot have \'.\' in consecutive positions"/>.';
	var alertMsg42 = '<egui:intnl text="admin.server.Component has been managed successfully"/>.';
	var alertMsg43 = '<egui:intnl text="admin.server.Would you like to add more components for the same system"/>?';
	var alertMsg44 = '<egui:intnl text="admin.server.Invalid URL"/>';
	var alertMsg45 = '<egui:intnl text="admin.server.Please select atleast one language"/>';
	var alertMsg46 = '<egui:intnl text="admin.server.Internal agent assignment option cannot be set to manual for this component, as this nickname is already mapped to an external/remote agent"/>';
	var alertMsg47 = '<egui:intnl text="admin.server.The nickname you are trying to add is already mapped to a remote agent"/>';
	var alertMsg48 = '<egui:intnl text="admin.server.The nickname you are trying to modify is already mapped to a remote agent"/>';
	var alertMsg49 = '<egui:intnl text="admin.server.Hence you cannot choose agentless option for this component"/>';
	var alertMsg50 = '<egui:intnl text="admin.common.Please enter a component name"/>';
	var alertMsg51 = '<egui:intnl text="admin.server.In addition, which of the following components would you like to add for the nickname"/>';
	var alertMsg52 = '<egui:intnl text="admin.server.In addition, which of the following components would you like to modify for the nickname"/>';
	var alertMsg55 = '<egui:intnl text="admin.server.In addition, "/>';
	var alertMsg56 = '<egui:intnl text="admin.server.Internal agent and nick name should not be same"/>';
	var alertMsg57 = '<egui:intnl text="admin.server.Please choose another internal agent or specify a different nick name"/>';
	var alertMsg59 = '<egui:intnl text="admin.server.You are trying to modify the nick name of the component"/>';
	var alertMsg60 = '<egui:intnl text="admin.server.Please ensure this modified nick name is assigned to the respective agent"/>';
	var alertMsg61 = '<egui:intnl text="admin.server.Remote agent must be selected"/>.';
	var alertMsg62 = '<egui:intnl text="admin.server.Please enter the RUM UserName Selector Path"/>.';
	var alertMsg63 = '<egui:intnl text="admin.server.Please choose the RUM Expression Type"/>.';
	var alertMsg64 = '<egui:intnl text="admin.server.Please enter the RUM Extraction Rule"/>.';
	var alertMsg65 = '<egui:intnl text="admin.server.Please enter the RUM Selector Index"/>.';
	var alertMsg66 = '<egui:intnl text="admin.server.RUM Selector Index should be numeric and greater than zero"/>.';
	var alertMsg67 = '<egui:intnl text="admin.server.RUM collector must be selected"/>.';
	var alertMsg69 = '<egui:intnl text="admin.server.Please enter the URL Exclude pattern"/>.';
	var alertMsg70 = '<egui:intnl text="admin.server.Please enter the URL Include Pattern"/>.';
	var alertMsg71 = '<egui:intnl text="admin.server.Please enter the URL Exclude Pattern For AJAX"/>.';
	var label_vMwareHorizonPod = '<egui:intnl text="admin.server.The agent required to monitor VMware Horizon Pod should have powershell CLI installed with it"/>.';
	var label_Category = '<egui:intnl text="admin.server.Category"/>';
	var label_CompTyep = '<egui:intnl text="admin.server.Component type"/>';
	var label_HostIP = '<egui:intnl text="admin.server.Host IP/Name"/>';
	var ipMsg = '<egui:intnl text="admin.server.Specify the IP address or the fully qualified host name of the target"/>';
	if (isMspModel != null && isMspModel == 'true')
	{
		label_HostIP = '<egui:intnl text="admin.discovery.Host name"/>';
		ipMsg = '<egui:intnl text="admin.server.Specify the DNS resolvable fully qualified host name of the target"/>';
	}
	var label_Monitoring = '<egui:intnl text="admin.server.Monitoring"/>';
	var label_Component = '<egui:intnl text="admin.server.Nick name"/>';
	var label_HostCheck1 = '<egui:intnl text="admin.server.Do you wish to rename all the components that have the old nick name"/>?';
	var label_HostCheck2 = '<egui:intnl text="admin.server.Do you wish to add the new nick name for this component and apply for all components"/>?';
	var label_Add = '<egui:intnl text="admin.common.Add"/>';
	var label_Update = '<egui:intnl text="admin.common.Update"/>';
	var label_Back = '<egui:intnl text="admin.common.Back"/>';
	var label_port = '<egui:intnl text="admin.server.Port number"/>';
	var label_sid = '<egui:intnl text="admin.server.SID/Service name"/>';
	var label_isPass = '<egui:intnl text="admin.server.Is passive"/>';
	var label_mts =  '<egui:intnl text="admin.server.MTS enabled"/>';
	var label_ExtAgents = '<egui:intnl text="admin.server.External agents"/>';
	var label_Agentless = '<egui:intnl text="admin.server.Agentless"/>';
	var label_IntAgentAssign = '<egui:intnl text="admin.server.Internal agent assignment"/>';
	var label_rum_username = '<egui:intnl text="admin.server.Capture UserName"/>';
	var label_rumExpType = '<egui:intnl text="admin.server.Expression Type"/>';
	var label_rumSelectorPathindex = '<egui:intnl text="admin.server.Selector Field Index"/>';
	var label_rumSelectorPath = '<egui:intnl text="admin.server.Selector Name"/>';
	var label_rumCssSelectorPath = '<egui:intnl text="admin.server.CSS Selector Name"/>';
	var label_rumCssSelectorPathindex = '<egui:intnl text="admin.server.CSS Selector Index"/>';
	var label_rumDomSelectorPath = '<egui:intnl text="admin.server.DOM Locator Name"/>';
	var label_rumDomSelectorPathindex = '<egui:intnl text="admin.server.DOM Locator Index"/>';
	var label_rumXpathSelectorPath = '<egui:intnl text="admin.server.XPath Locator Name"/>';
	var label_rumXpathSelectorPathindex = '<egui:intnl text="admin.server.XPath Locator Index"/>';
	var label_rumApplyCleanUp = '<egui:intnl text="admin.server.Apply Cleanup Rule"/>';
	var label_rumExtractionRule = '<egui:intnl text="admin.server.Extraction Rule"/>';
	var label_OS = '<egui:intnl text="admin.server.OS"/>';
	var label_Mode = '<egui:intnl text="admin.server.Mode"/>';
	var label_RemPort = '<egui:intnl text="admin.server.Remote port"/>';
	var label_RemUser = '<egui:intnl text="admin.server.User"/>';
	var label_RemPwd = '<egui:intnl text="admin.server.Password"/>';
	var label_RemAgent = '<egui:intnl text="admin.server.Remote agent"/>';
	var label_IntAgent = '<egui:intnl text="admin.server.Internal agent"/>';
	var label_VirEnv = '<egui:intnl text="admin.server.Virtual environment"/>';
	var label_VirServs = '<egui:intnl text="admin.server.Virtual servers"/>';
	var label_CloudEnv = '<egui:intnl text="admin.server.Cloud environment"/>';
	var label_CloudServ = '<egui:intnl text="admin.server.Cloud servers"/>';
	var label_Cancel = '<egui:intnl text="admin.common.Cancel"/>';
	var label_compInfo = '<egui:intnl text="admin.server.Component information"/>';
	var label_monAppro = '<egui:intnl text="admin.server.Monitoring approach"/>';
	var label_extInfo = '<egui:intnl text="admin.server.Additional information"/>';
	var label_languages= '<egui:intnl text="admin.server.Languages"/>';
	var label_java= '<egui:intnl text="admin.server.Java"/>';
	var label_dotnet= '<egui:intnl text="admin.server.DotNet"/>';
	var label_others= '<egui:intnl text="admin.server.Others (JavaScript)"/>';
	var label_otherslib= '<egui:intnl text="admin.server.RUM Library for JavaScript"/>';
	var label_RumURL = '<egui:intnl text="admin.server.RUM collector"/>';
	var label_RumAlternateURL = '<egui:intnl text="admin.server.RUM collector private URL"/>';
	var label_RumDownload2 = '<egui:intnl text="admin.server.Include this line in your pages (html/jsp/aspx) immediately after the head tag"/>';
	var label_RumDownload3 = '<egui:intnl text="admin.server.Include this line in your js files"/>';
	var label_NodeDownload = '<egui:intnl text="admin.server.nodejs.step2"/><br><br>'+'<egui:intnl text="admin.server.nodejs.step3"/>.<br><br>'+'<egui:intnl text="admin.server.nodejs.step4"/><br><br>'+'<egui:intnl text="admin.server.nodejs.step5"/>.<br><br>';
	
	var label_RumDownload3_Andriod = '<egui:intnl text="admin.server.Include this line into the applications Main or default activity to inject eG Android agent  into your mobile apps"/>';
	var label_RumDownload3_IOS = '<egui:intnl text="admin.server.Include this line in your AppDelegate file"/>';
	var label_RumDownload4_IOS = '<egui:intnl text="admin.server.Download eGAPM IOS SDK and unzip the folder"/>';

	var updating = '<egui:intnl text="admin.common.Updating"/>';
	var plsWait = '<egui:intnl text="admin.common.Please wait"/>';
	var backHref = '<%=backHref%>';
	var label_EncType = '<egui:intnl text="admin.snmp.Authentication type"/>';
	var label_keyFile = '<egui:intnl text="admin.server.Key file name"/>';
	var label_Node_DownloadPanel = '<egui:intnl text="admin.server.nodejs.title"/>';
	var label_DownloadPanel = '<egui:intnl text="admin.server.To instrument your html pages use the eG javascript agent"/>';
	var label_PDFPanel = '<egui:intnl text="admin.server.To instrument your mobile application use the eG agent"/>';
	var label_PDFPanel_andriod = '<egui:intnl text="admin.server.To instrument your android apps use the eG Android agent"/>';
	var label_download_andriod = '<egui:intnl text="admin.server.Download the PDF and follow the steps to inject eG Android agent into your mobile apps "/>';
	var compNick = '<%=compNick%>';
	var compIp = '<%=compIp%>';
	var proceedBtn = '<egui:intnl text="admin.server.Proceed"/>';
	
	var probsErrorMessage = '<egui:intnl text="admin.error.Problem encountered while loading the user interface"/>.';
	var requestTimeOut = '<egui:intnl text="admin.error.Response timed out"/>.';
	var errorTitle = '<egui:intnl text="admin.user.Error"/>';

	var nickShareMsg1 = '<egui:intnl text = "admin.server.This nickname is already mapped to an organization"/>';
	var nickShareMsg2 = '<egui:intnl text = "admin.server.Associating a new component to this nick will automatically associate the new component to the organization too"/>';
	var nickShareMsg3 = '<egui:intnl text = "admin.server.Do you want to proceed further?"/>';

	// wizard design starts...
	var fromWizard = '<%=fromWizard%>';
	var initiate = '<%=initiate%>';
	var wizCType = '<%=wizCType%>';

	var pageTitle = '<egui:intnl text="admin.server.Component"/>';
	var pageDesc3 = '<egui:intnl description="EgNewServer.jsp"/>';
	if (currentAction != null && currentAction == 'add')
	{
		pageTitle = '<egui:intnl text="admin.server.Add Component"/>';
		pageDesc3 = '<egui:intnl description="EgNewServer.jsp"/>';
	}
	else if (currentAction != null && currentAction == 'modify')
	{
		pageTitle = '<egui:intnl text="admin.server.Modify Component"/>';
		pageDesc3 = '<egui:intnl description="EgNewServer.jsp Modify"/>';
	}

	var homeTitle = '<div>'+pageTitle+' <img src="/final/images/spacer.gif" id="homeTitle" class="iconInfoCircle" style="vertical-align:text-top;position:relative;top:2px"/></div>';
	//var modifyTitle = '<div>'+modifyPolicyLbl+' <img src="/final/images/spacer.gif" id="homeTitle" class="iconInfoCircle" style="vertical-align:text-top;position:relative;top:2px"/></div>';
	//var addPolicyTitle = '<div>'+addPolicyLbl+' <img src="/final/images/spacer.gif" id="homeTitle" class="iconInfoCircle" style="vertical-align:text-top;position:relative;top:2px"/></div>';


	// wizard design ends..

	Ext.onReady(function(){
		Ext.Ajax.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.Connection.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};
		Ext.data.ScriptTagProxy.prototype.extraParams = {"com.eg.CSRF_NONCE" : csrfToken};

		Ext.Ajax.on('requestexception', function (conn, response, options) {
			var errorStr = response.responseText;
			if (errorStr != undefined && errorStr != 'undefined' && errorStr.indexOf("customerror") != -1)
			{
				if (errorStr.indexOf("user-session-invalid") != -1)
				{
					callWindow(1);
				}
				else if (errorStr.indexOf("user-deleted") != -1)
				{
					callWindow(2);
				}
				else if (errorStr.indexOf("user-timedout") != -1)
				{
					callWindow(3);
				}
			}
			else
			{
				if (response.status == 302 || (response.timedout != undefined && response.timedout == true))
				{
					Ext.Msg.show({
						title : errorTitle,
						msg : requestTimeOut,
						buttons : Ext.Msg.OK,
						icon : Ext.MessageBox.ERROR
					});
				}
				else
				{
					console.log(response.responseText);
					Ext.Msg.show({
						title : errorTitle,
						msg : probsErrorMessage,
						buttons : Ext.Msg.OK,
						icon : Ext.MessageBox.ERROR
					});
				}
			}
		});
	});
	</script>
</head>
<BODY>
	<div id="loadmask" 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 (com.egurkha.util.StringUtils.isNull(fromWizard))
	{
		if(request.getQueryString()!=null)
		{
			session.setAttribute("adminLastAccessedURL","/final/admin/EgNewServer.jsp?"+request.getQueryString()+"&showtree=discoverytree");
		}
		else
		{
			session.setAttribute("adminLastAccessedURL","/final/admin/EgNewServer.jsp?showtree=discoverytree");
		}
	}
%>



