				function selectColor(feld){
				// figure our optimal window placement for popup dialog
				var posX    = event.screenX;
				var posY    = event.screenY + 20;
				var screenW = screen.width;                                 // screen size
				var screenH = screen.height - 20;                           // take taskbar into account
				if (posX + 232 > screenW) { posX = posX - 232 - 40; }       // if mouse too far right
				if (posY + 164 > screenH) { posY = posY - 164 - 80; }       // if mouse too far down
				var wPosition   = "dialogLeft:" +posX+ "; dialogTop:" +posY;
			
				var oldcolor = feld.value;
				var newcolor = showModalDialog("edit/colorpicker.html", oldcolor,
											   "dialogWidth:238px; dialogHeight: 187px; "
											   + "resizable: no; help: no; status: no; scroll: no; "
											   + wPosition);
				if (newcolor != null) { feld.value = "#"+newcolor; }
				}
