function Horde_Form_Sorter(A,C,B){this._instanceName=A;this._varName=C;this._header="";this.minLength=0;if(B!=""){this._header=B;this.minLength=1}this.sorterList=document.getElementById(this._varName+"[list]");this.sorterArray=document.getElementById(this._varName+"[array]");this.deselectHeader=function(){if(this._header!=""){this.sorterList[0].selected=false}};this.setHidden=function(){var E=[];for(var D=this.minLength;D<this.sorterList.length;D++){if(this.sorterList[D].value){E[D-this.minLength]=this.sorterList[D].value}}this.sorterArray.value=E.join("\t")};this.moveColumnUp=function(){var E=this.sorterList.selectedIndex;if(E<=this.minLength||this.sorterList.length<=this.minLength+1){return }this.sorterList.selectedIndex=E;var D=this.sorterList[E].value;tmp=[];for(i=this.minLength;i<this.sorterList.length;i++){tmp[i-this.minLength]=new Option(this.sorterList[i].text,this.sorterList[i].value)}for(i=0;i<tmp.length;i++){if(i+this.minLength==E-1){this.sorterList[i+this.minLength]=tmp[i+1]}else{if(i+this.minLength==E){this.sorterList[i+this.minLength]=tmp[i-1]}else{this.sorterList[i+this.minLength]=tmp[i]}}}this.sorterList.selectedIndex=E-1;this.setHidden()};this.moveColumnDown=function(){var D=this.sorterList.selectedIndex;if(D==-1||D==this.sorterList.length-1){return }this.sorterList.selectedIndex=D;var E=this.sorterList[D].value;tmp=[];for(i=this.minLength;i<this.sorterList.length;i++){tmp[i-this.minLength]=new Option(this.sorterList[i].text,this.sorterList[i].value)}for(i=0;i<tmp.length;i++){if(i+this.minLength==D){this.sorterList[i+this.minLength]=tmp[i+1]}else{if(i+this.minLength==D+1){this.sorterList[i+this.minLength]=tmp[i-1]}else{this.sorterList[i+this.minLength]=tmp[i]}}}this.sorterList.selectedIndex=D+1;this.setHidden()}};