<!--  -->
function komunikat() {
  document.getElementById("tutaj_kom").innerHTML;
}

<!--  -->

nr=0;
czas=7000; // w milisekundach (1 sekunda = 1000 ms)

txt = new Array();
txt[0] = "materiały dla nauczycieli i studentów";
txt[1] = "największa baza z materiałami";
txt[2] = "kopalnia pomysłów";
txt[3] = "fachowe opracowania";
txt[4] = "informacje dla rodziców";
txt[5] = "komplet materiałów w jednym miejscu";
txt[6] = "co tydzień aktualizacja bazy!";

function napis() {
  document.getElementById("tutaj").innerHTML = txt[nr];
  nr++;
  if (nr>=txt.length) nr=0;
  setTimeout("napis()",czas);
}

<!--  -->


DayName = new Array(7)
DayName[0] = "Niedziela"
DayName[1] = "Poniedziałek"
DayName[2] = "Wtorek"
DayName[3] = "Środa"
DayName[4] = "Czwartek"
DayName[5] = "Piątek"
DayName[6] = "Sobota"

MonthName = new Array(12)
MonthName[0] = "stycznia"
MonthName[1] = "lutego"
MonthName[2] = "marca"
MonthName[3] = "kwietnia"
MonthName[4] = "maja"
MonthName[5] = "czerwca"
MonthName[6] = "lipca"
MonthName[7] = "sierpnia"
MonthName[8] = "września"
MonthName[9] = "października"
MonthName[10] = "listopada"
MonthName[11] = "grudnia"
 

function getDateStr(){
    var Today = new Date()
    var WeekDay = Today.getDay()
    var Month = Today.getMonth()
    var Day = Today.getDate()
    var Year = Today.getYear()

    if(Year <= 1900)
        Year += 1900

    return DayName[WeekDay]+","+"&nbsp;"+Day+"&nbsp;"+MonthName[Month]+"&nbsp;"+Year
}

<!--  -->

function sprawdz_q1(pole) {
    if (pole.value !="0" && pole.value !="") {
    return true;
    return parametr(this)
  }
  else {
     alert("Proszę wybrać kategorię i podkategorię.\n\n Podany termin będzie wyszukiwany zgodnie z podanymi kryteriami wyboru. \n\n W przypadku nie podania terminu do wyszukania, wyświetlone zostaną \n wszystkie teksty z wybranej kategorii / podkategorii.\n "); 
     return false;
  }
}

<!--  -->

function sprawdz_q2(pole) {
    if (pole.value !="") {
    return true;
    return parametr(this)
  }
  else {
     alert("Nie wprowadzono hasła!"); 
     document.getElementById("q2_focus").focus();
     return false;
  }
}

<!--  -->

function sprawdz_q3(pole) {
    if (pole.value !="") {
    return true;
    return parametr(this)
  }
  else {
     alert("Nie wprowadzono hasła!"); 
     document.getElementById("q3_focus").focus();
     return false;
  }
}

<!--  -->

function sprawdz_q4(pole) {
    if (pole.value !="") {
    return true;
    return parametr(this)
  }
  else {
     alert("Nie wprowadzono hasła!"); 
     document.getElementById("q4_focus").focus();
     return false;
  }
}

<!--  -->

function wysz_lista() {
  if (document.getElementById("wysz2").d.selectedIndex==0 || document.getElementById("wysz2").d.selectedIndex==1 || 
      document.getElementById("wysz2").d.selectedIndex==2 || document.getElementById("wysz2").d.selectedIndex==3 || 
      document.getElementById("wysz2").d.selectedIndex==4 || document.getElementById("wysz2").d.selectedIndex==5 || 
      document.getElementById("wysz2").d.selectedIndex==7 || document.getElementById("wysz2").d.selectedIndex==9 ||
      document.getElementById("wysz2").d.selectedIndex==12) {
    document.getElementById("wysz2").w.disabled=false;
  } else {
    document.getElementById("wysz2").w.disabled=true;
    document.getElementById("wysz2").w.selectedIndex=4;
  }
}

<!--  -->

