(function($) {

   $.fn.coloredtabs = function(settings) {
     var config = {'foo': 'bar'};

     if (settings) $.extend(config, settings);

     this.each(function() {
			 // create div to mask line between the tab and its box
			 $('<div id="tabfilter" />').prependTo("body");

			 // initialize upon page load
       $(this).children("div.photos").hide().css({
					position: 'absolute',
					top: '100px',
					left: '200px'});
					
			 // define on-click event
       $(this).children("h2").css('cursor', 'pointer')
	     		.click(function(event) {
	     		  // hide all divs with photos
						$(this).parent().children("div.photos").hide();
						// remove highlight from all headers
						$(this).parent().children("h2").css({
							'font-weight': 'normal'
						});
						// highlist actual header
						$(this).css({
							'font-weight': 'bold'
						});
						// show the div with photos
			 			$(this).next().show();
						// mask border between the tab and the box
						curveySupports = curvyBrowser.isMoz || curvyBrowser.isWebKit;
						var me = $(this);
						$("#tabfilter").offset({
							left: me.offset().left + me.outerWidth() - 7,
							top: me.offset().top + 2
						}).height(me.innerHeight() - (curveySupports ? 0 : 4));
					});
					
  	   // show first box
			 $(this).children("h2").first().click();
     });

 	   return this;
   };

})(jQuery);

