// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
jQuery(document).ready(function(){
  // Your code here
// I don't know why this is here - commented on 4/21/2009 by KTF
//  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("#notice").fadeOut(2500);
/*
        jQuery('ul.sf-menu').superfish({ 
            delay:       1000,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows 
        }); 
*/
	// Expander
	jQuery('.expanded').hide();
	
	jQuery('.expander').click(function(){
		if( jQuery(this).next('.expanded').is(':hidden') ) {
			jQuery(this).next('.expanded').slideDown('normal');
			jQuery(this).removeClass('expander');
			jQuery(this).addClass('expander-hit');
		} else {
			jQuery(this).next('.expanded').slideUp('normal');
			jQuery(this).removeClass('expander-hit');
			jQuery(this).addClass('expander');
		}
	});

});

function mark_for_destroy(thisElement) {
  $(thisElement).next(".should_destroy").value = 1;
  //alert($(thisElement).next(".should_destroy").value);
  $(thisElement).up(".option").hide();
}