<!--
// Set fadeSpeed (number of milliseconds to wait between 5% changes in opacity)
var fadeSpeed = 30;

var fadeT;
var fadeOpacity = 0;
var preloadLength = fotos.length

var preloadpics = new Array();
var j = preloadLength - 1;
for (var i = 0; i < preloadLength; i++) {
	if (i > j) break;
	preloadpics[i] = new Image();
	preloadpics[i].src = fotos[i][0];
	preloadpics[j] = new Image();
	preloadpics[j].src = fotos[j][0];
	j--;

}

var cur_foto = 0;
var tot_fotos = fotos.length - 1;
var to;

function scroll_photo(i, w, h) {
	if (fadeOpacity > 0) return;
	if (to) clearTimeout(to);
	to = setTimeout("scroll_photo2(" + i + "," + w + "," + h + ")", 50);
}

function scroll_photo2(i, w, h) {
	cur_foto = cur_foto + i;
	if (cur_foto < 0) cur_foto = tot_fotos;
	if (cur_foto > tot_fotos) cur_foto = 0;
	var top = (fotos[cur_foto][2] > h ? '-' + Math.round((fotos[cur_foto][2] - h) / 2) : '0') + 'px';
	var left = (fotos[cur_foto][1] > w ? '-' + Math.round((fotos[cur_foto][1] - w) / 2) : '0') + 'px';
	
	$("photoview1").style.top = top;
	$("photoview1").style.left = left;
	$("photoview1").innerHTML = '<img src="' + fotos[cur_foto][0] + '" width="' + fotos[cur_foto][1] + '" height="' + fotos[cur_foto][2] + '" border="0">';
	$("photolabel").innerHTML = fotos[cur_foto][3];

	fadeT = setTimeout("fadeIn()", fadeSpeed);
}

function fadeIn() {
	fadeOpacity = fadeOpacity + 5;
	fade_top_object = $("photoview1");
	fade_bottom_object = $("photoview0");

	if (fadeOpacity <= 100) {
		tmpOpacity = (fadeOpacity == 100 ? 99.999 : fadeOpacity);
		if (fade_top_object.filters) fade_top_object.filters.alpha.opacity = tmpOpacity;
		if (fade_top_object.style.MozOpacity) fade_top_object.style.MozOpacity = tmpOpacity / 100;
		if (fade_top_object.style.opacity) fade_top_object.style.opacity = tmpOpacity / 100;
		if (fade_top_object.style.KHTMLOpacity) fade_top_object.style.KHTMLOpacity = tmpOpacity / 100;
		if (fadeOpacity == 100) {
			fade_bottom_object.style.top = fade_top_object.offsetTop + "px";
			fade_bottom_object.style.left = fade_top_object.offsetLeft + "px";
			fade_bottom_object.innerHTML = fade_top_object.innerHTML;
		}
		fadeT = setTimeout('fadeIn()', fadeSpeed);
	} else {
		if (fade_top_object.filters) fade_top_object.filters.alpha.opacity = 0;
		if (fade_top_object.style.MozOpacity) fade_top_object.style.MozOpacity =0;
		if (fade_top_object.style.opacity) fade_top_object.style.opacity = 0;
		if (fade_top_object.style.KHTMLOpacity) fade_top_object.style.KHTMLOpacity = 0;
		fadeOpacity = 0;
	}
}
-->
