<?xml version="1.0"  encoding="iso-8859-2" ?> 
<Module>
  <ModulePrefs title="My first module" /> 
   <Content type="html"> 
     <![CDATA[ 
<center>
<script>
MAXX=10;
MAXY=15;
fieldText="&nbsp;&nbsp;&nbsp;&nbsp;";
document.write('<font size="1">(c) 2006 by RMK</font>');
</script>
<table border="-1" cellspacing="0">
<script>
for (var x=0; x<MAXX; x++)
{
	document.write("<tr>");
	for (var y=0; y<MAXY; y++)
	{
		document.write('<td width="8px" height"8px"><div style="background-color:WHITE" id="field'+(x)+"_"+(y)+'">'+fieldText+'</td>');
	}
}

var colors=new Array(MAXX*MAXY);
for (var i=0; i<(MAXX*MAXY); i++) colors[i]=15;
var dirs=new Array(MAXX*MAXY);
for (var i=0; i<(MAXX*MAXY); i++) dirs[i]=-1;

function cosik()
{
	x=Math.round(Math.random()*(MAXX-1));
	y=Math.round(Math.random()*(MAXY-1));

	fieldId = x+y*MAXX;

	colors[fieldId]+=dirs[fieldId];

	if (colors[fieldId]<0) 
	{
		colors[fieldId]=0;
		dirs[fieldId]=2;
	}
	if (colors[fieldId]>15)
	{
		colors[fieldId]=15;
		dirs[fieldId]=-1;
	}

	var fieldName="field"+(x)+"_"+(y);
	color="#";
	for (var i=0; i<6; i++) color+=colors[fieldId].toString(16);

	document.getElementById(fieldName).innerHTML="<div style='background-color:"+color+"'>"+fieldText+"</div>";
//	document.getElementById(fieldName).background=color;
//	document.getElementById(fieldName).innerHTML="RED";
	setTimeout("cosik()",10);
}

cosik();
</script>
	
     ]]> 
   </Content> 
</Module>