
var buick_paint = [
{
code: 'A',
name: 'Carlsbad Black',
image: '../pics/paint/Carlsbad_Black.gif',
duco: '246-2048',
webColor: "#000000",
fontColor: 'white'
},
{
code: 'B',
name: 'Dover White',
image: '../pics/paint/Dover_White.gif',
duco: '246-58162',
webColor: "#FAFBED",
fontColor: 'black'
},
{
code: 'C',
name: 'Cameo Beige',
image: '../pics/paint/Cameo_Beige.gif',
duco: '246-58181',
webColor: "#E3C096",
fontColor: 'black'
},
{
code: 'D',
name: 'Windsor Gray Metallic',
image: '../pics/paint/Windsor_Gray_Metalic.gif',
duco: '202-58345',
webColor: "#646C6F",
fontColor: 'black'
},
{
code: 'E',
name: 'Temple Gray',
image: '../pics/paint/Temple_Gray.gif',
duco: '246-58165',
webColor: "#C6CED0",
fontColor: 'black'
},
{
code: 'F',
name: 'Colonial Blue',
image: '',
duco: '?',
webColor: "#154161",
comment: 'Spring Color',
fontColor: 'white'
},
{
code: 'G',
name: 'Victoria Blue Metallic',
image: '../pics/paint/Victoria_Blue_Metalic.gif',
duco: '202-58493',
webColor: "#041243",
fontColor: 'white'
},
{
code: 'H',
name: 'Cascade Blue',
image: '../pics/paint/Cascade_Blue.gif',
duco: '246-58092',
webColor: "#306D9A",
fontColor: 'black'
},
{
code: 'K',
name: 'Stafford Blue Metallic',
image: '../pics/paint/Stafford_Blue_Metalic.gif',
duco: '202-58409',
webColor: "#497D95",
fontColor: 'black'
},
{
code: 'L',
name: 'Belfast Green Metallic',
image: '../pics/paint/Belfast_Green_Metalic.gif',
duco: '202-58159-H',
webColor: "#11321F",
fontColor: 'white'
},
{
code: 'M',
name: 'Willow Green',
image: '../pics/paint/Willow_Green.gif',
duco: '246-57734',
webColor: "#71AA81",
fontColor: 'black'
},
{
code: 'N',
name: 'Galway Green',
image: '../pics/paint/Galway_Green.gif',
duco: '246-58401-H',
webColor: "#4AA65B",
fontColor: 'black'
},
{
code: 'P',
name: 'Cadet Blue',
image: '',
duco: '?',
webColor: "#6495ED",
comment: 'Spring Color',
fontColor: 'black'
},
{
code: 'R',
name: 'Titain Red Metallic',
image: '../pics/paint/Titian_Red_Metallic.gif',
duco: '202-57728-H',
webColor: "#330E08",
fontColor: 'white'
},
{
code: 'S',
name: 'Cherokee Red',
image: '../pics/paint/Cherokee_Red.gif',
duco: '246-58343-H',
webColor: "#A61B1E",
fontColor: 'white'
},
{
code: 'T',
name: 'Gulf Turquoise',
image: '../pics/paint/Gulf_Turquoise.gif',
duco: '246-57960',
webColor: "#6CBBA6",
fontColor: 'black'
},
{
code: 'U',
name: 'Condor Yellow',
image: '../pics/paint/Condor_Yellow.gif',
duco: '246-57727',
webColor: "#F5F378",
fontColor: 'black'
},
{
code: 'W',
name: 'Spruce Green',
image: '',
duco: '?',
webColor: "#154854",
comment: 'Spring Color',
fontColor: 'white'
},
{
code: 'X',
name: 'Nile Green',
image: '',
duco: '?',
webColor: "#3E7C7B",
comment: 'Spring Color',
fontColor: 'black'
},
{
code: 'Y',
name: 'Mist Green',
image: '',
duco: '?',
webColor: "#D3EAE7",
comment: 'Spring Color',
fontColor: 'black'
}
];

function paintPopulateSelect(selectName)
		{
			d=document.getElementById(selectName);
			if(!d){return;}	
			d.options.length=buick_paint.length;
			for(var i=0;i<buick_paint.length;i++)
			{
				d.options[i].text=buick_paint[i].code;
				d.options[i].value=buick_paint[i].code;
			}
		}

function getBuickPaintByCode(code) {
	for(var i=0;i<buick_paint.length;i++)
		{
			if (buick_paint[i].code == code)
			    return buick_paint[i];
		}
	return null;
}
		
function paintShowSelect(element,value) {
    d=document.getElementById(element);
	if(!d){alert('element not found!');return;}	
    var selectedPaint = getBuickPaintByCode(value);
	if (selectedPaint == null)
	    d.innerHTML='No value found';
	else {
	var c =  '<div style="color:'+selectedPaint.fontColor+'; background:'+selectedPaint.webColor+'"><div>55-'+selectedPaint.code+'</div><div>'+selectedPaint.name+'</div><div> duco code: '+selectedPaint.duco+'</div>';
	if (selectedPaint.comment != null || selectedPaint.comment != undefined)
	    c+='<div>'+selectedPaint.comment+'</div>';
		c+='</div>';
		d.innerHTML=c;
	}
}