// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function toggle_value(element, on, off) 
{
  if(element.getValue() == on) 
    element.value = off;
  
  else if (element.getValue() == off) 
    element.value = on;
}

function toggleElement(eltID, show) 
{
  var toggleElt = $(eltID);
  if (show) 
    new Effect.BlindDown(toggleElt);

  else 
    new Effect.BlindUp(toggleElt);
}

function mark_for_destroy(element) 
{
	$(element).next('.should_destroy').value = 1;
	$(element).up('.question').hide();
}