function jf_popup(winname, url, pname, pwidth, pheight, ppos) {

if (pwidth == 0) {
 	params = 'width=' + screen.width;
 } else {
	params = 'width=' + pwidth;
}

if (pheight == 0) {
//Corrections in width and heigh are because different browsers show different
 	params += ', height=' + (screen.height - 120);
 } else {
	params += ', height=' + pheight;
}

if (pheight == 1 && pheight == 1) {params += ', fullscreen=yes';}

if (ppos == 0) {
	params += ', top=0, left=0';
 } else {
	var left   = (screen.width  - width)/2;
	var top    = (screen.height - height)/2;
	params += ', top='+top+', left='+left;
}

params += ', scrollbars=yes';
params += ', resizable=yes';
params += ', toolbar=no';
params += ', directories=no';

winname = window.open(url, pname, params);
if (window.focus) {winname.focus()};

}

