
<%@ page import="com.egurkha.*" %>
<%@ page import="com.egurkha.ini.*" %>
<%@ page import="java.util.*" %>
<%@ page import = "com.eg.IniFile"%>
<%@ page import = "com.eg.EgInstallInfo" %>
<%@ page import = "com.eg.EgMappingInfo"%>
<%@ taglib prefix = "egui" uri = "../WEB-INF/eg-taglib.tld"%>
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%
	response.setHeader("Cache-Control", "no-store");
	response.setHeader("Pragma", "no-cache");
	response.setDateHeader("Expires", -1); 
%>
<script>

function getURLSplit(temp_url)
{
	var params = new Array();
	try
	{
		var param_array = temp_url.split('?')[1].split('&');
		var count=0;
		for(var i in param_array)
		{
			x = param_array[i].split('=');
			params[count++] = x[1];
		}
	}
	catch (e)
	{
		return null;
	}
	return params;
}

function logout_call()
{
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (xmlhttp!=null)
	{
		var temp_url=window.location.href;
		var isPass=false;
		if(temp_url!=null && temp_url.indexOf("&pass=") > -1)
		{
			isPass=true;
		}

		var temp_param=null;

		var userNameObj=document.getElementById("user_name");
		try
		{
			var user_name_value=userNameObj.value;
			if(user_name_value!=null && user_name_value!=undefined && user_name_value!="")
			{
				var params = "userName="+decodeURI(user_name_value)+"&isLocal=true";
				var url = "/final/servlet/com.egurkha.Logout";
				xmlhttp.onreadystatechange = function() {
					if (this.readyState == 4 && this.status == 200)
						login_call();
				};
				xmlhttp.open('POST',url,true);
				xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
				xmlhttp.setRequestHeader('Content-length',params.length);
				xmlhttp.setRequestHeader('Connection','close');
				xmlhttp.send(params);
			}
			else
			{
				window.location.href="/final/servlet/com.egurkha.Logout";
			}
		}
		catch (e)
		{
		}
	}
}
function call()
{
	logout_call();
}

