function opBig(bigSrc,tit) {
    if(bigSrc!=''){
        window.open('/core/php/bigImg.php?tit='+tit+'&path=/'+bigSrc,'','width=200,height=200');
    }
}

function _Mvr(oB){
    if(oB!=null) {
        fcol = oB.getAttribute('fcol');
        if(!fcol) {fcol='white';}
        oB.style.cursor='pointer';
        oB.style.backgroundColor=fcol;
    }
}

function _Mut(oB){
    if(oB!=null) {
        oB.style.backgroundColor='';
    }
}

function _Mck(oB){
    if(oB!=null) {
        uri = oB.getAttribute('uri');
        if(uri) {
            uri=uri.replace(/\/\//,'/');
            if(uri=='') {
                document.location.href='/';
            }else{
                document.location.href=uri;
            }
        }

    }
}
lyr=null;
xOs=6;
yOs=15;

function moveLyr(lyrObj,x,y) {
    lyrObj.top = y;
    lyrObj.left = x;
}

function mouseMove(e) {
    if (lyr) moveLyr(lyr,event.x + xOs + document.body.scrollLeft,event.y + yOs + document.body.scrollTop);
}

function showTip(which,MPX,MPY) {
    lyr = document.all[which].style;
    moveLyr(lyr,MPX + xOs + document.body.scrollLeft,MPY + yOs + document.body.scrollTop);
    document.onmousemove = mouseMove;
    lyr.visibility = "visible";
}

function mouseMove2(e) {
    if (lyr) moveLyr(lyr,event.x -200 + xOs + document.body.scrollLeft,event.y + yOs + document.body.scrollTop);
}

function showTip2(which,MPX,MPY) {
    lyr = document.all[which].style;
    moveLyr(lyr,MPX - 200 + xOs + document.body.scrollLeft,MPY + yOs + document.body.scrollTop);
    document.onmousemove = mouseMove2;
    lyr.visibility = "visible";
}

function hideTip(which) {
    document.all[which].style.visibility = "hidden";
    lyr=null;
}

function z(e, x) {
    hideTip(x);
    m= window.open(e,'ww','toolbar=yes,location=yes,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no')
    m.focus();
}
function MM_findObj(n, d) { //v4.01
    var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
        if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
        for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
        if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
    var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
    var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function retFalse() {
    return false;
}

function onItem(id) {
    oB = document.getElementById(id);
    if(!oB) {return}
    oB.onmouseover = retFalse;
    oB.onmouseout = retFalse;
    var cn = oB.childNodes
    im = (cn[0].tagName=='IMG') ? cn[0] : cn[1];
    var s = '' + im.src;
    s = s.split('.gif');
    im.src = s[0] + '_f2.gif' + s[1];
}
/* inst uchtea abit kont spon */
// stop hiding -->



function addClassName(el, sClassName) {
    var s = el.className;
    var p = s.split(" ");
    var l = p.length;
    for (var i = 0; i < l; i++) {
        if (p[i] == sClassName)
        return;
    }
    p[p.length] = sClassName;
    el.className = p.join(" ");

}

function removeClassName(el, sClassName) {
    var s = el.className;
    var p = s.split(" ");
    var np = [];
    var l = p.length;
    var j = 0;
    for (var i = 0; i < l; i++) {
        if (p[i] != sClassName)
        np[j++] = p[i];
    }
    el.className = np.join(" ");
}

function rpcSubmitForm(window, oForm, action)  {
    aData = new Array();
    for(i=0; i<oForm.elements.length; i++)  {
        try  {
            if(oForm.elements[i].name)  {
                if(oForm.elements[i].tagName == 'INPUT' && oForm.elements[i].type == "checkbox")  {
                    if(oForm.elements[i].checked)  {
                        aData[oForm.elements[i].name] = oForm.elements[i].value;
                    }
                }
                else  {
                    aData[oForm.elements[i].name] = oForm.elements[i].value;
                }

            }
        } catch(e)  {}
    }

    if(!action)
    action = oForm.action;

    rpc(window, action, 'js' + oForm.id, aData);
}

function rpc(windowObj, href, scriptId, aData, noRemove) {
    rpc_xmlhttpreq(href, windowObj, scriptId, aData, noRemove);
    return;

    /* if(!scriptId)
    scriptId = 'lastScript';
    var head=documentObj.getElementsByTagName('head').item(0);
    var old=documentObj.getElementById(scriptId);
    if(old)
    old.parentNode.removeChild(old);
    script=documentObj.createElement('script');
    script.src=href;
    script.type='text/javascript';
    script.defer=true;
    script.id=scriptId;
    void(head.appendChild(script));*/
}
var aRpcParamList = new Array();
var aRpcParamListCounter = 0;

function rpc_xmlhttp_readystatechange(paramIndex) {
    if(aRpcParamList[paramIndex])  {
        if (aRpcParamList[paramIndex]['hreq'].readyState == 4 && aRpcParamList[paramIndex]['hreq'].status == 200) {
            if(!aRpcParamList[paramIndex]['scriptId']) {
                aRpcParamList[paramIndex]['scriptId'] = 'lastScript';
            }
            var old = aRpcParamList[paramIndex]['windowObj'].document.getElementById(aRpcParamList[paramIndex]['scriptId']);
            if(old && aRpcParamList[paramIndex]['noRemove']==null) {
                old.parentNode.removeChild(old);
            }
            var script=aRpcParamList[paramIndex]['windowObj'].document.createElement('script');
            script.type='text/javascript';
            script.text = aRpcParamList[paramIndex]['hreq'].responseText;
            script.id=aRpcParamList[paramIndex]['scriptId'];

            var head=aRpcParamList[paramIndex]['windowObj'].document.getElementsByTagName('head').item(0);
            void(head.appendChild(script));
            delete aRpcParamList[paramIndex];
            aRpcParamList[paramIndex] = null;

        }
    }
    //eval(hreq.responseText);
}
function rpc_xmlhttpreq(uri, windowObj, scriptId, aData, noRemove) {
    var hreq = (windowObj.XMLHttpRequest) ? new windowObj.XMLHttpRequest() : new windowObj.ActiveXObject("Microsoft.XMLHTTP");

    if (!hreq) return;

    aRpcParamList[aRpcParamListCounter] = {'hreq':hreq, 'windowObj':windowObj, 'scriptId':scriptId, 'noRemove':noRemove};

    hreq.onreadystatechange = new Function ("rpc_xmlhttp_readystatechange(" + (aRpcParamListCounter) + ");");
    aRpcParamListCounter++;
    hreq.open("POST", uri, true);
    if(aData)  {
        hreq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        var requestData = '';
        for (var i in aData) {
            requestData += 'aData[' + i + ']' + '=' + escape(aData[i]).replace(/\+/g,'%2B') + '&'
        }
        hreq.send(requestData);
    }
    else  {
        hreq.send(null);
    }

}

function BrowserCheck() {
    if (BrowserCheck.ready) return BrowserCheck.ready;

    var ua = navigator.userAgent;
    this._ie = /msie/i.test(ua);
    this._moz = navigator.product == "Gecko";

    if (this._moz) {
        /rv\:([^\);]+)(\)|;)/.test(ua);

        this._version = RegExp.$1;
        this._ie55 = false;
        this._ie6 = false;
    } else {
        /MSIE([^\);]+)(\)|;)/.test(ua);

        this._version = RegExp.$1;
        this._ie55 = /msie 5\.5/i.test(ua);
        this._ie6 = /msie 6/i.test(ua);
    }

    BrowserCheck.ready = this;
}

BrowserCheck.prototype.getIe      = function() { return this._ie; } ;
BrowserCheck.prototype.getIe55    = function() { return this._ie55; } ;
BrowserCheck.prototype.getIe6     = function() { return this._ie6; } ;
BrowserCheck.prototype.getMoz     = function() { return this._moz; } ;
BrowserCheck.prototype.getVersion = function() { return this._version; } ;
var br_tmp = new BrowserCheck;
BrowserCheck.ie = br_tmp.getIe();
BrowserCheck.ie55 = br_tmp.getIe55();
BrowserCheck.ie6 = br_tmp.getIe6();
BrowserCheck.moz = br_tmp.getMoz();
BrowserCheck.version = br_tmp.getVersion();
br_tmp = null;


