Det her klarer sagen:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="vs_targetSchema" content="
http://schemas.microsoft.com/intellisense/ie5"> </head>
<body>
<select id=tst size=10 multiple onmouseover="SaveItems(this)" onchange="SelectItem(this);">
<option>test 1</option>
<option>test 2</option>
<option>test 3</option>
<option>test 4</option>
</select>
</body>
</html>
<script language=javascript>
var arr = new Array();
function SelectItem(ts)
{
arr[ts.selectedIndex] = !arr[ts.selectedIndex];
for( var t=0; t<arr.length; t++ )
{
ts.options[t].selected = arr[t];
};
};
function SaveItems(ts)
{
if( arr.length == 0 )
for(var t=0; t < ts.options.length; t++)
{
arr[t] = ts.options[t].selected;
};
};
</script>