// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function initHelp () {
	jQuery('a.help-tips').click(function() {
		jQuery(this).next('div.help-tips').show('fast');
		return false;
	    }
	  );
	jQuery('div.help-tips img').click(function() {
		jQuery(this).parent('div.help-tips').fadeOut('fast');
		return false;
	    }
	  );
     }
function initProductShow() {	
	jQuery("#show-product img").addClass("product-image");
}
function form_submitted(submit_message) {
  $$('div.submit input')[0].disabled = true;
  $('submit_spinner').show();
  if ($('submit_cancel')) $('submit_cancel').hide();
  $('submit_message').innerHTML = (submit_message ? submit_message : "One moment...");
}

function comment_reply(name) {
  $('comment_comment').value = name + ': ';
  $('comment_name').focus();
}

jQuery(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);
});
jQuery(document).ready(function () {
  jQuery("body").addClass("jsenabled");  
  initHelp();
  initProductShow();
});