(function($) {
    var functions = {
    };
    
    $.fn.beenbusy = function(options) {
		options = $.extend({}, $.fn.beenbusy.defaults, options);
		
		this.each(function() {
		    var self = $(this);
    		
    		// Find the id of the popup container
    		var popupId = self.find('.popup').attr('id');
		    
		    // Setup colorbox for the popup
            self.find('a').colorbox({
        		slideshow: false,
        		transition: 'fade',
        		innerWidth: options.width,
        		innerHeight: options.height,
        		initialWidth: options.width,
        		initialHeight: options.height,
        		//inline: true,
        		scrolling: false,
        		opacity:0.5,
        		//href: "#" + popupId,
        		onComplete: function(){ 
            		$('.carousel').crazyscroller();
            		$(document).trigger('launchVideo');
        		}
        	});
		});
		
		return this;
    };
    
	$.fn.beenbusy.defaults = {
	    popupDivClass: '.popup-div',
	    width:undefined,
	    height:undefined
	};
})(jQuery);
