﻿<html>
<head>
<title>Control_Manager_Settings</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--base href="$$BASE_URL$$"-->
<link href="css/trend-style-new.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="javascripts/localization.js"></script>
<script language="JavaScript" src="javascripts/trend-ui-new.js"></script>
<script language="JavaScript" src="javascripts/OLH_Mapping.js"></script>
<script language="javascript" src="$$LINK_CM_SETTING_LINKS$$"></script>
<script language="JavaScript" src="javascripts/StringTransform.js"></script>
<!--script language="javascript" src="$$LINK_CM_SETTING_VALUE$$"></script-->
<script language="JavaScript" type="text/JavaScript">
<!--
var VAR_DEFAULT_DISPLAY_NAME = "$$DEFAULT_DISPLAY_NAME$$";
var MSG_UNREGISTER = "Do you want to unregister to Control Manager?";

function jsInitPage() {
	// set max length
	document.fmMain.EntDisName.maxLength  = INT_LMAX_CM_DISNAME;
	document.fmMain.txtFQDNIP.maxLength  = INT_LMAX_CM_DISNAME + 1;
	document.fmMain.txtPort.maxLength  = INT_LMAX_PORT;
	document.fmMain.txtUN.maxLength  = INT_LMAX_USERNAME;
	document.fmMain.txtPW.maxLength  = INT_LMAX_PASSWORD;
	document.fmMain.txtProxyPort.maxLength  = INT_LMAX_PORT;
	document.fmMain.txtProxyHost.maxLength  = INT_LMAX_CM_DISNAME;
	document.fmMain.txtProxyUser.maxLength  = INT_LMAX_USERNAME;
	document.fmMain.txtProxyPW.maxLength  = INT_LMAX_PASSWORD;
	document.fmMain.twIP.maxLength  = INT_LMAX_SNMP_IP;
	document.fmMain.twPort.maxLength  = INT_LMAX_PORT;
	
	// Init Page Value;
	if (document.fmValue.EC_ENTITY_DISPLAYNAME.value == "")
	    document.fmValue.EC_ENTITY_DISPLAYNAME.value = VAR_DEFAULT_DISPLAY_NAME;
	    
	//Connection Status
	document.getElementById("strRegisterCMServer_ready").innerText = document.fmValue.EC_HOST.value;
	document.getElementById("FntLastHeartbeat").innerText = VAR_LAST_HEARTBEAT;
	//Connection Settings
	document.fmMain.EntDisName.value = document.fmValue.EC_ENTITY_DISPLAYNAME.value;
	document.getElementById("FntDisName").innerText = document.fmValue.EC_ENTITY_DISPLAYNAME.value;
	//Control Manager Server Settings
	document.fmMain.txtFQDNIP.value  = document.fmValue.EC_HOST.value;
	document.getElementById("FntFQDNIP").innerText = document.fmValue.EC_HOST.value;
	document.fmMain.txtPort.value    = document.fmValue.EC_HOST_PORT.value;
	document.getElementById("FntPort").innerText = document.fmValue.EC_HOST_PORT.value;
	document.fmMain.chkHTTPS.checked = document.fmValue.EC_HOST_ENABLE_HTTPS.value != 0;	
	document.fmMain.txtUN.value      = document.fmValue.EC_HOST_USERNAME.value;
	document.getElementById("FntUN").innerText = document.fmValue.EC_HOST_USERNAME.value;
	document.fmMain.txtPW.value      = document.fmValue.EC_HOST_USERNAME.value.length ? '*********' : '';
	document.getElementById("FntPW").innerText = document.fmValue.EC_HOST_USERNAME.value.length ? '*********' : '';
	//MCP Proxy Settings 
 	document.fmMain.chkProxyEnable.checked      = document.fmValue.EC_PROXY_ENABLE.value != 0;
 	document.fmMain.chkProxyType[0].checked     = document.fmValue.EC_PROXY_TYPE.value == '0';
 	document.fmMain.chkProxyType[1].checked     = document.fmValue.EC_PROXY_TYPE.value == '2';
 	document.fmMain.txtProxyHost.value          = document.fmValue.EC_PROXY_HOST.value;
 	document.getElementById("fntProxyHost").innerText = document.fmValue.EC_PROXY_HOST.value;
 	document.fmMain.txtProxyPort.value          = document.fmValue.EC_PROXY_PORT.value;
 	document.getElementById("fntProxyPort").innerText = document.fmValue.EC_PROXY_PORT.value;
 	document.fmMain.txtProxyUser.value          = document.fmValue.EC_PROXY_USERNAME.value;
 	document.getElementById("fntProxyUser").innerText = document.fmValue.EC_PROXY_USERNAME.value;
 	document.fmMain.txtProxyPW.value            = document.fmValue.EC_PROXY_USERNAME.value.length ? '*********' : '';
 	document.getElementById("fntProxyPW").innerText = document.fmValue.EC_PROXY_USERNAME.value.length ? '*********' : '';
	//Two Way Communication Port Forwarding
	document.fmMain.chkTWCom.checked = document.fmValue.EC_NAT_ENABLE.value != 0;
	document.fmMain.twIP.value      = document.fmValue.EC_NAT_ADDRESS.value;
	document.fmMain.twPort.value    = (document.fmValue.EC_NAT_PORT.value == 0)?"":document.fmValue.EC_NAT_PORT.value;
	
	jsUIDependecy();
}
function jsPrepare() {
	// add some checking
	//document.fmMain.submit();
	
	document.fmValue.EC_HOST.value              = document.fmMain.txtFQDNIP.value;
	document.fmValue.EC_HOST_PORT.value         = document.fmMain.txtPort.value;
	document.fmValue.EC_HOST_ENABLE_HTTPS.value = document.fmMain.chkHTTPS.checked ? 1 : 0;
	document.fmValue.EC_ENTITY_DISPLAYNAME.value= document.fmMain.EntDisName.value;
	document.fmValue.EC_HOST_USERNAME.value     = document.fmMain.txtUN.value;
	document.fmValue.EC_HOST_PASSWORD.value     = document.fmMain.isPwChanged.value == "true" ? encryptString(document.fmMain.txtPW.value) : "";

    document.fmValue.EC_PROXY_ENABLE.value      = document.fmMain.chkProxyEnable.checked ? 1 : 0;
    document.fmValue.EC_PROXY_TYPE.value        = document.fmMain.chkProxyType[0].checked ? (document.fmMain.chkProxyType[0].value) : (document.fmMain.chkProxyType[1].checked ? document.fmMain.chkProxyType[1].value : "0");
    document.fmValue.EC_PROXY_HOST.value        = document.fmMain.txtProxyHost.value;
    document.fmValue.EC_PROXY_PORT.value        = document.fmMain.txtProxyPort.value;
    document.fmValue.EC_PROXY_USERNAME.value    = document.fmMain.txtProxyUser.value;
    document.fmValue.EC_PROXY_PASSWORD.value    = document.fmMain.isProxyPwChanged.value == "true" ? encryptString(document.fmMain.txtProxyPW.value) : "";

	document.fmValue.EC_NAT_ENABLE.value        = document.fmMain.chkTWCom.checked ? 1 : 0;
	document.fmValue.EC_NAT_ADDRESS.value       = document.fmMain.twIP.value;
	document.fmValue.EC_NAT_PORT.value          = document.fmMain.twPort.value;
	document.fmValue.action                     = VAR_LINK_CM_SETTING_PROGRESS;
}
function encryptString(str)     
{
	var ret = StringTransform(str);
	return ret;
}
function jsSubmit(fromButton){
    
    document.getElementById("btnUnregister").disabled = true;
	document.getElementById("btnRegister").disabled = true;
	document.getElementById("btnModify").disabled = true;
	document.getElementById("btnTest").disabled = true;
	document.getElementById("btnCancel").disabled = true;
	
	if (fromButton == "EnableCom")
    {
        document.fmValue.EC_ENABLE.value = (document.getElementById("EnableCom").checked)?1:0;
        document.fmValue.FormAction.value = "modify";
    }
    else
    {
	    if(!checkNumberRange(document.fmMain.EntDisName.value.length,INT_LMAX_CM_DISNAME,INT_LMIN_CM_DISNAME,STR_ERR_CM_DISNAME,false))
	    {
	        jsRevokeBtn();
	        jsFocus(document.fmMain.EntDisName);
	        return;
	    }
	    if(!checkEntityDisplayNameFormat(document.fmMain.EntDisName.value, STR_ERR_CM_DISNAME2, false))
    	    {
    	    	jsRevokeBtn();
	        jsFocus(document.fmMain.EntDisName);
	        return;
    	    }
	    if(!checkNumberRange(document.fmMain.txtFQDNIP.value.length,INT_LMAX_CM_FQDN,INT_LMIN_CM_FQDN,STR_ERR_CM_FQDN,false))
	    {
	        jsRevokeBtn();
	        jsFocus(document.fmMain.txtFQDNIP);
	        return;
	    }
	    if(!checkNumber(document.fmMain.txtPort.value,"") || !checkNumberRange(document.fmMain.txtPort.value,INT_NMAX_PORT,INT_NMIN_PORT,"",false))
	    {
	        alert(STR_ERR_INVALID_PORT);
	        jsRevokeBtn();
	        jsFocus(document.fmMain.txtPort);
	        return;
	    }
	    if(!checkNumber(document.fmMain.txtProxyPort.value,"") || !checkPortRange(document.fmMain.txtProxyPort.value,"",true))
	    {
	        alert(STR_ERR_INVALID_PORT);
	        jsRevokeBtn();
	        jsFocus(document.fmMain.txtProxyPort);
	        return;
	    }
	    if(!checkIPAddressFormat(document.fmMain.twIP.value,STR_ERR_INVALID_IPADDRESS,true))
	    {
	        jsRevokeBtn();
	        jsFocus(document.fmMain.twIP);
	        return;
	    }
	    if(!document.getElementById("twPort").disabled){
	        if(!checkNumber(document.fmMain.twPort.value,"") || !checkPortRange(document.fmMain.twPort.value,"",true))
	        {
	            alert(STR_ERR_INVALID_PORT);
	            jsRevokeBtn();
	            jsFocus(document.fmMain.twPort);
	            return;
	        }
	    }
	    if(!document.getElementById("txtProxyHost").disabled || !document.getElementById("txtProxyPort").disabled){
	        if(!checkNumberRange(document.fmMain.txtProxyHost.value.length,INT_LMAX_CM_FQDN,INT_LMIN_CM_FQDN,STR_ERR_CM_FQDN,false))
	        {
	            jsRevokeBtn();
	            jsFocus(document.fmMain.txtProxyHost);
	            return;
	        }
	    }
	    if(!document.getElementById("txtProxyPort").disabled){
	        if(!checkNumber(document.fmMain.txtProxyPort.value,"") || !checkPortRange(document.fmMain.txtProxyPort.value,"",true))
	        {
	            alert(STR_ERR_INVALID_PORT);
	            jsRevokeBtn();
	            jsFocus(document.fmMain.txtProxyPort);
	            return;
	        }
	    }
    }	
    jsPrepare();
    if (fromButton == "btnRegister")        { document.fmValue.FormAction.value = "register";}
    else if (fromButton == "btnUnregister") { 
        if(confirm(MSG_UNREGISTER)) {document.fmValue.FormAction.value = "unregister";}
        else{
            jsRevokeBtn();
            return;
        }
    }
    else if (fromButton == "btnTest")       document.fmValue.FormAction.value = "testconnection";
    else if (fromButton == "btnModify")     document.fmValue.FormAction.value = "modify";
    
    jsAddCSRFToken(document.fmValue);
    document.fmValue.submit();
}
function jsCancel(){
    jsInitPage();
}
function jsUIDependecy(){
    var fRegister = IsRegisterredToCM(VAR_CONNECTION_STATUS);
    //Connection Status
	document.getElementById("strRegisterCMServer_no").style.display = (fRegister)?"none":"";
    document.getElementById("strRegisterCMServer_ready").style.display = (fRegister)?"":"none";
    document.getElementById("trLastHearbeat").style.display = (fRegister)?"":"none";
    //Connection Settings
    document.getElementById("EntDisName").style.display = (fRegister)?"none":"";
    document.getElementById("FntDisName").style.display = (fRegister)?"":"none";
   //Control Manager Server Settings
    document.getElementById("txtFQDNIP").style.display = (fRegister)?"none":"";
    document.getElementById("FntFQDNIP").style.display = (fRegister)?"":"none";
    document.getElementById("txtPort").style.display = (fRegister)?"none":"";
    document.getElementById("FntPort").style.display = (fRegister)?"":"none";
    document.getElementById("chkHTTPS").disabled = fRegister;
    document.getElementById("txtUN").style.display = (fRegister)?"none":"";
    document.getElementById("FntUN").style.display = (fRegister)?"":"none";
    document.getElementById("txtPW").style.display = (fRegister)?"none":"";
    document.getElementById("FntPW").style.display = (fRegister)?"":"none";
    
   //Proxy Setting
    document.getElementById("chkProxyEnable").disabled = fRegister;
    document.getElementById("chkProxyType_HTTP").disabled = (fRegister || !document.getElementById("chkProxyEnable").checked);
    document.getElementById("chkProxyType_SOCKS5").disabled = (fRegister || !document.getElementById("chkProxyEnable").checked);
    document.getElementById("txtProxyHost").disabled = !document.getElementById("chkProxyEnable").checked;
    document.getElementById("txtProxyPort").disabled = !document.getElementById("chkProxyEnable").checked;
    document.getElementById("txtProxyUser").disabled = !document.getElementById("chkProxyEnable").checked;
    document.getElementById("txtProxyPW").disabled = !document.getElementById("chkProxyEnable").checked;
    document.getElementById("txtProxyHost").style.display = (fRegister)?"none":"";
    document.getElementById("txtProxyPort").style.display = (fRegister)?"none":"";
    document.getElementById("txtProxyUser").style.display = (fRegister)?"none":"";
    document.getElementById("txtProxyPW").style.display = (fRegister)?"none":"";
    document.getElementById("fntProxyHost").style.display = (fRegister)?"":"none";
    document.getElementById("fntProxyPort").style.display = (fRegister)?"":"none";
    document.getElementById("fntProxyUser").style.display = (fRegister)?"":"none";
    document.getElementById("fntProxyPW").style.display = (fRegister)?"":"none";
   
   //Two Way
   document.getElementById("twIP").disabled = !document.getElementById("chkTWCom").checked;
   document.getElementById("twPort").disabled = !document.getElementById("chkTWCom").checked;
   
    //Button
   document.getElementById("btnRegister").style.display = (fRegister)?"none":"";
   document.getElementById("btnModify").style.display = (fRegister)?"":"none"; 
   document.getElementById("btnTest").style.display = (fRegister)?"none":"";
   
   var bIsOppEnabled = IsOppEnabled();
   
   document.getElementById("btnUnregister").disabled =  (bIsOppEnabled && fRegister);
   //Fix case#1.8-00151: [Administration]Unregister button do not gray out in firefox 
   if (vBrowser != "IE"){
   	if (document.getElementById("btnUnregister").disabled == true){
   		document.getElementById("btnUnregister").style.color = 'gray';
	}else{
		document.getElementById("btnUnregister").style.color = 'black';
	}
   }
   document.getElementById("EnableCom").checked = (document.fmValue.EC_ENABLE.value == 1)?true:false;
   document.getElementById("EnableCom").disabled = bIsOppEnabled;
   if (document.fmValue.EC_ENABLE.value == 0){ 
        var oform = document.fmMain;
	    var EleLen = oform.elements.length;
	    for (var i=0;i<EleLen;i++){
	        oform.elements[i].disabled = true;
	    }
   }
}
function jsSetPort(){
    if(document.fmMain.txtPort.value == "80")
         document.fmMain.txtPort.value = "443";
}
function jsRevokeBtn(){
    document.getElementById("btnUnregister").disabled = false;
	//Fix case#1.8-00151: [Administration]Unregister button do not gray out in firefox 
	if (vBrowser != "IE"){
		document.getElementById("btnUnregister").style.color = 'black';
		}
	
    document.getElementById("btnRegister").disabled = false;
    document.getElementById("btnModify").disabled = false;
    document.getElementById("btnTest").disabled = false;
    document.getElementById("btnCancel").disabled = false;
}
//-->
</script>
<body onLoad="jsInitPage();">

