<Table width = "100%" border = "1">
<Tr>
<Td width = "10%"> <table width = "100%" height = "100%" border = "1">
<Tr>
<Td> <input type = "button" name = "Submit3" value = "TOP" onClick = "moveFirst ()"> </td>
</Tr>
<Tr>
<Td> <input type = "button" name = "Submit" value = "up" onClick = "moveUp ()"> </td>
</Tr>
<Tr>
<Td> <input type = "button" name = "Submit2" value = "down" onClick = "moveDown ()"> </td>
</Tr>
<Tr>
<Td> <input type = "button" name = "Submit4" value = "bottom" onClick = "moveEnd ()"> </td>
</Tr>
</Table> </td>
<Td> <table width = "100%" border = "1" id = "DynaTable">
<Tr>
<Td> <input type = "radio" name = "radio1" value = "1" onClick = "radioChecked (this)"> </td>
<Td> first </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "2" onClick = "radioChecked (this)"> </td>
<Td> second </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "3" onClick = "radioChecked (this)"> </td>
<Td> third </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "4" onClick = "radioChecked (this)"> </td>
<Td> fourth </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "5" onClick = "radioChecked (this)"> </td>
<Td> fifth </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "6" onClick = "radioChecked (this)"> </td>
<Td> sixth </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "7" onClick = "radioChecked (this)"> </td>
<Td> seventh </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "8" onClick = "radioChecked (this)"> </td>
<Td> eighth </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "9" onClick = "radioChecked (this)"> </td>
<Td> ninth </td>
</Tr>
<Tr>
<Td> <input type = "radio" name = "radio1" value = "10" onClick = "radioChecked (this)"> </td>
<Td> tenth </td>
</Tr>
</Table> </td>
</Tr>
</Table>
<Script language = "javascript">
<! --
Var moveRow = false;
Var moveRadio = false;
Function radioChecked (obj ){
MoveRadio = obj;
MoveRow = obj. parentNode. parentNode;
}
Function moveUp (){
If (moveRow ){
Var prevRow = moveRow. previussibling;
If (prevRow ){
Document. all ["DynaTable"]. childNodes [0]. insertBefore (moveRow, prevRow );
MoveRadio. checked = true;
}
}
}
Function moveDown (){
If (moveRow ){
Var nexRow = moveRow. nextSibling;
If (nexRow ){
Var nnextRow = nexRow. nextSibling;
If (nnextRow ){
Document. all ["DynaTable"]. childNodes [0]. insertBefore (moveRow, nnextRow );
} Else {
Document. all ["DynaTable"]. childNodes [0]. appendChild (moveRow );
}
MoveRadio. checked = true;
}
}
}
Function moveEnd (){
If (moveRow ){
Document. all ["DynaTable"]. childNodes [0]. appendChild (moveRow );
MoveRadio. checked = true;
}
}
Function moveFirst (){
If (moveRow ){
Document. all ["DynaTable"]. childNodes [0]. insertBefore (moveRow, document. all ["DynaTable"]. childNodes [0]. firstChild );
MoveRadio. checked = true;
}
}
// -->
</Script>