var win = null;

function popdown() {
  if (win && !win.closed) win.close();
}



function showpdf(formtext)
{ 
attr = "scrollbars=yes, width=500, height=700, resizable=yes, left="+(screen.availWidth/2-250)+", top="+(screen.availHeight/2-350);
win = window.open(formtext,"PDFDatei",attr);

if (win) return false;
  else return true;
}

function showurl(formtext)
{ 
attr = "location=yes,menubar=yes,toolbar=yes,status=yes,scrollbars=yes, width=700, height=500, resizable=yes, left="+(screen.availWidth/2-250)+", top="+(screen.availHeight/2-350);
win = window.open(formtext,"URL",attr);

if (win) return false;
  else return true;
}

window.onunload = popdown;
window.onfocus = popdown;

function reloadEdit () {

var reloadTimer = null;
//window.onload = function()
//{
    setReloadTime(5); // In this example we'll use 5 seconds.
//}
function setReloadTime(secs)
{
    if (arguments.length == 1) {
        if (reloadTimer) clearTimeout(reloadTimer);
        reloadTimer = setTimeout("setReloadTime()", Math.ceil(parseFloat(secs) * 1000));
    }
    else {
        window.location.href = window.location.href;
    }
}

}