

function mindl(obj,minlen)
{
    if (obj.value.length < minlen) return true;
    return false;
}

function litera(obj)
{
  var charpos = obj.value.search("[^A-ZÊÓ¥Œ£¯ÆÑa-zêó¹œ³¿Ÿæñ]");
  if(obj.value.length > 0 &&  charpos >= 0)
  {
    return false;
  }
  else
    return true;
}

function liczba(obj)
{
var charpos = obj.value.search("[^0-9]"); 
if(obj.value.length > 0 &&  charpos >= 0) 
{ 
    return false; 
}
return true;
}
//-----------------------------------------------------------------------------------
function sprawdz(formularz)
{
  for (i = 0; i < formularz.length; i++)
  {
    var pole = formularz.elements[i];
    if (pole.type == "textarea" && pole.value == "")
    {
      alert("Prosze wypelnic wszystkie pola.");
      return false;
    }
  }
  return true;
}

function sprawdzLiteraText(formularz)
{
  for (i = 0; i < formularz.length; i++)
  {
    var pole = formularz.elements[i];
    if (pole.type == "text" && pole.value == "")
    {
      alert("Prosze wypelnic wszystkie pola.");
      return false;
    }
  }
  return true;
}
//-----------------------------------------------------------------------------------
//sprawdzanie czy jest symbol malpki w mailu,pozniej sprawdzimy reszte w yrazeniach reg. w php-cu
function zapisz(Forma)
{
    if (!liczba(Forma.kod))
    {
		alert("W polu numer identyfikacyjny nie moze byc liter!");
		return false;
    }
	if (mindl(Forma.kod,6) )
    {
		alert("Zbyt krotki numer identyfikacyjny!");
		return false;
    }
    return true;
}

function czyLiczba(Forma)
{
    if (!liczba(Forma.iloscObrazkow))
    {
		alert("W polu z iloscia obrazow nie moze byc liter!");
		return false;
    }
    return true;
}
function czyLitera(Forma)
{
    if (!litera(Forma.imie) || !litera(Forma.nazwisko))
    {
		alert("W polu imiê i nazwisko nie mo¿e byc cyfr. Proszê o poprawienie danych.");
		return false;
    }
    return true;
}
function hide(id) {	
	if (document.all && !window.opera) {
	 // kod dla IE, np:
		var d = document.all[id]
		d.style.display = "none"
	}
	else if (document.getElementById&&!document.all) {
	 // kod zgodny z W3C, Mozilla, Opera i Safari
	 	var d = document.getElementById(id)
		d.setAttribute("style", "display: none")
	} 
	
}

function show(id) {	
	if (document.all && !window.opera) {
	 // kod dla IE, np:
		var d = document.all[id]
		d.style.visibility= "visible";
	}
	else if (document.getElementById&&!document.all) {
	 // kod zgodny z W3C, Mozilla, Opera i Safari
	 	var d = document.getElementById(id)
		d.setAttribute("style", "visibility: visible; ")
	} 	
}
function hidemapa(id) {	
	if (document.all && !window.opera) {
	 // kod dla IE, np:
		var d = document.all[id]
		d.style.visibility= "hidden";
	}
	else if (document.getElementById&&!document.all) {
	 // kod zgodny z W3C, Mozilla, Opera i Safari
	 	var d = document.getElementById(id)
		d.setAttribute("style", "visibility: hidden; ")
	} 	
}


// End -->
