self.name = "mainframe";

isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && document.readyState //Opera 7+
isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isNetscape4=document.layers //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla или Netscape 6.*


nn4 = (document.layers) ? true : false;
ie4 = (document.all) ? true : false;
dom = (document.createTextNode)? true : false;

function pop(fileUrl, winW, winH, winN, scrollB) {
    var winWidth = (winW)? winW : 740;
    var winHeight = (winH)? winH : 520;
    var winName = (winN)? winN : 'popupWin'
    var scrollBars = "yes";
    if (nn4 || ie4 || dom) {
        if (screen.width < winWidth + 50) { winWidth = screen.width - 50; scrollbars = 'yes' }
        if (screen.height < winHeight + 100) { winHeight = screen.height - 100; scrollbars = 'yes' }
        posX = Math.round((screen.width - winWidth)/2);
        posY = Math.round((screen.height - winHeight)/2);
        posCode = (nn4)? "screenX="+posX+",screenY="+posY : "left="+posX+",top="+posY;
    } else {
        posCode = "";
    }
    var popupWin = window.open(fileUrl, winName,"menubar=no,toolbar=no,scrollbars=" + scrollBars + ",status=yes,resizable=yes,width=" + winWidth + ",height=" + winHeight + "," + posCode);
    if (popupWin) popupWin.focus();
}


function pop2(fileUrl, winW, winH, winN, scrollB) {
    var winWidth = (winW)? winW : 740;
    var winHeight = (winH)? winH : 520;
    var winName = (winN)? winN : 'popupWin'
    var scrollBars = "yes";
    if (nn4 || ie4 || dom) {
        if (screen.width < winWidth + 50) { winWidth = screen.width - 50; scrollbars = 'yes' }
        if (screen.height < winHeight + 100) { winHeight = screen.height - 100; scrollbars = 'yes' }
        posX = Math.round((screen.width - winWidth)/2);
        posY = Math.round((screen.height - winHeight)/2);
        posCode = (nn4)? "screenX="+posX+",screenY="+posY : "left="+posX+",top="+posY;
    } else {
        posCode = "";
    }
    var popupWin = window.open(fileUrl, winName,"menubar=yes,toolbar=no,scrollbars=" + scrollBars + ",status=yes,resizable=yes,width=" + winWidth + ",height=" + winHeight + "," + posCode);
    if (popupWin) popupWin.focus();
}

mousex = 0
mousey = 0
if(isNetscape4) document.captureEvents(Event.MOUSEMOVE)
if(isMSIE || isOpera7){
  document.onmousemove=function(){
    mousex=event.clientX+document.body.scrollLeft
    mousey=event.clientY+document.body.scrollTop
    return true
  }
}else if(isOpera){
  document.onmousemove=function(){
    mousex=event.clientX
    mousey=event.clientY
    return true
  }
}else if(isNetscape4 || isMozilla){
  document.onmousemove=function(e){
    mousex = e.pageX
    mousey = e.pageY
    return true
  }  
}



function move(n) {
    document.getElementById("info"+n).style.top = mousey + 5;
    document.getElementById("info"+n).style.left = mousex + 5;

}

function info(n) {
    var o = document.getElementById("info"+n);
    o.style.top = mousey + 5;
    o.style.left = mousex + 5;
    o.style.display = 'block';
}

function hide(n) {
    document.getElementById("info"+n).style.display = 'none';
}

