(function($)
{
	$.fn.mediaContainer = function(text, args) {
		return this.each(function() {
			var $this = $(this);
			
			if($this.hasClass('gallery'))
			{
				//init lightbox for the images
				$this.children('a').lightBox();
				// display only 1 image in the page, but lightbox will show them all.
				if ($this.hasClass('single'))
				{
					$this.children('a:not(:first)').hide();
				}
			}
		});
	};
	$(function(){
		// initialize all media containers on pageload.
		$('div.mediacontainer').mediaContainer();
	});
})($);