function wysz_lista_old2() {
  if (document.wysz2.d.selectedIndex==0 || document.wysz2.d.selectedIndex==1 || document.wysz2.d.selectedIndex==2 || 
  document.wysz2.d.selectedIndex==3 || document.wysz2.d.selectedIndex==5 || document.wysz2.d.selectedIndex==6 || 
  document.wysz2.d.selectedIndex==8 || document.wysz2.d.selectedIndex==10) {
    document.wysz2.w.disabled=false;
  } else {
    document.wysz2.w.disabled=true;
    document.wysz2.w.selectedIndex=4;
  }
}

<!--  -->

function wysz_lista_old() {
  if (document.wysz2.d.selectedIndex==3 || document.wysz2.d.selectedIndex==4 || document.wysz2.d.selectedIndex==7 || 
  document.wysz2.d.selectedIndex==9 || document.wysz2.d.selectedIndex==10 || document.wysz2.d.selectedIndex==11 || 
  document.wysz2.d.selectedIndex==12 || document.wysz2.d.selectedIndex==13 || document.wysz2.d.selectedIndex==14) {
    document.wysz2.w.value="";
    document.wysz2.w.disabled=true;
  } else {
    
    document.wysz2.w.disabled=false;
  }
}

<!--  -->

function zmien2(t) {
  if (t[t.selectedIndex].value == "all") {
    document.sz_menu_top.w.disabled=true;
	document.sz_menu_top.tem.disabled=true;
	document.sz_menu_top.sort.disabled=true;
  } else {
	document.sz_menu_top.w.disabled=false;
	document.sz_menu_top.tem.disabled=false;
	document.sz_menu_top.sort.disabled=false;
  }
}

<!--  -->

/* przekazywanie zmiennej w formularzu
<script type="text/javascript">
<!-- <![CDATA[
function parametr(f1) {
  f1.param.value="k39";
  return true;
}
// ]]> -->
</script>
*/

<!--  -->

function kasuj() {
  document.f_polec.adresat.value="";
  document.f_polec.email.value="";
  document.f_polec.imie.value="";
}

<!--  -->

function WyslijPolec(){
      window.location = "mailto:" + "?subject=" + "Polecam adres" + "&body=" + document.title+": " + "www.rokwprzedszkolu.pl";
   }

<!--  -->

var good;
function SprawdzAdresBiul() {
   maskaBiul = /^[0-9a-z_.-]+@([0-9a-z-]+.)+[a-z]{2,4}$/;
   if (MailerBiul.address.value != '' && MailerBiul.address.value != "wpisz@email" && MailerBiul.address.value.match(maskaBiul)){
   good = true;
   }
   else {
   alert('WprowadĄ poprawny adres!')
   good = false;
   }
}

function WyslijBiul(){
   good = false;
   SprawdzAdresBiul(document.MailerBiul.address)
   if (good){
      window.location = "mailto:redakcja@rokwprzedszkolu.pl" + "?subject=" + "Biluletyn" + "&body="+document.MailerBiul.address.value
   }
}

<!--  -->

function wyslij(t) {
   t.target="odp";
   odp = window.open("","odp","width=250,height=150,resizable=0,titlebar=0,status=0,menubar=0,location=0,scrollbars=0");
   odp.moveTo(50, 50);
   odp.focus();
   return true;
}

<!--  -->

function wylacz() {
	if (document.ins_pg.r_pg[1].checked) {
		document.ins_pg.t_pg.disabled=true;
		document.ins_pg.tp_pg.disabled=true;
		document.ins_pg.ng_pg.disabled=true;
		document.ins_pg.t_pg.checked=false;
		document.ins_pg.tp_pg.checked=false;
		document.ins_pg.ng_pg.checked=false;
		document.ins_pg.pub_pg.disabled=true;
		document.ins_pg.pub_pg.value="";
	} else if (document.ins_pg.r_pg[0].checked) {
		document.ins_pg.t_pg.disabled=false;
		document.ins_pg.tp_pg.disabled=false;
		document.ins_pg.ng_pg.disabled=false;
		document.ins_pg.pub_pg.disabled=false;
	}
}

