function trim(str)
{
   return str.replace(/^\s+|\s+$/g,'');
}

function chkspaces(chkStr,fieldname)
{
	if (chkStr.indexOf(" ")>=0)
	{
		alert("The "+fieldname+" has spaces in it.");
		return false;
	}
	else
	{
		return true;
	}
}

function emailCheck(emailStr){
var str=emailStr
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
return true
else{
alert("\nNot a valid input in the following field(s):\n\n\t Email Address")
	return false;
}
	return true
}
