$(document).ajaxSend(function(event, request, settings) {
  if (typeof(AUTH_TOKEN) == "undefined") return;
  // settings.data is a serialized string like "foo=bar&baz=boink" (or null)
  settings.data = settings.data || "";
  settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(AUTH_TOKEN);
});

$(document).ready(function(){
	$(".striped tr:even").addClass("alt");
	$(".striped tr.order-summary").removeClass("alt");
	$(".striped tr.order-total").removeClass("alt");
	$("#handle").hide();
	$("#toggle_handle").click( function(){
		$("#handle").toggle();
	});

	$(".notice").fadeTo(3000, 1).BlindUp();
	
	$("#product_new #product_tag_list").defaultvalue("add, tags, for, this, product");
	$("#search-field").defaultvalue("Search");
	$("#thumbnails img.featured:first").show();
	$('a[rel*=facebox]').facebox();
	
	$(".hide").hide();
	
	$("#toggle_help").click(function() {
		id = $(this).attr('title');
		$(id).toggle();
	});
	$("#preview").cycle({
		fx: 'scrollRight',
		easing: 'easeInOutBack',
		pause: 1,
		timeout: 5000
	}).pngFix();
});
