
//
//	User JavaScript Validator File
//
//
//	stringTrim(string)
//
function stringTrim(str)
{
	s = str.replace(/^(\s)*/, '');
	s = s.replace(/(\s)*$/, '');

	return s;
}

//
//	validateEMail(string)
//
function validateEMail(str)
{
	if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str))
	{
		return true;
	}
	else
	{
		return false;
	}
}

//
//	formRegisterValidate(form)
//
function formRegisterValidate(form)
{

	var text = new String(form.reus_email.value);
	text = stringTrim(text);

	if(text.length == 0)
	{
		alert('\n\r - Error! Please Enter a Valid Email!\n\r');

		return false;
	}

	var text = new String(form.reus_password.value);
	text = stringTrim(text);

	if(text.length == 0)
	{
		alert('\n\r - Error! Please Enter the Password!\n\r');

		return false;
	}
}