// Javascript
// Common Validation Functions

// Function Returns True if the String has a value
// Otherwise Returns False
function BlankField( stringValue )
{
	if ( stringValue.replace(/(^\s+)|(\s+$)/g, '').length < 1 )
		return true;
	else
		return false;
}

// Uses Regular Expressions to check for a valid E-mail Address
// If valid returns true, otherwise it returns false
function ValidEmail(strValue)
{
    var valid = true;
    var regExp = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
    var regExp2 = /(\s+)|(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;

    if ( (strValue.search(regExp)) == -1 || strValue.search(regExp2) != -1)
		valid = false;

    return valid;
}
