  U =
{
  doSubmit : function() {
               if ($('#UName').val().length == 0) {
          alert("! ת.ז. שגוי");
          $('#UName').focus();
              }
              else if (!/\d+/.test($('#UName').val())) {
                 alert("! ת.ז. שגוי");
                 $('#UName').focus();
        }
       
        else if ($('#UID').val().length == 0) {
            
           
            alert("! שדה מזהה שגוי");
            $('#UID').focus();
          
        }
         else if ($('#UToken').val().length == 0) {
          alert("! סיסמא שגויה");
          $('#UToken').focus();
        }
      
        else{
                        $("#__VIEWSTATE").attr('disabled', 'disabled');
             
                        var frm = $("form"); 
            frm.attr( 'action' ,'http://www.shadow.co.il/Neemanim_WebLogin/authenticate.aspx');
                        frm.attr( 'method' ,'post');             
                        frm.submit();
          }
      
    }  

};  

$(document).ready(function() {
   $(window).load( function() {
   $("#UName").focus();
   });

   $('#UName').keydown(function(event) {
    if (event.keyCode == '13') {
        $("#UID").focus();
   event.returnValue  = false;
   }
});
$('#UID').keydown(function(event) {
    if (event.keyCode == '13') {
        $("#UToken").focus();
   event.returnValue  = false;
   }
  });
  $('#UToken').keydown(function(event) {
    if (event.keyCode == '13') {
     U.doSubmit();
   event.returnValue  = false;
   }
  });
  $('#SUBMIT1').click(function() {
  U.doSubmit();
});
  $('#SUBMIT2').click(function() {
   window.location='http://www.shadow.co.il/Neemanim_WebLogin/authenticate.aspx?f=1';
});
  // Focus
$('#UName').focus(function() {
  this.select();
});
$('#UID').focus(function() {
  this.select();
});
$('#UToken').focus(function() {
  this.select();
});

});

