var domiasta;
var z=0;

function osrodek(jaki) {

	//document.getElementById("poznan_kot").src="./img/kotek.png";
	document.getElementById("poznan_kot").src="./img/kotekBez.png";
	document.getElementById("krakow_kot").src="./img/kotekBez.png";
	//document.getElementById("krakow_kot").src="./img/kotek.png";
	//document.getElementById("wroclaw_kot").src="./img/kotek.png";
	document.getElementById("wroclaw_kot").src="./img/kotekBez.png";
	//document.getElementById("szczecin_kot").src="./img/kotek.png";
	document.getElementById("szczecin_kot").src="./img/kotekBez.png";
	//document.getElementById("gdansk_kot").src="./img/kotek.png";
	//document.getElementById("gdansk1_kot").src="./img/kotek.png";
	document.getElementById("gdansk_kot").src="./img/kotekBez.png";
	document.getElementById("gdansk1_kot").src="./img/kotekBez.png";
	//document.getElementById("lublin_kot").src="./img/kotek.png";
		document.getElementById("lublin_kot").src="./img/kotekBez.png";
	//document.getElementById("slupsk_kot").src="./img/kotek.png";
	document.getElementById("slupsk_kot").src="./img/kotekBez.png";
	document.getElementById("katowice_kot").src="./img/kotekBez.png";
	//document.getElementById("katowice_kot").src="./img/kotek.png";
	//document.getElementById("warszawa1_kot").src="./img/kotek.png";
	document.getElementById("warszawa1_kot").src="./img/kotekBez.png";
	//document.getElementById("warszawa2_kot").src="./img/kotek.png";
	document.getElementById("warszawa2_kot").src="./img/kotekBez.png";
	document.getElementById("warszawa3_kot").src="./img/kotekBez.png";
	//document.getElementById("olsztyn_kot").src="./img/kotek.png";
	document.getElementById("olsztyn_kot").src="./img/kotekBez.png";
	//document.getElementById("zielonagora_kot").src="./img/kotek.png";
	document.getElementById("zielonagora_kot").src="./img/kotekBez.png";
	//document.getElementById("bialystok_kot").src="./img/kotek.png";
	document.getElementById("bialystok_kot").src="./img/kotekBez.png";
	//document.getElementById("bydgoszczogrod_kot").src="./img/kotek.png";
	document.getElementById("bydgoszczogrod_kot").src="./img/kotekBez.png";
	//document.getElementById("bydgoszcz_kot").src="./img/kotek.png";
	document.getElementById("bydgoszcz_kot").src="./img/kotekBez.png";
	document.getElementById("poznanogrod_kot").src="./img/kotekBez.png";
	//document.getElementById("lodz_kot").src="./img/kotek.png";
	document.getElementById("lodz_kot").src="./img/kotekBez.png";
	//document.getElementById("torun_kot").src="./img/kotek.png";
	document.getElementById("torun_kot").src="./img/kotekBez.png";
	//document.getElementById("opole_kot").src="./img/kotek.png";
	document.getElementById("opole_kot").src="./img/kotekBez.png";
	//document.getElementById("lublin2_kot").src="./img/kotek.png";
	document.getElementById("lublin2_kot").src="./img/kotekBez.png";
	document.getElementById("sopot_kot").src="./img/kotek.png";
	//document.getElementById("krakow1_kot").src="./img/kotek.png";
	document.getElementById("krakow1_kot").src="./img/kotekBez.png";
	document.getElementById("krakow2_kot").src="./img/kotekBez.png";
	//document.getElementById("poznan1_kot").src="./img/kotek.png";
	document.getElementById("poznan1_kot").src="./img/kotekBez.png";
	//document.getElementById("lublin1_kot").src="./img/kotek.png";
	document.getElementById("lublin1_kot").src="./img/kotekBez.png";
	//document.getElementById("kielce_kot").src="./img/kotek.png";
	document.getElementById("kielce_kot").src="./img/kotekBez.png";
	document.getElementById("zielonagora1_kot").src="./img/kotekBez.png";
	
	document.getElementById("rzeszow_kot").src="./img/kotekBez.png";
	document.getElementById("krosno_kot").src="./img/kotekBez.png";
	document.getElementById("poznan2").src="./img/kotekBez.png";
	document.getElementById("poznan3").src="./img/kotekBez.png";
	
	kon_logo="";
	for (n=1;n<=33;n++) {
		if (u_ktory[n]==jaki) {


			if (u_program[n]) {
				document.getElementById(jaki+"_kot").src="./img/kotek1.png";
			} else {
				document.getElementById(jaki+"_kot").src="./img/kotek2.png";
			}

			document.getElementById("opis_u").style.display='block';
			wpis="Ul. "+u_ulica[n]+" "+u_nr[n]+"<br>"+u_kod[n]+" "+u_miasto[n];
			if (u_koor_imie[n] && u_koor_czy!='nie') {
				wpis=wpis+"<br><br>Kontakt:<br><b>"+u_koor_imie[n]+"<br>"+u_koor_nazwisko[n];
			}
			wpis=wpis+"</b><br>";
			if (u_tel[n]) wpis=wpis+"tel. "+u_tel[n];
			if (u_fax[n]) {
				wpis=wpis+"<br>fax "+u_fax[n];
			} else {
				wpis=wpis+"<br><br>";
			}
			document.getElementById("opis_u").innerHTML=wpis;
			kon_logo=u_logo[n];
			kon_budynek=u_budynek[n];
			nazwa=u_wydzial[n];
			nazwa1=u_uniwersytet[n];

		}
	}

	document.getElementById("logo").style.width='170px';
	if (kon_logo) {
		document.getElementById("logo").src="./img/logo_"+jaki+kon_logo;
	} else {
		document.getElementById("logo").src="./img/pusty.png";
	}

	document.getElementById("wydzial").innerHTML=nazwa;
	document.getElementById("uniwersytet").innerHTML=nazwa1;


	if (kon_budynek) {
		document.getElementById("budynek_u").style.backgroundImage = "url(./img/budynek_"+jaki+kon_budynek+")";
		document.getElementById("budynek_u").style.display='block';
	} else {
		document.getElementById("budynek_u").style.backgroundImage = "url(./img/pusty.png)";
	}
	
	//if (-1 != navigator.userAgent.indexOf("Firefox")) {
	//} else {
		//n=1+Math.floor(Math.random()*2);
		//DHTMLSound('./dzwieki/mial'+n+'.wav');
	//}

}

