function myPPT(id) {
    this._id = id;
    this._mainImageID = this._id + "_mainImage";
    this._mainLinkID = this._id + "_mainLink";
    this._mainTextID = this._id + "_Text";
    this._listID = this._id + "_List";
    this._currentIndex = $(this._id + "_h_currentIndex").value;
    this._timer = $(this._id + "_h_timer").value;
    this._arrImgs = $(this._id + "_h_imgURLs").value.split("|-|");
    this._arrUrls = $(this._id + "_h_linkURLs").value.split("|-|");
    this._arrTexts = $(this._id + "_h_linkTexts").value.split("|-|");
    this._itemCount = 4;
    this._timeDuration = 3;
    this._isPause = $(this._id + "_h_pause").value;
    this._isTransition = isIE;
    this.setTimer = function(strTime) {
        $(this._id + "_h_timer").value = strTime
    }
    this.setPausse = function(isPause) {
        $(this._id + "_h_pause").value = isPause
    }
    this.setIndex = function(nextIndex) {
        $(this._id + "_h_currentIndex").value = nextIndex
    }
    this.setTextLink = function(text, link) {
        $(this._mainTextID).href = link;
        $(this._mainTextID).innerHTML = text
    }
    this.swich = function(index) {
        var img = $(this._mainImageID);
        if (isIE) {
            var now = new Date();
            var rndNumber = now.getSeconds() % 23;
            img.filters.item(0).Transition = rndNumber;
            img.filters.item(0).Apply()
        }
        if (index == 0) {
            if (this._isPause == "true") return;
            var timeMark;
            timeMark = Date.parse(this._timer);
            var curTime = new Date();
            if ((curTime - timeMark) < (this._timeDuration * 1000)) return;
            index = this._currentIndex.valueOf();
            if (index > this._itemCount.valueOf()) index = 1
        }
        img.src = this._arrImgs[index - 1];
        $(this._mainLinkID).href = this._arrUrls[index - 1];
        $(this._mainTextID).href = this._arrUrls[index - 1];
        $(this._mainTextID).innerHTML = this._arrTexts[index - 1];
        this.setTimer((new Date).toString());
        this.setTextLink(this._arrTexts[index - 1], this._arrUrls[index - 1]);
        if (isIE) img.filters.item(0).Play();
        this.setTimer((new Date()).toString());
        index++;
        this.setIndex(index)
    }
    this.init = function() {
        this.setTimer((new Date()).toString());
        for (var i = 0; i < 4; i++) {
            var a = document.createElement("A");
            a.href = "javascript:pptImageSwith(" + (i + 1).toString() + ");"
            var smallImg = document.createElement("img");
            smallImg.src = this._arrImgs[i];
            a.appendChild(smallImg);
            $(this._listID).appendChild(a)
        }
    }
}
function pptImageSwith(index) {
    var iPPT = new myPPT("ppt1");
    iPPT.swich(index)
}
