function trim(s)
 {
    if(s!="")  return s.replace(/^\s*(.+?)\s*$/, "$1");
    else       return "";
 }



 function CheckEmail(str)
     {
        var email = /^[0-9a-z]([-_\.:]?[0-9a-z])*@[0-9a-z]([-_\.]?[0-9a-z])*\.[a-z]{2,4}$/i;
        if (email.test(str))  return true; 
        else return false;
     }
