function  checkYear(obj) {
	if (obj.value == '' || obj.value.match(/\d{4}/)) {
		return true;
	} else {
		alert('Rok należy wpisywać w postaci czterycyfrowej!');
		obj.value='';
		return false;
	}
}

function Pomoc(filename, width, height, title) {
    var swidth = screen.width;
    var sheight = screen.height;
    var popup = null;
    var left = (swidth/2) - (width/2);
    var top = (sheight/2) - (height/2) - 30;
    popup = window.open("", title,"scrollbars=no,resizable=no,height=" + height + ",width=" + width + ",left=" + left + ",top=" + top);
    if( popup != null ) {
    	if( popup.opener == null ) {
    		popup.opener = self;
    	}
    	popup.location.href = filename;
    	popup.focus();
    }
}

function Szczegoly(filename, width, height, title) {
    var swidth = screen.width;
    var sheight = screen.height;
    var popup = null;
    var left = (swidth/2) - (width/2);
    var top = (sheight/2) - (height/2) - 30;
    popup = window.open("", title,"scrollbars=yes,resizable=yes,height=" + height + ",width=" + width + ",left=" + left + ",top=" + top);
    if( popup != null ) {
    	if( popup.opener == null ) {
    		popup.opener = self;
    	}
    	popup.location.href = filename;
    	popup.focus();
    }
}

function EdycjaZdjecia(IdObiektu, idZrodlowegoArtykulu, width, height) {
   url = 'archEdycjaZdjecia.php?IdObiektu=' + IdObiektu + '&idZrodlowegoArtykulu=' + idZrodlowegoArtykulu;
   tytul = 'EdycjaZdjecia';
   popup = window.open('', tytul,  'scrollbars=yes,resizable=yes,height=' + height + ',width=' + width + ',left=50,top=50');
    if( popup != null ) {
    	if( popup.opener == null ) {
    		popup.opener = self;
    	}
    	popup.location.href = url;
    	popup.focus();
    }
}

function ImagePreview(IdObiektu) {
   url = 'img.php?big=1&id=' + IdObiektu;
   tytul = 'ImagePreview';
   popup = window.open('', tytul,  'scrollbars=yes,resizable=yes');
    if( popup != null ) {
    	if( popup.opener == null ) {
    		popup.opener = self;
    	}
    	popup.location.href = url;
    	popup.focus();
    }
}

function weryfikacja(f) {
//alert('tescik');
/*
    var komunikat = '';
    var puste_pola = '';
    for (var i = 0; i < f.length(); i++) {
        e = f.elements[i];
        if ((e.type=='text' || e.type=='textarea') && e.mustbe) {
            if (e.value.match(/^\s*$/) {
                puste_pola += '\n          ' + e.name;
                continue;
            }
       }
    }
    komunikat += '----------------------------------------------------------\n';
    komunikat += 'Formularz nie został wysłany z powodu poniższych błędów.\n';
    komunikat += '----------------------------------------------------------\n';
    if (puste_pola) {
        komunikat += 'Następujące pola są puste:' + puste_pola + '\n';;
        alert(komunikat);
        return false;
    } else {
        return true;
    }
*/
}