$(document).ready(function(){

	Bootlog.revealMenu();
	Bootlog.trackDownloadLinks();

});

var Bootlog = {

	revealMenu: function(){

		var timer=0;
		$('#menu').removeClass('invisible').children().hide().each(function(){

			timer += 1000;
			$(this).fadeIn(timer);

		});

	},

	showSearch: function(item){

		if($('#search').is(':visible')){

			$('#search').fadeOut('slow');

		} else {

			$('#search').fadeIn('slow', function(){ $('input#s').focus(); });

		}

		return false;

	},

	trackDownloadLinks: function(){

		$('a.download').click(function(){

			var link = this.href;
			// eliminamos el http:// con el hostname en caso de lo que tenga
			if(link.match(/http:/)) link = link.substring(7+this.hostname.length,link.length);
			pageTracker._trackPageview(link);

		});

	}

}
