//document.write('<img src="image/ngockhue00.jpg" id="box">');
//Put your images into the array below. Add as many as needed.
//pics=new Array("image/baoyen00.jpg","image/camly00.jpg","image/phikhanh00.jpg");

var browserinfos=navigator.userAgent
var ie4=!document.getElementById&&document.all&&!browserinfos.match(/Opera/)
var ie5=document.getElementById&&document.all&&!browserinfos.match(/Opera/)
var ns6=document.getElementById&&!document.all&&!browserinfos.match(/Opera/)
var opera=browserinfos.match(/Opera/)

//Transition speed. 4000 = 4 seconds etc.

commonlistimg = 'http://www.nnyvn.com/img/hoadao01.jpg,http://www.nnyvn.com/img/hoadao02.jpg,http://www.nnyvn.com/img/hoamai01.jpg,http://www.nnyvn.com/img/hoamai02.jpg,http://www.nnyvn.com/img/hoamai03.jpg';
var delay = 4000;
var pics = null;
var imgstep = 0;

l=new Array()
f=new Array();
n="progid:DXImageTransform.Microsoft.";

coordleft = 0;
coordtop = 300;
textwidth = 100;
textheight = 100;

function transimg(delayimg , initimg, listimg, widthimg, heightimg, widthtable, heighttable, backgroundtable, iscommon, cleft, ctop,txtwidth,txtheight,isdiv,p15,p16) {
    if (isBrowserType() != 1) return;
    delay = delayimg;
    if ( listimg != '' )  {
        if (iscommon == '1')
            pics= commonlistimg.split(","); 
        else
            pics= listimg.split(",");   
    }
    else pics=new Array(initimg);
    
    coordleft = cleft;
    coordtop = ctop;
    textwidth = txtwidth;
    textheight = txtheight;
    
    
    if (isdiv == '1') {
        if (ie5) {
	        document.write('<div ID="roof"  style="left:' + coordleft + ';top:' + coordtop + ';position:absolute;width:'+textwidth+'px;height:'+textheight+'px; >')
	    }
	    if (ns6 || opera) {
	        document.write('<div ID="Div1" style="position:relative;width:'+textwidth+'px;height:'+textheight+'px;">')
        }
    }
    else {
       document.write('<p align="center">');
    }
    document.write('<table  border="2" background="' + backgroundtable + '"  bordercolor="#DDDDDD"  cellpadding="0" style="width:'   + widthtable + ' ' +  ';  height:'  + heighttable + ' '+ ';  border-collapse: collapse">');
    document.write('<tr>');
    document.write('<td  align="center"  style="text-align: center;">'); 
        
    if (widthimg != '' && heightimg != '')
        document.write('<img width=' + widthimg +  ' height=' + heightimg + ' src="' + initimg + '" id="box">');
    if (widthimg != '' && heightimg == '')
        document.write('<img width=' + widthimg  + ' src="' + initimg + '" id="box">');    
    if (widthimg == '' && heightimg != '')
        document.write('<img height=' + heightimg + ' src="' + initimg + '" id="box">');
    if (widthimg == '' && heightimg == '')
        document.write('<img src="' + initimg + '" id="box">');
    
    document.write('</td>');
    document.write('</tr>');
    document.write('</table>');
    if (isdiv == '1')     document.write('</div>');
    else document.write('</p>');

    //Nothing needs altering paste here.
    //l=new Array()
    for (i=0; i < pics.length;i++){
        l[i]=new Image()
        l[i].src=pics[i]
    }
    //n="progid:DXImageTransform.Microsoft.";
    //f=new Array()
    f[0]="Wheel(spokes=4)";
    f[1]="Blinds(Bands=10,direction=up)";
    f[2]="Stretch(stretchstyle=PUSH)";
    f[3]="Stretch(stretchstyle=SPIN)";
    f[4]="RadialWipe(wipestyle=RADIAL)";
    f[5]="RadialWipe(wipestyle=WEDGE)";
    f[6]="Checkerboard(Direction=right,SquaresX=8,SquaresY=8)";
    f[7]="Fade(Overlap=1.00)";
    f[8]="GradientWipe(GradientSize=0.25,wipestyle=0,motion=forward)";
    f[9]="Iris(irisstyle=CIRCLE,motion=out)";
    f[10]="Iris(irisstyle=STAR,motion=out)";
    f[11]="Barn( motion=out,orientation=vertical)";
    f[12]="Barn( motion=in,orientation=vertical)";
    f[13]="Strips(motion=leftup)";
    f[14]="Slide(slidestyle=HIDE,Bands=1)";
    f[15]="Slide(slidestyle=PUSH,Bands=1)";
    f[16]="Slide(slidestyle=SWAP,Bands=1)";
    f[17]="RandomDissolve(duration=1)";
    f[18]="Wheel(duration=3)";
    f[19]="BasicImage(mirror=1)";
    f[20]="BasicImage(grayScale=1)";
    f[21]="gradient(startColorstr=#550000FF, endColorstr=#55FFFF00)";
    f[22]="Barn()";
    f[23]="Blinds()";
    f[24]="Alpha(opacity=70)";
    f[25]="Pixelate(maxSquare=50)";
    f[26]="Blinds(Duration=2)";
    f[27]="GradientWipe(Duration=3, gradientSize=0.25)";
    f[28]="ICMFilter(intent=1)";
    f[29]="Blur(makeShadow=false)";
    f[30]="AlphaImageLoader(sizingMethod=crop)"; 
    f[31]="Matrix(SizingMethod=auto expand)"; 
    
    f[32]="Wheel(spokes=10)";
    f[33]="Wheel(spokes=20)";
    f[34]="Blinds(Bands=10,direction=left)";
    f[35]="Blinds(Bands=10,direction=right)";
    f[36]="Blinds(Bands=4,direction=down)";
    f[37]="Stretch(stretchstyle=HIDE)";
    f[38]="RadialWipe(wipestyle=CLOCK)";
    f[39]="Checkerboard(Direction=up,SquaresX=12,SquaresY=12)";
    f[40]="Iris(irisstyle=CIRCLE,motion=in)";
    f[41]="Iris(irisstyle=STAR,motion=in)";
    f[42]="Iris(irisstyle=CROSS,motion=in)";
    f[43]="Iris(irisstyle=SQUARE,motion=in)";
    f[44]="Iris(irisstyle=PLUS,motion=in)";
    f[45]="Iris(irisstyle=CROSS,motion=out)";
    f[46]="Pixelate(MaxSquare=50,Duration=1)";
    f[47]="Pixelate(MaxSquare=20,Duration=1)";
    f[48]="RandomBars(orientation='vertical')";
    f[49]="RandomBars(orientation='horizontal')";
    f[50]="Slide(slidestyle=HIDE,Bands=3)";
    f[51]="Slide(slidestyle=PUSH,Bands=5)";
    f[52]="Slide(slidestyle=SWAP,Bands=7)";
    f[53]="Spiral(GridSizeX=32, GridSizeY=32)";
    f[54]="Spiral(GridSizeX=8, GridSizeY=64)";
    f[55]="Spiral(GridSizeX=64, GridSizeY=32)";
    f[56]="Spiral(GridSizeX=16, GridSizeY=16)";
    f[57]="zigzag(GridSizeX=32, GridSizeY=32)";
    f[58]="zigzag(GridSizeX=8, GridSizeY=64)";
    f[59]="zigzag(GridSizeX=64, GridSizeY=32)";
    f[60]="zigzag(GridSizeX=16, GridSizeY=16)";
    /*
    
    f[21]="BasicImage(mask=1, maskColor=255)";
    f[21]="BasicImage(xray=1)";
    f[22]="Blur(pixelradius=2)";
f[20]="MotionBlur(strength=13, direction=310)";

f[19]="BasicImage(invert=1)";
    */
    

    window.onload=new Function("setTimeout('ani()',delay)");
    
}

function ani() {
    rnd=f[Math.floor(Math.random()*f.length)]
    box.style.filter=n+rnd;
    box.filters[0].apply();
    box.src=l[imgstep].src;
    box.filters[0].play();
    imgstep++;
    if (imgstep >= l.length) imgstep=0;
    setTimeout("ani()",delay);
}

//window.onload=new Function("setTimeout('ani()',delay)")
