<!--
if (document.images)
	{
		pic1= new Image(160,23); 
		pic1.src="/main/paw_r.gif"; 
	}
	$(document).ready(function()
{
	$("#frmlogin").submit(function()
	{
		var beforepass = document.forms['frmlogin'].password.value;
		var username1 = document.forms['frmlogin'].username.value;
		username1 = username1.toLowerCase();
		beforepass = beforepass + "&&"+username1;		
		var passval=hex_sha1(beforepass);
        //remove all the class add the messagebox classes and start fading
        $("#msgbox").removeClass().addClass('messagebox').text('Validating....').fadeIn(1000);
        //check the username exists or not from ajax
        $.post("/loginsubmit.php",{ username:username1,password:passval,rand:Math.random() } ,function(data)
        {
          if(data=='yes') //if correct login detail
          {
                $("#msgbox").fadeTo(200,0.1,function()  //start fading the messagebox
                {
                  //add message and change the class of the box and start fading
                  $(this).html('Logging in.....').addClass('messageboxok').fadeTo(900,1,
                  function()
                  {
                     //redirect to secure page
                     window.location.reload();
					 
                  });
                });
          }
          else
          {
                $("#msgbox").fadeTo(200,0.1,function() //start fading the messagebox
                {
                  //add message and change the class of the box and start fading
                  $(this).html('Username/Password Incorrect').addClass('messageboxerror').fadeTo(900,1);
                });
          }
       });
       return false;//not to post the  form physically
});
//now call the ajax also focus move from 
	$("#password").blur(function()
	{
		$("#login_form").trigger('submit');
	});

});	
  //-->
