SlideShow = function(divID, leftArrow, rightArrow, txt, firstImg)
    {
    var THIS = this;

    this._divID = $(divID);
    this._leftArrow = $(leftArrow);
    this._rightArrow = $(rightArrow);
    this.txt = $(txt);
    this._firstImg = $(firstImg);

    this._pictures = new Array(
        new Array('/i/slide1.jpg', 'Administrative center of Astana'),
        new Array('/i/slide2.jpg', 'Baiterek&mdash;symbol of Astana'),
        new Array('/i/slide3.jpg', 'Presidential palace &ldquo;Ak Orda&rdquo;'),
        new Array('/i/slide4.jpg', 'Parliament building of RK'),
        new Array('/i/slide5.jpg', 'Ministry of Foreign Affairs of RK'),
        new Array('/i/slide6.jpg', 'Ministry of Defence of RK'),
        new Array('/i/slide7.jpg', '&ldquo;Singing Fountains&rdquo; in front of Nursaya housing estate'),
        new Array('/i/slide8.jpg', 'Palace of Peace and Harmony'),
        new Array('/i/slide9.jpg', 'New street in administrative center of Astana &mdash; Syganak st.'),
        new Array('/i/slide10.jpg', 'National archive and &ldquo;Northern lights&rdquo; housing estate'),
        new Array('/i/slide11.jpg', 'Esil quay'),
        new Array('/i/slide12.jpg', 'Fountains in old center of Astana'),
        new Array('/i/slide13.jpg', 'Aldar Kose, kazakh fictional character'),
        new Array('/i/slide15.jpg', 'National kazakh dressing')
        );

    this._currPic = 1;
    this._interval = 5 * 1000; // 5 seconds
    this._firstTime = true;

    this._newPic = $(document.createElement("img"));
    this._newPic.src = this._pictures[1][0];
    this._newPic.setStyle({position: 'absolute', left: '566px'});
    this._divID.appendChild(this._newPic);

    for(i = 2, ic = this._pictures.length; i < ic; i++)
        document.createElement("img").src = this._pictures[i][0];

    //this._leftArrow.setStyle({display: 'block'});
    //this._rightArrow.setStyle({display: 'block'});

    this._changePic();

    }

SlideShow.prototype =
	{
    _changePic: function()
        {
        var THIS = this;

        if(this._firstTime == true)
            {
            window.setTimeout(function() {new Effect.Move(THIS._newPic, { x: -566, y: 0, mode: 'relative' }); THIS.txt.update(THIS._pictures[1][1]);}, THIS._interval);
            this._firstTime = false;

            }
        else
            {
            this._firstImg.src = this._newPic.src;
            this._newPic.setStyle({left: "566px"});

            if(this._pictures.length <= (this._currPic + 1))
                this._currPic = 0;
            else
                this._currPic += 1;

//            this._newPic.src = this._pictures[this._currPic][0];
//            this._newPic.onload = function() {window.setTimeout(function() {new Effect.Move(THIS._newPic, { x: -566, y: 0, mode: 'relative' }); THIS.txt.update(THIS._pictures[THIS._currPic][1]);}, THIS._interval)};

            window.setTimeout(function() {THIS._newPic.src = THIS._pictures[THIS._currPic][0];}, 100);
            this._newPic.src = this._pictures[this._currPic][0];
            window.setTimeout(function() {new Effect.Move(THIS._newPic, { x: -566, y: 0, mode: 'relative' }); THIS.txt.update(THIS._pictures[THIS._currPic][1]);}, THIS._interval);
            }

        window.setTimeout(function() {THIS._changePic()}, (THIS._interval + THIS._interval));
        }
    }
