function rowOverEffect(object) {
  if (object.className == 'dataTableRow') object.className = 'dataTableRowOver';
}
function rowOutEffect(object) {
  if (object.className == 'dataTableRowOver') object.className = 'dataTableRow';
}

function set_radio_field(id,value){
  if( id == 'invoice_address_selector' ){
    document.checkout_address.deliver_address_selector[0].checked = value;
  }else if( id == 'deliver_address_selector' ) {
    document.checkout_address.deliver_address_selector[1].checked = value;
  }
}
function breakout_of_frame() { if (top.location != location) { top.location.href = document.location.href }}


function tep_replaceButtonIe(button_name, button_value) {
  $('button[name=' + button_name + ']').hide();
  if (document.all) {
    $('button[name=' + button_name + ']').html(button_value);
  }
  return true;
}

$(document).ready(function(){
  $('.module_output').each(function(index, element) {
    $(element).find('.behavior_tab').each(function(index, element) {
      $(element).attr('focus_index', index);
      });
    });
  $(".behavior_tab").keypress(function(event){
    if(event.which == 13) {
      event.preventDefault();
      next_index = parseInt($(event.currentTarget).attr("focus_index")) + 1;
      current_parent_id = $(event.currentTarget).parents('.module_output').attr('id');
      if ($('#' + current_parent_id + ' .behavior_tab').length <= next_index) {
        next_index = 0;
      } 
      $('#' + current_parent_id + ' .behavior_tab').eq(next_index).focus();

    }

    });
});
