var iPhoneQTVR = Class.create();
Object.extend(iPhoneQTVR.prototype, VRGallery.prototype);
Object.extend(iPhoneQTVR.prototype, Event.Listener);
Object.extend(iPhoneQTVR.prototype, {
    initialize: function(options) {
        this.__VRGallery_initialize(options); // parent constructor
        this.__iPhoneQTVR_initialize(options);
    },
    
    __iPhoneQTVR_initialize: function(options) {
        this.listenForEvent(this, 'load', false, function() {
            var anchor = document.createElement('a');
            anchor.addClassName('play_hand');
            anchor.setAttribute('href', '#');
            anchor.innerHTML = "Play / Control";
            Event.observe(anchor, 'click', function(evt, anchor) {
                Event.stop(evt);
                anchor.toggleClassName('pause');
                if (anchor.hasClassName('pause')) {
                    this.residualVelocityX = 0;
                }
                else {
                    this.residualVelocityX = 0.4;
                    this.animate();
                }
            }.bindAsEventListener(this, anchor));

            this.container.appendChild(anchor);
        }.bind(this));
    }
});
