var colors= new Array();

var hexbase="0123456789ABCDEF";
	function decToHex(number) {
	number = parseInt(number);
	return hexbase.charAt((number>> 4)& 0xf)+ hexbase.charAt(number& 0xf);
}

function hexToDec(number) {
	dec = 0;var a=10,b=11,c=12,d=13,e=14,f=15;
	hexNum = number;
	times = hexNum.length;h = -1;for (i=times;i>0;i--) {
	h++;decValue = parseInt(hexNum.charAt(i-1).toUpperCase(), 16);dec += decValue * Math.pow(16,h);
}
return dec;
}

function lum (r,g,b,nr){
colors = new Array();
rc = parseInt((255 - r) / nr), gc = parseInt((255 - g) / nr), bc = parseInt((255 - b) / nr);
for (i = 0 ;i < nr;i++) {
colors[i] = decToHex(r + rc * i) + "" + decToHex(g + gc * i) + "" + decToHex(b + bc * i);
}
}

function reGenCols() {

	lum(55 + parseInt(150 * Math.random()), 55 + parseInt(200 * Math.random()),55 + parseInt(200 * Math.random()), 9);
	document.getElementById('DescBox').style.backgroundColor = colors[colors.length - 4];
	document.getElementById('rg_3').style.backgroundColor = colors[parseInt(colors.length /  2)];
	document.getElementById('rg_2').style.backgroundColor = colors[colors.length - 4];
	for (i=0; i < colors.length; i++) {
		document.getElementById('rg_1_' + i).style.backgroundColor = colors[i];
	}
}