obips.ShuttleBase.Item=function(b,a){this.sValue=b;this.sText=a};obips.ShuttleBase.AvailableComponent=function(b){this.select=document.createElement("SELECT");this.select.multiple=true;this.select.className="shuttleSelect";this.select.size=10;for(var c=0;c<b.length;c++){var a=new Option(b[c].sText,b[c].sValue);a.className="shuttleValue";this.select.options[this.select.length]=a}};extend(obips.ShuttleBase.AvailableComponent,obips.ShuttleBase.Component);obips.ShuttleBase.AvailableComponent.prototype.removeSelected=function(){var a=[];for(var b=0;b<this.select.options.length;b++){if(this.select.options[b].selected){a.push(new obips.ShuttleBase.Item(this.select.options[b].value,this.select.options[b].text))}}return a};obips.ShuttleBase.AvailableComponent.prototype.removeAll=function(){var a=[];for(var b=0;b<this.select.options.length;b++){a.push(new obips.ShuttleBase.Item(this.select.options[b].value,this.select.options[b].text));this.select.options[b].selected=false}return a};obips.ShuttleBase.AvailableComponent.prototype.remove=function(e){var c=[];for(var b=0;b<e.length;b++){var a=e[b];for(var d=0;d<this.select.options.length;d++){if(this.select.options[d].value==a){c.push(new obips.ShuttleBase.Item(this.select.options[d].value,this.select.options[d].text));this.select.remove(d)}}}return c};obips.ShuttleBase.AvailableComponent.prototype.add=function(a){};obips.ShuttleBase.AvailableComponent.prototype.getHTMLView=function(){return this.select};obips.ShuttleBase.SelectedComponent=function(b){this.select=document.createElement("SELECT");this.select.multiple=true;this.select.className="shuttleSelect";this.select.size=10;for(var c=0;c<b.length;c++){var a=new Option(b[c].sText,b[c].sValue);a.className="shuttleValue";this.select.options[this.select.length]=a}};extend(obips.ShuttleBase.SelectedComponent,obips.ShuttleBase.Component);obips.ShuttleBase.SelectedComponent.prototype.indexOfItem=function(b){for(var a=0;a<this.select.options.length;a++){if(this.select.options[a].value==b){return a}}return -1};obips.ShuttleBase.SelectedComponent.prototype.removeSelected=function(){var a=[];for(var b=0;b<this.select.options.length;){if(this.select.options[b].selected){a.push(new obips.ShuttleBase.Item(this.select.options[b].value,this.select.options[b].text));this.select.remove(b);continue}b++}return a};obips.ShuttleBase.SelectedComponent.prototype.removeAll=function(){var a=[];while(this.select.options.length>0){a.push(new obips.ShuttleBase.Item(this.select.options[0].value,this.select.options[0].text));this.select.remove(0)}return a};obips.ShuttleBase.SelectedComponent.prototype.add=function(a){for(var c=0;c<a.length;c++){if(this.indexOfItem(a[c].sValue)<0){var b=new Option(a[c].sText,a[c].sValue);b.className="shuttleValue";this.select.options[this.select.length]=b}}};obips.ShuttleBase.SelectedComponent.prototype.getHTMLView=function(){return this.select};obips.ShuttleBase.SelectedComponent.prototype.remove=obips.ShuttleBase.AvailableComponent.prototype.remove;obips.ShuttleBase.SelectedComponent.prototype.moveItemsToPosition=function(d,b){if(d.length>0){for(var c=0;c<d.length;c++){var a=this.indexOfSelectedItem(d[c]);this.select.options.splice(a,1)}if(b!=null){for(var c=d.length-1;c>=0;c--){this.selectedItems.splice(b,0,d[c])}}else{this.selectedItems=this.selectedItems.concat(d)}}};obips.ShuttleBase.SelectedComponent.prototype.moveSelectedItemsToPosition=function(d){if(d<0){return}var c=[];for(var b=this.select.options.length-1;b>=0;b--){if(this.select.options[b].selected){if(b<=d){d--}c.push(this.select.removeChild(this.select.options[b]))}}for(var a=0;a<c.length;a++){this.select.insertBefore(c[a],this.select.options[d])}};obips.ShuttleBase.SelectedComponent.prototype.moveSelectedItemsToBottom=function(){this.moveSelectedItemsToPosition(this.select.options.length)};obips.ShuttleBase.SelectedComponent.prototype.moveSelectedItemsToTop=function(){this.moveSelectedItemsToPosition(0)};obips.ShuttleBase.SelectedComponent.prototype.moveSelectedItemsUp=function(){var b=-1;for(var a=0;a<this.select.options.length;a++){if(this.select.options[a].selected){b=a-1;break}}if(b>=0){this.moveSelectedItemsToPosition(b)}};obips.ShuttleBase.SelectedComponent.prototype.moveSelectedItemsDown=function(){var e=-1;var d=false;var c=false;for(var b=0;b<this.select.options.length;b++){var a=this.select.options[b];if(!c&&d&&!a.selected){e=b+1;c=true}else{if(c&&a.selected){e=b+2;break}else{if(a.selected){d=true;e=b+1}}}}if(e>=0){this.moveSelectedItemsToPosition(e)}};obips.ShuttleBase.SelectedComponent.prototype.getSelectedItemIDs=function(){var a=new Array();var c=this.select.options;for(var b=0;b<c.length;b++){a.push(c[b].value)}return a};