<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title><?php echo $this->translate('WebAdmin'); ?></title>
<!-- Fav icon -->
<link rel="shortcut icon" href="<?php echo $this->siteBaseUrl ?>images/favicon-admin.ico?<?php echo getVersionCurrentLocalCodebase() ?>" type="image/x-icon" />

<link rel="stylesheet" type="text/css" href="<?php echo $this->siteBaseUrl; ?>css/login.css" />
<link rel="stylesheet" href="<?php echo $this->siteBaseUrl; ?>css/webadmin.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $this->siteBaseUrl; ?>css/common.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo $this->siteBaseUrl ?>js/jQuery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php echo $this->siteBaseUrl ?>js/jQuery/ui/jquery-ui-1.7.2.custom.min.js"></script>



<script type="text/javascript">

function login()	{
	document.body.style.cursor = 'wait';
	document.loginPage.submit();
}

$(function() {

	<?php if($this->global['demo'] == 1) :?>
	$("#password").val("demo");
	$("#username").val("demo");
	<?php elseif(!empty($this->username)) :?>
	$("#password").focus();	
	<?php else :?>
	$("#username").focus();
	<?php endif; ?>

});
</script>
	
</head>

<BODY>
	
<div id="center">

<div id="content-admin">
	
	<div id="logo-admin"><img src="<?php echo $this->siteBaseUrl ?>images/webadmin-logo.gif" /></div>
	
	<div id="contain">
<?php 	if(!empty($this->notRegistered) || !empty($this->err) || isset($this->error)) : ?>
		<table width='860'>
		<tr>
		<td>
			<div id="licence-error"><img class="regerror" src="<?php echo $this->siteBaseUrl; ?>images/icons/error.png"/><span class="atmail_error_message" tabindex="0">
<?php 			if( !empty($this->notRegistered) ) :
					echo $this->translate('To complete the install your license must be registered. Login to the WebAdmin and register your copy.');
				elseif($this->err == 5) :
	 				echo $this->translate('License has expired. Login in to WebAdmin and go to License to purchase a user-license.');
				elseif($this->err == 4) :
		 			echo $this->translate('Trial period has expired. Login in to WebAdmin and go to License to purchase a user-license.');
				elseif($this->err == 3) :
	 				echo $this->translate('Session timed out.');
				elseif($this->err == 2) :
					echo $this->translate('User license exceeded. Please purchase an additional user-license and add it via the WebAdmin.');	
				elseif($this->err == 1) :
					echo $this->translate('Serial checksum failed. Please check your license details and register again via the WebAdmin control panel.');
				else :
					echo $this->translate('Error:') . " " . $this->error;
				endif ?>
		</span>
		</div>
		</td>
		</tr>
		</table>
<?php endif; ?>

		<div id="hold-admin">

			<div id="left-admin">
					<h1 class="login"><?php echo $this->translate('WebAdmin Login page') ?></h1>

					<?php if($this->global['demo'] == 1) :?>
					<h2 class="login-text"><?php echo $this->translate('Enter the username <b>demo</b> and password <b>demo</b> to access the online demo Webadmin interface.') ?></h2>
					<?php else :?>
					<h2 class="login-text"><?php echo $this->translate('Enter your admin username and password to access the Administrator control-panel and manage your domain or Atmail system') ?></h2>
					<?php endif ?>
					<!-- Begin Form -->
					<form class="login-form" name="loginPage" action="<?php echo $this->moduleBaseUrl ?>/index/login" method="post">					
					
						<table border="0">
							<tbody>
								<tr>
									<td height="40" width="90"><?php echo $this->translate('Username:') ?></td>
									<td><input class="input" name="Username" id="username" type="text" value="<?php echo $this->username ?>" /></td>   
								</tr>
								<tr>
									<td height="40"><?php echo $this->translate('Password:') ?></td>
									<td><input class="input" name="Password" id="password" type="password" value="" /></td>
									<td>&nbsp;</td>
									<td>&nbsp;</td>                                    
								</tr>
								<tr>
									<td height="40" width="90"><?php print $this->translate('Language') ?>:</td>
									<td>	
										<select class="language" name="Language">
								  			<option value=""><?php print $this->translate('Default'); ?></option>
											<?php foreach( $this->availableLocales as $k => $v ) : ?>	
											<option value="<?php echo $k ?>"<?php echo ($this->localeString==$k?' selected':'') ?>><?php echo $v ?></option>
											<?php endforeach ?>
										</select>
									</td>
							</tr>
							  <!-- 
							  <tr>
							  <td height="40">WebAdmin Server: </td>
							  <td><input class="input" name="server" type="text" value="http://<?php echo $_SERVER['HTTP_HOST'] . $this->siteBaseUrl ?>" /></td>
							  <td>&nbsp;</td>
							  <td>&nbsp;</td>
							  </tr>
							  -->
 							</tbody>
						</table>

						  <div id="button-admin" onclick="login()">
						  <div class="login-btn">Login</div>
						  <input class="formbutton" name="login" alt="Login" src="<?php echo $this->siteBaseUrl; ?>images/login-btn-login.jpg" type="image" />
						  <input name="send" value="1" type="hidden" />
						  </div>

						</form>
</div>
							<!-- Right Text -->
							<div id="right-admin">
								<p><?php echo $this->translate('Administrator Login') ?></p>
								<h2 class="right-text"><?php echo $this->translate('Please provide your Webadmin access details to access your domain or site-side administration.') ?></h2>
								<p></p>
								<p><?php echo $this->translate('Lost Password') ?></p>
								<h2 class="right-text"><?php echo $this->translate('If you have lost your administrator password please contact') ?> <a href='mailto:<?php echo $this->global['admin_email'] ?>'><?php echo $this->global['admin_email'] ?></a></h2>
							</div>
</div>

<div id="footer-admin">
	<div id="foot-info-admin">
		<a href="http://www.atmail.com/" target="_blank"><?php echo $this->translate('Powered by Atmail') . " " . $this->version ?></a> - 
		<a href="<?php echo $this->siteBaseUrl; ?>"><?php echo $this->translate('Webmail Login') ?></a> <img style="position:relative; top: 4px;" src="<?php echo $this->siteBaseUrl; ?>images/icons/email.png"/>
	</div>
</div>
<script language="text/javascript">
$('.atmail_error_message').focus();
</script>
</BODY>
</HTML>