function wlacz() {
	if (document.ins_pg.t_pg.checked || document.ins_pg.tp_pg.checked || document.ins_pg.ng_pg.checked) {
		document.ins_pg.r_pg[0].checked=true;
		document.ins_pg.r_pg[1].checked=false;
		document.ins_pg.pub_pg.disabled=false;
	} else {
		document.ins_pg.r_pg[0].checked=false;
		document.ins_pg.r_pg[1].checked=true;
		document.ins_pg.pub_pg.disabled=true;
	}
}

function sprawdz_dane(pole) {
	if (pole.value.length<3 && pole.name=="n_pg") {
		pole.value="";
		alert("Wprowadź nazwę przedszkola (dane wymagane)"); 
		return false;
	}
	if (pole.value.length<7 && pole.name=="woj_pg") {
		pole.value="";
		alert("Wprowadź nazwę województwa (dane wymagane)"); 
		return false;
	}
	if (pole.value.length<3 && pole.name=="p_pg") {
		pole.value="";
		alert("Wprowadź nazwę miejscowości-poczty (dane wymagane)"); 
		return false;
	}
	if (pole.value.length<3 && pole.name=="m_pg") {
		pole.value="";
		alert("Wprowadź nazwę miejscowości (dane wymagane)"); 
		return false;
	}
	if (pole.value.length<3 && pole.name=="ul_pg") {
		pole.value="";
		alert("Wprowadź nazwę ulicy (dane wymagane)"); 
		return false;
	}
	if (pole.value.length<1 && pole.name=="nr_pg") {
		pole.value="";
		alert("Wprowadź numer (dane wymagane)"); 
		return false;
	}
	maska_kp = /^[0-9]{2}-[0-9]{3}$/i;
	if (maska_kp.test(pole.value)==false && pole.name=="kp_pg") {
		pole.value="";
		alert("Niepoprawny format kodu pocztowego \n(dane wymagane, poprawny format: nn-nnn)"); 
		return false;
	}
	maska_tel_k = /^[+]?([0-9]*)[+-\.\s]?([0-9]*)?$/i;
	if ((pole.value.length<2 || maska_tel_k.test(pole.value)==false) && pole.name=="tel_k_pg") {
		alert("Wprowadź numer kierunkowy (dane wymagane)"); 
		return false;
	}
	maska_tel = /^(([0-9]*)[-,\.\s]?([0-9]*)?){20}$/i;
	if ((pole.value.length<4 || maska_tel.test(pole.value)==false) && pole.name=="tel_pg") {
		alert("Wprowadź numer telefonu (dane wymagane)"); 
		return false;
	}
	maska_fax_k = /^[+]?([0-9]*)[+-\.\s]?([0-9]*)?$/i;
	if ((pole.value.length<2 || maska_fax_k.test(pole.value)==false) && pole.name=="fax_k_pg") {
		pole.value="";
		alert("Wprowadź numer kierunkowy"); 
		return false;
	}
	maska_fax = /^(([0-9]*)[-,\.\s]?([0-9]*)?){10}$/i;
	if ((pole.value.length<4 || maska_fax.test(pole.value)==false) && pole.name=="fax_pg") {
		pole.value="";
		alert("Wprowadź numer faxu"); 
		return false;
	}
	maska_mail = /^[0-9a-z_.-]+@([0-9a-z-]+.)+[a-z]{2,4}$/;
	if ((pole.value.length<4 || maska_mail.test(pole.value)==false) && pole.name=="mail_pg") {
		pole.value="";
		alert("Wprowadź adres e-mail"); 
		return false;
	}
	maska_www = /^([^.]*\.[^.]*){1,7}$/;
	if ((pole.value.length<3 || maska_www.test(pole.value)==false) && pole.name=="www_pg") {
		pole.value="";
		alert("Wprowadź adres www"); 
		return false;
	}
}

/* zamiana ENTER na spacje oraz kilku spacji na 1 spacje (np. podczas wpisywania textu w textarea */
function zamien(f) {
  f.value = f.value.replace(/(\n|\r\n| {2,})/g," ");
}

