function initMenu()
{
	var el = $('menu');
	
	if(el)
	{
		var child = el.getChildren();
		
		var timer1 = el.tween.delay(3000, el, ['height', '22px']);
		var timer2 = child[0].tween.delay(3000, child[0], ['opacity', '0.0']);
		
		var open = false;
		
		el.addEvent('mouseenter', function() {
			if(open) return;
			$clear(timer1);
			$clear(timer2);
			open = true;
			el.tween('height', '80px');
			child[0].tween('opacity', '1.0');
		});
		
		el.addEvent('mouseleave', function() {
			if(!open) return;
			
			open = false;
			el.tween('height', '22px');
			child[0].tween('opacity', '0.0');
		});
	}
}

function initDl()
{
	var el = $$('.download');
	
	if(el)
	{
		el.each(function(e) {
			var paragraph = e.getChildren('p')[0];
			var button = e.getChildren('a');
			
			button.addEvent('mouseenter', function() {
				paragraph.setStyle('display', 'block');
			});
			
			el.addEvent('mouseleave', function() {
				paragraph.setStyle('display', 'none');
			});
			
			paragraph.setStyle('display', 'none');
		});
	}
}

function logDownload(id)
{
	_gaq.push(['_trackEvent', 'Maps', 'Download Map ' + id, '', null]);
}

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

(function() {
	var ga = document.createElement('script');
	ga.type = 'text/javascript';
	ga.async = 'async';
	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);
})();
