var slideshow_num = 1;
	var slideshow_speed = 50;
	var slideshow_step = 3;
	var slideshow_delay = 5000;
	var slideshow_img = null;
	
	var slideshow_slides = 1;
	var slideshow_slidename = 'foto';
	var slideshow_slide = null;

	function slideshow_load() {
	
		var name = slideshow_slidename;
		if (slideshow_slides>1) {
			for (var i=1; i<=slideshow_slides; i++) {
				document.getElementById(name + i).src = slideshow_list[i];
			}
		} else {
			document.getElementById(name).src = slideshow_list[0];
		}		
		slideshow_num = slideshow_slides; 
		setTimeout('slideshow()',slideshow_delay);
	}


	function slideshow()
	{
		slideshow_num++;
		if (slideshow_num>=slideshow_list.length) slideshow_num = 0;
		
		var name = slideshow_slidename;
		if (slideshow_slides>1) {
			n = Math.floor(Math.random() * slideshow_slides)+1;
			name = name + n;
		}		
		
		f1 = document.getElementById(name);
		f2 = document.getElementById(name + 'b');
		f2.src = f1.src;
		set_opacity(f2,100);
		
		f1.src = slideshow_list[slideshow_num];
		slideshow_slide = f2;
		slideshow_alpha();
	}
	
	function slideshow_alpha() {
		f2 = slideshow_slide;
		op = parseInt(read_opacity(f2)) - slideshow_step;
		if (op>0) {
			set_opacity(f2,op);
			setTimeout('slideshow_alpha()',slideshow_speed);
		} else {
			set_opacity(f2,0)
			setTimeout('slideshow()',slideshow_delay);
		}
	}
	
	function set_opacity(obj,op) {

		if (obj.filters)
			obj.filters.alpha.opacity = op;
		else
			obj.style.opacity = op*0.01;
	}

	function read_opacity(obj) {

		if (obj.filters)
			return parseInt(obj.filters.alpha.opacity);
		else
			return parseFloat(obj.style.opacity)*100;
	}