(function($) {
	$().ajaxSend(function(a, xhr, s) {
		s.data = (s.data ? s.data + '&' : '') + 'authenticity_token=' + encodeURIComponent(form_authenticity_token);
		xhr.setRequestHeader('Accept', 'text/javascript, text/html, application/xml, text/xml, */*');
	});
})(jQuery);

$(function() {
	$('#post_comment').livequery('submit', function() {
		// this is simply ajaxForm - but here using livequery instead of normal bind
		$(this).ajaxSubmit({
			success: function(responseText) {
				// replace our history section with that from the response document
				$('#history').html($('#history', responseText).html());
			}
		});
		return false;
	});
	
	$('a.zoom').livequery(function() { // livequery('fancybox', {...}) doesn't work, but this does
		$(this).fancybox({
			'hideOnContentClick': true,
			'overlayShow': false,
			'zoomSpeedIn': 300,
			'zoomSpeedOut': 300,
			'easingIn': 'linear',
			'easingOut': 'linear'
		});
	});
});