function login_call()
{
	xmlhttp=null;

	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (xmlhttp!=null)
	{
		var temp_url=window.location.href;
		var isPass=false;
		if(temp_url!=null && temp_url.indexOf("&pass=") > -1)
		{
			isPass=true;
		}

		var temp_param=null;

		var userNameObj=document.getElementById("user_name");
		var passwordObj=document.getElementById("password");
		var accessPageObj=document.getElementById("access_page");
		var accessNameObj=document.getElementById("access_name");
		var loginTypeObj=document.getElementById("loginType");
		var layerObj=document.getElementById("layer");
		var testObj=document.getElementById("test");
		var descriptorObj=document.getElementById("descriptor");
		var analysisByObj=document.getElementById("analysisBy");
		var analysisObj=document.getElementById("analysis");
		var compstateObj=document.getElementById("compstate");
		var startTimeUrlObj=document.getElementById("startTimeUrl");
		var endTimeUrlObj=document.getElementById("endTimeUrl");
		var toReporterPageObj=document.getElementById("toReporterPage");
		var alertTestObj=document.getElementById("alertTest");
		var compTypeListObj=document.getElementById("compTypeList");
		var fromConnectwiseObj=document.getElementById("fromConnectwise");
		var tstate=document.getElementById("tstate");
		var toDashBoardLayer=document.getElementById("toDashBoardLayer");
		var fromScom = document.getElementById("fromScom");
		var fromScomURL = document.getElementById("fromScomURL");
		var fromScomInterval = document.getElementById("fromScomInterval");

		var isScomPresent=false;
		if(temp_url!=null && temp_url.indexOf("&from=") > -1 && fromScomURL!=null && fromScomURL!=undefined && fromScomURL.value =='true')
		{
			isScomPresent=true;
		}
		
		if((!isPass) && loginTypeObj!=null && (loginTypeObj.value=='sdssso' || loginTypeObj.value=='SDSSSO'))
		{
			try
			{
				var user_name_value=userNameObj.value;
				var access_page_value=accessPageObj.value;
				var access_name_value=accessNameObj.value;
				var login_type_value=loginTypeObj.value;

				temp_url = temp_url.substring(0,temp_url.indexOf("?"));
				temp_url = temp_url+"?user="+user_name_value+"&access="+access_page_value+"&name="+access_name_value+"&loginType="+login_type_value;

				if(layerObj!=null && layerObj!=undefined && layerObj.value!='')
				{
					temp_url=temp_url+"&layer="+layerObj.value;
				}
				if(testObj!=null && testObj!=undefined && testObj.value!='')
				{
					temp_url=temp_url+"&test="+testObj.value;
				}
				if(descriptorObj!=null && descriptorObj!=undefined && descriptorObj.value!='')
				{
					temp_url=temp_url+"&descriptor="+descriptorObj.value;
				}
				if(fromConnectwiseObj!=null && fromConnectwiseObj!=undefined && fromConnectwiseObj.value!='')
				{
					temp_url=temp_url+"&from="+fromConnectwiseObj.value;
				}
				if(tstate!=null && tstate!=undefined && tstate.value!='')
				{
					temp_url=temp_url+"&tstate="+tstate.value;
				}
				if(toDashBoardLayer!=null && toDashBoardLayer!=undefined && toDashBoardLayer.value!='')
				{
					temp_url=temp_url+"&toDashBoardLayer="+toDashBoardLayer.value;
				}
				temp_param = getURLSplit(temp_url);
			}
			catch (e)
			{
				temp_param = null;
			}
		}
		else if(temp_url!=null && temp_url!=undefined && temp_url!="")
		{
			try
			{
				temp_param = getURLSplit(temp_url);
			}
			catch(e)
			{
				temp_param = null;
			}
		}

		if(isPass)
		{
			if(userNameObj!=null && userNameObj!=undefined && passwordObj!=null && passwordObj!=undefined && accessPageObj!=null && accessPageObj!=undefined && accessNameObj!=null && accessNameObj!=undefined)
			{
				if(layerObj!=undefined && layerObj.value!='' && testObj!=undefined && testObj.value!='' && descriptorObj!=undefined && descriptorObj.value!='' && fromConnectwiseObj!=undefined && fromConnectwiseObj.value!='')
				{
					if(temp_param!=null && temp_param.length==9)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value=temp_param[1];
						accessPageObj.value=temp_param[2];
						accessNameObj.value=temp_param[3];
						loginTypeObj.value=temp_param[4];
						layerObj.value=temp_param[5];
						testObj.value=temp_param[6];
						descriptorObj.value=temp_param[7];
						fromConnectwiseObj.value=temp_param[8];
						tstate.value=temp_param[9];
						toDashBoardLayer.value=temp_param[10];
					}
					else if(temp_param!=null && temp_param.length==8)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value=temp_param[1];
						accessPageObj.value=temp_param[2];
						accessNameObj.value=temp_param[3];
						loginTypeObj.value=temp_param[4];
						layerObj.value=temp_param[5];
						testObj.value=temp_param[6];
						descriptorObj.value=temp_param[7];
						tstate.value=temp_param[8];
						toDashBoardLayer.value=temp_param[9];
					}
					else if(temp_param!=null && temp_param.length==7)
					{
						if(temp_url.indexOf("&loginType=")>-1)
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value=temp_param[1];
							accessPageObj.value=temp_param[2];
							accessNameObj.value=temp_param[3];
							loginTypeObj.value=temp_param[4];
							layerObj.value=temp_param[5];
							testObj.value=temp_param[6];
						}
						else
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value=temp_param[1];
							accessPageObj.value=temp_param[2];
							accessNameObj.value=temp_param[3];
							layerObj.value=temp_param[4];
							testObj.value=temp_param[5];
							descriptorObj.value=temp_param[6];
						}
					}
					if(temp_param!=null && temp_param.length==6)
					{
						if(temp_url.indexOf("&loginType=")>-1)
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value=temp_param[1];
							accessPageObj.value=temp_param[2];
							accessNameObj.value=temp_param[3];
							loginTypeObj.value=temp_param[4];
							layerObj.value=temp_param[5];
						}
						else
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value=temp_param[1];
							accessPageObj.value=temp_param[2];
							accessNameObj.value=temp_param[3];
							layerObj.value=temp_param[4];
							testObj.value=temp_param[5];
						}
					}
					
					if(temp_param!=null && temp_param.length==5)
					{
						if(temp_url.indexOf("&loginType=")>-1)
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value=temp_param[1];
							accessPageObj.value=temp_param[2];
							accessNameObj.value=temp_param[3];
							loginTypeObj.value=temp_param[4];
						}
						else
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value=temp_param[1];
							accessPageObj.value=temp_param[2];
							accessNameObj.value=temp_param[3];
							layerObj.value=temp_param[4];
						}
					}
				}
				else
				{
					 if(temp_param!=null && temp_param.length==4)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value=temp_param[1];
						accessPageObj.value=temp_param[2];
						accessNameObj.value=temp_param[3];
					}
					else if(temp_param!=null && temp_param.length==3)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value=temp_param[1];
						accessPageObj.value=temp_param[2];
					}
					else if(temp_param!=null && temp_param.length==2)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value=temp_param[1];
					}
				}

				var user_name_value=userNameObj.value;
				var password_value=passwordObj.value;
				var access_page_value=accessPageObj.value;
				var access_name_value=accessNameObj.value;
				var login_type_value=loginTypeObj.value;
				var layer_value=layerObj.value;
				var test_value=testObj.value;
				var descriptor_value=descriptorObj.value;
				var analysisBy_value=analysisByObj.value;
				var analysis_value=analysisObj.value;
				var compstate_value=compstateObj.value;
				var startTimeUrl_value=startTimeUrlObj.value;
				var endTimeUrl_value=endTimeUrlObj.value;
				var toReporterPage_value=toReporterPageObj.value;
				var alertTest_value=alertTestObj.value;
				var compTypeList_value=compTypeListObj.value;
				var connectwise_value=fromConnectwiseObj.value;
				var tstate_value=tstate.value;
				var toDashBoardLayer_value=toDashBoardLayer.value;
				if(user_name_value!=null && user_name_value!=undefined && user_name_value!="")
				{
					if((access_page_value == 'null' || access_page_value == null))
					{
						access_page_value = 'validate';
					}

					var params = "uname="+decodeURI(user_name_value)+"&upass="+decodeURI(password_value)+"&access="+access_page_value+"&name="+decodeURI(access_name_value)+"&fromPage=quicklaunch&loginType="+decodeURI(login_type_value)+"&layer="+decodeURI(layer_value)+"&test="+decodeURI(test_value)+"&descriptor="+decodeURI(descriptor_value)+"&toReporterPage="+toReporterPage_value+"&from="+decodeURI(connectwise_value);
					if(tstate!=null && tstate!=undefined && tstate.value!='')
					{
						params=params+"&tstate="+tstate_value;
					}
					if(toDashBoardLayer_value!=null && toDashBoardLayer_value!=undefined && toDashBoardLayer_value.value!='')
					{
						params=params+"&toDashBoardLayer_value="+toDashBoardLayer_value;
					}
					if(fromScom.value != null && fromScom.value !=undefined && fromScom.value!='' && fromScom.value!='null')
					{
						params=params+"&fromScomCheck="+fromScom.value;
						if(fromScomInterval.value != null && fromScomInterval.value !=undefined && fromScomInterval.value!='')
							params=params+"&fromScomInterval="+fromScomInterval.value;
					}

					if(analysisBy_value != null && analysis_value != null)
					{
						params+="&analysisBy="+decodeURI(analysisBy_value)+"&analysis="+decodeURI(analysis_value)+"&compstate="+decodeURI(compstate_value)+"&startTimeUrl="+decodeURI(startTimeUrl_value)+"&endTimeUrl="+decodeURI(endTimeUrl_value);
					}
					if(alertTest_value != '' && alertTest_value != null && alertTest_value != undefined && alertTest_value != 'null')
						params += "&alertTest="+alertTest_value;
					if(compTypeList_value != '' && compTypeList_value != null && compTypeList_value != undefined && compTypeList_value != 'null')
						params += "&compTypeList="+compTypeList_value;
					var url = "/final/servlet/com.egurkha.LoginServlet";
					xmlhttp.onreadystatechange=validateStateChange;
					xmlhttp.open('POST',url,true);
					xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
					xmlhttp.setRequestHeader('Content-length',params.length);
					xmlhttp.setRequestHeader('Connection','close');
					xmlhttp.send(params);
				}
				else
				{
					if(isScomPresent)
						window.location.href="/final/servlet/com.egurkha.Logout";
					else
						alert("User name invalid.");
				}
			}
			else
			{
				if(isScomPresent)
					window.location.href="/final/servlet/com.egurkha.Logout";
				else
					alert("User name or Password invalid.");
			}
		}
		else if(isScomPresent && (!isPass))
		{
			window.location.href="/final/servlet/com.egurkha.Logout";
		}
		else if((!isPass))
		{
			window.location.href="/final/servlet/com.egurkha.Logout";
		}
		else
		{
			if(userNameObj!=null && userNameObj!=undefined && passwordObj!=null && passwordObj!=undefined && accessPageObj!=null && accessPageObj!=undefined && accessNameObj!=null && accessNameObj!=undefined)
			{
				if(layerObj!=undefined && layerObj.value!='' && testObj!=undefined && testObj.value!='' && descriptorObj!=undefined && descriptorObj.value!='')
				{
					if(temp_param!=null && temp_param.length==7)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value="";
						accessPageObj.value=temp_param[1];
						accessNameObj.value=temp_param[2];
						loginTypeObj.value=temp_param[3];
						layerObj.value=temp_param[4];
						testObj.value=temp_param[5];
						descriptorObj.value=temp_param[6];
					}
					else if(temp_param!=null && temp_param.length==6)
					{
						if(temp_url.indexOf("&loginType=")>-1)
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value="";
							accessPageObj.value=temp_param[1];
							accessNameObj.value=temp_param[2];
							loginTypeObj.value=temp_param[3];
							layerObj.value=temp_param[4];
							testObj.value=temp_param[5];
						}
						else
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value="";
							accessPageObj.value=temp_param[1];
							accessNameObj.value=temp_param[2];
							layerObj.value=temp_param[3];
							testObj.value=temp_param[4];
							descriptorObj.value=temp_param[5];
						}
					}
					if(temp_param!=null && temp_param.length==5)
					{
						if(temp_url.indexOf("&loginType=")>-1)
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value="";
							accessPageObj.value=temp_param[1];
							accessNameObj.value=temp_param[2];
							loginTypeObj.value=temp_param[3];
							layerObj.value=temp_param[4];
						}
						else
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value="";
							accessPageObj.value=temp_param[1];
							accessNameObj.value=temp_param[2];
							layerObj.value=temp_param[3];
							testObj.value=temp_param[4];
						}
					}
					
					if(temp_param!=null && temp_param.length==4)
					{
						if(temp_url.indexOf("&loginType=")>-1)
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value="";
							accessPageObj.value=temp_param[1];
							accessNameObj.value=temp_param[2];
							loginTypeObj.value=temp_param[3];
						}
						else
						{
							userNameObj.value=temp_param[0].replace("\\",'/');
							passwordObj.value="";
							accessPageObj.value=temp_param[1];
							accessNameObj.value=temp_param[2];
							layerObj.value=temp_param[3];
						}
					}
				}
				else
				{
					if(temp_param!=null && temp_param.length==3)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value="";
						accessPageObj.value=temp_param[1];
						accessNameObj.value=temp_param[2];
					}
					else if(temp_param!=null && temp_param.length==2)
					{
						userNameObj.value=temp_param[0].replace("\\",'/');
						passwordObj.value="";
						accessPageObj.value=temp_param[1];
					}
				}

				var user_name_value=userNameObj.value;
				var password_value=passwordObj.value;
				var access_page_value=accessPageObj.value;
				var access_name_value=accessNameObj.value;
				var login_type_value=loginTypeObj.value;
				var layer_value=layerObj.value;
				var test_value=testObj.value;
				var descriptor_value=descriptorObj.value;
				var analysisBy_value=analysisByObj.value;
				var analysis_value=analysisObj.value;
				var compstate_value=compstateObj.value;
				var startTimeUrl_value=startTimeUrlObj.value;
				var endTimeUrl_value=endTimeUrlObj.value;
				var toReporterPage_value=toReporterPageObj.value;
				var alertTest_value=alertTestObj.value;
				var compTypeList_value=compTypeListObj.value;
				if(user_name_value!=null && user_name_value!=undefined && user_name_value!="")
				{
					var params = "uname="+decodeURI(user_name_value)+"&upass="+decodeURI(password_value)+"&access="+decodeURI(access_page_value)+"&name="+decodeURI(access_name_value)+"&fromPage=quicklaunch&loginType="+decodeURI(login_type_value)+"&layer="+decodeURI(layer_value)+"&test="+decodeURI(test_value)+"&descriptor="+decodeURI(descriptor_value)+"&toReporterPage="+toReporterPage_value;
					if(analysisBy_value != null && analysis_value != null)
					{
						params+="&analysisBy="+decodeURI(analysisBy_value)+"&analysis="+decodeURI(analysis_value)+"&compstate="+decodeURI(compstate_value)+"&startTimeUrl="+decodeURI(startTimeUrl_value)+"&endTimeUrl="+decodeURI(endTimeUrl_value);
					}
					if(alertTest_value != '' && alertTest_value != null && alertTest_value != undefined && alertTest_value != 'null')
						params += "&alertTest="+alertTest_value;
					if(compTypeList_value != '' && compTypeList_value != null && compTypeList_value != undefined && compTypeList_value != 'null')
						params += "&compTypeList="+compTypeList_value;
					var url = "/final/servlet/com.egurkha.LoginServlet";
					xmlhttp.onreadystatechange=validateStateChange;
					xmlhttp.open('POST',url,true);
					xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
					xmlhttp.setRequestHeader('Content-length',params.length);
					xmlhttp.setRequestHeader('Connection','close');
					xmlhttp.send(params);
				}
				else
				{
					if(isScomPresent)
						window.location.href="/final/servlet/com.egurkha.Logout";
					else
						alert("User name invalid.");
				}
			}
			else
			{
				if(isScomPresent)
					window.location.href="/final/servlet/com.egurkha.Logout";
				else
					alert("User name or Password invalid.");
			}
		}
	}
	else
	{
		alert('<egui:intnl text="admin.login.Your browser does not support XMLHTTP"/>');
	}
}
function validateStateChange()
{
	var mydiv = document.getElementById("loginStatusDIV");
	var thisForm = document.indexForm;
	if (xmlhttp.readyState==4)
	{
		if (xmlhttp.status==200)
		{
			var v = xmlhttp.responseText;

			var myarr = v.split(":");
			
			if(myarr[0]=="Error")
			{
				if (mydiv!=null && mydiv!="Undefined")
				{
					//mydiv.style.visibility="visible";
					//mydiv.style.display="block";
					//var errorText = "<table border='0' align='center' width='100%' height='100%' cellspacing='0' cellpadding='0'><tr><td align='center'><img src='/final/admin/eg_images/fault.gif' width='25' height='25'><br>"+myarr[1]+"</td></tr></table>";
					//document.title = "<egui:intnl text='admin.login.Login Error'/>";
					//mydiv.innerHTML=errorText;
					window.location.href="/final/servlet/com.egurkha.Logout";
				}
			}
			else
			{
				window.location.href ="/final"+v;
				//var url="/final"+v;
				//openWin(url);
			}
		}
		else
		{
			//var errormsg='<center><br><egui:intnl text="admin.login.Sorry! Problem occured while logging in"/>.</center>';
			//mydiv.innerHTML=errormsg;
			window.location.href="/final/servlet/com.egurkha.Logout";
		}
	}
}