function osrodek_koniec() {

//	document.getElementById("budynek_u").style.display='none';
//	document.getElementById("opis_u").style.display='none';

//	document.getElementById("najblizszy").style.display='block';

}

function osrodekBez(jaki) {

	document.getElementById("poznan_kot").src="./img/kotekBez.png";
	document.getElementById("krakow_kot").src="./img/kotekBez.png";
	document.getElementById("wroclaw_kot").src="./img/kotekBez.png";
	document.getElementById("szczecin_kot").src="./img/kotekBez.png";
	document.getElementById("gdansk_kot").src="./img/kotekBez.png";
	document.getElementById("gdansk1_kot").src="./img/kotekBez.png";
	document.getElementById("lublin_kot").src="./img/kotekBez.png";
	document.getElementById("slupsk_kot").src="./img/kotekBez.png";
	document.getElementById("katowice_kot").src="./img/kotekBez.png";
	document.getElementById("warszawa1_kot").src="./img/kotekBez.png";
	document.getElementById("warszawa2_kot").src="./img/kotekBez.png";
	document.getElementById("warszawa3_kot").src="./img/kotekBez.png";
	document.getElementById("olsztyn_kot").src="./img/kotekBez.png";
	document.getElementById("zielonagora_kot").src="./img/kotekBez.png";
	document.getElementById("bialystok_kot").src="./img/kotekBez.png";
	document.getElementById("bydgoszczogrod_kot").src="./img/kotekBez.png";
	document.getElementById("bydgoszcz_kot").src="./img/kotekBez.png";
	document.getElementById("poznanogrod_kot").src="./img/kotekBez.png";
	document.getElementById("lodz_kot").src="./img/kotekBez.png";
	document.getElementById("torun_kot").src="./img/kotekBez.png";
	document.getElementById("opole_kot").src="./img/kotekBez.png";
	document.getElementById("lublin2_kot").src="./img/kotekBez.png";
	document.getElementById("sopot_kot").src="./img/kotek.png";
	document.getElementById("krakow1_kot").src="./img/kotekBez.png";
	document.getElementById("krakow2_kot").src="./img/kotekBez.png";
	document.getElementById("poznan1_kot").src="./img/kotekBez.png";
	document.getElementById("lublin1_kot").src="./img/kotekBez.png";
	document.getElementById("kielce_kot").src="./img/kotekBez.png";
	document.getElementById("zielonagora1_kot").src="./img/kotekBez.png";
	document.getElementById("rzeszow_kot").src="./img/kotekBez.png";
	document.getElementById("krosno_kot").src="./img/kotekBez.png";
	document.getElementById("poznan2_kot").src="./img/kotekBez.png";
	document.getElementById("poznan3_kot").src="./img/kotekBez.png";
	
	kon_logo="";
	for (n=1;n<=33;n++) {
		if (u_ktory[n]==jaki) {


			if (u_program[n]) {
				document.getElementById(jaki+"_kot").src="./img/kotek1bez.png";
			} else {
				document.getElementById(jaki+"_kot").src="./img/kotek2.png";
			}

			document.getElementById("opis_u").style.display='block';
			wpis="Ul. "+u_ulica[n]+" "+u_nr[n]+"<br>"+u_kod[n]+" "+u_miasto[n];
			if (u_koor_imie[n] && u_koor_czy!='nie') {
				wpis=wpis+"<br><br>Kontakt:<br><b>"+u_koor_imie[n]+"<br>"+u_koor_nazwisko[n];
			}
			wpis=wpis+"</b><br>";
			if (u_tel[n]) wpis=wpis+"tel. "+u_tel[n];
			if (u_fax[n]) {
				wpis=wpis+"<br>fax "+u_fax[n];
			} else {
				wpis=wpis+"<br><br>";
			}
			document.getElementById("opis_u").innerHTML=wpis;
			kon_logo=u_logo[n];
			kon_budynek=u_budynek[n];
			nazwa=u_wydzial[n];
			nazwa1=u_uniwersytet[n];

		}
	}

	document.getElementById("logo").style.width='170px';
	if (kon_logo) {
		document.getElementById("logo").src="./img/logo_"+jaki+kon_logo;
	} else {
		document.getElementById("logo").src="./img/pusty.png";
	}

	document.getElementById("wydzial").innerHTML=nazwa;
	document.getElementById("uniwersytet").innerHTML=nazwa1;


	if (kon_budynek) {
		document.getElementById("budynek_u").style.backgroundImage = "url(./img/budynek_"+jaki+kon_budynek+")";
		document.getElementById("budynek_u").style.display='block';
	} else {
		document.getElementById("budynek_u").style.backgroundImage = "url(./img/pusty.png)";
	}
	
	//if (-1 != navigator.userAgent.indexOf("Firefox")) {
	//} else {
		//n=1+Math.floor(Math.random()*2);
		//DHTMLSound('./dzwieki/mial'+n+'.wav');
	//}

}

