
var DynamicDiv = new Array("#86C32A","#86C32A","#86C32A","#86C32A","#86C32A","#86C32A","#86C32A","#86C32A","#86C32A","#86C32A","#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A", "#86C32A",
"transparent","transparent","transparent","transparent","transparent","transparent","transparent","transparent","transparent","transparent","transparent", "transparent", "transparent", "transparent", "transparent", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black");



function addDynamicComponents(){
	
	var container = document.getElementById("divbox");
	var newDIV = new Array();
	
	
	
 	for(var x = 0; x < DynamicDiv.length; x++){
 		newDIV[x] = document.createElement("div");
 		//newDIV[x].style = "float:left; width:10px; height:10px;";
 		
 		
 		
 		
 		//newDIV[x].style.border = "1px transparent solid";
 		//newDIV[x].style.overflow = "hidden";
 		newDIV[x].id = "node_" + x;
 		
 		newDIV[x].style.backgroundColor = DynamicDiv[x];
 		container.appendChild(newDIV[x]);
 	}
 	//newpar = parent + 1;
 	window.setTimeout("ChangeColors(0)", 1000);
}


function ChangeColors(){ 
	 var Zahl = Math.round(Math.random()*DynamicDiv.length);
	  var Zahl2 = Math.round(Math.random()*DynamicDiv.length);
	 var Zahl3 = Zahl + Zahl2;
	 
	 if(!document.getElementById("node_" + Zahl)) {
	 	window.setTimeout("ChangeColors(0)", 500);
	 	return ;
	 }
	 
	 if(!DynamicDiv[Zahl2]) {
	 	window.setTimeout("ChangeColors("+ Zahl +")", 500);
	 	return ;
	 }
	 
	var container = document.getElementById("node_" + Zahl);
	
	//container.innerHTML = Zahl3;
	//container.style.left = "" + Zahl3  + "px";
	//container.style.width = "" + Zahl3  + "px";
	container.style.backgroundColor = DynamicDiv[Zahl2];
	//container.style.border = "1px #86C32A solid";
	DynamicActive = Zahl;
	window.setTimeout("ChangeColors("+ (Zahl + 1) +")", 300);
}

