var dontclosehelp;


function getVkb(name) {
    grmDialog = window.open("reqvkb.html", name,"width=600, height=300, scrollbars=yes, resizable=yes");
    grmDialog.focus();
    return void(0);
};


function adjustIFrameSize (iframeWindow) {
    var frameheight = 500;
    var height = document.body.clientHeight;
    var iframeElement;
    if (iframeWindow.document.height) {
        iframeElement = document.getElementById(iframeWindow.name);
        frameheight = iframeWindow.document.height;
    }
    else if (document.all) {
        iframeElement = document.all[iframeWindow.name];
        if (iframeWindow.document.compatMode && iframeWindow.document.compatMode != 'BackCompat')
            frameheight = iframeWindow.document.documentElement.scrollHeight + 5;
        else
            frameheight = iframeWindow.document.body.scrollHeight + 5;
    }
    if (frameheight > height - 150){
        if (document.getElementById("closeinfoframe")) //opera
            document.getElementById("closeinfoframe").style.top = '30px';
        else if (document.getElementById("closeinfo"))
            document.getElementById("closeinfo").style.top = '30px';
        iframeElement.style.top = '30px';
        if (frameheight > height - 50)
            frameheight = height - 50;
    }
    iframeElement.style.height = frameheight + 'px';
    dontclosehelp = 0;
}

function showhelp(Src,w)
{
    if (w == 0)
        w = 0.8;
    if (w < 1)
        w *= document.body.clientWidth;
    var x = (document.body.clientWidth-w)/2;
    var realw = (!document.all || document.compatMode && document.compatMode != 'BackCompat')?w+5:w;
    document.getElementById("info").style.visibility = "visible";
    if (window.opera){
        document.getElementById("closeinfo").innerHTML = '<iframe id="closeinfoframe" name="closeinfoframe" src="closeinfo.html" width="14" height="14" style="position: absolute; border: 0; margin:0; top: 90px; left: '+ (x + realw - 15) + 'px;" />';
    } else {
        document.getElementById("closeinfo").style.left = (x+realw-15) + 'px';
        document.getElementById("closeinfo").style.top = '90px';
    }
    document.getElementById("info").innerHTML = '<iframe id="infoframe" name="infoframe" src="' + Src + '" width="' + w + '" height="500" style="position: absolute; top:90px; left: '+ x +'px;" />';
    document.getElementById("closeinfo").style.visibility = "visible";
    dontclosehelp = 1;
    return false;
}
function closehelp(){
    document.getElementById("closeinfo").style.visibility = "hidden";
    document.getElementById("info").style.visibility = "hidden";
}
function bodyclosehelp(){
    if (dontclosehelp == 0)
        closehelp();
}
