
(function ($) {
    $.fn.videoGallery = function (options) {

        var defaults = {
            w: 320,
            h: 240,
            holderDiv: '#video-holder',
            src: 'rel',
            showTitle: false,
            title: 'title',
            titleLoc: '#video-title'
        };

        var options = $.extend(defaults, options);

        var element = this;

        return this.each(function () {
            src = $(options.holderDiv).attr(options.src);
            title = $(options.holderDiv).attr(options.title);

            if (options.showTitle === true) {
                $(options.titleLoc).text(title);
            }

            $(options.holderDiv).html(src);

            $(this).
            click(
               function () {
                   src = $(this).attr(options.src);
                   title = $(this).attr(options.title);

                   $(options.holderDiv).html(src);

                   if (options.showTitle === true) {
                       $(options.titleLoc).text(title);
                   }
               }
            )
        });
    };
})(jQuery);
