function fnMoveItems(lstbxFrom,lstbxTo)
{
var varFromBox = document.getElementById(lstbxFrom);
var varToBox = document.getElementById(lstbxTo); 
 //if ((varFromBox != null) && (varToBox != null))
if ((varFromBox != 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 
  //}
  
  if( 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;
}