
function moveSelected(lstbxFrom,lstbxTo)
{
 var varFromBox = document.getElementById(lstbxFrom); // all(lstbxFrom);
 var varToBox = document.getElementById(lstbxTo); // all(lstbxTo); 
 if ((varFromBox != null) && (varToBox != null)) 
 { 
  if(varFromBox.length < 1) 
  {
   //alert('There are no items in the source ListBox');
   return false;
  }
  if(varFromBox.options.selectedIndex == -1) // when no Item is selected the index will be -1
  {
   //alert('Please select an Item to move');
   return false;
  }
  while ( varFromBox.options.selectedIndex >= 0 ) 
  { 
   var newOption = new Option(); // Create a new instance of ListItem 
   newOption.text = varFromBox.options[varFromBox.options.selectedIndex].text; 
   newOption.value = varFromBox.options[varFromBox.options.selectedIndex].value; 
   varToBox.options[varToBox.length] = newOption; //Append the item in Target Listbox
   varFromBox.remove(varFromBox.options.selectedIndex); //Remove the item from Source Listbox 
  } 
 }
 return false; 
}

function selectAll(boxId) {
var box = document.getElementById(boxId);
  if (box != null)
     for(var i=0; i<box.length; i++) {
          box[i].selected = true;
     }     
}

function toggleVisibility(id, toggle, textOpen, textClose) {

var element = document.getElementById(id);
if (!textOpen)
  textOpen = 'mer...';
if (!textClose)
  textClose = 'mindre';

if (element != null)
  if (element.style.display == '' ) {
      element.style.display = 'none';
	  if (toggle)
	      toggle.innerHTML = textOpen;
  }
  else {
      element.style.display = '';
	  if (toggle)
	      toggle.innerHTML = textClose;
  }
  
return false;

}
