checkLogin = function() {var usr=document.forms["loginForm"].userName.value;if (usr==undefined) usr = "";var pass=document.forms["loginForm"].userPass.value;if (pass==undefined) password = "";sendLoginReq(usr, pass,document.getElementById("sysSelect").selectedIndex);}
sendLoginReq = function(usr, pass, sys) { var pg = "Users"; var rp = "Default"; if (sys && sys == 1) { pg = "Customer"; rp = "CustDefault"; } $.ajax({ type: "POST", url: "services/" + pg + ".asmx/CheckLogin?rnd=" + Math.random(), data: "{user: '" + usr + "', pass: '" + pass + "', callerPage: '', logo: '', backColor: '' }", contentType: "application/json; charset=utf-8", dataType: "json", cache: false, success: function(resp) { var result = resp.d; if (result == "LOGINED") alert(Language.IDS_ERROR_USRLOGINEDALREADY); else if (result == "OK") { u37("lastSuccLogin", usr); document.location = rp+".aspx"; } else { alert(Language.IDS_ERROR_INVUSERPASS); var userPass = document.getElementById("userPass"); if (userPass.focus) userPass.focus(); } }, timeout: function(resp) { alert(Language.IDS_ERROR_SERVEROP); }, error: function(msg) { alert(Language.IDS_ERROR_SERVEROP); } }); }

