function ncsrgb(ncs1, ncs2){
	//ncs1 = eg "2030"
	//ncs2 = eg "Y30R"
	blackness = ncs1.substr(0,2);
	chromaticness = ncs1.substr(2,2);
	whiteness = 100 - blackness - chromaticness;

	//if ncs2="Y30G" then color1=Y and color2=G and strength=30
	color1=ncs2.substr(0,1);
	color2=ncs2.substr(3,1);
	strength=ncs2.substr(1,2);

	if (color2==null) strength=90;

	//neutral
	if (color1=='N') {
		r = Math.round(whiteness*2.55);
		g = Math.round(whiteness*2.55);
		b = Math.round(whiteness*2.55);
	}

	//red (and blue)

	if (color1=='R') {
		r = Math.round(2.55*chromaticness*(100-strength)/100 + 2.55*whiteness);
		g = Math.round(2.55*whiteness);
		b = Math.round(chromaticness*(strength/100)*2.55 + 2.55*whiteness);
	}

	//blue (and green)

	if (color1=='B') {
		r = Math.round(2.55*whiteness);
		g = Math.round(2.55*chromaticness*strength/100 + 2.55*whiteness);
		b = Math.round(2.55*chromaticness*(100-strength)/100 + 2.55*whiteness);
	}
	//green (and yellow)
	//green is 100% and red is less than 100%

	if (color1=='G') {
		r = Math.round(2.55*chromaticness*strength/100 + 2.55*whiteness);
		g = Math.round(2.55*chromaticness + 2.55*whiteness);
		b = Math.round(2.55*whiteness);
	}

	//yellow (and red)
	//red is 100% and green is less than 100%

	if (color1=='Y'){
		r = Math.round(2.55*chromaticness + 2.55*whiteness);
		g = Math.round(2.55*chromaticness*(100-strength)/100 + 2.55*whiteness);
		b = Math.round(2.55*whiteness);
	}

	var rgb = new Array(r, g, b);
	
	if(ncs1 && ncs2){
		$('.'+ncs1+''+ncs2).css("background-color","rgb("+rgb[0]+","+rgb[1]+","+rgb[2]+")");
	}

	return (rgb);
	
}
