function pokaz_okladke(id){
       var Win = window.open('okladka.php?pid=' + id,'displayWindow','width=400,height=400,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
}

function pokaz_mape(id){
       var Win = window.open('mapka.php?pid=' + id,'displayWindow','width=600,height=400,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
}

function mapa_ksiegarni(){
       var Win = window.open('mapka_ksiegarni.php', 'displayWindow','width=500,height=410,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
}

function popupGaleria(obrazek, width, height) {
window.open('galeria.php?id='+obrazek, 'Galeria','width=' + width + ',height=' + height +',resizable=0,scrollbars=no,menubar=no,left=10,top=20')
}


function pokaz_zdjecie(id){
	if(id==1)
       var Win = window.open('i/foto/foto_1.html','displayWindow','width=400,height=283,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==2)
       var Win = window.open('i/foto/foto_2.html','displayWindow','width=550,height=283,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==3)
       var Win = window.open('i/foto/foto_3.html','displayWindow','width=400,height=262,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
   	if(id==4)
       var Win = window.open('i/foto/foto_4.html','displayWindow','width=415,height=440,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
  	if(id==5)
       var Win = window.open('i/foto/foto_5.html','displayWindow','width=363,height=400,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==6)
       var Win = window.open('i/foto/foto_6.html','displayWindow','width=415,height=345,resizable=0,scrollbars=0,menubar=0,left=10,top=10');	
	if(id==8)
      var Win = window.open('i/foto/foto_8.html','displayWindow','width=400,height=300,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
 	if(id==9)
       var Win = window.open('i/foto/foto_9.html','displayWindow','width=404,height=450,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==10)
       var Win = window.open('i/foto/foto_10.html','displayWindow','width=410,height=430,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==11)
       var Win = window.open('i/foto/foto_11.html','displayWindow','width=600,height=353,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==12)
       var Win = window.open('i/foto/foto_12.html','displayWindow','width=400,height=315,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==13)
       var Win = window.open('i/foto/foto_13.html','displayWindow','width=410,height=445,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
}

function pokaz_nagrode(id){
	if(id==1)
       var Win = window.open('i/nagrody/kielce04_1.html','displayWindow','width=430,height=445,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==2)
       var Win = window.open('i/nagrody/kielce04_3.html','displayWindow','width=315,height=400,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
	if(id==3)
       var Win = window.open('i/nagrody/kielce04_4.html','displayWindow','width=314,height=400,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
   	if(id==4)
       var Win = window.open('i/nagrody/diamentowy_feniks.html','displayWindow','width=267,height=400,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
   	if(id==5)
       var Win = window.open('i/nagrody/kielce05.html','displayWindow','width=400,height=295,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
}

function pokaz_targi(id){
	if(id==1)
       var Win = window.open('i/targi/18targi_1.html','displayWindow','width=410,height=380,resizable=0,scrollbars=0,menubar=0,left=10,top=10');
}

function katalog(p, s, t){
	window.status='';
	document.indeks.przedmiot.value = p;
	document.indeks.szkola.value = s;
	document.indeks.typ.value = t;
	document.indeks.pag.value = 0;
	document.indeks.submit();
}

function katalog_1(p, s, t, i){
	window.status='';
	document.indeks.przedmiot.value = p;
	document.indeks.szkola.value = s;
	document.indeks.typ.value = t;
	document.indeks_1.przedmiot.value = p;
	document.indeks_1.szkola.value = s;
	document.indeks_1.typ.value = t;
	document.indeks_1.pag.value = i;
	document.indeks_1.submit();
}

function f_nauczyciel(s, p, t){
	window.status='';
	document.indeks.szkolenie.value = s;
	document.indeks.przedmiot.value = p;
	document.indeks.typ.value = t;
	document.indeks.pag.value = 0;
	document.indeks.submit();
}


function nauczyciel_1(s, p, t, i){
	window.status='';
	document.indeks.szkolenie.value = s;
	document.indeks.przedmiot.value = p;
	document.indeks.typ.value = t;
	document.indeks_1.przedmiot.value = p;
	document.indeks_1.szkolenie.value = s;
	document.indeks_1.typ.value = t;
	document.indeks_1.pag.value = i;
	document.indeks_1.submit();
}

function f_uczen(p, s, t){
	window.status='';
	document.indeks.przedmiot.value = p;
	document.indeks.szkola.value = s;
	document.indeks.typ.value = t;
	document.indeks.pag.value = 0;
	document.indeks.submit();
}

function uczen_1(p, s, t, i){
	window.status='';
	document.indeks.przedmiot.value = p;
	document.indeks.szkola.value = s;
	document.indeks.typ.value = t;
	document.indeks_1.przedmiot.value = p;
	document.indeks_1.szkola.value = s;
	document.indeks_1.typ.value = t;
	document.indeks_1.pag.value = i;
	document.indeks_1.submit();
}

function scenariusz(p, s, t){
	window.status='';
	document.scenariusze.przedmiot.value = p;
	document.scenariusze.szkola.value = s;
	document.scenariusze.klasa.value = t;
	document.scenariusze.pag.value = 0;
	document.scenariusze.submit();
}

function scenariusz_1(p, s, t, i){
	window.status='';
	document.scenariusze.przedmiot.value = p;
	document.scenariusze.szkola.value = s;
	document.scenariusze.klasa.value = t;
	document.scenariusze_1.przedmiot.value = p;
	document.scenariusze_1.szkola.value = s;
	document.scenariusze_1.klasa.value = t;
	document.scenariusze_1.pag.value = i;
	document.scenariusze_1.submit();
}

function plan(p, s, t, n){
	window.status='';
	document.plany.przedmiot.value = p;
	document.plany.szkola.value = s;
	document.plany.klasa.value = t;
	document.plany.program.value = n;
	document.plany.pag.value = 0;
	document.plany.submit();
}

function plan_1(p, s, t, n, i){
	window.status='';
	document.plany.przedmiot.value = p;
	document.plany.szkola.value = s;
	document.planuy.klasa.value = t;
	document.planuy.program.value = n;
	document.plany_1.przedmiot.value = p;
	document.plany_1.szkola.value = s;
	document.plany_1.klasa.value = t;
	document.plany_1.program.value = n;
	document.plany_1.pag.value = i;
	document.plany_1.submit();
}

function kwartalnik(p, s, t, i){
	window.status='';
	document.indeks.przedmiot.value = p;
	document.indeks.szkola.value = s;
	document.indeks.typ.value = t;
	document.indeks.pag.value = i;
	document.indeks.submit();
}

function znajdz(p, s, t){
	window.status='';
	document.znalezione.tekst.value = p;
	document.znalezione.tabela.value = s;
	document.znalezione.pag.value = t;
	document.znalezione.submit();
}

function subscribe()
	{
		var emailReg  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (!emailReg.test(document.newsletter.sub_email.value)){
			alert ("Niepoprawny format adresu e-mail");
		}else{
			document.newsletter.submit()
		}	
}

function search_check(id)
	{
	if(id==1)
		{
			if (document.wyszukiwarka.tekst.value=='Wpisz szukaną frazę...' || document.wyszukiwarka.tekst.value==''){
				alert ("Wpisz szukaną frazę...");
			}else{
				document.wyszukiwarka.submit()
			}
		}
	if(id==2)
		{
			if ((document.wyszukiwarka_adv.tekst.value=='Wpisz szukaną frazę...' || document.wyszukiwarka_adv.tekst.value=='') && (document.wyszukiwarka_adv.typ.value==0 && document.wyszukiwarka_adv.kategoria.value==0))
				 {
				alert ("Nie wypełniłe¶ żadnego pola....");
			}
			else{
				document.wyszukiwarka_adv.submit()
			}
		}
}

function rejestracja(id)
{
	document.powrot.etap.value==id
	document.powrot.submit();	
}

function aktywacja(par)
{
	if(par==1)
	{
	if (document.forms["f_wstepny"].zgoda_news.checked==true)
 		{
		document.forms["f_wstepny"].czestotliwosc.disabled = false;
		document.forms["f_wstepny"].czestotliwosc.focus();
		}
	else
		{ 
	  document.forms["f_wstepny"].czestotliwosc.disabled = true;
		}
	}
}


/*
function rejstracja(e){
//	document.location.href='exam_main.php?id_pytania=' + id;
//	document.indeks.przedmiot.value = p;
//	document.indeks.szkola.value = s;
//	document.indeks.typ.value = t;
//	document.indeks.pag.value = 0;
	document.indeks.submit();
}
*/

var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer(s)
{
	secs = s
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
    clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs==0)
    {       
		nwstecz();
		InitializeTimer(6);		
    }
  	else
    {
		//document.timer.sekundy.value=secs		
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }	
}