/* ograniczenie ilosci znakow w polu textarea (bez alertu podczas wpisywania, wpp alert pokzywalby sie 2x: onkeyup i onchange */
function sprawdz_dlugosc1(f, x) {
  if (f.value.length>x) {
   alert("Maksymalna ilość znaków: "+x+"");
   f.value = f.value.substr(0,x);
  }
}
/* alert onchange - aby zapobiec wklejeniu txt>1000 znakow */
function sprawdz_dlugosc2(f, x) {
  if (f.value.length>x) {
	f.value = f.value.substr(0,x);
  }
}

wstawione=0;
function wstaw(f) {
	j=f.img_il_pg[f.img_il_pg.selectedIndex].value;
	//alert("wstawione="+wstawione+"\n j="+j+"");
	//usuniecie pol
	if (wstawione==1) {
		n=wstawione;
		var pole = '<input type="file" size="20" style="margin-bottom: 7px; width: 240px;" name="img_pg_'+n+'" /><br />';
		document.getElementById("pola").innerHTML = "";
		wstawione=0;
	}
	else if (wstawione>1) {
		for (n=1; n<=wstawione; n++) {
			var pole = '<input type="file" size="20" style="margin-bottom: 7px; width: 240px;" name="img_pg_'+n+'" /><br />';
			document.getElementById("pola").innerHTML = "";
		}
		wstawione=0;
	}
	//dodanie pol
	if (j==1) {
		m=j;
		var pole = '<input type="file" size="20" style="margin-bottom: 7px; width: 240px;" name="img_pg_'+m+'" /><br />';
		document.getElementById("pola").innerHTML += pole;
		wstawione=1;
	}
	else if (j>1) {
		for (m=1; m<=j; m++) {
			var pole = '<input type="file" size="20" style="margin-bottom: 7px; width: 240px;" name="img_pg_'+m+'" /><br />';
			document.getElementById("pola").innerHTML += pole;
		}
		wstawione=j;
	}
}


function rozszerzenie(f) {
	nazwa = new Array(7)
	nazwa[0] = f.img_pg_0.value;
	nazwa[1] = f.img_pg_1.value;
	nazwa[2] = f.img_pg_2.value;
	nazwa[3] = f.img_pg_3.value;
	nazwa[4] = f.img_pg_4.value;
	nazwa[5] = f.img_pg_5.value;
	nazwa[6] = f.img_pg_6.value;
	err=0;
	i=0;
	for (i=0; i<=6; i++) {
		//nazwa = f.img_pg_+i+.value;
		if (nazwa[i]!="") alert("nazwa = "+nazwa[i]+"\n");
		//nazwa = nazwa.toLowerCase();
		//if (nazwa[i]!="" && nazwa[i].lastIndexOf(".gif")<0 && nazwa[i].lastIndexOf(".jpg")<0) err++;
		if (nazwa[i].lastIndexOf(".gif")<0 && nazwa[i].lastIndexOf(".jpg")<0) err++;
	}
	if (err>0) {
		alert("Możesz wysyłać tylko pliki GIF i JPG");
		err=0;
		return false;
	}
	return true;
}

/*
//UWAGA: TA FUNKCJA BLOKUJE FAQ/REGULAMIN/NEWS (nie rozwija sie tresc pod linkami)!!!!!!!!!
function rozszerzenie0(f) {
	err=0;
	i=0;
	for (i=0; i<=6; i++) {
		nazwa = f.img_pg_+i+.value;		//TO JEST ZLY ZAPIS - DO POPRAWY
		if (nazwa!="") alert("nazwa = "+nazwa+"\n");
		//nazwa = nazwa.toLowerCase();
		if (nazwa!="" && (nazwa.lastIndexOf(".gif")<0 || nazwa.lastIndexOf(".jpg")<0)) err++;
	}
	if (err>0) {
		alert("Możesz wysyłać tylko pliki GIF i JPG");
		err=0;
		return false;
	}
	return true;
}
*/

