<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE><%=Application("WebTitle")%>-Default.asp</TITLE>
<%
	dim PicWebPort
	PicWebPort = 8001

	dim waiter
	set waiter = Server.CreateObject("KVWebSvr.Waiter")	
	if not waiter is nothing then
		PicWebPort = waiter.GetPicWebPort()
		set waiter = nothing
	end if

	if PicWebPort < 0 then
		PicWebPort = PicWebPort + 65536
	end if
'	Response.Write "<SCRIPT LANGUAGE=javascript>"	
'	Response.Write "var strPicWebPort = " & CStr(PicWebPort) & ";"
'	Response.Write "</SCRIPT>"
%>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
var strPicWebPort = <%=PicWebPort%>;

function DKVWebMain1_OnOK() {
	switch(DKVWebMain1.SelIndex)
	{
	case 0:
		window.navigate("http://" + DKVWebMain1.CmdSvrIP + ":" + strPicWebPort + "/Index.html");
		break;
		
	case 1:
		window.navigate("RealIndex.asp");
		break;
		
	case 2:
		window.navigate("HisIndex.asp");
		break;
		
	case 3:
		window.navigate("DbIndex.asp");
		break;	
		
	case 4:
		window.navigate("UserMgr.asp");
		break;
		
	default:
		window.navigate("Login.asp");
		break;
	}
}

function DKVWebMain1_OnClose() {
	window.close();
}

//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript FOR=DKVWebMain1 EVENT=OnOK>
<!--
 DKVWebMain1_OnOK()
//-->
</SCRIPT>
<SCRIPT LANGUAGE=javascript FOR=DKVWebMain1 EVENT=OnClose>
<!--
 DKVWebMain1_OnClose()
//-->
</SCRIPT>
</HEAD>
<BODY bgColor=#9999ff>
<P align=center><STRONG><%=Application("WebTitle")%></STRONG><FONT 
size=2>-Homepage</FONT><hr>

<p align="center">
<object classid="clsid:BAFF46E1-435E-402E-AC79-5CE9713076AF" id="DKVWebMain1" width="60%" height="90%" codebase=".\Controls\KVWeb.cab#$KVWebMain.ocx$#">
	<param name="BackColor" value="16751001">
	<%
		if Application("ValidateUser") = 0 then
			Session("UserRole") = 1
			Response.Write("<param name=""UserRole"" value=""1"">")
		elseif Session("UserRole") = 0 then
			Response.Write("<param name=""UserRole"" value=""2"">")
		else
			Response.Write("<param name=""UserRole"" value=""" + CStr(Session("UserRole")) + """>")
		end if
	%>	
	<param name="CmdSvrIP" value="<%=Application("CmdSvrIP")%>">
	<param name="CmdSvrPort" value="<%=Application("CmdSvrPort")%>">
	<param name="FileSvrIP" value="<%=Application("FileSvrIP")%>">
	<param name="FileSvrPort" value="<%=Application("FileSvrPort")%>">
	<param name="FSvrVirtualDir" value="<%=Application("FSvrVirtualDir")%>">
	<param name="AutoDetectCmdSvr" value="0">
	<param name="AutoDetectFileSvr" value="0">
</object>
</p>

</BODY>
</HTML>