pic_1 = new Image;
pic_2 = new Image;
pic_3 = new Image;
pic_4 = new Image;

document.write ("<img id='thePic' src='http://kids-learn.org/scripts/trans1.gif' STYLE='position:absolute; filter:blendTrans(Duration=5) revealTrans(Duration=2, Transition=12)' WIDTH='1' HEIGHT='1'>");

setTimeout('moveIt(2,2)',5000);



var rows;
var cols;
var count = 0;

trans = new Image;
trans.src = "http://kids-learn.org/scripts/trans1.gif";

function moveIt(i,j) {
if (navigator.appName == "Netscape") {return;}
if (navigator.appVersion.indexOf("Mac") != -1) {return;}

count = count + 1;
tbl = document.all.tags("TABLE")(0);
if (tbl.id == "accessibility") {tbl = document.all.tags("TABLE")(1);}
	
// GET THE NUMBER OF ROWS
rows = tbl.rows.length;
// GET THE NUMBER OF COLS IN THE FIRST ROW
cols = tbl.rows(0).cells.length;

// MOVE THE ANIMATED autumn TO A NEW CELL
cell = tbl.rows(i).cells(j);
thePic.src = trans.src;
thePic.style.pixelLeft = cell.offsetLeft+cell.offsetParent.offsetLeft+cell.offsetParent.offsetParent.offsetLeft;
thePic.style.pixelTop = cell.offsetTop+cell.offsetParent.offsetTop+cell.offsetParent.offsetParent.offsetTop;
thePic.width = cell.offsetWidth;
thePic.height = cell.offsetHeight;
thePic.filters.blendTrans.Apply();

if (count%4 == 0) {thePic.src = pic_1.src}
if (count%4 == 1) {thePic.src = pic_2.src}
if (count%4 == 2) {thePic.src = pic_3.src}
if (count%4 == 3) {thePic.src = pic_4.src}

thePic.filters[0].Play();
setTimeout ('blendOut()',7000);
}

function blendOut(){
// DO THE FADE OUT
thePic.filters.revealTrans.Apply();
thePic.src = trans.src;
thePic.filters.revealTrans.Play();
newRow = Math.floor(Math.random() * rows);
newCol = Math.floor(Math.random() * cols);
setTimeout('moveIt (newRow, newCol)',5000);
}


