function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'block';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'block';
		}
		else { // IE 4
			document.all.id.style.display = 'block';
					}
	}
}





function pokazPytanie1() {
showdiv('newsURL');
hidediv('newsText');
}
function schowajPytanie1() {
showdiv('newsText');
hidediv('newsURL');

}





function sprawdz(){

if (document.getElementById('newsWybor').checked == true)
{pokazPytanie1();}
}


function wyslij()
{
document.getElementById("miasta").submit();

}

function wyslij2()
{
document.getElementById("testy").submit();

}

  


    function validateForm(AForm)
    {
    
    
       strEml     = AForm.sEmail.value;
        emlPatt = 		/^.+\@.+\..+$/;
        wynikEml   = strEml.match(emlPatt);

        if (wynikEml == null) {
            alert("Nieprawidłowy adres Email");
            return false;
        } else {
           
    
        str     = AForm.sImie.value;
        litPatt = /^[a-zA-ZąćęłńóśżźĄĆĘŁŃÓŚŻŹ0-9 -]+$/;
        wynik   = str.match(litPatt);

        if (wynik == null) {
            alert("Nieprawidłowy znak w polu Imie");
            return false;
        } else {
        
             str     = AForm.sNazwisko.value;
        litPatt = /^[a-zA-ZąćęłńóśżźĄĆĘŁŃÓŚŻŹ0-9 -]+$/;
        wynik   = str.match(litPatt);

        if (wynik == null) {
            alert("Nieprawidłowy znak w polu Nazwisko");
            return false;
        } else {
            
        str     = AForm.urodzenie.value;
         litPatt = /^[0-9-]{10}$/;
        wynik   = str.match(litPatt);

        if (wynik == null) {
            alert("Nieprawidłowy znak w polu data urodzenia");
            return false;
        } else {
       if (!AForm.zgoda.checked)
             {
            alert("Musisz wyrazić zgodę na przetwarzanie danych osobowych aby rozwiązać test");
            return false;
        } else {
         return true;
       }
       
       
        }
        }
        
        }
        }
         
        }
        
        function _delete(e,a) {
    if(window.confirm('Napewno chcesz usunac?'))
        window.location=a.parentNode.href;
    return false;
}
      