// JavaScript Document
var count = 0;
var color = "";
var win = null;
var speed = 300;
var running = true;
var	colors = new Array(14)
	colors[0]="0"
	colors[1]="1"
	colors[2]="2"
	colors[3]="3"
	colors[4]="4"
	colors[5]="5"
	colors[5]="6"
	colors[6]="7"
	colors[7]="8"
	colors[8]="9"
	colors[9]="a"
	colors[10]="b"
	colors[11]="c"
	colors[12]="d"
	colors[13]="e"
	colors[14]="f"
	
var	digit = new Array(5)

function calcColor(index) {
	color=""
	for (i=0;i<6;i++){
		digit[i]=colors[Math.round(Math.random()*14)]
		color = color+digit[i]
	}
}
function getBlurb(index) {
	calcColor(index);
	document.getElementById('dynamicCell1').innerHTML=color;// + " length: " + length;
	document.getElementById('dynamicCell1').style.backgroundColor=color;
}
function setBlurb(index) {
	document.getElementById(index).innerHTML=color;// + " length: " + length;
	document.getElementById(index).style.backgroundColor=color;
}
function step() {
	for(var j=1;j<=25;j++) {
		calcColor(j);
		document.getElementById(j).style.backgroundColor=color;
	}
}
function randomColor() {
	if(running) {
		step()
		setTimeout("randomColor()",speed);
	}
}
function startIt() {
	running = true;
	randomColor();
}
function stopIt() {
	running = false;
}
function faster() {
	if(speed>=200)
		speed = speed - 100;
}
function slower() {
	speed = speed + 100;
}
function openWindow(URL) {
	if(win==null || win.closed) 
		win = window.open(URL,URL,'left=200,top=150,width=260,height=200,toolbar=0,status=0,resizable=1');
	else 
		win.focus();
}

