
      function validate(f){
       $catch = false;
       if(!trim(f.login.value)){
        $catch = true;
        if(t_login = document.getElementById('login_text')){
         t_login.style.color = '#FF0000';
         t_login.style.fontWeight = 'bold';
        }
       }else{
        if(t_login = document.getElementById('login_text')){
         t_login.style.cssText = '';
        }
       }

       if(!trim(f.password.value)){
        $catch = true;
        if(t_password = document.getElementById('password_text')){
         t_password.style.color = '#FF0000';
         t_password.style.fontWeight = 'bold';
        }
       }else{
        if(t_password = document.getElementById('password_text')){
         t_password.style.cssText = '';
        }
       }

       if(!trim(f.email.value)){
        $catch = true;
        if(t_email = document.getElementById('email_text')){
         t_email.style.color = '#FF0000';
         t_email.style.fontWeight = 'bold';
        }
       }else{
        if(t_email = document.getElementById('email_text')){
         t_email.style.cssText = '';
        }
       }

       if(trim(f.password.value) != trim(f.password2.value)){
        $catch = true;
        if(t_cpassword2 = document.getElementById('password2_text')){
         t_cpassword2.style.color = '#FF0000';
         t_cpassword2.style.fontWeight = 'bold';
        }
       }else{
        if(t_cpassword2 = document.getElementById('cpassword2_text')){
         t_cpassword2.style.cssText = '';
        }
       }

       return $catch ? false : true;
      }

      function trim(s){
       while(s.substring(0, 1) == ' ' || s.substring(0, 1) == '\n' || s.substring(0, 1) == '\r')
        s = s.substring(1, s.length);
       while (s.substring(s.length-1, s.length) == ' ' || s.substring(s.length-1, s.length) == '\n' || s.substring(s.length-1, s.length) == '\r')
        s = s.substring(0, s.length-1);
       return s;
      }