function rozszerzenie1(f) {
	obiekt = {nazwa_0:"f.img_pg_0.value", nazwa_1:"f.img_pg_1.value", nazwa_2:"f.img_pg_2.value", nazwa_3:"f.img_pg_3.value", nazwa_4:"f.img_pg_4.value", nazwa_5:"f.img_pg_5.value", nazwa_6:"f.img_pg_6.value"};
	for (pole in obiekt) {
		//obiekt[pole] = obiekt[pole].toLowerCase();
		if (obiekt[pole]!="" && obiekt[pole].lastIndexOf(".gif")<0 && obiekt[pole].lastIndexOf(".jpg")<0) {
			alert("Możesz wysyłać tylko pliki GIF i JPG");
			return false;
		}
	}
	return true;
}


function rozszerzenie2(f) {
	nazwa = f.img_pg_0.value;
	nazwa = nazwa.toLowerCase();
	if (nazwa!="" && nazwa.lastIndexOf(".gif")<0 && nazwa.lastIndexOf(".jpg")<0) {
		alert("Możesz wysyłać tylko pliki GIF i JPG");
		return false;
	}
	return true;
}


function wyczysc() {
document.ins_pg.typ_pg.value="0";
document.ins_pg.r_pg[0].checked=false;
document.ins_pg.r_pg[1].checked=false;
document.ins_pg.t_pg.checked=false;
document.ins_pg.ng_pg.checked=false;
document.ins_pg.tp_pg.checked=false;
}

<!--  -->

function zmien3() {
  var typ = document.getElementById('sms').getAttribute('type');
  var input = document.createElement('input');
  if (typ=="text") input.setAttribute('type', 'password');
  else input.setAttribute('type', 'text');
  input.setAttribute('name', 'sms');
  input.setAttribute('id', 'sms');
  document.getElementById('r').removeChild(document.getElementById('r').firstChild);
  document.getElementById('r').appendChild(input);
}

<!--  -->

function antyspam(t) {
  t.spam.value=2;
  return true;
}

<!--  -->

var good;
function SprawdzUwagi(){
   maskaUwagi = /^ *$/;
   if (MailerUwagi.uwagi.value != "proszę wprowadzić swoje uwagi" && MailerUwagi.uwagi.value != "" && MailerUwagi.uwagi.value.match(maskaUwagi)){
   good = true;
   return true;
   }
   else {
   alert ("Wpisz swoje uwagi")
   window.focus()
   document.MailerUwagi.uwagi.focus();
   good = false;
   return false;
   }
}

<!--  -->

function okno() {
  o = document.getElementById("okienko");
  o.style.top = document.body.scrollTop+100
  o.style.left = document.body.scrollLeft+100
  if (o.style.display=="block") o.style.display="none";
  else o.style.display="block";
}

<!--  -->

function OknoUwagi(){
     SprawdzUwagi(document.MailerUwagi.uwagi);
     if (good==true){
     o = document.getElementById("okienko");
     o.style.top = document.body.scrollTop+130
     o.style.left = document.body.scrollLeft+270
     o.style.display = "block";
     setTimeout("o.style.display='none'", 30*1000);
     }
}

<!--  -->

function initArray()
{
this.length = initArray.arguments.length
for (var i=0;i<this.length;i++)
this[i+1] = initArray.arguments[i]
} 

function getLastDateStr()
{
var MOYArray = new initArray("stycznia", "lutego", "marca", "kwietnia", "maja",
"czerwca", "lipca", "sierpnia","września", "paĄdziernika", "listopada",
"grudnia");
var LastModDate = new Date(document.lastModified);
var i; //zmienna pomocnicza do sprawdzania y2kbug

//START sprawdzanie wyswietlania daty przez przegladarki IE i NN
i=LastModDate.getYear();
if (i<1900) {i=i+1900;}
//STOP sprawdzanie wyswietlania daty przez przegladarki IE i NN

return LastModDate.getDate() + "&nbsp" + MOYArray[(LastModDate.getMonth()+1)] + " " + "&nbsp" + i
}

<!--  -->

function over(id) {
  document.getElementById(id).className="menu-in";
}

function out(id) {
  document.getElementById(id).className="menu-out";
}

function menu(id) {
  if (document.getElementById(id).style.display=="none") {
    document.getElementById(id).style.display="inline";
  } else {
    document.getElementById(id).style.display="none";
  }
}

