<!--
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/

-->
<!-- BEGIN: main -->
<table width="50%" border="0" cellspacing="0" cellpadding="0" class="formOuterBorder">
<tr>
<td>
<table width="100%" cellpadding="5" cellspacing="1" border="0">
  <tbody>
	<form action="index.php" method="post" name="MailServer" id="form" onsubmit="return validate_mail_server(MailServer);">
  <input type="hidden" name="module" value="Settings">
  <input type="hidden" name="action" value="index">
  <input type="hidden" name="server_type" value="email">
  <input type="hidden" name="return_module" value="{RETURN_MODULE}">
  <input type="hidden" name="return_action" value="{RETURN_ACTION}">
  <tr><td colspan="2" class="formSecHeader">{MOD.LBL_MAIL_SERVER_INFO}</td></tr>
  <tr> 
    <td width="50%" nowrap class="dataLabel"><font color="red">*</font>{MOD.LBL_OUTGOING_MAIL_SERVER}:</td>
    <td align="left"> <input class="dataInput" type="text" name="server" value="{MAILSERVER}" size="25" /></td>
  </tr>
  <tr>
    <td nowrap class="dataLabel"><font color="red">*</font>{MOD.LBL_OUTGOING_MAIL_SERVER_LOGIN_USER_NAME}:</td>
    <td align="left"> <input class="dataInput" type="text" name="server_username" value="{USERNAME}" size="25"/></td>
  </tr>
  <tr>
    <td nowrap class="dataLabel"><font color="red">*</font>{MOD.LBL_OUTGOING_MAIL_SERVER_PASSWORD}:</td>
    <td align="left"><input class="dataInput" type="password" name="server_password" value="{PASSWORD}" size="25"/></td>
  </tr>
</table>
</td>
</tr>
</table>
<br>
<table width="65%" cellpadding="0" cellspacing="0" border="0"><tbody>
	<tr>
	         <td align="center">
			<input title="{APP.LBL_SAVE_BUTTON_LABEL}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';" type="submit" name="button" value="{APP.LBL_SAVE_BUTTON_LABEL}" >
	                <input title="{APP.LBL_CANCEL_BUTTON_LABEL}>" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="window.history.back()" type="button" name="button" value="{APP.LBL_CANCEL_BUTTON_LABEL}">
		</td>
	</tr>
	</form>
</table>

<script>
function validate_mail_server(form)
{
	if(form.server.value =='')
	{
		alert("Server Name could not be empty")	
		return false;
	}
	if(trim(form.server_username.value) =='')
	{
		alert("Server User Name could not be empty")	
		return false;
	}
	if(form.server_password.value =='')
	{
		alert("Server Password could not be empty")	
		return false;
	}
	
	return true;
}
function trim(s)
{
        while (s.substring(0,1) == " ") {
                s = s.substring(1, s.length);
        }
        while (s.substring(s.length-1, s.length) == ' ') {
                s = s.substring(0,s.length-1);
        }

        return s;
}
</script>
<!-- END: main -->