// Google Analytics

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20040457-3']);
_gaq.push(['_trackPageview']);

(function() {
	var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
	ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
	var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

/**
 * Initializes the site.
 */
function init()
{
	// Cover page transitions with an overlay.
	var overlayOptions = { 'tileColor': '#70B030' };
	$.tiledOverlayReveal(overlayOptions);
	$('#icons a').tiledOverlayCover(overlayOptions);

	// View media in a dia projector.
	$('#flickr-feed a, #youtube-feed a').diaProjector({});

	// Make page visible.
	$('body').css('background', '#fff url(img/paperbg.jpg)');
	$('#wrapper').css('display', 'block');

	// Make columns even height.
	evenGreatestHeight('div.column');
}

$(init);

/**
 * Sets all the matching elements to the greatest height.
 */
function evenGreatestHeight(selector)
{
	var $ees = $(selector);
	var height = 0;
	$ees.each(function(index)
	{
		var h = $(this).height();
		if (h > height)
		{
			height = h;
		}
	});
	$ees.each(function(index)
	{
		$(this).height(height);
	});
}