<!--Page Title-->
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr><td class="content-title">Control Manager Settings</td>
	<td align="right" valign="bottom">
		<a href="javascript:jsMapOnlineHelp('administration\CM_Settings.htm');" class="moretestblue">
		<img src="images/question.gif" class="vAlignMid"> Help</a></td></tr>
<tr><td colspan="2" height="4"></td></tr>
<tr><td colspan="2" height="1" background="images/dot.gif"></td></tr>
<tr><td colspan="2" height="10"></td></tr>
</table>
<!--/Page Title-->


<table width="98%" border="0" cellspacing="0" cellpadding="0">
<!--Page Description-->
<tr><td>Configure the settings for communication between the PortalProtect MCP Agent and the Control Manager server.</td></tr>
<tr><td height="10"></td></tr>
<tr><td>
        <input type="checkbox" name="EnableCom" id="EnableCom" onClick="jsSubmit(this.id)" />
        Enable communication between the PortalProtect MCP agent and Control Manager.</td></tr>
<tr><td height="10"></td></tr>
<!--/Page Description-->

<form id="fmMain" name="fmMain" action="" method="POST">
<!--Hidden Field-->
<input type="hidden" name="FormAction">
<!--/Hidden Field-->
<!--Page Content-->
<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
		<!--||Connection Status||-->
		<tr><td class="tableheader" colspan="2">Connection Status </td></tr>
		<tr><td class="data1" height="22" width="200">Registered Control Manager server:</td>
		    <td><font class="highlight-red" id="strRegisterCMServer_no">Not connected</font><font id="strRegisterCMServer_ready"></font></td></tr>
		<tr id="trLastHearbeat"><td class="data1">Last heartbeat:</td>
		    <td class="data1"><font id="FntLastHeartbeat"></font>
		        &nbsp;<input type="button" id="btnUnregister" name="btnUnregister" value="Unregister" class="text" onClick="jsSubmit(this.id);" /></td></tr>
		</table></td></tr>
