function _popup(url, width, height,name) {
	if (width==0) { width=screen.width; }
	if (height==0) { height=screen.height; }
	if (name!=true) { var rnd = (Math.round((Math.random()*999)+1)); }
	else { var rnd="x"; }
    var top=Math.floor((screen.availHeight-height)/2)-(screen.height-screen.availHeight);
    var left=Math.floor((screen.availWidth-width)/2)-(screen.width-screen.availWidth);
    window.open(url, "w"+rnd, "top="+top+", left="+left+", width="+width+", height="+height+", buttons=no, scrollbars=no, location=no, menubar=no, resizable=no, status=no, directories=no, toolbar=no");
    void(0);
}

function _popupR(url,width,height,name) {
	if (width==0) { width=screen.width; }
	if (height==0) { height=screen.height; }
	if (name!=true) { var rnd = (Math.round((Math.random()*999)+1)); }
	else { var rnd="x"; }
    var top=Math.floor((screen.availHeight-height)/2)-(screen.height-screen.availHeight);
    var left=Math.floor((screen.availWidth-width)/2)-(screen.width-screen.availWidth);
	window.open(url, "w"+rnd, "top="+top+",left="+left+",width="+width+",height="+height+",buttons=no,scrollbars=yes,location=no,menubar=no,resizable=yes,status=no,directories=no,toolbar=no");
	void(0);
}

function getImageURL(currentURL)
{
    var height = 700;
    var width = 700;
    var top=Math.floor((screen.availHeight-height)/2)-(screen.height-screen.availHeight);
    var left=Math.floor((screen.availWidth-width)/2)-(screen.width-screen.availWidth);
    window.open("/siteimages?image_name=" + currentURL, 
        "Paveiksleliai", 
        "top=" + top + ",left=" + left + ",width=" + width + ",height=" + 
            height + ",buttons=no,scrollbars=yes,menubar=no,resizable=yes,status=yes,toolbar=no");
    return false;
}

function setFileName(name)
{
    /*name = name.substring(1);*/
    this.opener.document.getElementById('src').value = name;
    this.opener.showPreviewImage(name);
    window.close();
}

var current_help_id = null;
var over_count = 0;

function show_inline_help(id)
{
    if (current_help_id != id)
    {
        if (current_help_id != null)
            document.getElementById(current_help_id).style.display = 'none';
        document.getElementById(id).style.display = 'block';
        current_help_id = id;
    }
    over_count++;
}

function hide_inline_help(id)
{
    setTimeout("_hide_inline_help('" + id + "')", 500);
}

function _hide_inline_help(id)
{
    over_count--;
    if (over_count == 0)
    {
        document.getElementById(id).style.display = 'none';
        current_help_id = null;
    }
}

