﻿// JScript File

function Rotor(name ) {
    this._name = name;
    this._j = 0;
    this.preLoad = new Array();
}

Rotor.prototype._name;
Rotor.prototype._j;
Rotor.prototype.preLoad;

Rotor.prototype.getName = function() {
    return this._name;
}

Rotor.prototype.addImage = function( imageName ) {
    //var img = new Image();
    //img.src = imageName;
    this.preLoad.push( imageName );
    return;
}

Rotor.prototype.runShow = function() {
    var ctl = document.getElementById(this._name);
    if (ctl) {
        if (document.all) {
            ctl.style.filter = "blendTrans(duration=2)";
            ctl.style.filter = "blendTrans(duration=crossFadeDuration)";
            ctl.filters.blendTrans.Apply();
        }
            //alert(this._j);
        ctl.src = this.preLoad[this._j];
        
       if (document.all){
          ctl.filters.blendTrans.Play();
       }        
        this._j = this._j + 1;
        if (this._j > (this.preLoad.length-1)) this._j=0;
    }
    return;
}