function openWin(url)
{
	var ver = navigator.appVersion;
	ver = ver.toLowerCase();
	if (ver.indexOf("chrome/") > 0 )
	{
		var w=800 
		var h=600 
		if (window.screen)
		{
			w = window.screen.availWidth;
			h = window.screen.availHeight;
		}
		loginwin = window.open(url,"eG_" + (new Date()).getTime(),"toolbar=no,menubar=no,location=no,status=no,statusbar=no,self,left=0,top=0,resizable=yes,screenX=0,screenY=0,width="+w+",height="+(h-65));
	}
	else
	{
		loginwin = window.open(url,"eG_" + (new Date()).getTime(),"toolbar=no,menubar=no,location=no,status=no,statusbar=no,self,width=1012,height=709,left=0,top=0,resizable=yes,screenX=0,screenY=0");
	}
	if(loginwin!=null)
	{
		loginwin.focus();
		if (top.window.outerHeight<=screen.availHeight || top.window.outerWidth<=screen.availWidth)
		{
			loginwin.outerHeight = screen.availHeight;
			loginwin.outerWidth = screen.availWidth;
		}
	}
	else
	{
		alert("Cannot open the login window. Your browser might have denied opening a popup window.");
	}
}

function closeWin()
{
	if(loginwin && !loginwin.closed)
		loginwin.close();
}

