var oScrollbar, oScrollPane;

if (document.all || document.getElementById) {
        oScrollPane	= new ypSimpleScroll("hfd", 25, 27, 123, 141, 100);
}

function initPane()
{
        oScrollbar = HfdScroll_create('scrollbar');
        if (oScrollbar)
        {
                oScrollbar.report = adjustPane;
                oScrollPane.load();
        };
};

function adjustPane(percent) {
    if (oScrollbar) {
        oScrollPane.jumpTo(0, Math.round(percent / 100 * oScrollPane.scrollH));
    }
};

function DragInit(thumbpos) {
    ShowImageBox();
    var theHandle = document.getElementById("handle");
    var theRoot   = document.getElementById("imagebox");
    Drag.init(theHandle, theRoot);
    initPane();
    if (thumbpos && thumbpos > 0 && oScrollbar) {
        oScrollbar.gotoThumbPos(thumbpos);
    }
};

function ActivateDrag(name) {
    Drag.init(document.getElementById(name + 'Handle'), document.getElementById(name));
}

function ShowImageBox() {
    //opera Netscape 6 Netscape 4x Mozilla
    if (window.innerWidth || window.innerHeight){
        docwidth = window.innerWidth;
    }

    //IE Mozilla
    if (document.body.clientWidth || document.body.clientHeight){
        docwidth = document.body.clientWidth;
        docheight = document.body.clientHeight;
    }

    var ib = document.getElementById('imagebox');
    ib.style.left = (docwidth - 150) + 'px';
    ib.style.top = '180px';
    ib.style.visibility = 'visible';
    ib.style.display = 'block';
};

