
		function strltrim() {
				return this.replace(/^\s+/,'');
		}
		function strrtrim() {
				return this.replace(/\s+$/,'');
		}
		function strtrim() {
				return this.replace(/^\s+/,'').replace(/\s+$/,'');
		}
		String.prototype.ltrim = strltrim;
		String.prototype.rtrim = strrtrim;
		String.prototype.trim = strtrim;
						

//------------------------------------------------------------------------
function checkBlank(control, msg) {
	if(control.value.trim()=='') {
		alert(msg);
		control.focus();
		return true;
	}	
	return false;
}
//------------------------------------------------------------------------
function confirmEmail ( strEmail )
{
	var indexAt = strEmail.indexOf("@");

	if (indexAt == -1)
	{
		return "Missing @ sign, expecting address like myname@myisp.com";
	}
	else
	{
		var saEmail = strEmail.split("@");

		if (saEmail.length > 2)
		{
			return "Too many @ signs, expecting address like myname@myisp.com";
		}
		else
		{
			if (saEmail[0].length == 0)
			{
				return "Name too short, expecting address like myname@myisp.com";
			}
			else
			{
				if (saEmail[1].length == 0)
				{
					return "Domain name too short, expecting address like myname@myisp.com";
				}
				else
				{
					if ((saEmail[1].indexOf(".") == -1) | 
							(saEmail[1].indexOf(".") == 0) |
							(saEmail[1].indexOf(".") == (saEmail[1].length-1)))
					{
						return "Domain name invalid, expecting address like myname@myisp.com";
					}
					else
					{
						return "";
					}
				}
			}
		}
	}
}
