// JavaScript Document

function member_login()
{
	var username = trim(document.getElementById('username').value);
	var password = trim(document.getElementById('password').value);
	var agree    = document.mem_login.agree_tc.checked;
	var error_str='** Please provide\n';
	var error    =0;	
	 
	if(!username)
	{
		error++;
		error_str=error_str+'Correct username\n';
	}
	
	if(!password)
	{
		error++;
		error_str=error_str+'Correct password\n';
	}	
	
	if(!agree)
	{
		error++;
		error_str=error_str+'Agree with terms & conditions of use\n';
	}	
	
	if(error)
	{
		alert(error_str); 
		return false;
	}
	else
	{return true;}
	
}


function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}
