var inRadioCheck=0;
function rowfly( r, val, action )
{

 var tabulate_flyover_cellclass=document.menuform.__tabulate_flyover_cellclass.value
  var rowid="_ROW_"+r+"_"+val;
  var row=document.getElementById(rowid).childNodes;
  if ( row == null || row == undefined ){
    return;
  }
  for( var i = 0; i < row.length ; i++ ){
    dostyleclass( row[i], action, tabulate_flyover_cellclass );
  }
}
function dostyleclass( thing, action, cls )
{
    switch( action ){
      case 0:
        if ( eval( "/\s*"+cls+"\s*/.test(thing.className)") ){
          eval( "thing.className=thing.className.replace( /^(.*)\s*"+cls+"\s*(.*)$/, \"$1 $2\" )");
        }
        break;
      case 1:
         if ( ! eval( "/\s*"+cls+"\s*/.test(thing.className)" ) ){
              thing.className=thing.className+" "+cls;
         }
         break;
    }
  return;
}
function rowclick( r, val, m_id )
{
 var tabulate_selected_cellclass=document.menuform.__tabulate_selected_cellclass.value
  var inpid="_INP_"+r+"_"+val;
  var input=document.getElementById(inpid);
  if ( input == null || input == undefined ){
    return;
  }
  /* now check it */
   if ( inRadioCheck == 0 ){
     if ( input.checked ){
      input.checked=false;
      action=0;
    }else{
      input.checked=true;
      action=1;
    }
  }else{
    if ( input.checked ){
      action=1;
    }else{
      action=0;
    }
  }
   inRadioCheck=0;
  /* now highlight the checked row */
  var rowid="_ROW_"+r+"_"+val;
  var row=document.getElementById(rowid).childNodes;
  if (  row != null &&  row != undefined ){
    for( var i = 0; i < row.length ; i++ ){
      dostyleclass( row[i], action, tabulate_selected_cellclass );
    }
  }
  /* do we need to uncheck the currently selected row */
  eval( "other=document.menuform.__SELECTEDVALUE_"+r+".value" );
  if ( m_id > 0 && input.checked ){
    do_submit(m_id);
  }
  /* do we need to uncheck the currently selected row */
  eval( "other=document.menuform.__SELECTEDVALUE_"+r+".value" );
  if ( other == -1 ){
    return;
  }
  if ( other > 0 ){
    var new_rowid="_ROW_"+r+"_"+other;
    var new_row=document.getElementById(new_rowid).childNodes;
     for( var i = 0; i < new_row.length ; i++ ){
      dostyleclass( new_row[i], 0 , tabulate_selected_cellclass );
    }   
  }
  eval( "document.menuform.__SELECTEDVALUE_"+r+".value=val" );
}
function radiocheckfix()
{
  inRadioCheck=1;
}
