function IsValidEmail(asTempString)
{
   var atCount = 0;
   var periodCount = 0;
   var strLen = asTempString.length;
   var i;
   var temp;
   var validchar= /^\w|[@.-]$/; //valid char = a-z, A-Z, @ , . , _ , -

   if (asTempString == '')
     return false;
     
   for (i = 0; i < strLen; i++)
      {
      temp = asTempString.substring(i, i+1);
	  if (temp == '@') 
         atCount++;
      if (temp == '.') 
         periodCount++;
	  if (!validchar.test(temp)){
//		alert(temp)
		return false;
		}
	  }
   if ((atCount == 1) && (periodCount > 0))
      return true;
   else
      return false;

}

/*function fIsPhoneFaxNumber(asTestString) {
	if (asTestString.length == 0) return false;
	if (asTestString.match(/[^0-9, ]/)) // If not these chars (0-9, comma, space) .... use comma and space to separate when the phone no is more than one
		return false;
	else
		return true;
}

function fIsAlphaNumeric(asTestString) {
	if (asTestString.length == 0) return false;
	if (asTestString.match(/[^0-9a-zA-Z_.-]/)) 
		return false;
	else
		return true;
}
*/
function CheckInvalidChar(asTestString, aopatternChar) {
	if (asTestString.length == 0) return true;
	if (asTestString.match(aopatternChar)) 
		return true;
	else
		return false;
}
