/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;


function change_on_off(row_id, on_off, del_id)
{
  var row = $(row_id);
//  var del = $(del_id);
//  if (del.checked) {
//    row.className = row.className.replace(' del', '');
//  }
  row.className = row.className.replace('on', '');
  row.className = row.className.replace('off', '');
  if ( on_off.checked ) {
    row.className = 'on';
  }
  else {
    row.className = 'off';
  }
//  if (del.checked) {
//    row.className += ' del';
//  }
  if ( navigator.appName == 'Microsoft Internet Explorer' ) {
    row.className += ' hover';
  }
}

function change_delete(row_id, del)
{
  var row = getobj(row_id);
  if ( del.checked ) {
    row.className += ' del';
  } else {
    row.className = row.className.replace(' del', '');
  }
}

function PMA_markRowsInit(id) {
  // for every table row ...
  var rows = $(id).getElementsByTagName('tr');
  for ( var i = 0; i < rows.length; i++ ) {
    if ( 'on' != rows[i].className.substr(0,2) && 'off' != rows[i].className.substr(0,3) ) {
      continue;
    }
    if ( navigator.appName == 'Microsoft Internet Explorer' ) {
      // but only for IE, other browsers are handled by :hover in css
      rows[i].onmouseover = function() {
        this.className += ' hover';
      }
      rows[i].onmouseout = function() {
        this.className = this.className.replace( ' hover', '' );
      }
    }
    // Do not set click events if not wanted
    if (rows[i].className.search(/noclick/) != -1) {
      continue;
    }
  }
}
