function PokazOsobe(id)
{
  var width=520;
  var height=500;
  var left=parseInt((screen.width-width)/2);
  var top=parseInt((screen.height-height)/2);
  win = window.open('/szukaj/osoba.php?id_osoby='+id, 'Informacje o osobie', 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',resizable=0,scrollbars=yes,menubar=no' );
  win.focus();
}

function PokazDyscypliny()
{
	var sel=document.getElementById("dyscypliny[]");
	s="";
	for (m=sel.options.length-1;m>=0;m--)
		s=s+sel.options[m].value+","
	var win = window.open("/szukaj/dyscypliny.php?wybrane="+s, "dyscypliny", 'width=500,height=600,left=400,top=100,resizable=1,scrollbars=yes,menubar=no' );
}

function WyczyscDyscypliny()
{
	var sel=document.getElementById("dyscypliny[]");
	for (m=sel.options.length-1;m>=0;m--)
		sel.options[m]=null
}

function WyczyscOpcjeParent(elem)
{
    var sel=window.opener.document.getElementById(elem);
	for (m=sel.options.length-1;m>=0;m--)
	sel.options[m]=null
}

function DodajOpcjeParent(elem, wartosc, tekst) 
{
    var sel=window.opener.document.getElementById(elem);
	i=sel.options.length;
	sel.options[i]=new Option(tekst, wartosc)
}

function CheckAll(formularz, nazwa, stan) {
	var fff = document.getElementById(formularz);
	for(i = 0; i < fff.elements.length; i++) {
		if(fff.elements[i].name == nazwa) fff.elements[i].checked=stan;
	}
}

function SelectAll(elem)
{
    var sel=document.getElementById(elem);
	for (m=sel.options.length-1;m>=0;m--)
		sel.options[m].selected=true
}

function OdznaczWszystkie()
{
	CheckAll("wybor_dysc", "id_dyscypliny[]", false)
}