function _popup(url, width, height,name) {
// naudojamas tik paveikslams
	var maxwidth = Math.floor(screen.availWidth * 500 / 800);
	var maxheight = Math.floor(screen.availHeight * 500 / 570);
	var scroll = 'no';
	if (width > maxwidth) {
		width = maxwidth + 20;
		scroll = 'yes';
	}
	if (height > maxheight) {
		height = maxheight;
		scroll = 'yes';
	}
	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=" + scroll + ", 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);
}
