var lastopened = 'none';

// JavaScript Document
function colorPreview(color, id) {

	document.getElementById('previewColor_'+id).style.backgroundColor = color;	
	document.getElementById(id).value = color;

}

function colorOpen(id) {
	
	if(lastopened != 'none') document.getElementById('colorPicker_'+lastopened).style.display = 'none';
	
	document.getElementById('colorPicker_'+id).style.display = 'block';
	if(navigator.appName == 'Microsoft Internet Explorer') document.getElementById('colorPicker_'+id).style.marginTop = '6px';
	
	lastopened = id;
	
}

function colorClose(id) {

	document.getElementById('colorPicker_'+id).style.display = 'none';

}

function colorSelect(id, color) {
	
	document.getElementById(id).value = color;
	document.getElementById('previewColor_'+id).style.backgroundColor = color;
	document.getElementById('colorPicker_'+id).style.display = 'none';
	
}