function show_confirm(url)
{
	var r=confirm("Czy na pewno usunąć?");
	if (r==true)
		{
		window.location=url;
		}
	else
		{
		
		}
}

function potwierdz(url,msg)
{
	var r=confirm(msg);
	if (r==true)
		{
		window.location=url;
		}
	else
		{
			
		}
}

function checkForm()
{
  var brakuje_danych=false;
  var formularz=document.forms['kontakt'];
  var napis="";
  if (formularz.ImieNazwisko.value == ""){
    napis += "- imie i nazwisko \n"
    brakuje_danych=true;
  }
	
  if (formularz.Telefon.value == ""){
    napis += "- telefon\n"
    brakuje_danych=true;
  }
	
	var WzorMaila = /^[0-9a-zA-Z_.-]+@+[0-9a-zA-Z.-]+\.[a-zA-Z]{2,3}$/;
	if (WzorMaila.test(formularz.Email.value)){}else 
	{
    napis += "- e-mail (np. imienazwisko@nnn.pl)\n"
    brakuje_danych=true;
  }
	
	var WzorTresci = /^.{10,}$/;
	if (WzorTresci.test(formularz.Tresc.value)) {} else
	{
    napis += "- treść (min. 10 znaków)\n"
    brakuje_danych=true;
  }
	
  if (!brakuje_danych)
    { 
			return true; 
		}
  else
    { 
			alert('W formularzu pojawiły się błędy.\nProszę poprawnie wypełnić następujące pola:\n\n' + napis);
			return false;
		}
}

function showNhide()
{
	var DIV1=document.getElementById('form11');
	var DIV2=document.getElementById('form22');
	
	if (document.getElementById('r2').checked==true)
	{
		DIV2.style.display='block';
		DIV1.style.display='none';
	}
	else if (document.getElementById('r1').checked==true)
	{
		DIV1.style.display='block';
		DIV2.style.display='none';
	}
}


