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

/**
 * Returns the value of the selected radio button in the radio group
 *
 * @param {radio Object} or {radio id} el
 * OR
 * @param {form Object} or {form id} el
 * @param {radio group name} radioGroup
 */
/*
function $RF(el, radioGroup) {
  if($(el).type == 'radio') {
    var el = $(el).form;
    var radioGroup = $(el).name;
  } else if ($(el).tagName.toLowerCase() != 'form') {
    return false;
  }
  return $F($(el).getInputs('radio', radioGroup).find(
    function(re) {return re.checked;}
  ));
}

*/
function $RF(radioClassName) {
  var tab=document.getElementsByName(radioClassName);
  for (var i=0;i<tab.length;i++) {
    var el=$(tab[i]);
    if (el.checked) {
      return el.value;
    }
  }
  return "";

}
