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

function toggleByCheckbox(checkboxId, toToggleId) {
    $(checkboxId).checked ? $(toToggleId).show() : $(toToggleId).hide();    
}

/* 
Go through _elements_ to find the element with _elementId_
and set its value to _value_
*/
function setValueForElementWithId(elements, elementId, value) {
  elements.each(function(elt, index) {
    if ( $(elt).id == elementId ) {
      $(elt).value = value;
    }
  });  
}


function select_text(box) {
  $(box).select();
}