function logoutQucikLaunch()
{
	window.location.href="/final/servlet/com.egurkha.Logout";
}

</script>
<%
	com.egurkha.ini.IniUI ui = (com.egurkha.ini.IniUI)com.egurkha.ini.IniUI.getInstance();
	String thisLanguage = ui.getDefaultLanguage();
	
	EgMappingInfo mappingInfo = new EgMappingInfo(thisLanguage);
	IniFile servicesINI =  new IniFile(EgInstallInfo.getInstallDir() + "/manager/config/eg_services.ini");
	String user_name=request.getParameter("user");
	user_name=(user_name==null || user_name.trim().length()==0)?"":user_name;
	String fromScom = request.getParameter("from");
	String password=request.getParameter("pass");
	String analysisBy=request.getParameter("analysisBy");
	String toReporterPage=request.getParameter("toReporterPage");
	if(toReporterPage != null && toReporterPage.equalsIgnoreCase("true") )
	  analysisBy = (analysisBy != null && analysisBy.equalsIgnoreCase("Components"))?"Component":analysisBy;
	String analysis=request.getParameter("analysis");
	String compstate=request.getParameter("compstate");
	String startTimeUrl=request.getParameter("startTimeUrl");
	String endTimeUrl=request.getParameter("endTimeUrl");	
	String alertTest=request.getParameter("alertTest");
	String compTypeList=request.getParameter("compTypeList");

	password=(password==null || password.trim().length()==0)?"":password;
	String access_page=request.getParameter("access");
	String fromConnectwise=request.getParameter("fromConnectwise");
	String tstate=request.getParameter("tstate");
	String toDashBoardLayer=request.getParameter("toDashBoardLayer");
	String access_name=request.getParameter("name");
	access_name=(access_name==null || access_name.trim().length()==0)?"":access_name;
	String login_type=request.getParameter("loginType");
	String layer=request.getParameter("layer");
	String test=request.getParameter("test");
	String descriptor=request.getParameter("descriptor");
	login_type=(login_type==null || login_type.trim().length()==0)?"sdssso":login_type;
	layer=(layer==null || layer.trim().length()==0)?"":layer;
	test=(test==null || test.trim().length()==0)?"":test;
	descriptor=(descriptor==null || descriptor.trim().length()==0)?"":descriptor;
	
	String fromScomURL = "false";
	if(fromScom != null && fromScom.trim().length()>0)
	{
		String scomString = com.eg.EgCrypt.decrypt(fromScom);
		if(scomString != null && fromScom.trim().length()>0 && scomString.startsWith("SCOM~$$~"))
			fromScomURL = "true";	
	}

	String quick_launch = servicesINI.getValue("QUICK_LAUNCH","quick_launch");
	String fromScomInterval = servicesINI.getValue("QUICK_LAUNCH","SCOM_Interval");
	if(quick_launch!=null && (quick_launch.trim().equalsIgnoreCase("true") || quick_launch.trim().equalsIgnoreCase("yes")))
	{
%>
<head>
	<title>

<%
	
			if(access_page!=null && access_page.trim().length()>0)
			{
				if(access_page.equalsIgnoreCase("segmentList"))
				{
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Segment List"/>
<%
				}
				else if(access_page.equalsIgnoreCase("serviceList"))
				{
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Service List"/>
<%
				}
				else if(access_page.equalsIgnoreCase("componentList"))
				{
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Component List"/>
<%
				}
				else if(access_page.equalsIgnoreCase("systemList"))
				{
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.System List"/>
<%
				}
				else if(access_page.equalsIgnoreCase("zoneList"))
				{
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Zone List"/>
<%
				}
				else if(access_page.equalsIgnoreCase("segment"))
				{
					if(access_name==null)
					{
						access_name="";
					}
					
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Segment"/> > <egui:intnl text="admin.login.Segment Name"/> : <%=access_name%>
<%
				}
				else if(access_page.equalsIgnoreCase("service"))
				{
					if(access_name==null)
					{
						access_name="";
					}
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Service"/> > <egui:intnl text="admin.login.Service Name"/> : <%=access_name%>
<%
				}
				else if(access_page.equalsIgnoreCase("zone"))
				{
					if(access_name==null)
					{
						access_name="";
					}
%>
					<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Zone"/> > <egui:intnl text="admin.login.Zone Name"/> : <%=access_name%>
<%
				}
				else if(access_page.equalsIgnoreCase("component"))
				{
					if(access_name!=null && access_name.trim().length()>0)
					{
%>
						<egui:intnl text="admin.login.eG monitor"/> - <egui:intnl text="admin.login.Component Name"/> : <%=access_name%> 
<%
					}
					if(layer!=null && layer.trim().length()>0)
					{
%>
						> <egui:intnl text="admin.login.Layer"/> : <%= mappingInfo.getLayerDescription(layer)%>
<%
					}
					if(test!=null && test.trim().length()>0)
					{
%>
						> <egui:intnl text="admin.login.Test"/> : <%=  mappingInfo.getTestDescription(test)%>
<%
					}
					if(descriptor!=null && descriptor.trim().length()>0)
					{
%>
						> <egui:intnl text="admin.login.Descriptor"/> : <%=descriptor%>
<%
					}
				}
			}
%>

	</title>
</head>
<body style="overflow-x:hidden;overflow-y:hidden" leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onload="call()">
<input type="hidden" id="user_name" name="user_name" value="<%=user_name%>"/>
<input type="hidden" id="password" name="password" value="<%=password%>"/>
<input type="hidden" id="analysisBy" name="analysisBy" value="<%=analysisBy%>"/>
<input type="hidden" id="compstate" name="compstate" value="<%=compstate%>"/>
<input type="hidden" id="analysis" name="analysis" value="<%=analysis%>"/>
<input type="hidden" id="startTimeUrl" name="startTimeUrl" value="<%=startTimeUrl%>"/>
<input type="hidden" id="endTimeUrl" name="endTimeUrl" value="<%=endTimeUrl%>"/>
<input type="hidden" id="access_page" name="access_page" value="<%=access_page%>"/>
<input type="hidden" id="access_name" name="access_name" value="<%=access_name%>"/>
<input type="hidden" id="loginType" name="loginType" value="<%=login_type%>"/>
<input type="hidden" id="layer" name="layer" value="<%=layer%>"/>
<input type="hidden" id="test" name="test" value="<%=test%>"/>
<input type="hidden" id="descriptor" name="descriptor" value="<%=descriptor%>"/>
<input type="hidden" id="toReporterPage" name="toReporterPage" value="<%=toReporterPage%>"/>
<input type="hidden" id="alertTest" name="alertTest" value="<%=alertTest%>"/>
<input type="hidden" id="compTypeList" name="compTypeList" value="<%=compTypeList%>"/>
<input type="hidden" id="fromConnectwise" name="fromConnectwise" value="<%=fromConnectwise%>"/>
<input type="hidden" id="tstate" name="tstate" value="<%=tstate%>"/>
<input type="hidden" id="toDashBoardLayer" name="toDashBoardLayer" value="<%=toDashBoardLayer%>"/>
<input type="hidden" id="fromScom" name="fromScom" value="<%=fromScom%>"/>
<input type="hidden" id="fromScomURL" name="fromScomURL" value="<%=fromScomURL%>"/>
<input type="hidden" id="fromScomInterval" name="fromScomInterval" value="<%=fromScomInterval%>"/>

	<div id="loginStatusDIV" style="visibility:visible;display:block;width:100%;height:100%;position:relative;border:0px solid #ff0000">
	</div>
</body>
<%
	}
	else
	{
%>

<body style="overflow-x:hidden;overflow-y:hidden" leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onload="logoutQucikLaunch()">
</body>
	<!-- <div id="loginStatusDIV" style="visibility:visible;display:block;width:100%;height:100%;position:relative;border:0px solid #ff0000">
		<table border='0' align='center' width='100%' height="100%" cellspacing='0' cellpadding='0'>
			<tr>
				<td align='center'>
					<img src='/final/admin/eg_images/fault.gif' width='25' height='25'><br>
					<b><egui:intnl text="admin.login.eG manager access from other tools has been disabled. Please conatct eG Administrator to enable this functionality"/></b>
				</td>
			</tr>
		</table>
	</div>
</body>-->

<%
	}
%>