/**
 * YtTools
 * requires mootools version 1.1
 *
 * @author yootheme.com
 * @copyright Copyright (C) 2007 YOOtheme Ltd. & Co. KG. All rights reserved.
 */ 
var YtTools = {
		
	start: function() {
		
		/* Match width of div tags */
		YtTools.matchDivWidthWithContent('#gallery div[class^=module]', '#gallery', 160);

		/* Lightbox */
		YtBase.setupLightbox();		
		Lightbox.init();
				
		/* Spotlight */
		var spotlightFx = new YtSpotlight('div.spotlight, span.spotlight');
	},

	/* Match width of div tags */
	matchDivWidthWithContent: function(content, wrapper, offset) {
		var maxWidth = offset;
		var content  = $ES(content);
		if (content) {
			content.each(function(div, i){
				maxWidth += div.getCoordinates().width + 10;
			});
		}
		$E(wrapper).setStyle('width', maxWidth + 'px')
	}
};

/* Add functions on window load */
window.addEvent('load', YtTools.start);
