SlideShow = {};
SlideShow.images = [];

SlideShow.timeout = 4000;
SlideShow.setNext = function(){
	var image = SlideShow.images[SlideShow.currentIm];
    SlideShow.currentIm++;
    if (SlideShow.currentIm == SlideShow.images.length) {
        SlideShow.currentIm = 0;
    }
    var oop2 = document.getElementById('op2');
    oop2.innerHTML = '';
    var im2 = new Image;
    var im = document.getElementById('slideshow_box_img');
    im2.id = 'im2';
    im2.src = im.src;
    im2.width = im.width;
    im2.height = im.height;
	im2.style.marginTop = im.style.marginTop;
    im.src = image.src;
    im.width = image.width;
    im.height = image.height;
	im.style.marginTop = Math.round( (99 - image.height)/2 ) + "px";
    im2.style.border = "0 none";
    oop2.appendChild(im2);
    //set background opacity(old image) -> 1, front(next image) -> 0
	if (typeof oop2.style.filter != 'undefined') {
	    oop2.style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
        document.getElementById("op1").style.filter='progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
    }
    else {
	    oop2.style.opacity = 1;
	    document.getElementById("op1").style.opacity = 0;
	}
    SlideShow.anim1.animate();
    SlideShow.anim2.animate();
    return;
}


