
var timer
var currentPhoto = 0;
var photoCount;
var photoLinks = new Array();

function SetPath(ImgPath, Count) {
    photoCount = Count;
    photoLinks = ImgPath.split('@');
    startphotoslideshow();
}

function nextphoto(fade) {
    currentPhoto++;
    if (currentPhoto == photoCount)
        currentPhoto = 0;
    var imgObj = getObjectByID("PropertyPhoto");
    if (fade) {
        imgObj.style.filter = "blendTrans(duration=2)";
        imgObj.style.filter = "blendTrans(duration=crossFadeDuration)";
        if (imgObj.filters)
            imgObj.filters.item(0).Apply();
    }
    imgObj.src = photoLinks[currentPhoto];
    if (fade) {
        if (imgObj.filters)
            imgObj.filters.item(0).Play();
    }
    
}

function startphotoslideshow() {
    //if (document.all.photoplay) {
        timer = window.setInterval("nextphoto(1)", 6000);
        //document.all.photoplay.href = "javascript:stopphotoslideshow()"
        //document.all.photoplayimg.src="images/btn_stop.gif"
        //document.all.photoplay.title="Stop"
    //}
}

function getObjectByID(id) {
    if (document.getElementById) {
        return document.getElementById(id);
    }
    else if (document.all) {
        return document.all[id];
    }
    else if (document.layers) {
        return document.layers[id];
    }
    else {
        return false;
    }
}