Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h4');

$(function() {
	$('#query').data('default', $('#query').val()).focus(function() {
		if($(this).val() == $(this).data('default'))
			$(this).val('');
	}).blur(function() {
		if($(this).val() == '')
			$(this).val($(this).data('default'));
	});
	
	$('a.mp3').click(function() { 
		if(typeof pageTracker !== 'undefined')
			pageTracker._trackEvent('MP3', 'Download', $(this).text());							  
	});
	
	$('a.pdf').click(function() { 
		var title;
		if(this.title != '')
			title = this.title;
		else if( $('img', this).length )
			title = $('img', this).attr('alt');
		else
			title = $(this).text();
		
		if(typeof pageTracker !== 'undefined')
			pageTracker._trackEvent('PDF', 'Download', title);							  
	});
	
	$("a[href*='/images/infographics/']").click(function() {
		var sec = $(this).closest('body').attr('id').charAt(0).toUpperCase() + $(this).closest('body').attr('id').slice(1),
			title = $('.info-preview').attr('alt') +" - "+sec;
		
		if(typeof pageTracker !== 'undefined')
			pageTracker._trackEvent('Infographic', 'Download', title);
	});
});