function IsEmpty (txt){ var c,i; if (txt == "") return true; for (i=0; i<txt.length; i++) { c = txt.charAt(i);  if ( c!=" " && c!="\n" && c!="\t" && c!="\r") return false; } return true; }
function openWindow(theURL, winName, features) {
   new_window = window.open(theURL,winName,features);
}
function CheckEmail(cValue){    return cValue.match(/^[0-9a-zA-Z]+([0-9a-zA-Z.\-])*@([0-9a-zA-Z]+[.\-])+[a-zA-Z]+$/);}
function CheckForm(){
   var f=document.frm;
   if (IsEmpty(f.name.value)){
      alert("Введите ваше имя или название организации!");
      f.name.focus();
      return false;
   }
   if (f.email.value!='' && !CheckEmail(f.email.value)){
      alert("Введите правильный e-mail!");
      f.email.focus();
      return false;
   }
   if (IsEmpty(f.text.value)){
      alert("Введите текст предложения!");
      f.text.focus();
      return false;
   }
   return true;
}

function IsEmpty (txt){ var c,i; if (txt == "") return true; for (i=0; i<txt.length; i++) { c = txt.charAt(i);  if ( c!=" " && c!="\n" && c!="\t" && c!="\r") return false; } return true; }
function CheckEmail(cValue){    return cValue.match(/^[0-9a-zA-Z]+([0-9a-zA-Z.\-])*@([0-9a-zA-Z]+[.\-])+[a-zA-Z]+$/);}
function CheckForm(){
   var f=document.frm;
   if (IsEmpty(f.email.value)){
      alert("Введите свой e-mail!");
      f.email.focus();
      return false;
   }
   if (!CheckEmail(f.email.value)){
      alert("Введите правильный e-mail!");
      f.email.focus();
      return false;
   }
   if (IsEmpty(f.name.value)){
      alert("Введите ваше имя или название организации!");
      f.name.focus();
      return false;
   }
   window.open('about:blank', 'welldone','width=500,height=250,resizable=0,menubar=0,scrollbars=0').focus();
   return true;
}
