function input(name, value) {
	ip = document.createElement('input');
	ip.type = 'hidden';
	ip.name = name;
	ip.value = value;
	return ip;
}

function directLogin() {
	var form = document.getElementById('loginform');
	var user = document.getElementById('un');
	var pass = document.getElementById('pw');
	var slct = document.getElementById('type');

	loginType = slct.options[slct.selectedIndex].value;

	if (loginType == 'stat') {
		form.appendChild(input('cryptEnabled','1'));
		form.action = 'http://stats.j-db.nl/login/';
		user.name = 'username';
		pass.name = 'password';
		pass.value = cryptStatsPassword(pass.value);
		return true;

	} else if (loginType == 'mail') {
		form.appendChild(input('logout','0'));
		form.appendChild(input('rootdir',''));
		form.appendChild(input('port','110'));
		form.appendChild(input('host','212.79.251.2'));
		form.appendChild(input('int_lang','eng/'));
		form.action = 'http://webmail.beursstraat.nl/source/index.php';
		user.name = 'user';
		pass.name = 'password';
		return true;
	}
	return false;
}
