var coloropt_last = null;
	
function updateColor(fldName, color_id) {
	var fld = document.getElementById(fldName);
	fld.value = color_id;
	
	updateColorHighlight(color_id);
}

function updateColorSelect(fldName) {
	var fld = document.getElementById(fldName);
	updateColorHighlight(fld.value);
}

function updateColorHighlight(color_id) {
	var coloropt = document.getElementById('coloropt'+color_id);
	if (coloropt_last != coloropt) {
		coloropt.className='coloroptssel';
		
		if(coloropt_last) {
			coloropt_last.className='coloropts';
		}
		coloropt_last = coloropt;
	}
}

function setDefaultColor(fldName) {
	var fld = document.getElementById(fldName);
	coloropt_last = document.getElementById('coloropt'+fld.value);
	coloropt_last.className='coloroptssel';
}
