// duale Liste - Move-Funktion
function move_dualeListe( srcList, destList, moveAll, move ) {

	if (destList)
	{
		newDestList = new Array( destList.options.length );
		var len = 0;
		for( len = 0; len < destList.options.length; len++ )
		{
			if ( destList.options[ len ] != null ) {
				newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
			}
		}
	
		for( var i = 0; i < srcList.options.length; i++ )
		{ 
			if (srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
			{
	
				if (newDestList.length == 10)
				{
					alert('Tut uns leid, Du kannst maximal 10 Sprachen angeben!');
					return false;
				}	
		
				// Incorporate into new list
				newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );
				len++;
			}
		}
		
		// Populate the destination with the items from the new array
		for ( var j = 0; j < newDestList.length; j++ )
		{
			if ( newDestList[ j ] != null )
			{
				destList.options[ j ] = newDestList[ j ];
			}
		}
		
		// Erase source list selected elements
		for( var i = srcList.options.length - 1; i >= 0; i-- )
		{ 
			if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
			{
				// Erase Source
				srcList.options[i]       = null;
			}
		}
		
		select(srcList, false);		
	}
	return false;
} // Funcktion - Ende

function select(list, value)
{
	for( var i = 0; i < list.options.length; i++ )
	{ 
		if (list.options[i] != null && ( list.options[i].selected != value) )
		{
			list.options[i].selected = value;
		}
	}
}
