// Image mixer 
document.write ('<table border="0" cellspacing="2" cellpadding="0">');
document.write ('<tr><td>');
document.write ('<img name="img1" src="graphics/r1c1.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img2" src="graphics/r1c2.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img3" src="graphics/r1c3.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img4" src="graphics/r2c1.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img5" src="graphics/r2c2.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img6" src="graphics/r2c3.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img7" src="graphics/r3c1.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img8" src="graphics/r3c2.png" height="93" width="101" border="0">');
document.write ('</td></tr><tr><td>');
document.write ('<img name="img9" src="graphics/r3c3.png" height="93" width="101" border="0">');
document.write ('</td></tr></table>');

var img_win = new Array();
img_win[0] = document.images.img1;
img_win[1] = document.images.img2;
img_win[2] = document.images.img3;
img_win[3] = document.images.img4;
img_win[4] = document.images.img5;
img_win[5] = document.images.img6;
img_win[6] = document.images.img7;
img_win[7] = document.images.img8;
img_win[8] = document.images.img9;

var img_path = new Array();
img_path[0] = "graphics/r1c1.png";
img_path[1] = "graphics/r1c2.png";
img_path[2] = "graphics/r1c3.png";
img_path[3] = "graphics/r2c1.png";
img_path[4] = "graphics/r2c2.png";
img_path[5] = "graphics/r2c3.png";
img_path[6] = "graphics/r3c1.png";
img_path[7] = "graphics/r3c2.png";
img_path[8] = "graphics/r3c3.png";

var i = 0;

function chgimg () {

    setTimeout ( "chgimg()", 10000 );

    var trk = new Array();
    for ( var j = 0; j < 9; j++ ) {
        trk[j] = false;
    }

    for ( var j = 0; j < 9; j++ ) {
        var img = Math.floor(Math.random()*9);
        while (1) {
            if ( trk[img] == false ) {
                break;
            }
            if ( ++img > 8 ) {
                img = 0;
            }
        }
        trk[img] = true;
        img_win[j].src = img_path[img];

        //img_win[j].style.position = 'relative';
        //img_win[j].style.left = 0;
        //img_win[j].style.top = 0;
    }
}

var imgidx = 7;

function wider () {

    img_win[imgidx].style.left = 0;

    imgidx++;
    if ( imgidx > 7 ) {
       imgidx = 0; 
       chgimg()
    }
    moveit (img_win[imgidx]);
    setTimeout ( "wider()", 3000 );
}

var slideval = 0;

function moveit (obj) {
    obj.style.left = slideval;
    slideval++;
    if (slideval < 25 ) {
        setTimeout ( 'moveit('+obj+')', 1 );
    } else {
        slideval = 0;
    }
}

setTimeout ( "chgimg()", 1 );
// setTimeout ( "wider()", 3000 );


    
