text: /*
   * ###
   * Framework Web Archive
   * 
   * Copyright (C) 1999 - 2012 Photon Infotech Inc.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * ###
   */
  function addOption(theSel, theText, theValue)
  {
    var newOpt = new Option(theText, theValue, false, true);
    var selLength = theSel.length;
    theSel.options[selLength] = newOpt;
  }
  
  function deleteOption(theSel, theIndex)
  { 
    var selLength = theSel.length;
    if(selLength>0)
    {
      theSel.options[theIndex] = null;
    }
  }
  function moveOptions(theSelFrom, theSelTo)
  {
    
    var selLength = theSelFrom.length;
    var selectedText = new Array();
    var selectedValues = new Array();
    var selectedCount = 0;
    var i;
    for(i=selLength-1; i>=0; i--)
    {
      if(theSelFrom.options[i].selected)
      {
        selectedText[selectedCount] = theSelFrom.options[i].text;
        selectedValues[selectedCount] = theSelFrom.options[i].value;
        deleteOption(theSelFrom, i);
        selectedCount++;
      }
    }
    for(i=selectedCount-1; i>=0; i--)
    {
      addOption(theSelTo, selectedText[i], selectedValues[i]);
    }
    
    if(NS4) history.go(0);
  }
  function moveAllOptions(theSelFrom, theSelTo)
  {
    
    var selLength = theSelFrom.length;
    var selectedText = new Array();
    var selectedValues = new Array();
    var selectedCount = 0;
    var i;
    for(i=selLength-1; i>=0; i--)
    {
        selectedText[selectedCount] = theSelFrom.options[i].text;
        selectedValues[selectedCount] = theSelFrom.options[i].value;
        deleteOption(theSelFrom, i);
        selectedCount++;
    }
    for(i=selectedCount-1; i>=0; i--)
    {
      addOption(theSelTo, selectedText[i], selectedValues[i]);
    }
  }
  