$(document).ready( function() {
	
	/* Add notice pointer */
	
	$('.notice.alert').append('<div class="pointer"></div>');

	/* Create clickable mailto links */
	
	$('span.mailto').each(function() {
		var mailto = $(this).text(),
			anchor = $(document.createElement('a'));

		anchor.attr('href', 'mailto:' + mailto);
		anchor.append(mailto);
		if (typeof _gaq == 'object') {
			anchor.click( function() {
				_gaq.push(['_trackEvent', 'Contact us', 'Mailto click', document.title]);
			});
		}
		$(this).html(anchor);
	});
	
	/* Create pretty quotes */
	
	$('blockquote').each( function() {	
		var quoteLeft = $(document.createElement('span'));
		quoteLeft.attr('class', 'quote-left');
	
		var quoteRight = $(document.createElement('span'));
		quoteRight.attr('class', 'quote-right');

		$(this).append(quoteLeft);
		$(this).append(quoteRight);
	});
	
	/* Scroll to top of page */
	
	$('a.scroll-to-top').click( function() {	
		$(window).scrollTop(0);
		return false;
	});
	
});

