﻿// JScript File

    function openImage(inode)
    {
        iOldSTop = ws_ScrollTop(document,false);
        iOldSLeft = ws_ScrollLeft(document,false);
        iOldWWidth = ws_WindowWidth();
        iOldWHeight = ws_WindowHeight();
        document.getElementById('firstImgBack').style.width = ws_WindowWidth() + 'px';
        document.getElementById('firstImgBack').style.height = ws_WindowHeight() + 'px';
        document.getElementById('firstImgBack').style.left = ws_ScrollLeft(document,false) + 'px';
        document.getElementById('firstImgBack').style.top = ws_ScrollTop(document,false) + 'px';
        document.getElementById('firstImgBack').onclick = function anony() { closeImage(); };
        document.getElementById('firstImgBack').style.display = 'inline';
        document.getElementById('firstImgBack').style.zIndex = 999;
        document.getElementById('firstBigImage').src = inode ;//+ '&width=' + ws_WindowWidth()/4 + '&height=' + ws_WindowHeight()/3;
        document.getElementById('firstImgBack').width = ws_WindowWidth()/4;
        document.getElementById('firstImgBack').height = ws_WindowHeight()/3;
             
        document.getElementById('firstBigImage').onclick = function anony() { closeImage(); };
        document.getElementById('firstBigImage').style.width ='640px';// ws_WindowWidth()/2.2 + 'px';
        document.getElementById('firstBigImage').style.height = '480px';//ws_WindowHeight()/1.1 + 'px';
        document.getElementById('firstBigImage').style.left = '' + (ws_WindowWidth()/2-(ws_WindowWidth()/4.4)+ws_ScrollLeft(document,false)) + 'px';
        document.getElementById('firstBigImage').style.top = '' + (ws_WindowHeight()/2-(ws_WindowHeight()/2.2)+ws_ScrollTop(document,false)) + 'px';
        document.getElementById('firstBigImage').style.display = 'inline';
        document.getElementById('firstBigImage').style.zIndex = 999;                 

        chkScroll();
       
    }
    function chkScroll(){
 
        
        if (ws_ScrollTop(document,false)!=iOldSTop)closeImage();      
        if (ws_ScrollLeft(document,false)!=iOldSLeft)closeImage();
        if (ws_WindowWidth()!=iOldWWidth)closeImage();
        if (ws_WindowHeight()!=iOldWHeight)closeImage();
        scrolldelay = setTimeout('chkScroll()',100);
    }
    function nochkScroll() {
        clearTimeout(scrolldelay);   
    }
    function closeImage(){
        document.getElementById('firstBigImage').src = 'images/white.png';
        document.getElementById('firstImgBack').style.display = 'none';
        document.getElementById('firstBigImage').style.display = 'none';
        nochkScroll();
    }