   function toggle(layer,kind,task) 
   {
      if (kind=="visibility") {
         if (task=="hide")
            vis_to = "hidden";
         else if (task=="show")
            vis_to = "visible";
         else {
            vis_to = (document.getElementById(layer).style.visibility=="hidden") ? "visible" : "hidden";
         }
      } else if (kind=="display") {
         if (task=="hide")
            dis_to = "none";
         else if (task=="show")
            dis_to = "block";
         else {
            dis_to = (document.getElementById(layer).style.display=="none") ? "block" : "none";
         }
      }
      (kind=="display") ? document.getElementById(layer).style.display = dis_to : document.getElementById(layer).style.visibility = vis_to;
   }

   function validateEmail(email)
   {
      
      if(email.length <= 0) {
         return false;
      }
      var splitted = email.match("^(.+)@(.+)$");
      if (splitted == null) return false;
      if (splitted[1] != null ) {
         var regexp_user=/^\w+[\w-_\.]*$/;
         if(splitted[1].match(regexp_user) == null) return false;
      }
      if(splitted[2] != null) {
         var regexp_domain=/^\w+[\w-\.]*\.[A-Za-z]{2,4}$/;
         if(splitted[2].match(regexp_domain) == null) {
            var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
            if(splitted[2].match(regexp_ip) == null) return false;
         }
         return true;
      }
      return false;
   }