var loginMethod = ""; function onLogin(_1) { if (typeof (loginMethod) === "function") { loginMethod(_1); } else { if (typeof (commentControl) != "undefined") { commentControl.auth.onLogin(_1); } else { if (_1.refreshPage === true) { window.location.reload(); } else { if (ExistsAndNotEmpty(_1.successUrl)) { window.location = _1.successUrl; } } } } } function openLoginWindow(_2) { document.domain = getDomain(); loginMethod = _2.onLogin ? _2.onLogin : ""; var _3 = buildSettings(_2); window.open(_3[0], "login", _3[1]); } function buildSettings(_4) { var _5 = 800; var _6 = 500; var _7 = "http://myaccount.24.com/auth/"; var _8 = _4.refreshPage ? "?rp=" + _4.refreshPage : "?rp=false"; var _9 = _4.template ? "&t=" + _4.template : ""; var _a = _4.successUrl ? "&su=" + _4.successUrl : ""; if (_4.facebookAuth) { _7 += "OAuth/FacebookOAuth.aspx" + _8 + _9 + _a; } else { _7 += "LoginPopup.aspx" + _8 + _9 + _a; } var _b = "height=" + _6; _b += ",width=" + _5; _b += ",top=" + (screen.height - _6) / 2; _b += ",left=" + (screen.width - _5) / 2; return [_7, _b]; } function getDomain() { var _c = window.location.hostname.split("."); var _d = _c[_c.length - 1]; var _e = 2; if (_d !== "com" && _d !== "net" && _d !== "org") { _e = 3; } var _f = []; for (var i = 0; i < _e; i++) { _f.push(_c[_c.length - (i + 1)]); } return _f.reverse().join("."); } function ExistsAndNotEmpty(_11) { return (typeof (_11) != "undefined" && _11.length > 0); } 
