aktualnosci1 = new Image (); aktualnosci1.src = "gfx/intervac_04.png";
aktualnosci2 = new Image (); aktualnosci2.src = "gfx/intervac_04-p.png";

czymjest1 = new Image (); czymjest1.src = "gfx/intervac_05.png";
czymjest2 = new Image (); czymjest2.src = "gfx/intervac_05-p.png";

zalety1 = new Image (); zalety1.src = "gfx/intervac_06.png";
zalety2 = new Image (); zalety2.src = "gfx/intervac_06-p.png";

jakzostac1 = new Image (); jakzostac1.src = "gfx/intervac_07.png";
jakzostac2 = new Image (); jakzostac2.src = "gfx/intervac_07-p.png";

regulamin1 = new Image (); regulamin1.src = "gfx/intervac_08.png";
regulamin2 = new Image (); regulamin2.src = "gfx/intervac_08-p.png";

reportaze1 = new Image (); reportaze1.src = "gfx/intervac_09.png";
reportaze2 = new Image (); reportaze2.src = "gfx/intervac_09-p.png";

media1 = new Image (); media1.src = "gfx/intervac_10.png";
media2 = new Image (); media2.src = "gfx/intervac_10-p.png";

poland1 = new Image (); poland1.src = "gfx/btn_whypoland.gif";
poland2 = new Image (); poland2.src = "gfx/btn_whypoland-p.gif";

napisz1 = new Image (); napisz1.src = "gfx/btn_napisz.gif";
napisz2 = new Image (); napisz2.src = "gfx/btn_napisz-p.gif";

home1 = new Image (); home1.src = "gfx/btn_home.gif";
home2 = new Image (); home2.src = "gfx/btn_home-p.gif";

var aktywna;
var aktywnyobrazek;
var menuover;
var interwal;

function hidelayer() {
	if (aktywna && !(menuover)) {
		showhide(aktywna,"hidden");
		if (aktywna == "menu" + aktywnyobrazek) picoff(aktywnyobrazek);
		clearInterval(interwal);
	}
}

function picoff(obrazek)	{
	plik = obrazek + "1";
	document[obrazek].src = window[plik].src; 	
}

function off(obrazek)	{
	if (!(aktywna == "menu" + obrazek)) picoff(obrazek);
	if (menuover) interwal = setInterval("hidelayer()",1500);
}

function on(obrazek)	{
	if (aktywna) {
		picoff(aktywnyobrazek);
		showhide(aktywna,"hidden");
	}
	plik = obrazek + "2";
	document[obrazek].src = window[plik].src; 	
	aktywnyobrazek = obrazek;
}


function showhide(warstwa,funkcja) {
	if (funkcja == "visible") aktywna = warstwa;
	if (document.all) eval('document.all["' + warstwa + '"].style.visibility="' + funkcja + '"');
	if (document.getElementById) eval('document.getElementById("' + warstwa + '").style.visibility="' + funkcja + '"');
	if (document.layers) eval('document.layers["' + warstwa + '"].visibility="' + funkcja + '"');
}



function menuact(ktory) {
	ktory.style.background="#F1CE7B"
}

function menudeact(ktory) {
	ktory.style.background="#F7F5EA"
}

function mediawin(pic,width) {
	mediaokno=eval("window.open('gfx/zdjecia/" + pic + "','oknomedia', 'width=" + width + ",height=550,left=0,top=0,menubar=no,status=yes,scrollbars=yes')");
}

function sprawdz_zgloszenie() {
		txt='';

		var opistrue = 0;
		for (a = 1; a < 42; ++a) {
			if (eval('(document.formularz["opisoferty[' + a + ']"].checked)'))
				opistrue = 1;
		}
		if (!opistrue) 
				txt='Proszę zaznaczyć odpowiednie pola w opisie oferty.'
		
		if (!document.formularz["form[jezyk]"].value)
			txt='Proszę podać język korespondencji.'

		if (document.formularz["form[email]"].value) {
			if (document.formularz["form[email]"].value.indexOf("@") == -1 || document.formularz["form[email]"].value.indexOf(".") == -1)
				txt='Proszę podać poprawny adres e-mail.'
		}
		if (!document.formularz["form[kraj_wymiany][]"].value)
			txt='Proszę wybrac oczekiwany kraj wymiany.'

		if (!document.formularz["form[rodzaj_wymiany][]"].value)
			txt='Proszę wybrac rodzaj wymiany.'

		if (!document.formularz["form[czas_wymiany][]"].value)
			txt='Proszę wybrać cas przeznaczony na wymiany.'

		if (!document.formularz["form[ilosc_wymian]"].value)
			txt='Proszę podać ilość dotychczasowych wymian.'

		if (!document.formularz["form[zawod]"].value)
			txt='Proszę podać wykonywany zawód.'

		if (!document.formularz["form[urbanizacja]"].value)
			txt='Proszę wybrać charakter urbanizacji.'

		if (!document.formularz["form[rodzina]"].value)
			txt='Proszę podać skład rodziny.'

		if (!document.formularz["form[kod_miasto]"].value)
			txt='Proszę podac kod pocztowy i miasto.'

		if (!document.formularz["form[adres]"].value)
			txt='Proszę podać adres.'

		if (!document.formularz["form[ile_lazienek]"].value)
			txt='Proszę podać ilość łazienek.'

		if (!document.formularz["form[ile_pokoi]"].value)
			txt='Proszę podac ilość pokoi.'

		if (!document.formularz["form[ile_osob]"].value)
			txt='Proszę podać ilość osób mogacych mieszkać.'

		if ((document.formularz["form[opis_domu]"].value == 'C') && (!document.formularz["form[nr_pietra]"].value))
			txt='Prosze podac numer piętra.'

		if (!document.formularz["form[opis_domu]"].value)
			txt='Proszę wybrac opis.'

		if (!document.formularz["form[telefon]"].value)
			txt='Proszę podać numer telefonu kontaktowego\nwraz z numerem kierunkowym.'

		if (!document.formularz["form[imie_nazwisko]"].value)
			txt='Proszę podac imię i nazwisko.'

		if (txt) {
			alert(txt)
			return false 
			}
		else {
			return true;
		}
}

function sprawdz_formularz() {
		txt='';

		if (!document.formularz["form[tresc]"].value)
			txt='Proszę wpisac treść listu.'

		if (document.formularz["form[email]"].value) {
			if (document.formularz["form[email]"].value.indexOf("@") == -1 || document.formularz["form[email]"].value.indexOf(".") == -1)
				txt='Prosze podac poprawny adres e-mail.'
		}

		if ((!document.formularz["form[telefon]"].value) && (!document.formularz["form[email]"].value))
			txt='Proszę podać nuumer telefonu kontaktowego\nwraz z numerem kierunkowym, lub poprawny adres e-mail.'

		if (!document.formularz["form[imie_nazwisko]"].value)
			txt='Proszę podać imię i nazwisko.'

		if (txt) {
			alert(txt)
			return false 
			}
		else {
			return true;
		}
}