<tr><td height="10"></td></tr>
<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
      <!--||Connection Settings||-->
       <tr><td class="tableheader" colspan="2">Connection Settings</td></tr>
       <tr><td class="data1" height="22">Entity display name<font class="highlight-red">*</font>:
                <input type="text" class="text" id="EntDisName" name="EntDisName" value="" style="display:none" />
                <font id="FntDisName" style="display:none"></font>
                <img src="images/info_mark.gif" style="cursor:hand;position:relative" onMouseOut="hideToolTip('ifmToolTip');"
                         onmouseover="showToolTip('ifmToolTip',this,240,80,TIP_CM_ENTITY_DISPLAYNAME_TITLE,TIP_CM_ENTITY_DISPLAYNAME_CONTENT);">
                </td></tr>
       <tr><td class="tableheadergreyM">Control Manager Server Settings</td></tr>
       <tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr><td height="22" class="data1" width="180">Server FQDN or IP address<font class="highlight-red">*</font>:</td>
                     <td class="data1"><input type="text" class="text" id="txtFQDNIP" name="txtFQDNIP" value="" style="width:200" />
                        <font id="FntFQDNIP" style="display:none"></font>
                     </td></tr>
             <tr><td height="22" class="data1">Port<font class="highlight-red">*</font>:</td>
                     <td class="data1"><table border="0" cellspacing="0" cellpadding="0"><tr><td><input type="text" class="text" id="txtPort" name="txtPort" value="" style="width:50" style="display:none" /></td>
                        <td><font id="FntPort" style="display:none"></font>&nbsp;
                        <input type="checkbox" id="chkHTTPS" name="chkHTTPS" onClick="jsSetPort()" /></td>
                        <td >Connect using HTTPS</td></tr>
                        </table></td></tr>
              <tr><td height="22" class="data1" colspan="2">Web server authentication:
                     <img src="images/info_mark.gif" style="cursor:hand;position:relative" onMouseOut="hideToolTip('ifmToolTip');"
                         onmouseover="showToolTip('ifmToolTip',this,300,70,TIP_CM_USER_NAME_TITLE,TIP_CM_USER_NAME_CONTENT);">
                     </td></tr>
              <tr><td height="22" class="data1">Username:</td>
                     <td class="data1"><input type="text" class="text" id="txtUN" name="txtUN" value="" style="width:160" style="display:none" /><font id="FntUN" style="display:none"></font></td></tr>
              <tr><td height="22" class="data1">Password:</td>
                     <td class="data1">
                     <input type="hidden" name="isPwChanged" value="false" />
                     <input type="password" class="text" id="txtPW" name="txtPW" value="" style="width:160" onchange="this.form.isPwChanged.value='true'" style="display:none" /><font id="FntPW" style="display:none"></font></td></tr>
              </table>
              </td></tr>
       <!-- -->
       <tr><td class="tableheadergreyM">MCP Proxy Settings </td></tr>
       <!--tr><td height="5"><img src="images/1space_cui.gif" width="1" height="5"></td></tr-->
       <tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tr><td colspan="3"><table width="100%%" border="0" cellspacing="0" cellpadding="0">
              <tr><td width="20" class="data1" ><input type="checkbox" id="chkProxyEnable" name="chkProxyEnable" value="true" onClick="jsUIDependecy();" /></td>
                    <td colspan="2" class="data1">Use a proxy server for communication with the Control Manager server</td></tr>
              <!--tr><td class="data1" >&nbsp;</td>
                    <td width="22" class="data1"><input name="radiobutton" type="radio" value="radiobutton" checked /></td>
                    <td nowrap class="data1">Auto-detect (uses proxy settings defined in Internet Explorer) <img src="images/info_mark_cui.gif" width="14" height="17" align="absmiddle" /></td></tr>
              <tr><td class="data1" >&nbsp;</td>
                    <td width="22" class="data1"><input name="radiobutton" type="radio" value="radiobutton" /></td>
                    <td class="data1">Manual (manually define the proxy settings)&nbsp; </td></tr-->

              <tr class="border">
                <td height="10" colspan="3" ></td>
              </tr>


              <tr class="border">
                <td class="data1" >&nbsp;</td>
                <td colspan="2"><table border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="data1" style="vertical-align:top">Proxy protocol:</td>
                      <td><table border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="22" class="data1"><input name="chkProxyType" id="chkProxyType_HTTP" type="radio" value="0" checked />
                            </td>
                            <td class="data1">HTTP</td>
                          </tr>
                          <tr>
                            <td width="22" class="data1"><input name="chkProxyType" id="chkProxyType_SOCKS5" type="radio" value="2" />
                            </td>
                            <td class="data1">SOCKS 5</td>
                          </tr>
                      </table></td>
                    </tr>
                    <tr>
                      <td colspan="2" height="10"></td>
                    </tr>
                    <tr>
                      <td nowrap class="data1">Server FQDN or IP address:</td>
                      <td class="data1" height="20"><input id="txtProxyHost" name="txtProxyHost" type="text" class="button" size="46" />
                      <font id="fntProxyHost" style="display:none"></font>
                      </td>
                    </tr>
                    <tr>
                      <td class="data1">Port:</td>
                      <td class="data1" height="20"><input id="txtProxyPort" name="txtProxyPort" type="text" class="button" size="4" style="width:50;" />
                      <font id="fntProxyPort" style="display:none"></font>
                      </td>
                    </tr>
                    <tr>
                      <td colspan="2" height="5"></td>
                    </tr>
                    <tr>
                      <td colspan="2" class="data1">Proxy server authentication:</td>
                    </tr>
                    <tr>
                      <td class="data1" height="20">User ID:</td>
                      <td class="data1"><input id="txtProxyUser" name="txtProxyUser" type="text" class="button" size="30" />
                      <font id="fntProxyUser" style="display:none"></font>
                      </td>
                    </tr>
                    <tr>
                      <td class="data1" height="20">Password:</td>
                      <td class="data1"><input name="isProxyPwChanged" type="hidden" value="false"/>
                                        <input id="txtProxyPW" name="txtProxyPW" type="password" class="button" size="30" onChange="this.form.isProxyPwChanged.value='true';"/>
                                        <font id="fntProxyPW" style="display:none"></font>
                      </td>
                    </tr>
                </table></td>
              </tr>
          </table></td>
        </tr>
    </table></td>
  </tr>

      <!-- -->
      <tr height="5"><td></td></tr>  
       <tr><td class="tableheadergreyM">Two Way Communication Port Forwarding</td></tr>
       <tr height="5"><td></td></tr>
      <tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
             <tr><td width="20"><input type="checkbox" name="chkTWCom" id="chkTWCom" class="text" onClick="jsUIDependecy();" /></td>
                    <td class="data1" colspan="2">Enable two-way communication port forwarding
                         <img src="images/info_mark.gif" style="cursor:hand;position:relative" onMouseOut="hideToolTip('ifmToolTip');"
                         onmouseover="showToolTip('ifmToolTip',this,300,70,TIP_CM_TW_COMM_TITLE,TIP_CM_TW_COMM_CONTENT);"></td></tr>
             <tr><td></td>
                    <td width="80" nowrap class="data1">IP address:</td>
                    <td width="90%"><input type="text" class="text" id="twIP" name="twIP" value="" style="width:120" /></td></tr>
             <tr><td></td>
                    <td class="data1" nowrap>Port:</td>
                    <td><input type="text" class="text" id="twPort" name="twPort" value="" style="width:50" /></td></tr>
             </table></td></tr> 
       <tr height="5"><td></td></tr> 
       </table></td></tr>
