﻿(function (wo$)
{

    var methods =
        {
            init: function (options)
            {
                return this.each(function ()
                {
                    var url = '/ContentFragment?type=PhoneSpecsPopup&id=' + options.phoneID;
                    wo$(this).attr('href', url).fancybox(
                    {
                        padding: 0,
                        centerOnScroll: true,
                        overlayOpacity: 0.7,
                        overlayColor: '#000'
                    });
                });
            }
        };

    wo$.fn.phoneSpecsPopup = function (method)
    {
        if (methods[method])
        {
            return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        }
        else if (typeof method === 'object' || !method)
        {
            return methods.init.apply(this, arguments);
        }
        else
        {
            $.error('Method ' + method + ' does not exist on jQuery.phoneSpecsPopup');
        }
    };

})(jQuery);

