function Select(B){var A=B.selectedIndex;oListText.selectedIndex=A;oListValue.selectedIndex=A;var D=document.getElementById("txtText");var C=document.getElementById("txtValue");D.value=oListText.value;C.value=oListValue.value}function Add(){var B=document.getElementById("txtText");var A=document.getElementById("txtValue");AddComboOption(oListText,B.value,B.value);AddComboOption(oListValue,A.value,A.value);oListText.selectedIndex=oListText.options.length-1;oListValue.selectedIndex=oListValue.options.length-1;B.value="";A.value="";B.focus()}function Modify(){var A=oListText.selectedIndex;if(A<0){return }var C=document.getElementById("txtText");var B=document.getElementById("txtValue");oListText.options[A].innerHTML=HTMLEncode(C.value);oListText.options[A].value=C.value;oListValue.options[A].innerHTML=HTMLEncode(B.value);oListValue.options[A].value=B.value;C.value="";B.value="";C.focus()}function Move(A){ChangeOptionPosition(oListText,A);ChangeOptionPosition(oListValue,A)}function Delete(){RemoveSelectedOptions(oListText);RemoveSelectedOptions(oListValue)}function SetSelectedValue(){var A=oListValue.selectedIndex;if(A<0){return }var B=document.getElementById("txtSelValue");B.value=oListValue.options[A].value}function ChangeOptionPosition(E,B){var A=E.selectedIndex;if(A<0){return }var F=A+B;if(F<0){F=0}if(F>(E.options.length-1)){F=E.options.length-1}if(A==F){return }var D=E.options[A];var C=HTMLDecode(D.innerHTML);var G=D.value;E.remove(A);D=AddComboOption(E,C,G,null,F);D.selected=true}function RemoveSelectedOptions(D){var A=D.selectedIndex;var B=D.options;for(var C=B.length-1;C>=0;C--){if(B[C].selected){D.remove(C)}}if(D.options.length>0){if(A>=D.options.length){A=D.options.length-1}D.selectedIndex=A}}function AddComboOption(D,F,E,A,B){var C;if(A){C=A.createElement("OPTION")}else{C=document.createElement("OPTION")}if(B!=null){D.options.add(C,B)}else{D.options.add(C)}C.innerHTML=F.length>0?HTMLEncode(F):"&nbsp;";C.value=E;return C}function HTMLEncode(A){if(!A){return""}A=A.replace(/&/g,"&amp;");A=A.replace(/</g,"&lt;");A=A.replace(/>/g,"&gt;");return A}function HTMLDecode(A){if(!A){return""}A=A.replace(/&gt;/g,">");A=A.replace(/&lt;/g,"<");A=A.replace(/&amp;/g,"&");return A};