<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HEAD>
<%
Dim clientData(15,6)
' [01] ### Win32 ###
clientData(1,1) = "Win32"
clientData(1,2) = "en/ica32/ica32t.exe"
' [02] ### Win16 ###
clientData(2,1) = "Win16"
clientData(2,2) = "en/ica16/ica16.exe"
' [03] ### Win16_Plugin ###
clientData(3,1) = "Win16"
clientData(3,2) = "en/ica16/ica16.exe"
' [04] ### Mac ###
clientData(4,1) = "Macintosh"
clientData(4,2) = "en/icamac/MACICA_SEA.HQX"
' [05] ### Solaris/Sparc ###
clientData(5,1) = "Solaris SPARC UNIX"
clientData(5,2) = "en/icaunix/solaris.tar.Z"
' [06] ### Solaris/x86 ###
clientData(6,1) = "Solaris/X86 UNIX"
clientData(6,2) = "en/icaunix/solx86.tar.Z"
' [07] ### SunOS ###
clientData(7,1) = "SunOS UNIX"
clientData(7,2) = "en/icaunix/sunos.tar.Z"
' [08] ### SGI ###
clientData(8,1) = "SGI UNIX"
clientData(8,2) = "en/icaunix/sgi.tar.Z"
' [09] ### HP/UX ###
clientData(9,1) = "HP/UX UNIX"
clientData(9,2) = "en/icaunix/hp.tar.Z"
' [10] ### AIX ###
clientData(10,1) = "IBM AIX UNIX"
clientData(10,2) = "en/icaunix/ibm.tar.Z"
' [11] ### SCO ###
clientData(11,1) = "SCO UNIX"
clientData(11,2) = "en/icaunix/sco.tar.Z"
' [12] ### TRU64 ###
clientData(12,1) = "Tru64 UNIX"
clientData(12,2) = "en/icaunix/dec.tar.Z"
' [13] ### LINUX ###
clientData(13,1) = "Linux"
clientData(13,2) = "en/icaunix/linuxx86.tar.gz"
' [14] ### JAVA, Application Mode ###
clientData(14,1) = "Java Application"
clientData(14,2) = "en/icajava/setup.class"
%>

