//Fade-in image slideshow- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
//This credit MUST stay intact for use

var slideshow_width='240px'
var slideshow_height='236px'
var slideshowtimeout=6000

var fadeimages=new Array()

fadeimages[0]="images/teaser1.gif"
fadeimages[1]="images/teaser2.gif"
fadeimages[2]="images/teaser3.gif"
fadeimages[3]="images/teaser4.gif"
fadeimages[4]="images/teaser5.gif"

////NO need to edit beyond here/////////////

var preloadedimages=new Array()
for (p=0;p<fadeimages.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=fadeimages[p]
}

var ie4=document.all
var dom=document.getElementById

var curpos=0
var curcanvas="canvas0"
var curimageindex=Math.floor(Math.random() * fadeimages.length);
var nextimageindex=1
var fade_to = null;
var fade_from = null;

if (ie4||dom)
    document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"><div  id="canvas0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=100);-moz-opacity:100%"><img src="'+fadeimages[curimageindex]+'"></div></div>')
else
    document.write('<img name="defaultslide" src="'+fadeimages[0]+'">')

function fadepic()
{
    curpos += 10;
    if (curpos <= 100) {
        if (fade_from.filters)
            fade_from.filters.alpha.opacity=(100 - curpos)
        else if (fade_from.style.MozOpacity) {
            fade_from.style.MozOpacity=(100 - curpos) + "%";
        }
    } 
    if (curpos == 120) {
        fade_from.innerHTML='<img src="'+fadeimages[curimageindex]+'">';
    }
    if (curpos >= 150) {
        if (fade_from.filters)
            fade_from.filters.alpha.opacity=(curpos - 150)
        else if (fade_from.style.MozOpacity) {
            fade_from.style.MozOpacity=(curpos - 150) + "%";
        }
    } 
    if (curpos == 250) {
        clearInterval(dropslide)
        setTimeout(scrollernext,slideshowtimeout)
    }
}

function rotateimage()
{
    if (ie4||dom) {
        fade_from = ie4 ? eval("document.all.canvas0") : document.getElementById("canvas0");
        curimageindex = (curimageindex < fadeimages.length - 1) ? curimageindex + 1 : 0;
        curpos = 0;
        var temp='setInterval("fadepic()",25)';
        dropslide=eval(temp);
    } else document.images.defaultslide.src=fadeimages[curimageindex];
}

//setTimeout("rotateimage()",slideshowtimeout);
 