function osrodek_koniec() {

//	document.getElementById("budynek_u").style.display='none';
//	document.getElementById("opis_u").style.display='none';

//	document.getElementById("najblizszy").style.display='block';

}
function DHTMLSound(surl) {
  document.getElementById("dzwiek").innerHTML=
    "<embed src='"+surl+"' hidden=true autostart=true loop=false>";
} 





/***********************************************
* Dynamic Countdown script-  Dynamic Drive (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function cdtime(container, rr, mm, dd, hh){

if (!document.getElementById || !document.getElementById(container)) return
this.container=document.getElementById(container)
this.currentTime=new Date()
this.targetdate=new Date(rr, mm, dd, hh, 0, 0, 0)

this.timesup=false
this.updateTime()
}

cdtime.prototype.updateTime=function(){
var thisobj=this
this.currentTime.setSeconds(this.currentTime.getSeconds()+1)
setTimeout(function(){thisobj.updateTime()}, 1000) //update time every second
}

cdtime.prototype.displaycountdown=function(baseunit, functionref){
this.baseunit=baseunit
this.formatresults=functionref
this.showresults()
}

cdtime.prototype.showresults=function(){
var thisobj=this


var timediff=(this.targetdate-this.currentTime)/1000 //difference btw target date and current date, in seconds



if (timediff<0){ //if time is up
this.timesup=true
this.container.innerHTML=this.formatresults()
return
}
var oneMinute=60 //minute unit in seconds
var oneHour=60*60 //hour unit in seconds
var oneDay=60*60*24 //day unit in seconds
var dayfield=Math.floor(timediff/oneDay)

var hourfield=Math.floor((timediff-dayfield*oneDay)/oneHour)
var minutefield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour)/oneMinute)
var secondfield=Math.floor((timediff-dayfield*oneDay-hourfield*oneHour-minutefield*oneMinute))
if (this.baseunit=="hours"){ //if base unit is hours, set "hourfield" to be topmost level
hourfield=dayfield*24+hourfield
dayfield="n/a"
}
else if (this.baseunit=="minutes"){ //if base unit is minutes, set "minutefield" to be topmost level
minutefield=dayfield*24*60+hourfield*60+minutefield
dayfield=hourfield="n/a"
}
else if (this.baseunit=="seconds"){ //if base unit is seconds, set "secondfield" to be topmost level
var secondfield=timediff
dayfield=hourfield=minutefield="n/a"
}
this.container.innerHTML=this.formatresults(dayfield, hourfield, minutefield, secondfield)
setTimeout(function(){thisobj.showresults()}, 1000) //update results every second
}




function formatresults(){


if (arguments[0]>9) {
	ar=arguments[0].toString();
	a1=ar.substring(0,1);
	a2=ar.substring(1,2);
	a3=ar.substring(2,3);
	var displaystring="<img src='./img/0.png'><img src='./img/"+a1+".png'><img src='./img/"+a2+".png'>";
	//<img src='./img/"+a3+".png'>"
} else {
	var displaystring="<img src='./img/0.png'><img src='./img/"+arguments[0]+".png'>";
}
var displaystring=displaystring+"<img src='./img/_.png'>";
if (arguments[1]>9) {
	ar=arguments[1].toString();
	a1=ar.substr(0,1);
	a2=ar.substr(1,1);
	var displaystring=displaystring+"<img src='./img/"+a1+".png'><img src='./img/"+a2+".png'>";
} else {
	var displaystring=displaystring+"<img src='./img/0.png'><img src='./img/"+arguments[1]+".png'>";
}
var displaystring=displaystring+"<img src='./img/_.png'>";
if (arguments[2]>9) {
	ar=arguments[2].toString();
	a1=ar.substr(0,1);
	a2=ar.substr(1,1);
	var displaystring=displaystring+"<img src='./img/"+a1+".png'><img src='./img/"+a2+".png'>";
} else {
	var displaystring=displaystring+"<img src='./img/0.png'><img src='./img/"+arguments[2]+".png'>";
}
var displaystring=displaystring+"<img src='./img/_.png'>";
if (arguments[3]>9) {
	ar=arguments[3].toString();
	a1=ar.substr(0,1);
	a2=ar.substr(1,1);
	var displaystring=displaystring+"<img src='./img/"+a1+".png'><img src='./img/"+a2+".png'>";
} else {
	var displaystring=displaystring+"<img src='./img/0.png'><img src='./img/"+arguments[3]+".png'>";
}




//if (this.timesup==false){//if target date/time not yet met
//var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">Za "+arguments[0]+" dni "+arguments[1]+" godzin "+arguments[2]+" minut "+arguments[3]+" sekund 8me urodziny szablony.blogowicz.info"
//}
//else{ //else if target date/time met
//var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">było: 8me urodziny szablony.blogowicz.info"
//}

return displaystring
}

function formatresults2(){
if (this.timesup==false){ //if target date/time not yet met
var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">Za "+arguments[0]+" dni "+arguments[1]+" godzin "+arguments[2]+" minut "+arguments[3]+" sekund 8me urodziny szablony.blogowicz.info"
}
else{ //else if target date/time met
var displaystring="<p style=\"font-size: 10px; font-family: tahoma; color: #000000;\">8me urodziny szablony.blogowicz.info" //Don't display any text
}
return displaystring
}

function rozwin() {

	z++;
	document.getElementById("szukszuk").style.marginLeft=(parseInt(document.getElementById("szukszuk").style.marginLeft)-1)+'px';
	document.getElementById("szukszuk").style.width=(parseInt(document.getElementById("szukszuk").style.width)+1)+'px';
	if (z>70) clearInterval (idszuk);
}

function przeszukaj() {

	document.getElementById("szukszuk").style.border="2px solid #89244E";
	document.getElementById("szukszuk").focus();
	idszuk = setInterval("rozwin();", 1);



}