﻿// JScript File


// Browser Slide-Show script.
// With image cross fade effect for those browsers that support it.
var slideCache = new Array();
function RunSlideShow(pictureName,linkName,textName, imageFiles,displaySecs)
{
var imageSeparator = imageFiles.indexOf(";");
var arrImage_tmp = imageFiles.substring(0,imageSeparator);
var arrImage=arrImage_tmp.split(',');
var nextImage = arrImage[0];
var nextLnk=arrImage[1];
var nextAlt=arrImage[2];

if (document.all)
{
document.getElementById(pictureName).style.filter="blendTrans(duration=2)";
document.getElementById(pictureName).filters.blendTrans.Apply();
}
document.getElementById(pictureName).height = "60";
document.getElementById(pictureName).width = "120";
document.getElementById(pictureName).src = nextImage;
document.getElementById(textName).innerHTML=nextAlt;
document.getElementById(pictureName).alt = nextAlt.replace('<br>',' ');
document.getElementById(linkName).href = "javascript:ligaExterna('" + nextLnk + "');"; //nextLnk;


if (document.all)
{
document.getElementById(pictureName).filters.blendTrans.Play();
}
var futureImages= imageFiles.substring(imageSeparator+1,imageFiles.length)
+ ';' + arrImage_tmp;
//alert("f:" + futureImages + "\nimg:" + imageFiles);
if (futureImages.length<=0){
setTimeout("RunSlideShow('"+pictureName+"','"+linkName+"','"+textName+"','"+imageFiles+"',"+displaySecs+")",displaySecs*1000);
}
else{
setTimeout("RunSlideShow('"+pictureName+"','"+linkName+"','"+textName+"','"+futureImages+"',"+displaySecs+")",displaySecs*1000);
}

// Cache the next image to improve performance.
/*imageSeparator = futureImages.indexOf(";");
nextImage = futureImages.substring(0,imageSeparator);
if (slideCache[nextImage] == null) {
slideCache[nextImage] = new Image;
slideCache[nextImage].src = nextImage;
}*/
}


