<!--
var ie4=document.all;
var dom=document.getElementById;
var internSlideObject;

var scurpos=10;
var spause=3000;

this.sfadepic = sfadepic;
this.srotateimage = srotateimage;
this.sresetit = sresetit;
this.sstartit = sstartit;

function sfadepic(){

	if (scurpos<100){
		scurpos+=10;
	}
	else{
		clearInterval(sdropslide);
		setTimeout('srotateimage()',spause);
	}

	for (var nafnaf=0;nafnaf<SlideShowObject.length;nafnaf++)
		internSlideObject[nafnaf].fadepic();
}

function srotateimage(){
	sresetit();
	var stemp='setInterval("sfadepic()",50)';
	sdropslide=eval(stemp);

	for (var nafnaf=0;nafnaf<SlideShowObject.length;nafnaf++)
		internSlideObject[nafnaf].rotateimage();
}

function sresetit(){
	scurpos=10;
}

function sstartit(SlideShowObject){
	internSlideObject = SlideShowObject;

	srotateimage();

	for (var nafnaf=0;nafnaf<internSlideObject.length;nafnaf++)
		internSlideObject[nafnaf].startit();

}


function SlideshowClass(FadeimagesArray,LayerName,PicWidth,PicHeight) {
// INPUT:
//		FadeimagesArray   an array with imagenames
//		LayerName			an unique string for all instances of SlideshowClass
//		PicWidth				width of the image
//		PicHeight			height of the image

	//SET IMAGE WIDTH
	var slideshow_width= PicWidth + 'px';
	
	//SET IMAGE HEIGHT
	var slideshow_height= PicHeight + 'px';
	
	var fadeimages = FadeimagesArray;

	var preloadedimages=new Array()
	var p = 0;

	for (p=0;p<fadeimages.length;p++){
		preloadedimages[p]=new Image();
		preloadedimages[p].src=fadeimages[p];
	}

	if (ie4||dom)
		document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"><div  id="canvas0' + LayerName +'" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div><div id="canvas1' + LayerName + '" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div></div>');
	else
		document.write('<img name="defaultslide" src="'+fadeimages[0]+'">');

	var curpos=10;
	var degree=10;
	var curcanvas="canvas0"+ LayerName;
	var curimageindex=0;
	var nextimageindex=1;
	var tempobj;

	this.fadepic = fadepic;
	this.rotateimage = rotateimage;
	this.resetit = resetit;
	this.startit = startit;

	function fadepic(){
		if (curpos<100){
			curpos+=10
			if (tempobj.filters)
			tempobj.filters.alpha.opacity=curpos
			else if (tempobj.style.MozOpacity)
			tempobj.style.MozOpacity=curpos/100
		}
		else{
			nextcanvas=(curcanvas=="canvas0"+ LayerName)? "canvas0" + LayerName : "canvas1" + LayerName
//			alert(nextcanvas);
			tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
			tempobj.innerHTML='<img src="'+fadeimages[nextimageindex]+'">'
			nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0
		}
	}

	function rotateimage(){
	if (ie4||dom){
		resetit(curcanvas)
		var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
		crossobj.style.zIndex++
		curcanvas=(curcanvas=="canvas0" + LayerName)? "canvas1" + LayerName : "canvas0" + LayerName
	}
	else
		document.images.defaultslide.src=fadeimages[curimageindex]

	curimageindex=(curimageindex<fadeimages.length-1)? curimageindex+1 : 0
	}

	function resetit(what){
		curpos=10
		var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
		if (crossobj.filters)
		crossobj.filters.alpha.opacity=curpos
		else if (crossobj.style.MozOpacity)
		crossobj.style.MozOpacity=curpos/100
	}

	function startit(){
		var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
		crossobj.innerHTML='<img src="'+fadeimages[curimageindex]+'">'
		rotateimage()
	}

	// initialize the member function references
	// for the class prototype
	if (typeof(_slideshow_prototype_called) == 'undefined')
    {
       _slideshow_prototype_called = true;
       SlideshowClass.prototype.startit = startit ;
       SlideshowClass.prototype.startit = resetit ;
       SlideshowClass.prototype.rotateimage = rotateimage;
       SlideshowClass.prototype.fadepic = fadepic;
    }
}
//-->
