function func_insert()
{
for (i=document.form1.select2.options.length-1; i>=0; i--)
{
if(document.form1.select2.options[i].selected)
{
option_text=document.form1.select2.options[i].text;
option_value=document.form1.select2.options[i].value;
option_style_color=document.form1.select2.options[i].style.color;
var my_option = document.createElement("OPTION");
my_option.text=option_text;
my_option.value=option_value;
my_option.style.color=option_style_color;
//pos=func_find(select1,option_text);
document.form1.select1.options.add(my_option);
document.form1.select2.remove(i);
}
}//for
}
function func_delete()
{
for (i=document.form1.select1.options.length-1; i>=0; i--)
{
if(document.form1.select1.options[i].selected)
{
option_text=document.form1.select1.options[i].text;
option_value=document.form1.select1.options[i].value;
var my_option = document.createElement("OPTION");
my_option.text=option_text;
my_option.value=option_value;
alert(my_option.text);
alert(my_option.value);
//pos=func_find(select2,option_text);
document.form1.select2.options.add(my_option);
document.form1.select1.remove(i);
}
}//for
}
function func_select_all1()
{
for (i=document.form1.select1.options.length-1; i>=0; i--)
document.form1.select1.options[i].selected=true;
}
function func_select_all2()
{
for (i=document.form1.select2.options.length-1; i>=0; i--)
document.form1.select2.options[i].selected=true;
}
function func_up()
{
sel_count=0;
for (i=document.form1.select1.options.length-1; i>=0; i--)
{
if(document.form1.select1.options[i].selected)
sel_count++;
}
if(sel_count==0)
{
alert("<?=_("调整顺序时,请选择其中一项!")?>");
return;
}
else if(sel_count>1)
{
alert("<?=_("调整顺序时,只能选择其中一项!")?>");
return;
}
i=document.form1.select1.selectedIndex;
if(i!=0)
{
var my_option = document.createElement("OPTION");
my_option.text=document.form1.select1.options[i].text;
my_option.value=document.form1.select1.options[i].value;
document.form1.select1.options.add(my_option,i-1);
document.form1.select1.remove(i+1);
document.form1.select1.options[i-1].selected=true;
}
}
function func_down()
{
sel_count=0;
for (i=document.form1.select1.options.length-1; i>=0; i--)
{
if(document.form1.select1.options[i].selected)
sel_count++;
}
if(sel_count==0)
{
alert("<?=_("调整顺序时,请选择其中一项!")?>");
return;
}
else if(sel_count>1)
{
alert("<?=_("调整顺序时,只能选择其中一项!")?>");
return;
}
i=document.form1.select1.selectedIndex;
if(i!=document.form1.select1.options.length-1)
{
var my_option = document.createElement("OPTION");
my_option.text=document.form1.select1.options[i].text;
my_option.value=document.form1.select1.options[i].value;
document.form1.select1.options.add(my_option,i+2);
document.form1.select1.remove(i);
document.form1.select1.options[i+1].selected=true;
}
}