//<![CDATA[
var rxRedNines		= /^rnpr\d{8}$/;

function submitSignUp(identifier,room,form)
{
	if (form.indexOf("Detail") != -1) {
		var txtUserID			= document.getElementById('txtUserIDDetail');
		var txtAccountNo		= document.getElementById('txtAccountNoDetail');	
	} else {
		var txtUserID			= document.getElementById('txtUserID');
		var txtAccountNo		= document.getElementById('txtAccountNo');	
	}
	
	var errors			= '';

	if (txtUserID.value == txtUserID.defaultValue)
	{
		errors = errors + '- enter your ' + identifier + ' at ' + room + '\r\n';
	}
	
	if (txtAccountNo.value.length < 6 || txtAccountNo.value.length > 255 || !rxRedNines.test(txtAccountNo.value.toLowerCase()) || txtAccountNo.value == txtAccountNo.defaultValue)
	{
		errors = errors + '- enter your valid Account Number (rnpr########) at ' + room + '\r\n';
	}

	if (errors.length > 0)
	{
		window.alert('Sorry, please correct the following before submitting the sign up form:\r\n\r\n' + errors);
		return false;
	}
	else
	{
		return true;
	}
}
//]]>