/**
 * Internal mail contact
 * @version:  01.01.01 Alpha
 * @modified: 2009-07-06 15:58:00
 */
var slideShow = newObject({
    
    //autoInit  : true,
    slide_url : [],
    slide_img : [],
    cur_img   : 0,
    init : function(slide_url)
    {
        this.slide_url = slide_url;
     },

    onready : function()
    {
        var container, i;
        //getting container element of image
        container = this.$("#" + this.config.modelId);
        if (!container) {
            return;
        }
        //make image wrappers
        this.slide_img[0] = container.getChild(0);
        for (i = 1; i < this.slide_url.length; i++) {
            this.slide_img[i] = this.$w0.makeElement('img', {src: this.slide_url[i], alt : 'Model of the month'});
            this.slide_img[i].hide();
            container.elm.appendChild(this.slide_img[i].elm);
        }
        //run timer
        this.setInterval(this.config.period, this, 'onTimer');
    },

    onTimer : function()
    {
         this.slide_img[this.cur_img].hide();
         this.cur_img++;
         if(this.cur_img >= this.slide_url.length) {
             this.cur_img = 0
         }
         this.slide_img[this.cur_img].show();
    },

    config : {
         "modelId" : 'model_month',
         "period"  : 5000
    }


});

