var popupVariable = null;

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

function popup(obj, width, height) {
	var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
	if (!url) {
		return true;
	}
	width = (width) ? width += 20 : 840;  // 840px*675px is the default size
	height = (height) ? height += 25 : 675;
	var args = 'width=' + width + ',height=' + height + ',resizable,scrollbars';
	popdown();
	popupVariable = window.open(url, '', args);
	if (popupVariable) {
		return false;
	}
	else {
		return true;
	}
}
