var window_width = parseFloat($(window).width()), window_height = parseFloat($(window).height()); $(document).ready(function () { $('#root').hide(); var url = 'ajax.php', type = 'POST'; root = $('#root').attr('href'); $(document).on('click', '#ok', function () { $('#biskvitki').remove(); $.ajax({ type: 'POST', url: root + 'home/setcookies', data: { set_cookies: 1 } }); }); $(window).scroll(function () { if ($(this).scrollTop() > 370) $('#back_to_top').fadeIn(); else $('#back_to_top').fadeOut(); }); $('#back_to_top').click(function () { $('body,html').animate({ scrollTop: 0 }, 800); return false; }); $(document).on('click', '.hiks,.djam', function () { close_djam(); }); /** * * @description Опресняване на страницата * @returns {undefined} */ function refresh(url) { if (url) { window.location.href = url; } else { window.location.href = window.location.href; } } // $(document).on('keyup input click', 'table#login_forma input', function(key) { // var name = $('table#login_forma input[name=name]').val().length, // pass = $('table#login_forma input[name=password]').val().length; // if (name > 6 && pass > 6) { // $('table#login_forma button').attr('disabled', false); // if (key.keyCode == 13) { // login(type, url); // } // } else { // $('table#login_forma button').attr('disabled', true); // } // }); // $(document).on('click', 'table#login_forma button', function() { // login(type, url); // }); //Рефрешване на капчата $('.refresh').click(function () { var d = new Date(); $('img.captcha').attr('src', root + 'home/captchaimage/' + '?' + d.getTime()); }); $('#in').click(function () { login_djam('#3a1d03'); }); }); //function login_djam(color) { // djam('
| Име: | \n\ //\n\ // |
| Парола: | \n\ //\n\ // |
| затвори | \n\ //\n\ // |
');
$('.wait').css({
'top': (window_height / 2) - (parseFloat($('.wait').height()) / 2),
'left': (window_width / 2) - (parseFloat($('.wait').width()) / 2)
});
}
/**
*
* @description Затваряне на чакалня
* @returns {unresolved}
*/
function close_wait() {
$('.wait_').remove();
$('.wait').remove();
}
/**
*
* @description Отваряне на нов прозорец
* @param {string} url
* @returns {null}
*/
function openWin(url) {
window.open(url);
return null;
}
/**
*
* @description Отваряне на нов прозорец с по-малки размери
* @example openWinMini({url: 'http://hankrum.info', width: 800, height: 500});
* @see default - url: 'http://hankrum.info', width: 1000, height: 700
* @param {object} params
* @returns {null}
*/
function openWinMini(params) {
var object;
if (params === undefined)
object = {};
else
object = params;
if (parseInt(object.width) === 0 || object.width === undefined)
object.width = 1000;
if (parseInt(object.height) === 0 || object.height === undefined)
object.height = 700;
if (String(object.url) === null || object.url === undefined)
object.url = 'http://hankrum.info';
var size = 'width = ' + object.width + ', ' + 'height = ' + object.height;
window.open(object.url, object.name, size);
return null;
}
/**
*
* @description Затваряне на нов прозорец
* @returns {null}
*/
function closeIt() {
window.close();
return null;
}