<!--   -->

function kopiuj() {
  IE4 = (document.all) ? true : false;

  if (IE4) txt = document.selection.createRange().text;
  else txt = document.getSelection().createRange().text;
    
  <!--  alert(txt) --> 
  if (txt!="") {
  alert("zaznaczony teskt został skopiowany do schowka \n (można go wkleić do Worda <ctrl-v>)")
  clipboardData.setData("TEXT", txt);
  }
  else alert("zaznacz tekst do skopiowania!")
}

<!--  -->

function skocz(t) {
  if (t.selectedIndex!=0) {
    open(t[t.selectedIndex].value,"_self");
  }
}

<!--  -->

function okno() {
okno=open("", "okno",
  "width=200,height=200,scrollbars=no,menubar=no");
}

<!-- NEWS, FAQ -->
function pokaz(id) {
  if (document.getElementById(id).style.display=="none") {
    document.getElementById(id).style.display="inline";
  } else {
    document.getElementById(id).style.display="none";
  }
}

function pokaz_ency(id) {
  if (document.getElementById(id).style.display=="none") {
    document.getElementById(id).style.display="inline";
  } 
}

function styl(id) {
  if (document.getElementById(id).style.fontWeight=="bold") {
    document.getElementById(id).style.fontWeight="normal";
  } else {
    document.getElementById(id).style.fontWeight="bold";
  }
}

function pokaz_all(id_plus, id_minus, id) {
	document.getElementById(id_plus).style.display="none";
	document.getElementById(id_minus).style.display="inline";
    document.getElementById(id).style.display="inline";
}

function pokaz_all2(id) {
    document.getElementById(id).style.display="inline";
}

function pokaz_all_2(id) {
	document.getElementById("plus_2").style.display="none";
	document.getElementById("minus_2").style.display="inline";
    document.getElementById(id).style.display="inline";
}

function styl_in_all(id) {
	document.getElementById(id).style.fontWeight="bold";
}

function zamknij_all(id_plus, id_minus, id) {
	document.getElementById(id_plus).style.display="inline";
	document.getElementById(id_minus).style.display="none";
    document.getElementById(id).style.display="none";
}

function zamknij_all2(id) {
    document.getElementById(id).style.display="none";
}

function zamknij_all_2(id) {
	document.getElementById("plus_2").style.display="inline";
	document.getElementById("minus_2").style.display="none";
    document.getElementById(id).style.display="none";
}

function styl_out_all(id) {
	document.getElementById(id).style.fontWeight="normal";
}

function pokaz_menu(id) {
    document.getElementById(id).style.display="block";
}
function zamknij_menu(id) {
    document.getElementById(id).style.display="none";
}

/* dodaj do ulubionych - dla 3 przegladarek */
function dodaj() {
  var tytul = 'Rok w Przedszkolu';
  var url = 'http://www.rokwprzedszkolu.pl';
  if (window.sidebar) { window.sidebar.addPanel(tytul, url, ""); } // FF 
  else if (window.external) { window.external.AddFavorite(url, tytul); } // IE
  else if (window.opera && window.print) {
     var a = document.createElement('a');
     a.setAttribute('href', url);
     a.setAttribute('title', tytul);
     a.setAttribute('rel','sidebar');
     a.click();
  }
}

function polec_nas1() {
	document.f_polec.action='index.php?k=k1302&o=sh';
	document.f_polec.submit();
}
function polec_nas2() {
	document.f_check.action='index.php?k=k1302';
	document.f_check.submit();
}

function przelacz(id) {
  if (document.getElementById(id).style.display=="none") {
    document.getElementById(id).style.display="inline";
  } else {
    document.getElementById(id).style.display="none";
  }
}

/* i_wyszukiwarka.php */
function zmien(wybor) {
  l2=document.form1.kat_d;
  
  for (i=l2.options.length;i>=0;i--) l2.options[i]=null;
  for (i=0;i<opcje[wybor].length;i++) 
    l2.options[i]=new Option(opcje[wybor][i].value,opcje[wybor][i].text);
}

