<script type="text/javascript">
//左右移动
function LeftRightChangeOptions(option,select){
var orderselect=document.getElementById(select);
for(var i=0;i<orderselect.options.length;i++)
{
if(option.value==orderselect.options[i].value)
break;
}
if(i==orderselect.options.length)
orderselect.options.add(new Option(option.text,option.value));
}
function LeftRightDirectionOnChange(select1,select2){
var orderselect=document.getElementById(select1);
for(var i=0;i<orderselect.options.length;i++)
{
if(orderselect.options[i].selected)
{
ChangeOptions(orderselect.options[i],select2);
orderselect.remove(i);
i--;
}
}
}
//******************************************************************************
//上下移动
function UpDownChangeOptions(int1,int2){
var orderselect=document.getElementById("lstbSubOrder");
var itemText=orderselect.options[int1].text;
var itemValue=orderselect.options[int1].value;
var itemSelect=orderselect.options[int1].selected;
orderselect.options[int1].text=orderselect.options[int2].text;
orderselect.options[int1].value=orderselect.options[int2].value;
orderselect.options[int1].selected=orderselect.options[int2].selected;
orderselect.options[int2].text=itemText;
orderselect.options[int2].value=itemValue;
orderselect.options[int2].selected=itemSelect;
}
function UpDownDirectionOnChange(direction){
var orderselect=document.getElementById("lstbSubOrder");
var cnt=orderselect.options.length;
if(direction=="up")
{
for(var i=0;i<cnt;i++)
{
if(orderselect.options[i].selected)
{
if(i==0)
return;
ChangeOptions(i-1,i);
}
}
}
else
{
for(var i=cnt-1;i>-1;i--)
{
if(orderselect.options[i].selected)
{
if(i==cnt-1)
return;
ChangeOptions(i,i+1);
}
}
}
}
</script>