var panorama = {
    imgWidth: 785,
    divWidth: 290,
    step: 1,
    speed: 20,

    _direction: -1,
    _panorama: false,

    move: function () {
        if (!this._panorama) {
            this._panorama = $("#panorama");
        }
        if (this._panorama.length > 0) {
            var pos = this._panorama.position();
            var step = this.step;
            var new_pos = pos.left + (this._direction*step);
            if (
                (new_pos*-1)+this.divWidth >= this.imgWidth ||
                new_pos > 0
                ) {
                this._direction *= -1;
                new_pos = pos.left + (this._direction*step);
            }
            this._panorama.css("left", new_pos + "px");
            setTimeout('panorama.move();', this.speed);
        }
    }
}

