<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="stylemain.css" type="text/css">
<link rel="stylesheet" href="colors.css" type="text/css">
<meta http-equiv="Pragma" content="no-cache">
<title>OpenVPN</title>
<script language="javascript" src="util.js"></script>
<script language="javascript" src="openvpn_msg.js"></script>
<script language="javascript">
<!-- hide  
var sessionKey='<%ejGetOther(sessionKey)%>';

var mode = '<%ejGet(ovpnMajorMode)%>';

//setLanguage('<%ejGet(webUILanguage)%>'); 
//Butterlate.setTextDomain("advanced_1");

var ovpnStatus = '<%ejGet(ovpnStatus)%>';
var ovpnMajorMode = '<%ejGet(ovpnMajorMode)%>';
var ovpnConnName = '<%ejGet(ovpnConnName)%>';
/*
function initTranslation() 
{
    var idArray = new Array("ovpn_title", "ovpn_tips", "ovpn_description", "ovpn_usingWeb", "ovpn_usingFile", "ovpn_btnBack", "ovpn_btnNext");
    setAllIdValue(idArray);
}
*/

function formLoad()
{
    //initTranslation();
	with ( document.forms[0] )
	{
		if(ovpnStatus==0)
		{
			rdcnf[0].checked=true;	
		}
		else
		{
			if(ovpnMajorMode=="custom")
			{
				rdcnf[1].checked=true;
			}
			else
			{
				rdcnf[0].checked=true;
			}
		}
		txtDescription.value=ovpnConnName;
	}
}

function nextClick() 
{
    var loc;
    with ( document.forms[0] )
    {
		if(rdcnf[0].checked==true)
		{
			if(ovpnStatus==1 && ovpnMajorMode!="custom")
			{
				loc = 'openvpncfg.cgi?ovpnMajorMode='+ovpnMajorMode;
			}
			else
			{
				loc = 'openvpncfg.cgi?ovpnMajorMode=server';
			}
			
		}
		else if(rdcnf[1].checked==true)
		{
			loc = 'openvpnmanual1.cgi?ovpnMajorMode=custom';
		}	
	
        if ( isValidNameWSpace(txtDescription.value) == false) 
        {
            alert(_("ovpn_alertCnnName") + txtDescription.value + '".');
            return;
        }
		loc+='&ovpnConnName=' + txtDescription.value;
        loc += '&sessionKey=' + sessionKey;
        var code = 'location="' + loc + '"';
        eval(code);
    }
}

function backClick() 
{
    var code = 'location="openvpnview.html"';
    eval(code);
}

// done hiding -->
</script>
</head>
<body onLoad="formLoad()">
<blockquote>
  <form>
    <b id="ovpn_title">OpenVPN<br>
    </b> <br>
    <span id='ovpn_tips'>OpenVPN is a full-featured SSL VPN which implements OSI layer 2 or 3 secure network extension using the industry standard SSL/TLS protocol.</span> <br>
    <table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="180" id="ovpn_description">Description</td>
        <td><input type="text" name="txtDescription" id="txtDescription" size="20" maxlength="60"></td>
      </tr>
      <tr>
        <td width="180" id="ovpn_usingWeb">Using the Web Browser Interface for Configuration</td>
        <td><input type="radio" name="rdcnf" id="rdcnf1" onClick=''></td>
      </tr>
      <tr>
        <td width="180" id="ovpn_usingFile">Use the configuration file</td>
        <td><input type="radio" name="rdcnf" id="rdcnf2" onClick=''></td>
      </tr>
    </table>
    <br>
    <br>

      <input type='button' onClick='backClick()' value='Back' id='ovpn_btnBack'>
      &nbsp;
      <input type='button' onClick='nextClick()' value='Next' id='ovpn_btnNext'>

  </form>
</blockquote>
</body>
</html>
