/* Dolmat - funkcje JS */


function formularz()
{
    if (document.kontakt.dane.value == '')
    {
        alert('Proszę podać imię i nazwisko.');
        document.kontakt.dane.focus();
        return false;
    }
    else if (document.kontakt.email.value == '')
    {
        alert('Proszę podać swój adres e-mail.');
        document.kontakt.email.focus();
        return false;
    }
    else if (document.kontakt.tresc.value == '')
    {
        alert('Proszę podać treść wiadomości.');
        document.kontakt.tresc.focus();
        return false;
    }

    if ( !/^[\w\.-]+@([\w-]+\.)*[a-z]{2,4}$/i.test(document.kontakt.email.value))
    {
        alert('Adres e-mail jest nieprawidłowy!');
        document.kontakt.email.focus();
        document.kontakt.email.select();
        return false;
    }
    else
    {
        return true;
    }    
}

function popup (url,windowName,windowTitle,closeOnClick,width,height,t)
{
	if(!url)return
	function readSize(){if(t.complete)showPopup(t.width,t.height);else setTimeout(readSize,1e2)}
	function showPopup(w,h){with(window.open('',windowName||'','width='+(width||w)+',height='+(height||h)).document){open();write('<html><head><title>'+(windowTitle||'')+'</title></head><body style="margin:0;padding:0"><img src="'+url+'" style="display:block;cursor: pointer" onclick="self.close()" title="Zamknij okno"'+'></body></html>');close()}}
	if(!width||!height)t=new Image(),t.src=url,readSize()
	else showPopup(width,height)
}