function pokaz_obiekt(oid)
{
	if (oid!='' && oid!=0) document.getElementById(oid).style.display='block';
};

function ukryj_obiekt(oid)
{
	if (oid!='' && oid!=0) document.getElementById(oid).style.display='none';
};

function kalendarz(pole)
{
  o = window.open("kalendarz.php?p="+pole, "k", "width=200, height=320,"
   + " left=200,top=125,innerwidth=200,innerheight=200,location=0,status=0,"
   + " directories=0, scrollbars=0, menubar=0, toolbar=0, resizable=1");
  o.focus();
  return false;
};

function sprawdz_pola()
{
  if (document.getElementById('sIdWlasciciela').value==0)
  {
	  alert('Wybierz adresata zlecenia!');
	  return false;
  }
   else if (document.getElementById('tOpisZadania').value=='')
  {
	  alert('Wpisz opis zadania!');
	  return false;
  }
  else return true;
};

function showMilitaryTime()
{
	return true;
}
function showTheHours(theHour) {
	if (showMilitaryTime() || (theHour > 0 && theHour < 13))
	{
		if (theHour == "0") theHour = 12;
		return (theHour);
	}
	if (theHour == 0)
	{
		return (12);
	}
	return (theHour-12);
}

function showZeroFilled(inValue)
{
	if (inValue > 9)
	{
		return "" + inValue;
	}
	return "0" + inValue;
}

function showAmPm()
{
	if (showMilitaryTime())
	{
		return ("");
	}
	if (now.getHours() < 12)
	{
		return (" am");
	}
	return (" pm");
}

function pokazCzas()
{
	now = new Date
	var rok = now.getYear(); // Returns year (ile uplynelo od roku 1900)
   rok =2000+rok%100;
   var miesiac = now.getMonth()+1;
	if (miesiac<10) miesiac='0'+miesiac;
	var dzien = now.getDate();
	if (dzien<10) dzien='0'+dzien;
	document.getElementById("dDataGodzina").innerHTML = 'Aktualna data: '+rok+'-'+miesiac+'-'+dzien+' '+showTheHours(now.getHours()) + ":" + showZeroFilled(now.getMinutes()) + ":" + showZeroFilled(now.getSeconds()) + showAmPm()
	setTimeout("pokazCzas()",1000)
}