// this will remove any ( or ) or spaces
function massagePhoneNumber(str) {
	var newphone;
	re=/\(/g;
	newphone=str.replace(re,"");
	re=/\)/g;
	newphone=newphone.replace(re,"");
	re=/ /g;
	newphone=newphone.replace(re,"");
	return newphone;
}

function isNumber(input) 
{
	for (var i=0;i<input.length;i++) 
		{
	    var ch = input.charAt(i);
	    if (isNaN(parseInt(ch))) 
			{
			return false
			}
		}
	return true
}
			
function goodPhone(str) 
{
	var retval = true
	if (str.length == 12) 
	{ 
		for (i=0; i<str.length; i++) 
		{
			if ((i == 3) || (i == 7)) {
				if ((str.charAt(i) != "-") && (str.charAt(i) != ".") && (str.charAt(i) != " "))
				{
					retval = false 
				}
			}
			else 
			{
				if ((str.charAt(i) < "0") || (str.charAt(i) > "9")) 
				{ 
					retval = false 
				}
			}
		}
		if ((str.substring(0, 3) == "000") || (str.substring(0, 3) == "111")) {
		    retval = false;
		}
	}
	else 
	{
		retval = false
	}
	
	return retval;
}
	
function goodEmail(emailstring)
{
	var isEmail = ((emailstring.indexOf("@") != -1) && (emailstring.indexOf(".") != -1));
	
	return isEmail;
}  
