var root = "http://www.nontrovo.it/";

function ImageRotator(ctrlid, images)
{
    this.index = 1;
    this.imageUrl = images.split(';');
    this.images = new Array();
    this.ctrl = ctrlid;
    
    this.Init();      
}

ImageRotator.prototype.Init = function()
{
    for(var x = 0; x < this.imageUrl.length; x++)
    {
        var img = new Image();
        img.src = root + this.imageUrl[x];
        this.images.push(img);
    }
}

function Process(obj)
{
    if(obj != null)
    {
        var img = document.getElementById(obj.ctrl);

        if(img != null)
        {
            img.src = obj.images[obj.index++].src;
            if(obj.index == obj.images.length)
                obj.index = 0;        
        }
    }
}
