function loginsub(e,s){var o=jQuery("#"+e).attr("action");o=o||"user.php?mod=login&op=logging&action=login&loginsubmit=yes";var t=jQuery("#"+e).serialize();jQuery.post(o+"&returnType=json",t,function(e){e.success?(showmessage(e.success.message,"success","",1,"right-top"),location.href=e.success.url_forward):e.error?(clearpwd(),showmessage(e.error,"danger","",1,"right-top"),jQuery("#"+s).html(e.error)):(clearpwd(),showmessage(__lang.system_busy,"danger","",1,"right-top"),jQuery("#"+s).html(__lang.system_busy))},"json")}function lostpass(e,s,o){var t=jQuery("#"+s).attr("action");t=t||"user.php?mod=login&op=logging&action=lostpasswd&lostpwsubmit=yes";var r=jQuery("#"+s).serialize();jQuery.post(t+"&returnType=json",r,function(s){if(s.success){var t=jQuery("#"+e);console.log(t);var r="http://mail."+s.success.email.split("@")[1];t.find(".Mtitle").html(__lang.password_back_email_sent_successfully),t.find(".Mbody").html(s.success.msg),t.find(".modal-footer .toMail").on("click",function(){window.location.href=r}),t.find(".modal-footer").show()}else s.error?jQuery("#"+o).html(s.error):jQuery("#"+o).html(__lang.system_busy)},"json")}function setImage(e,s){var o=document.documentElement.clientWidth,t=document.documentElement.clientHeight;o/t>e/s?(w=o,h=w*(s/e)):(h=t,w=h*(e/s))}