function onmouseup()

m_bMousedown=false;
m_bCellResize=false;
element.document.body.style.cursor='default';  //取消鼠标样式
}function onmousemove()
{
var oTd;
var iMouseShiftPos;
var iNewTargetCellWidth;
if(m_iCurRowIndex==-1 || m_iCurColIndex==-1) return;

oTd=element.rows(m_iCurRowIndex).cells(m_iCurColIndex);
if(m_bMousedown==false && m_bCellResize==false)
{
if(Math.abs(oTd.offsetWidth-event.offsetX)<=4)
{
element.document.body.style.cursor='col-resize';
}
else
{
element.document.body.style.cursor='default';  
return;
}    
    }
    else
    { 
if(m_iTagetCellIndex==-1) return;
iMouseShiftPos=event.x-m_iMousedownPos;
oTargetCell=element.rows[0].children[m_iTagetCellIndex];
iNewTargetCellWidth=parseInt(oTargetCell.style.width) + parseInt(iMouseShiftPos); if(parseInt(element.clientWidth)+parseInt(iMouseShiftPos)<1)//表格没有了呀!
  return;
if(iNewTargetCellWidth<1)//单元格没有了呀!
  return;
  
for(i=0;i<element.rows.length;i++)
{
oTargetCell=element.rows(i).cells(m_iTagetCellIndex);
oTargetCell.children(0).style.width=iNewTargetCellWidth;
oTargetCell.style.width=iNewTargetCellWidth;
}
element.style.width=parseInt(element.style.width)+parseInt(iMouseShiftPos);
m_iMousedownPos=event.x;
}
     //saveColumnWidth();     
}function ondblclick()
{
if(m_iCurRowIndex==0 && m_iCurColIndex!=-1)
{
compositor();
}
}function saveColumnWidth()
{
var oBannerCell=element.rows[0].children
var sColumnWidth=oBannerCell[0].offsetWidth;
for(var i=1;i<oBannerCell.length;i++)
{
sColumnWidth+=",";
sColumnWidth+=oBannerCell[i].offsetWidth;      
}
setCookie(getPageBaseURL()+'sColumnWidth',sColumnWidth);
setCookie(getPageBaseURL()+'sTableWidth',element.offsetWidth);
}function retrievesColumnWidth()
{
var sColumnWidth=getCookie(getPageBaseURL()+'sColumnWidth')
var sTableWidth=getCookie(getPageBaseURL()+'sTableWidth')
if(sColumnWidth==null||sTableWidth==null)
{
return;
}
element.style.width=sTableWidth;
sColumnWidth=sColumnWidth.split(",");
var oBannerCell=element.rows[0].children
for(var i=0;i<sColumnWidth.length;i++)
{      
oBannerCell[i].style.width=sColumnWidth[i];     

}// The cookie expires is one month.
function setCookie(sName, sValue)
{
var day=new Date();
var expireDay=new Date();
var intervalDay=31*24*60*60*1000; 
expireDay.setTime(day.getTime()+intervalDay);
element.document.cookie = sName + "=" + escape(sValue) + "; expires=" + expireDay.toGMTString(); 
}function getCookie(sName)
{
var aCookie;
var allCookie = document.cookie.split("; ");
for (var i=0;i<allCookie.length;i++)
{
aCookie = allCookie[i].split("=");
if (sName == aCookie[0]) 
return unescape(aCookie[1]);
}
return null;
}function onmouseoutTable()
{
//if(event.srcElement.tagName=="TABLE")
//{
// element.document.body.style.cursor='default';  //取消鼠标样式
//}
}function setCurRowIndex()
{
var oTr=event.srcElement;
while(oTr.tagName!="TR" && oTr.tagName!="TABLE")
{
oTr=oTr.parentElement;
}
if(oTr.tagName=="TR")
m_iCurRowIndex = oTr.rowIndex;
else
m_iCurRowIndex = -1;
}function setCurColIndex()
{
var oTd=event.srcElement;
while(oTd.tagName!="TD" && oTd.tagName!="TABLE")
{
oTd=oTd.parentElement;
}
if(oTd.tagName=="TD")
m_iCurColIndex = oTd.cellIndex;
else
m_iCurColIndex = -1;
}//对选定的列按指定的规则进行排序
function compositor()
{
var i,j,t;
var max;
var arrCell=new Array(element.rows.length);

for(i=1;i<element.rows.length;i++) //获得排序数据
{
arrCell[i]=element.rows(i).cells(m_iCurColIndex).innerText;
}
//选择排序
for(i=1;i<arrCell.length-1;i++)
{
max=i;
for(j=i+1;j<arrCell.length;j++)
{
if(arrCell[j]>arrCell[max]) max=j;
}
if(max!=i)
{
t=arrCell[i];
arrCell[i]=arrCell[max];
arrCell[max]=t;

for(j=0;j<element.rows(0).cells.length;j++)
{
t=element.rows(i).cells(j).children(0).innerText;
element.rows(i).cells(j).children(0).innerText=element.rows(max).cells(j).children(0).innerText;
element.rows(max).cells(j).children(0).innerText=t;
}
}
}
}
//-->
</script>
怎么用这段代码?可以举个例子吗?