popup.default_options = "sr";
popup.default_width = 500;
popup.default_height = 325;
function popup(url, width, height, options, name)
{
	if( options == null ) options = popup.default_options;
	if( width == null ) width = popup.default_width;
	if( height == null ) height = popup.default_height = 300;

	x = Math.floor((screen.availWidth-width)/2);
	y = Math.floor((screen.availHeight-height)/2);
	parm =  'width='        + width;
	parm += ',height='      + height;
	parm += ',screenX='     + x;
	parm += ',left='        + x;
	parm += ',screenY='     + y;
	parm += ',top='         + y;
	parm += ',resizable='   + ((options.indexOf('r')>-1)?'yes':'no');
	parm += ',scrollbars='  + ((options.indexOf('s')>-1)?'yes':'no');
	parm += ',menubar='     + ((options.indexOf('m')>-1)?'yes':'no');
	parm += ',directories=' + ((options.indexOf('d')>-1)?'yes':'no');
	parm += ',location='    + ((options.indexOf('l')>-1)?'yes':'no');
	parm += ',status='      + ((options.indexOf('t')>-1)?'yes':'no');
	popupwin = window.open(url,name,parm);

//    popupwin.moveTo(x, y);
//    popupwin.resizeTo(width, height);
    popupwin.focus();
}
function showElement(elmID) {
	if(document.getElementById(elmID).style.display == "none") {
		document.getElementById(elmID).style.display = "";
	} else {
		document.getElementById(elmID).style.display = "none";
	}
}
