<?
//   XUL Webmail, a web based mailclient
//
//   Copyright (C) 2004 Wouter van Wijk (wvw a@t dds.nl),
//
//   This program is free software; you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation; either version 2 of the License, or
//   (at your option) any later version.
//
//   This program is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with this program; if not, write to the Free Software
//   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//

include('settings.php');
$errorstring = $_GET['errorstring'];
$errorstring2 = $_GET['errorstring2'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><? echo $standardtitle ?></title>

  <meta content="text/html; charset=iso-8859-1" http-equiv="content-type">
  <meta name="ROBOTS" content="noindex,nofollow">
  <meta name="revisit-AFTER" content="0 days"> 
  <meta content="Wouter van Wijk, MediaVilla.nl" name="author">
  <meta content="<? echo $standardtitle ?>, webmail for Mozilla browsers" name="description">
  <meta content="webmail, xul, mozilla, firefox" name="keywords">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <link rel="stylesheet" href="login.css" type="text/css" />
  <script type="text/JavaScript">
    if (navigator.userAgent.indexOf('Gecko') == -1)
    {
      alert('To be able to use <? echo $standardtitle ?>, you will need a Mozilla browser.\nYou will be sent to the download page of Mozilla Firefox now.\nPlease come back using this browser.');
      window.location.href = 'http://www.getfirefox.com/';
    }
    
    function openMail () {
	var checkwin = document.getElementById('newwindow');
	var loginform = document.getElementById('loginform');
    	if (checkwin.checked == true) {
		loginform.target = 'mainwindow';
		var newwin = window.open('', 'mainwindow', 'width=750, height=550, location=no, menubar=no, status=yes, toolbar=no, scrollbars=no, resizable=yes');
		newwin.focus();		
	} else {
		loginform.target = '_self';
	}
    }
</script>
</head>
<body>
<h1><? echo $standardtitle ?> - Logon</h1>
<div id="loginundertitle">Just type in your username, password, emailaddress<? if (!$onlyusestandardserver) {
	echo ", server";
} ?>...</div>
  <br />
<div align="center">
<? if ($errorstring !='') {
	echo "<div id=\"errordiv\"><h2>$errorstring</h2>$errorstring2</div>";
}
?>
  <div id="loginformdiv">
<form method="post" id="loginform" action="mailwindow.xul.php">
Username:  <br />
<input name="user" value="<? echo $standarduser ?>" /><br /><br />
Password:<br />
<input name="pass" type="password" /><br />
E-Mail:  <br />
<input name="email" size="30" value="<? echo $standardemail ?>" /><br /><br />

<? if (!$onlyusestandardserver) {
	echo "Server:  <br /><input name=\"server\" value=\"".$standardserver."\" /><br /><br />Port (optional): <br /><input name=\"port\" value=\"".$standardport."\" /><br /><br />"; 
} ?>
<? 	if (!$onlyusestandardssl) {
echo '<label for="usessl"><input name="usessl" id="usessl" type="checkbox" /> Use secure connection</label><br /><br />'; }
?>
<label for="newwindow"><input name="newwindow" id="newwindow" type="checkbox" checked="true" /> Open in new window</label><br /><br />
<!-- <label for="pop3"><input name="pop3" id="pop3" type="checkbox" /> Use POP3</label><br /> -->
  <input name="submit" value="Logon" type="submit" onclick="openMail();" /><br />
</form></div></div></div>
</body>
