function form_sprawdz(f) {
	with(f) {
		if(!nadawca.value.length) {
			alert('Wypełnij pole "Nadawca"!')
			nadawca.focus()
			return false
		}

		if(!adres.value.length) {
			alert('Wypełnij pole "Adres e-mail"!')
			adres.focus()
			return false
		}

		if(!temat.value.length) {
			alert('Wypełnij pole "Temat"!')
			temat.focus()
			return false
		}

		if(!tresc.value.length) {
			alert('Wypełnij pole "Treść"!')
			tresc.focus()
			return false
		}
	}
}

function form_ok() {	alert('Wiadomość wysłana, dziękujemy!') }
function form_error() { alert('Nie udało się wysłać wiadomości!\nProsimy o kontakt pod adresem: stowarzyszenie@kolejowepodlasie.pl') }

function img_enlarge(s) {
	var c = document.getElementById('draperia')
	var i = document.getElementById('obrazek')

	if(!c) {
		c = document.createElement('div')
		c.id = 'draperia'

		with(c.style) {
			display = 'none'
			position = 'absolute'
			top = left = '0px'
			backgroundColor = '#000000'
			opacity = '0.6'
			filter = 'alpha(opacity=60)'
			width = document.body.offsetWidth+'px'
			height = document.body.offsetHeight+'px'
			zIndex = 2
		}

		c.onclick = function() { this.style.display = document.getElementById('obrazek').style.display = 'none' }

		i = document.createElement('img')
		i.id = 'obrazek'
		i.title = 'Kliknij, aby zamknąć obrazek'

		with(i.style) {
			border = '10px solid #ffffff'
			display = 'none'
			position = 'absolute'
		}

		i.onload = function() {
			var scrollTop = window.pageYOffset ? window.pageYOffset : (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop
			with(this.style) {
				top = (scrollTop + ~~(self.innerHeight/2-this.height/2))+'px'
				left = ~~(self.innerWidth/2-this.width/2)+'px'
				display = 'block'
				zIndex = 3
			}
			document.getElementById('draperia').style.display = 'block'
		}

		i.onclick = function() { this.style.display = document.getElementById('draperia').style.display = 'none' }

		document.body.appendChild(i)
		document.body.appendChild(c)
	}

	i.src = s
}
