// Google Analytics tracking on RSS subscriptions
$(function() {$("a.feed_subscribe").attr("onClick","(javascript:urchinTracker('/tracking/feed');")});

// Live Comment Preview jQuery function
$(function() {
	$('#comment').one('focus',function() {
});
	var $comment = ''; 
	$('#comment').keyup(function() {
		$comment = $(this).val();
		$comment = $comment.replace(/\n/g, "<br />").replace(/\n\n+/g, '<br /><br />').replace(/(<\/?)script/g,"$1noscript");
		$('p.live-preview').html($comment);
	});
});

// Beautiful Ampersands
$(function() {
	$("*:contains('&')", document.body)
		.contents()
		.each(
			function() {
				if( this.nodeType == 3 ) {
					$(this)
						.replaceWith( this
							.nodeValue
							.replace( /&/g, "<span class='amp'>&</span>" )
						);
				}
			}
	);
});

$(function() {
	$(".tabbed").tabs({ fx: { opacity: 'toggle' } });
	//Hide content only used for accessibility reasons on tabbed interfaces
	$(".tabbed .accessibility").hide();
});
