$(document).ready(function(){var bstatus=true,itimer=0;$('#frm_user').focus();var oform=$("#frm_login").validform({tipsweep:true,ajaxpost:true,tiptype:function(msg,o){if(o.type==3){showmsg(msg);}},beforesubmit:function(curform){if(!bstatus){return false;}showmsg('authenticating...','info');bstatus=false;},callback:function(data){if(data.status=="success"){showmsg('login successful. redirecting...','info');location.href="./";}else if(data.status=="error"){oform.resetform();showmsg(data.msg);$('#img_auth').click();bstatus=true;}}});$('input,select').keydown(function(){cleartimeout(itimer);$('#msg').fadeout();});var showmsg=function(smsg,stype){cleartimeout(itimer);if(typeof smsg=="string"){stype=typeof stype=="string"?stype:'error';$('#msg').html('').fadein();itimer=settimeout("$('#msg').fadeout()",5000);}else{$('#msg').fadeout();}};});