function popup(url_var, url_var_value) {
	window.open("popup.php?" + url_var + "=" + url_var_value, "studentsmsPopup", "width: 800; height: 600;");
}

function tab(tab_id) {
  current_tab = "tab" + tab_id;
  current_tablink = "tablink" + tab_id;
  
  for (i = 0; i <= 10; i++) {
	other_tab = "tab" + i;
	other_tablink = "tablink" + i;
	
	if (document.getElementById(other_tab) && i != tab_id) {
	  //document.getElementById(other_tab).style.visibility = "hidden";
	  document.getElementById(other_tab).className = "tabblad_hidden";
	  document.getElementById(other_tablink).className = "tab";
	}
  }
  
  //document.getElementById(current_tab).style.visibility = "visible";
  document.getElementById(current_tab).className = "tabblad";
  document.getElementById(current_tablink).className = "tab_active";
}

function copyToList(from, to)
{
  fromList = document.getElementById(from);
  toList = document.getElementById(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 ('Deze tekst kunt u niet verplaatsen!');
        return;
      }
      txt = current.text;
      val = current.value;
      toList.options[toList.length] = new Option(txt,val);
      fromList.options[i] = null;
      i--;
    }
  }
  //if (!sel) alert ('U heeft geen selectie gemaakt!');
}

function allSelect(source)
{
  List = document.getElementById(source);
  if (List.length && List.options[0].value == 'temp') return;
  for (i=0;i<List.length;i++)
  {
     List.options[i].selected = true;
  }
}