var sId, errors, edtUserName, edtPassword;

function userLogin()
{
	errors = false; //initialise
	validate_edtUserName();
	validate_edtPassword();	
	if (!errors)
	{
		var data = {};
		data.dummy = ""; //we seem to get errors from the first value, so always add a dummy value first.
		data.sId = document.getElementById('sId').value;
		data.edtUserName = edtUserName;
		data.edtPassword = edtPassword;
		callModule('login/login_val.php', data);
	}
} //function login()

function validate_edtUserName(){edtUserName = validateRequiredText("edtUserName", "Please enter your email address.")};
function validate_edtPassword(){edtPassword = validateRequiredText("edtPassword", "Please enter your password.")};

function showHidePassword()
{
	var edtPassword = document.getElementById('edtPassword');
	var attr = edtPassword.getAttribute('type');
	if (attr==='text')
	{
		edtPassword.setAttribute('type', 'password');
	}
	else
	{
		edtPassword.setAttribute('type', 'text');
	}
}