<tr><td height="10"></td></tr>
<tr><td><input type=button class="text" id="btnRegister" value="Register"     onclick="jsSubmit(this.id);"><input type=button class="text" id="btnModify" value="Update Settings" onClick="jsSubmit(this.id);" style="display:none">
		<input type=button class="text" id="btnTest"     value="Test Connection" onClick="jsSubmit(this.id);">
		<input type=button class="text" id="btnCancel"   value="Cancel"          onclick="jsCancel();"></td></tr>
<tr><td height="10"></td></tr>
<!--/Page Content-->
</table>
</form>

<form id="fmValue" name="fmValue" action="" method="POST">
<!--Hidden Field-->
<input type="hidden" name="FormAction"              value=""/>
<input type="hidden" name="EC_ENABLE"               value="$$EC_ENABLE$$"/>
<input type="hidden" name="EC_HOST"                 value="$$EC_HOST$$"/>
<input type="hidden" name="EC_HOST_PORT"            value="$$EC_HOST_PORT$$"/>
<input type="hidden" name="EC_HOST_ENABLE_HTTPS"    value="$$EC_HOST_ENABLE_HTTPS$$"/>
<input type="hidden" name="EC_HOST_USERNAME"        value="$$EC_HOST_USERNAME$$"/>
<input type="hidden" name="EC_HOST_PASSWORD"        value="$$EC_HOST_PASSWORD$$"/>
<input type="hidden" name="EC_ENTITY_GUID"          value="$$EC_ENTITY_GUID$$"/>
<input type="hidden" name="EC_ENTITY_DISPLAYNAME"   value="$$EC_ENTITY_DISPLAYNAME$$"/>
<input type="hidden" name="EC_PROXY_ENABLE"         value="$$EC_PROXY_ENABLE$$"/>
<input type="hidden" name="EC_PROXY_TYPE"           value="$$EC_PROXY_TYPE$$"/>
<input type="hidden" name="EC_PROXY_HOST"           value="$$EC_PROXY_HOST$$"/>
<input type="hidden" name="EC_PROXY_PORT"           value="$$EC_PROXY_PORT$$"/>
<input type="hidden" name="EC_PROXY_USERNAME"       value="$$EC_PROXY_USERNAME$$"/>
<input type="hidden" name="EC_PROXY_PASSWORD"       value="$$EC_PROXY_PASSWORD$$"/>
<input type="hidden" name="EC_NAT_ENABLE"           value="$$EC_NAT_ENABLE$$"/>
<input type="hidden" name="EC_NAT_ADDRESS"          value="$$EC_NAT_ADDRESS$$"/>
<input type="hidden" name="EC_NAT_PORT"             value="$$EC_NAT_PORT$$"/>
</form>

<iframe id="ifmToolTip" name="ifmToolTip" src="html/ToolTip.htm" frameborder="0" style="z-index:10000;position:absolute;width:0;height:0;scrolling:no"/>
</body>
</html>
