/* NOTE: this file is used only for portal functionalities */

function copy(from_list, to_list) {
    var to = $("#"+to_list);
    /* remove instructions */
    $("#"+to_list+" > option[@value=temp]").each(function () {
        $(this).remove();
        
    });
    /* move from one list to the other */
    $("#"+from_list+" > option:selected").each(function () {
        $(this).appendTo(to);
    });
    
    /* sort the to list */
    to.sortOptions();
}

function select_all(list)
{
    if (document.getElementById) {
      List = document.getElementById(list);
      if (List.length && List.options[0].value == 'temp') return;
      for (i=0;i<List.length;i++)
      {
         List.options[i].selected = true;
      }
    }
}