= 0) {
LOGINZA.mobile = true;
break;
};
};
} else if (LOGINZA.mobile) {
LOGINZA.mobile = true;
} else {
LOGINZA.mobile = false;
};
if (!LOGINZA.mobile && !LOGINZA.loaded) {
if(!+"\v1") {var ps = 'absolute';location.href = '#top';} else {var ps = 'fixed';};
var cldDiv = document.createElement("div");
cldDiv.id = 'loginza_auth_form';
cldDiv.style.overflow = 'visible';
cldDiv.style.backgroundColor = 'transparent';
cldDiv.style.zIndex = '10000';
cldDiv.style.position = ps;
cldDiv.style.display = 'block';
cldDiv.style.top = '0px';
cldDiv.style.left = '0px';
cldDiv.style.textAlign = 'center';
cldDiv.style.height = '878px';
cldDiv.style.width = '1247px';
cldDiv.style.paddingTop = '125px';
cldDiv.style.backgroundImage = 'url(/php/uAuth/uauth.php?img=1)';
var cntDiv = document.createElement("div");
cntDiv.style.position = 'relative';
cntDiv.style.display = 'inline';
cntDiv.style.overflow = 'visible';
var img = document.createElement("img");
img.onclick = LOGINZA.close;
img.style.position = 'relative';
img.style.left = '348px';
img.style.top = '-332px';
img.style.cursor = 'hand';
img.style.width = '7px';
img.style.height = '7px';
img.style.border = '0';
img.alt = 'X';
img.title = 'Close';
img.src = LOGINZA.service_host+'/img/widget/close.gif';
var iframe = document.createElement("iframe");
iframe.id = 'loginza_main_ifr';
iframe.width = '359';
iframe.height = '350';
if (LOGINZA.mobile) {
iframe.width = '320';
iframe.height = '480';
};
iframe.scrolling = 'no';
iframe.frameBorder = '0';
iframe.src = "javascript:'Загрузка…
'";
cntDiv.appendChild(img);
cldDiv.appendChild(cntDiv);
cldDiv.appendChild(iframe);
try {
cldDiv.style.paddingTop = (window.innerHeight-350)/2 + 'px';
} catch (e) {
cldDiv.style.paddingTop = '100px';
};
cldDiv.style.paddingLeft = 0;
cldDiv.style.height = '2000px';
cldDiv.style.width = document.body.clientWidth + 50 + 'px';
document.body.appendChild(cldDiv);
LOGINZA.loaded = true;
if (LOGINZA.ajax) {
setInterval(LOGINZA.hashParser, 500);
};
$('#loginza_main_ifr').after('');
};
if (!LOGINZA.token_url) {
alert('Error token_url value!');
} else {
var loginza_url = LOGINZA.service_host+'/api/widget.php?overlay=true&w='
+document.body.clientWidth+
'&token_url='+encodeURIComponent(LOGINZA.token_url)+
'&provider='+encodeURIComponent(LOGINZA.selected_provider)+
'&providers_set='+encodeURIComponent(LOGINZA.providers_set)+
'&lang='+encodeURIComponent(LOGINZA.lang)+
'&ajax='+(LOGINZA.ajax ? 'true' : 'false')+
(LOGINZA.mobile ? '&mobile=true' : '');
if (LOGINZA.mobile) {
document.location = loginza_url;
} else {
document.getElementById('loginza_main_ifr').setAttribute('src', loginza_url);
};
};
if (!LOGINZA.mobile) {
document.getElementById('loginza_auth_form').style.display = '';
};
return false;
};
LOGINZA.close = function () {
document.getElementById('loginza_auth_form').style.display = 'none';
};
LOGINZA.resize = function () {
var frm = document.getElementById('loginza_auth_form');
if (frm) {
frm.style.width = document.body.clientWidth + 50 + 'px';
try {
frm.style.paddingTop = (window.innerHeight-350)/2 + 'px';
} catch (e) {
frm.style.paddingTop = '100px';
};
};
};
LOGINZA.getQueryStringValue = function (link, key) {
var url_str = link;
var match = null;
var query_str = url_str.match(/^[^?]*(?:\?([^#]*))?(?:$|#.*$)/)[1]
var _query_regex = new RegExp("([^=]+)=([^&]*)&?", "g");
while ((match = _query_regex.exec(query_str)) != null)
{
if (decodeURIComponent(match[1]) == key) {
return decodeURIComponent(match[2]);
};
};
return null;
};
LOGINZA.findClass = function (str, node) {
if (document.getElementsByClassName) {
return (node || document).getElementsByClassName(str);
} else {
var node = node || document, list = node.getElementsByTagName('*'), length = list.length, Class = str.split(/\s+/), classes = Class.length, array = [], i, j, key;
for(i = 0; i < length;="" i++)="" {="" key="true;" for(j="0;" j="">< classes;="" j++)="" {if="" (list[i].classname.search('\\b'="" +="" class[j]="" +="" '\\b')="=" -1)="" {key="false;};};" if="" (key)="" {array.push(list[i]);};="" };="" return="" array;="" };="" };="" loginza.addevent="function" (obj,="" type,="" fn){="" if="" (obj.addeventlistener){="" obj.addeventlistener(="" type,="" fn,="" false);="" }="" else="" if(obj.attachevent)="" {="" obj.attachevent(="" "on"+type,="" fn="" );="" }="" else="" {="" obj["on"+type]="fn;" };="" };="" loginza.init="function" ()="" {="" loginza.addevent(window,="" 'resize',="" loginza.resize);="" loginza.addevent(document,="" 'keydown',="" function(e)="" {="" e="e" ||="" window.event;="" if="" (e.keycode="=" 27)="" {="" loginza.close();="" };="" return="" true;="" });="" };="" loginza.widget="function" ()="" {="" var="" iframenode="document.getElementById('loginza_main_ifr');" if="" (iframenode.contentdocument)="" {return="" iframenode.contentdocument;};="" if="" (iframenode.contentwindow)="" {return="" iframenode.contentwindow.document;};="" return="" iframenode.document;="" };="" loginza.hashparser="function" ()="" {="" var="" func,="" param;="" try="" {="" var="" hash="LOGINZA.widget().location.hash.substr(1);" var="" commands="hash.split(';');" var="" callbacks="[" ['token:',="" 'gettoken']="" ];="" if="" (hash="" !="LOGINZA.hash)" {="" for="" (var="" k="0;">
Вы не ввели e-mail адрес!
');
};
};
LOGINZA.auth_go = function(nick,t) {
if (nick) {
$(t).attr('disabled','disabled').val('Подождите…');
$('#auth_frame').contents().find('input[name="login"]').val(nick);
$('#auth_frame').attr('onload','LOGINZA.prov()');
$('#auth_frame').load(function(){LOGINZA.prov();});
$('#auth_frame').contents().find('#n_login').submit();
} else {
_uWnd.alert('
Вы не ввели логин!
');
};
};
function auth_go(t) {
var code = $('#auth_code input[name="code"]').val();
var seckey = $('#seckey_auth').val();
if (code) {
$(t).val('Подождите…').attr('disabled','disabled');
$('#auth_frame').contents().find('input[name="code"]').val(code);
$('#auth_frame').contents().find('input[name="seckey"]').val(seckey);
$('#auth_frame').attr('onload','LOGINZA.prov()');
$('#auth_frame').load(function(){LOGINZA.prov();});
$('#auth_frame').contents().find('#n_login').submit();
} else {
_uWnd.alert('
Вы не ввели код безопасности!
');
};
};
LOGINZA.prov = function() {
var status = $('#auth_frame').contents().find('#ident_status').php();
if ($('#auth_frame').contents().find('#ident_status').size() > 0) {
$('#auth_frame').removeAttr('onload');
$('#auth_frame').unbind('load');
if (status == '0') {
_uWnd.alert('
Неизвестная ошибка!
Пожалуйста, свяжитесь с Администратором ресурса.
');
};
if (status == '141') {
_uWnd.close('new_login')
$('#auth_frame').contents().find('#n_login').submit();
}
if (status == '5') {
_uWnd.alert('
Неверный код безопасности!
');
};
if (status == '6') {
_uWnd.alert('
В логине содержатся недопустимые символы или он слишком короткий!
');
$('#auth_button').removeAttr('disabled').val('"Авторизоваться"');
};
if (status == '7') {
_uWnd.alert('
Пользователь с таким логином уже зарегистрирован!
');
$('#auth_button').removeAttr('disabled').val('Авторизоваться');
};
if (status == '4') {
eval($('#auth_frame').contents().find('#capcha').php());
};
if (status == '2') {
_uWnd.close('secure');_uWnd.close('new_email');
new _uWnd('new_login','Установка логина','430','200',{autosize:0,close:0,modal:1},'
К сожалению, логин, под которым Вы хотите авторизоваться, уже занят.
Пожалуйста, введите в поле ниже другой логин.
');
};
if (status == '9') {
_uWnd.close('secure');_uWnd.close('new_email');
new _uWnd('new_login','Установка логина','430','200',{autosize:0,close:0,modal:1},'
Установите, пожалуйста, свой логин. Он будет отображаться на сайте.
');
};
if ((status == '10') || (status == '11')) {
if (status == '11') {_uWnd.alert('
Неверно введён e-mail адрес!
');};
_uWnd.close('secure');
new _uWnd('new_email','Установка e-mail-адреса','430','200',{autosize:0,close:0,modal:1},'
Перед авторизацией введите, пожалуйста, свой e-mail адрес в поле ниже.
');
};
};
};
LOGINZA.redirect = function () {
$('#loginza_main_ifr, #g-xpert').hide();
$('body').append('');
};
LOGINZA.addEvent(window, 'load', LOGINZA.init);
LOGINZA.addEvent(window, 'message', LOGINZA.scriptMessage);