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()}};