jQuery(document).ready(function(){
    var toggleVideo = new ToggleVideo;
});

function ToggleVideo() {
    this.showBtn = null;
    this.hideBtn = null;
    this.player = null;
    var _this = this;

    this.init = function() {
        _this.showBtn = jQuery("#show-movie");
        _this.hideBtn = jQuery("#hide-movie");
        _this.player = jQuery("#video-player");
        _this.bindActions();
        _this.checkQueryString();
    };

    this.showPlayer = function() {
        _this.player.fadeIn(300);
        _this.showBtn.hide();
    };

    this.hidePlayer = function() {
        _this.player.fadeOut(300);
        _this.showBtn.show();
    };

    this.checkQueryString = function() {
        if (-1 != window.location.toString().indexOf("video=yes")) {
            _this.showPlayer();
        }
    };



    this.bindActions = function() {
        _this.showBtn.bind({
            click: function() {
                _this.showPlayer();
                return false;
            }
        })

        _this.hideBtn.bind({
            click: function() {
                _this.hidePlayer();
                return false;
            }
        })
    };


    this.init()
}
