function selectAll( srcList, delAll ) {
  numOptions = srcList.options.length;
  for( var i = 0; i < numOptions; i++ ) {
    if ( delAll )
	  srcList.options[ 0 ] = null;
	else
      srcList.options[ i ].selected = true;
  }
}

function addVals( srcList, destList ) {
  if ( srcList.selectedIndex == -1 ) return;
  for ( var i = 0; i < srcList.options.length; i++ ) { 
    if ( srcList.options[ i ].selected == true ) {
      addVal( destList, srcList.options[ i ].text );
	}
  }
}

function delVals( srcList ) {
  if ( srcList.selectedIndex == -1 ) return;
  for ( var i = srcList.options.length - 1; i >= 0; i-- ) { 
    if ( srcList.options[ i ].selected == true ) {
      srcList.options[ i ] = null;
	}
  }
}

function addVal( destList, theVal ) {
  addVar = true;
  for( var j = 0; j < destList.options.length; j++ ) {
    if ( destList.options[ j ].text == theVal ) {
      addVar = false;
      break;
    }
  }
  if ( addVar ) destList.options[ destList.options.length ] = new Option( theVal, theVal, true );
}
