	var MAC = ( navigator.appVersion.indexOf("Macintosh") != -1 )
	var IE = ( navigator.appVersion.indexOf("MSIE") != -1 )


function copyToList(from,to)
{
  fromList = eval('document.forms[0].' + from);
  toList = eval('document.forms[0].' + to);
  if (toList.options.length > 0 && toList.options[0].value == 'temp')
  {
    toList.options.length = 0;
  }
  var sel = false;
  for (i=0;i<fromList.options.length;i++)
  {
    var current = fromList.options[i];
    if (current.selected)
    {
      sel = true;
      if (current.value == 'temp')
      {
        alert ('You cannot move this text!');
        return;
      }
      txt = current.text;
      val = current.value;
      toList.options[toList.length] = new Option(txt,val);
      fromList.options[i] = null;
      i--;
    }
  }
  //if (!sel) alert ('Er is/zijn nog geen item(s) geselecteerd');
  
  sortlist(from);
  sortlist(to); 
}

function allSelect()
{
  List = document.forms[0].pltsDest;
  if (List.length && List.options[0].value == 'temp') return;
  
  document.objectfilter.pltsid.value='';
  document.objectfilter.typeid.value='';
  
  for (i=0;i<List.length;i++)
  {
     List.options[i].selected = true;
	 document.objectfilter.pltsid.value += List.options[i].value + ','
  }
  
  List2 = document.forms[0].typeDest;
  if (List2.length && List2.options[0].value == 'temp') return;
  document.objectfilter.typeDest.value='';
  for (i=0;i<List2.length;i++)
  {
     List2.options[i].selected = true;
	 document.objectfilter.typeid.value += List2.options[i].value + ','
  }
}

//////////////////////////////////////////////////////////////////////////////

function sortlist(sortthis) {
	var lb = document.getElementById(sortthis);
	arrTexts = new Array();
	
	for(i=0; i<lb.length; i++)  {
	  arrTexts[i] = new Array(lb.options[i].text,lb.options[i].value);
	}
	
	arrTexts.sort();
	
	for(i=0; i<lb.length; i++)  {
	  lb.options[i].text = arrTexts[i][0];
	  lb.options[i].value = arrTexts[i][1];
	}
}
