<!--
function trim(str)
{
  return( (""+str).replace(/^\s+/,'').replace(/\s+$/,'') );
}
function Trim(str)
{
  return(trim(str));
}

function isValidEmail(input_str) {
  // are regular expressions supported?
  var supported = 0;
  var result = 0;
  if (window.RegExp) {
    var tempStr = "a";
    var tempReg = new RegExp(tempStr);
    if (tempReg.test(tempStr)) supported = 1;
  }
  if (!supported) 
    result = (input_str.indexOf(".") > 2) && (input_str.indexOf("@") > 0);
  else {
    var emailRegExp = new RegExp("^([_a-z0-9-]+)(\\.[_a-z0-9-]+)*@([a-z0-9-]+)(\\.[a-z0-9-]+)*(\\.[a-z]{2,4})$");
    result = (emailRegExp.test(input_str.toLowerCase()));
  }
  return (result);
}
//-->