<%
icaClientCode = Request.Cookies("icaClientCode")
icaObjectCode = Request.Cookies("icaObjectCode")
icaClientCode = CInt(icaClientCode)
icaObjectCode = CInt(icaObjectCode)
%>
<style type="text/css">
<!--
P {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; color: #000000;}
H3 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16pt; color: #000000; font-weight: bold; }

A
{
    FONT-SIZE: 8pt;
    FONT-WEIGHT: bold;
    TEXT-DECORATION: none
    COLOR: #000000
    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
}
A:hover
{
    COLOR: #CCCCCC
}
-->
</style>
<TITLE>ICA Client Detection</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
                    <table border="0" cellspacing="0" cellpadding="10">
                      <tr align="center" valign="middle" bgcolor="#6699CC"> 
                        <td> <font face="Verdana, Arial, Helvetica, sans-serif" size="3" color="#FFFFFF"><b>Citrix
ICA Client Installation</b></font></td>
                      </tr>
                      <tr align="center" valign="top"> 
                        <td> 
<%
select case icaClientCode
    case 1
		select case icaObjectCode
			case 1
' ###################################################
' ## [1a] ActiveX Detection & Installation         ##
' ###################################################
%>
<script language="vbscript" type="text/vbscript">
<!--                      
function hasIcaObjVal()
    dim obj
    Err.Clear
    On Error Resume Next
    hasIcaObjVal = 0
    set obj = CreateObject("Citrix.ICAClient")
    if (Err.number = 0) then
        hasIcaObjVal = 1
    else
        Err.Clear
	  set obj = CreateObject("Wfica.WficaCtl.6")
        if (Err.number = 0) then
            hasIcaObjVal = 1
	  else
	    Err.Clear
	    hasIcaObjVal = 0
        end if		
    end if
    set obj = Nothing
end function
                      
select case hasIcaObjVal()
    case 1
		popupContent = "<h3>Citrix ICA Client for <%=clientData(1,1)%> (ActiveX)</h3>"
		popupContent = popupContent & "<p>You have the ICA <%=clientData(1,1)%> Client installed on your system."
		popupContent = popupContent & "<p></p><p></p>"
		popupContent = popupContent & "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>"
		popupContent = popupContent & "<p><img src='media/citrix.jpg' vspace=10></p>"
		document.write(popupContent)
    case else
		popupContent = "<h3>Citrix ICA Client for <%=clientData(1,1)%> (ActiveX)</h3>"
		popupContent = popupContent & "<p>You do not have the ICA <%=clientData(1,1)%> Client installed on your system."
		popupContent = popupContent & "You must install the ICA Client to continue."
		popupContent = popupContent & "<p>Select the link below to install the ICA Client, then click <i>Close window</i> "
		popupContent = popupContent & "when installation is complete."
		popupContent = popupContent & "<p></p>"
		popupContent = popupContent & "<p><a href='../icaweb/<%=clientData(1,2)%>'>Install Citrix ICA Client for <%=clientData(1,1)%></a>"
		popupContent = popupContent & "<p></p><p></p>"
		popupContent = popupContent & "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>"
		popupContent = popupContent & "<p><img src='media/citrix.jpg' vspace=10></p>"
		document.write(popupContent)
end select
//-->
</script>

<%
			case else
' ###################################################
' ## [1b] Plug32 Detection & Installation          ##
' ###################################################
%>
<script language="javascript" type="text/javascript">
<!--
function GetIcaPlugInExistance()
{
    var idx;
    var plugIn;
    var mimeIdx;
    var mimeCount;
    var ver = 0;
    var found = 0;
    var count = navigator.plugins.length;

    //document.write("Plug-In count = " + count + "<br>")
    for (idx = 0; (found==0) && (idx < count); idx++)
    {
        plugIn = navigator.plugins[idx];
        mimeCount = plugIn.length;
        for (mimeIdx = 0; (!found) && (mimeIdx < mimeCount); mimeIdx++)
        {
            if (plugIn[mimeIdx].type == "application/x-ica")
            {
                //document.write(plugIn.filename+"<br>");
                //document.write(plugIn.description+"<br>");
                found = 1;
                // expect "Citrix ICA Plugin DLL (Win32) Version n.n.n" for version 6 onwards
            }
        }
    }
    return found;
}


var IsPlug = GetIcaPlugInExistance();
switch (IsPlug)
{
    case 1:
<% If ((Not(Request.Querystring("clientButton") = "true")) And (Not(Request.Querystring("fromForm") = "on"))) Then %>
		self.close();
<% Else %>
		popupContent = "<h3>Citrix ICA Client for <%=clientData(1,1)%> (Plug-in)<h3>"
		popupContent = popupContent + "<p>You have the ICA <%=clientData(1,1)%> Client installed on your system.";
		popupContent = popupContent + "<p></p><p></p>";
		popupContent = popupContent + "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>";
		popupContent = popupContent + "<p><img src='media/citrix.jpg' vspace=10></p>";
		document.write(popupContent);
<% End If %>
        break;
    default:
		popupContent = "<h3>Citrix ICA Client for <%=clientData(1,1)%> (Plug-in)</h3>";
		popupContent = popupContent + "<p>You do not have the ICA <%=clientData(1,1)%> Client installed on your system.";
		popupContent = popupContent + "You must install the ICA Client to continue.";
		popupContent = popupContent + "<p>Select the link below to install the ICA Client, then click <i>Close window</i> ";
		popupContent = popupContent + "when installation is complete.";
		popupContent = popupContent + "<p></p>";
		popupContent = popupContent + "<p><a href='../icaweb/<%=clientData(1,2)%>'>Install Citrix ICA Client for <%=clientData(1,1)%></a>";
		popupContent = popupContent + "<p></p><p></p>";
		popupContent = popupContent + "<p><a href='#' onClick='self.close()' class=closeWin><b><font size=-1>Close window</font></b></a>";
		popupContent = popupContent + "<p><img src='media/citrix.jpg' vspace=10></p>";
        document.write(popupContent);
        break;
}
//-->
</script>
<%
		end select				
	case 2
' ###################################################
' ## [2] Plug16 Detection & Installation          ##
' ###################################################
%>
<script language="javascript" type="text/javascript">
<!--
function GetIcaPlugInExistance()
{
    var idx;
    var plugIn;
    var mimeIdx;
    var mimeCount;
    var ver = 0;
    var found = 0;
    var count = navigator.plugins.length;

    //document.write("Plug-In count = " + count + "<br>")
    for (idx = 0; (!found) && (idx < count); idx++)
    {
        plugIn = navigator.plugins[idx];
        mimeCount = plugIn.length;
        for (mimeIdx = 0; (found==0) && (mimeIdx < mimeCount); mimeIdx++)
        {
            if (plugIn[mimeIdx].type == "application/x-ica")
            {
                //document.write(plugIn.filename+"<br>");
                //document.write(plugIn.description+"<br>");
                found = 1;
                // expect "Citrix ICA Plugin DLL (Win16) Version n.n.n" for version 6 onwards
             }
        }
    }
    return found;
}

var IsPlug = GetIcaPlugInExistance();
switch (IsPlug)
{
    case 0:
		popupContent = "<h3>Citrix ICA Client for <%=clientData(2,1)%> (Plug-in)</h3>";
		popupContent = popupContent + "<p>You do not have the ICA <%=clientData(2,1)%> Client installed on your system.";
		popupContent = popupContent + "You must install the ICA Client to continue.";
		popupContent = popupContent + "<p>Select the link below to install the ICA Client, then click <i>Close Window</i> ";
		popupContent = popupContent + "when installation is complete.";
		popupContent = popupContent + "<p></p>";
		popupContent = popupContent + "<p><a href='../icaweb/<%=clientData(2,2)%>'>Install Citrix ICA Client for <%=clientData(2,1)%></a>";
		popupContent = popupContent + "<p></p><p></p>";
		popupContent = popupContent + "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>";
		popupContent = popupContent + "<p><img src='media/citrix.jpg' vspace=10></p>";
        document.write(popupContent);
        break;
    default:
        self.close();
        break;
}
//-->
</script>
<%
	case 0
' ###################################################
' ## [0] SunOS & Solaris detection resolution      ##
' ###################################################
		popupContent = "<h3>Citrix ICA Client for SunOS, Solaris Sparc or Solaris x86</h3>"
		popupContent = popupContent & "<p>NFuse requires that you have the appropriate Citrix ICA Client installed on your system."
		popupContent = popupContent & "<p>We have detected that you are using a variety of operating system from Sun Microsystems, "
		popupContent = popupContent & "but cannot determine the exact type."
		popupContent = popupContent & "<p></p>"
		popupContent = popupContent & "<p>If you do not have the Citrix ICA Client, please install it by using one of the three links below, dependant on your system."
		popupContent = popupContent & "<br><a href='../icaweb/" & clientData(5,2) & "'>Install Citrix ICA Client for <b>" & clientData(5,1) & "</b></a>"
		popupContent = popupContent & "<br><a href='../icaweb/" & clientData(6,2) & "'>Install Citrix ICA Client for <b>" & clientData(6,1) & "</b></a>"
		popupContent = popupContent & "<br><a href='../icaweb/" & clientData(7,2) & "'>Install Citrix ICA Client for <b>" & clientData(7,1) & "</b></a>"
		popupContent = popupContent & "<p></p><p></p>"
		popupContent = popupContent & "<p>Click the link below if you already have the ICA Client, or are done installing:"
		popupContent = popupContent & "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>"
		popupContent = popupContent & "<p><img src='media/citrix.jpg' vspace=10></p>"
		Response.Write popupContent
	
    case 14
' #######################################################
' ## [14] Java Application Mode detection resolution    ##
' #######################################################
		popupContent = "<h3>Citrix Java ICA Client, Application Mode</h3>"
		popupContent = popupContent & "<p>NFuse requires that you have a Citrix ICA Client installed on your system."
		popupContent = popupContent & "<p>We have detected that your system will support the ICA Java Client running in 'application mode.'"
		popupContent = popupContent & "<p></p>"
		popupContent = popupContent & "<p>If you do not currently have the appropriate ICA Client, you can download the Java Client 'setup.class' installer here:"
		popupContent = popupContent & "<ul><li><a href='../icaweb/" & clientData(14,2) & "'>Install Citrix ICA Client for <b>" & clientData(14,1) & "</b>"
		popupContent = popupContent & "<p><i>Installation Instructions:</i>"
		popupContent = popupContent & "<br>Download setup.class."
		popupContent = popupContent & "<br>Please see the ICA Java Client Administrator's Guide for information on running setup.class." 
		popupContent = popupContent & "<p></p><p></p>"
		popupContent = popupContent & "<p>Click the link below if you already have the ICA Client, or are done installing:"
		popupContent = popupContent & "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>"
		popupContent = popupContent & "<p><img src='media/citrix.jpg' vspace=10></p>"
 		Response.Write popupContent
	
	case 15
' #######################################################
' ## [15] Java Applet Mode detection resolution        ##
' #######################################################
		popupContent = "<h3>Citrix ICA Client for " & clientData(icaClientCode,1) & "</h3>"
		popupContent = popupContent & "<p>This NFuse installation is using the ICA Java Client in applet mode to access applications. You do not need to install an ICA Client."
		popupContent = popupContent & "<p></p><p></p>"
		popupContent = popupContent & "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>"
		popupContent = popupContent & "<p><img src='media/citrix.jpg' vspace=10></p>"
		Response.Write popupContent
	
	case else
' #######################################################
' ## [ELSE] Other client detection resolution		   ##
' #######################################################
		popupContent = "<h3>Citrix ICA Client for " & clientData(icaClientCode,1) & "</h3>"
		popupContent = popupContent & "<p>NFuse requires that you have the appropriate Citrix ICA Client installed on your system."
		popupContent = popupContent & "<p>For your system, we recommend that you use the ICA Client for " & clientData(icaClientCode,1) & "."
		popupContent = popupContent & "<p></p>"
		popupContent = popupContent & "<p>If you do not have the Citrix ICA Client, please download and install it using the link below:"
		popupContent = popupContent & "<p><a href='../icaweb/" & clientData(icaClientCode,2) & "'>Install Citrix ICA Client for <b>" & clientData(icaClientCode,1) & "</b></a>"
		popupContent = popupContent & "<p></p><p></p>"
		popupContent = popupContent & "<p>Click the link below if you already have the ICA Client, or are done installing:"
		popupContent = popupContent & "<p><a href='#' onClick='self.close()'><b><font size=-1>Close window</font></b></a>"
		popupContent = popupContent & "<p><img src='media/citrix.jpg' vspace=10></p>"
 		Response.Write popupContent
end select
%>
                        </td>
                      </tr>
                    </table>


</BODY>
</HTML>