<!--
function isRegExpOk() {
   var supported=0;
   if (window.RegExp) {
      var tempStr = "a";
      var tempReg = new RegExp(tempStr);
      if (tempReg.test(tempStr)) 
         supported = 1;
      }
   return supported;
}

function isValid(str) {   
   var pat="(<!--)|(-->)|(!doctype)|(<\/?a)|(<\/?abbr)|(<\/?acronym)|(<\/?address)|(<\/?applet)|(<\/?area)|(<audioscope)|(<\/?b)|(<\/?base)|(<basefont)|(<\/?bdo)|(<bgsound)|(<\/?big)|(<\/?blackface)|(<\/?blink)|";
   pat=pat+"(<\/?blockquote)|(<\/?body)|(<\/?bq)|(<br)|(<\/?button)|(<\/?caption)|(<\/?center)|(<\/?cite)|(<\/?code)|(<col)|(<colgroup)|(<\/?comment)|(<\/?dd)|(<\/?del)|(<\/?dfn)|(<\/?dir)|(<\/?div)|(<\/?dl)|";
   pat=pat+"(<\/?dt)|(<\/?em)|(<\/?embed)|(<\/?fieldset)|(<\/?fn)|(<\/?font)|(<\/?form)|(<frame)|(<\/?frameset)|(<\/?h)[0-9]|(<\/?head)|(<hr)|(<\/?html)|(<\/?i)|(<\/?iframe)|(<\/?ilayer)|(<img)|(<input)|(<\/?ins)|";
   pat=pat+"(<isindex)|(<\/?kbd)|(<keygen)|(<\/?label)|(<\/?layer)|(<\/?legend)|(<\/?li)|(<limitext)|(<link)|(<\/?listing)|(<\/?map)|(<\/?marquee)|(<\/?menu)|(<meta)|(<\/?multicol)|(<nobr)|(<\/?noembed)|(<\/?noframes)|";
   pat=pat+"(<\/?noscript)|(<\/?nosmartquotes)|(<\/?object)|(<\/?ol)|(<\/?optgroup)|(<\/?option)|(<\/?p)|(<param)|(<\/?plaintext)|(<\/?pre)|(<\/?q)|(<\/?s)|(<\/?samp)|(<\/?script)|(<\/?select)|(<\/?server)|(<\/?shadow)|";
   pat=pat+"(<\/?sidebar)|(<\/?small)|(<spacer)|(<\/?span)|(<\/?strike)|(<\/?strong)|(<\/?style)|(<\/?sub)|(<\/?sup)|(<\/?table)|(<\/?tbody)|(<\/?td)|(<\/?textarea)|(<\/?tfoot)|(<\/?th)|(<\/?thead)|(<\/?title)|(<\/?tr)|";
   pat=pat+"(<\/?tt)|(<\/?u)|(<\/?ul)|(<\/?var)|(<wbr)|(<xmp)";
   var re=new RegExp(pat,'g');   
   var temp=str.replace(String.fromCharCode(13)," ");
   temp=temp.replace(String.fromCharCode(10)," ");
   temp=temp.toLowerCase();
   temp=trim(temp);
   if (temp.length>0) {
      if (re.test(temp)==false)
         return 0;				//ok
      else
         return 1;				//html
   }
   else
      return 2;					//blank
}

function trim(str) {
   var tempstr=str;
   var passed=true;
   if (tempstr.length==0) return tempstr;
   while (passed==true) {
      if (tempstr.charAt(0)==" ") {
         tempstr=tempstr.substring(1,tempstr.length);
      }
      else {
         passed=false;break;
      }
      if (tempstr.length==0) break;
   }
   passed=true
   while (passed==true) {
      if (tempstr.charAt(tempstr.length-1)==" ") {
         tempstr=tempstr.substring(0,tempstr.length-1);
      }
      else {
         passed=false;break;
      }
      if (tempstr.length==0) break;
   }
   return tempstr;
}

function isEmail(str) {
   if (str.length>0) {
      var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
      var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
      return (!r1.test(str) && r2.test(str));
   } 
   else
      return true;
}
//-->