function finish() { 
 if (document.getElementById('mfix') == undefined) { return; }
 if (document.getElementById('bfix') == undefined) { return; }
 var mfix = document.getElementById('mfix');
 var bfix = document.getElementById('bfix');
 var dtfh = -1;
 document.getElementById('bpos').innerHTML='<div class="bpos" style="height:'+(mfix.clientHeight+bfix.clientHeight-dtfh-1)+'px;"></div><div class="bpos" style="float:left;"></div>';
 if(mfix.clientWidth==document.getElementById('mlft').clientWidth) { document.getElementById('dtfix').style.display='none'; return; }
 dtfh = thead('dtfix','dtvar');
 if (dtfh >= 0) { 
  document.getElementById('bpos').innerHTML='<div class="bpos" style="height:'+(mfix.clientHeight+bfix.clientHeight-dtfh-1)+'px;"></div><div class="bpos" style="float:left;"></div>';
  }
 }

function thead(dtf,dtv) { 
 if (document.getElementById(dtf) == undefined) { return -1; }
 var s=document.getElementById(dtv).innerHTML;
 s=s.replace(/\s*[\n\r]+/g, "");
 document.getElementById(dtv).innerHTML=s;
//alert(s);
 document.getElementById(dtf).innerHTML=s.substring(0,s.search(/<tbody/i))+'<tbody><tr style="display:none"><td/></tr></tbody></table>';
 var thfix = document.getElementById(dtf).firstChild;
 thfix.className=thfix.className+'_';
 var thfx = thfix;
 var thfix = thfix.firstChild;
 var thvar = document.getElementById(dtv).firstChild.firstChild;
 for(r=0;r<thfix.rows.length; r++) {
  for(i=0; i<thfix.rows[r].cells.length; i++) {
   var f=thfix.rows[r].cells[i];
   var v=thvar.rows[r].cells[i];
   var w=v.clientWidth;
   f.style.width=w+'px';
   while (f.clientWidth>v.clientWidth){w=w-1;f.style.width=w+'px';}
   }
  }
 return thfx.clientHeight;
 }

