function custompopup(urlpage, winname, height, width, menubar, toolbar, status, scrollbars, resizable) {
	var h, w;
	if (height <= screen.height) {
		h = Math.round((screen.height - height) / 2);
	} else {
		height = screen.height;
		h = 0;
	}
	if (width <= screen.width) {
		w = Math.round((screen.width - width) / 2);
	} else {
		width = screen.width;
		w = 0;
	}
	var options = "'menubar=" + menubar + ",toolbar=" + toolbar + ",status=" + status + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",width=" + width + ",height=" + height + ",left=" + w + ",top=" + h + "'";
	window.open (urlpage, winname , options); 
}

function popup(urlpage, height, width){
	var h, w;
	if (height <= screen.height) {
		h = Math.round((screen.height - height) / 2);
	} else {
		height = screen.height;
		h = 0;
	}
	if (width <= screen.width) {
		w = Math.round((screen.width - width) / 2);
	} else {
		width = screen.width;
		w = 0;
	}
	var options = "'menubar=no,toolbar=no,status=yes,scrollbars=yes,resizable=no,width=" + width + ",height=" + height + ",left=" + w + ",top=" + h + "'";
	window.open (urlpage, "windowloc",options); 
}

function toggleImage(obj) {
	var idx = obj.src.lastIndexOf("/") + 1;
	var prefix = obj.src.substring(0, idx);
	var suffix = obj.src.substring(idx, obj.src.length);
	var tmp = suffix.split("_");
	if (tmp.length == 2) { obj.src = prefix + tmp[0] + (tmp[1]=="off.jpg"?"_on.jpg":"_off.jpg"); }
}
