var ImageSrcArr = new Array();
var AUrlArr = new Array();
var ATitleArr = new Array();
var ImageUBound = 0;
var ImageDBound = 0;
var curIndex = -1;
var imageObject = "";
var aObject = "";
var tipObject = "";
var timer = "";
var minseconds = 3000;
function setMinSecond(ms)
{
    minseconds = ms;
}
function initObject(imgId, aId, tipId)
{
    imageObject = document.getElementById(imgId);
    aObject = document.getElementById(aId);
    if (tipId != "")
        tipObject = document.getElementById(tipId);
}
function goImage(index)
{
    imageObject.src = ImageSrcArr[index];
    aObject.href = AUrlArr[index];
    if (tipObject != "")
        tipObject.innerText = ATitleArr[index];
    curIndex = index;

}
function addImage(imgUrl, aHref, title)
{
    ImageSrcArr[ImageUBound] = imgUrl;
    AUrlArr[ImageUBound] = aHref;
    ATitleArr[ImageUBound] = title;
    ImageUBound++;
}
function rollImage()
{
    var src = "";
    var tip = "";
    if (imageObject == "" || aObject == "")
    {
        alert("图片对象或链\n接对象不存在!");
        return;
    }
    curIndex++;
    if (curIndex < ImageUBound) {
        src = ImageSrcArr[curIndex];
        aObject.href = AUrlArr[curIndex];
        if (tipObject != "") {
            tip = ATitleArr[curIndex];
            tipObject.innerText = tip;
        }
    } else if (curIndex == ImageUBound) {
        curIndex = 0;
        src = ImageSrcArr[curIndex];
        aObject.href = AUrlArr[curIndex];
        if (tipObject != "") {
            tip = ATitleArr[curIndex];
            tipObject.innerText = tip;
        }
    }
    with (imageObject.filters.revealTrans) {
        apply();
        transition = 23;
        imageObject.src = src;
        imageObject.title = tip;
        play();
    }
    timer = setTimeout("rollImage()", minseconds);
}
function loadXP(imgid, alinkid, divid)
{
    initObject(imgid, alinkid, divid);
    rollImage();
  
}


 

