<html>
<head>
<title><?php echo $lang->welcome_to_imp; ?></title>

</head>

<?php $default->body->generate_body(); ?>

<center>
<form action="<?php echo $default->root_url ?>/mailbox.php3" method="post" name="login">
<input type="hidden" notab name="actionID" value="<?php echo IMP_LOGIN ?>">
<input type="hidden" notab name="mailbox" value="INBOX">

  <p><font size="+1" face="<?php echo $default->font->face; ?>"><b>IMP</b></font></p>
  <p><font size="2" face="<?php echo $default->font->face; ?>">
  <?php echo $lang->$reason ?>
  </font></p>


   <p>
   <font size="2" face="<?php echo $default->font->face; ?>"><b><?php echo $lang->user_name ?></b></font>
   <input type="text" tabindex="1" name="user">
   </p>

   <p>
   <font size="2" face="<?php echo $default->font->face; ?>"><b><?php echo $lang->password ?></font>
   <input type="password" tabindex="2" name="pass">
   </p>

<?php if ($default->user_change_server): ?>
  <p>
  <font size="2" face="<?php echo $default->font->face; ?>"><b><?php echo $lang->server ?></b></font>
  <input type="text" tabindex="3" name="server" value="<?php echo $default->server ?>"> <?php $lang->server_port; ?> <input type="text" size=4 name="port" tabindex="3" value="<?php echo $default->port ?>">
  </p>

<?php elseif ($default->use_server_list): echo( 'FIXME NO SERVER LIST SUPPORT YET - ZERO' ); ?>
<!--  
<tr>
  <td align="right"><font size="2" face="<?php echo $default->font->face; ?>"><b><?php echo $lang->server ?></b></font></td>
  <td><select name="server" onchange="setFields()">
      <?php
include ('./config/servers.php3');
$option = '';
while (list($key, $iserver) = each($IMAPServers)) {
   if (gettype($iserver->preferred) == 'array') {
      while (list($pkey, $pref) = each($iserver->preferred)) {
         if ($pref == $default->localhost) {
	    $option = ' selected';
	    $defaultport = $iserver->port;
	 }
      }
   } else {
      if ($iserver->preferred == $default->localhost) {
	 $option = ' selected';
	 $defaultport = $iserver->port;
	 $defaultfldr = $iserver->folders;
      }
   }
   echo "<option value=\"$iserver->server\"$option>$iserver->name\n";
   $option = '';
}

if (!isset($defaultport)) {
   reset($IMAPServers);
   list ($key, $iserver) = each($IMAPServers);
   $defaultport = $iserver->port;
   $defaultfldr = $iserver->folders;
}
      ?>
      </select>
      <input type="hidden" name="port" value="<?php echo $defaultport ?>">
  </td>
</tr>
-->
<?php else: ?>
<input type="hidden" name="server" notab value="<?php echo $default->server ?>">
<input type="hidden" name="port" notab value="<?php echo $default->port ?>">
<?php endif; ?>

<?php if ($default->user_change_folder): ?>
  <p>
  <font size="2" face="<?php echo $default->font->face; ?>"><b><?php echo $lang->folders ?></b></font>
  <input type=text tabindex="3" name="folders" value="<?php echo $default->folders ?>">
  </p>

<?php elseif ($default->use_server_list): ?>
<input type="hidden" notab name="folders" value="<?php echo $defaultfldr ?>">
<?php else: ?>
<input type="hidden" notab name="folders" value="<?php echo $default->folders ?>">
<?php endif; ?>

<p>
<input type="submit" tabindex="4" value="<?php echo( $lang->log_in ); ?>">
</p>

</form>
</center>

<?php if ($default->use_server_list && ! $this_client->lynx ): ?>
<script language="Javascript">
<!--

var Ports = new Array ();
var Folders = new Array ();

<?php
reset($IMAPServers);
$i = 0;
while (list($key, $iserver) = each($IMAPServers)) {
   echo "Ports[$i] = '$iserver->port';\n";
   echo "Folders[$i] = '$iserver->folders';\n";
   $i++;
}
?>

function setFields () {
   document.login.port.value = Ports[document.login.server.selectedIndex];
   document.login.folders.value = Folders[document.login.server.selectedIndex];
}

//-->
</script>
<?php endif; ?>

			   
</body>
</html>
