function webim_login() {

    if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/webim/client.php?locale=ru', 'webim_', 'toolbar=0,scrollbars=0,location=0,menubar=0,width=600,height=420,resizable=1');if(this.newWindow!=null){this.newWindow.focus();this.newWindow.opener=window;}

}


function go_whois() {

    if ($('whois_domain').value) {
        $('whois_form').submit();
    }

}

function remember_value(a) {

    JsHttpRequest.query(
        caller(),
        {
            'action': func_name(arguments.callee),
            'param': a.id,
            'value': a.value
        },

        function(result, errors) {

        },
        true
    );

}

loader_image = new Image();
loader_image.src = "/img/al.gif";

function spinner(a) {

    if (a == '1') {
        $('spinner').src=loader_image.src;
    } else {
        $('spinner').src='/img/empty.gif';
    }

}

function caller() {

    return location.pathname.substring(location.pathname.lastIndexOf('/') + 1);

}

function func_name(func) {

    var p=/function\s+(\w+)/.exec(func + "");
    return p?p[1]:null;

}

function checkEnter(e) {

    characterCode = e.keyCode;

    if (characterCode == 13) {
        return true;
    } else {
        return false;
    }

}

function getCookie(name) {

    var cookie = " " + document.cookie;
    var search = " " + name + "=";
    var setStr = null;
    var offset = 0;
    var end = 0;
    if (cookie.length > 0) {
        offset = cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = cookie.indexOf(";", offset)
            if (end == -1) {
                end = cookie.length;
            }
            setStr = unescape(cookie.substring(offset, end));
        }
    }

    return(setStr);

}

