Move <option> to top of list with Javascript
<p>I'm trying to create a button that will move the currently selected OPTION in a SELECT MULTIPLE list to the top of that list. I currently have <a href="http://www.mattkruse.com/javascript/optiontransfer/combined_compact_source.html" rel="nofollow">OptionTransfer.js</a> implemented, which is allowing me to move items up and down the list.  I want to add a new function </p>

<pre>function moveOptionTop(obj){ 
var i = obj.selectedIndex; 
if(i == 0){return;} 
var length = obj.options.length; 
for(j=length;j>0;j++){ obj.options[j] = obj.options[j-1]; //move all elements up a position to free up index 0 } 
obj.options[0] = obj.options[i+1]; //set new [0] element
for(j=i+1;j</pre>
