<!--
function checkMail(id) {
    email = get(id).value;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    if (filter.test(email)) {
        return true;
    }
    return false;
}

function checkInput(id, min) {
    input = get(id).value;
    if (input.length >= min) {
        return true;
    }
    return false;
}
function checkCheckbox(id) {
    checkbox = get(id);
    if (checkbox.checked == false) {
        return false;
    }
    return true;
}
function checkCompare(id1, id2) {
    pole1 = get(id1).value;
    pole2 = get(id2).value;
    if (pole1 == pole2) {
        return true;
    }
    return false;
}
function get(id) {
        if (document.getElementById(id)) {
            return document.getElementById(id);
        }
    return false;
}
function checkForm_rejestracja(form, submit, pokaz) {
    wynik = true;
    var info = new Array();
    var i = 0;
    if (!checkInput('imie', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- imię'; } }
    if (!checkInput('nazwisko', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- nazwisko'; } }
    if (!get('znak').disabled && !checkInput('adres', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- znak'; } }
    if (!checkInput('adres', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- adres'; } }
    if (!checkInput('kod', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- kod'; } }
    if (!checkInput('miasto', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- miasto'; } }
    if (!checkMail('email')) { wynik = false; if (pokaz == true) { info[i++] = '- e-mail'; } }
    if (!checkInput('telefon', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- telefon'; } }
    if (!checkInput('login', 1)) { wynik = false; if (pokaz == true) { info[i++] = '- login'; } }
    if (!checkInput('password', 1) && get('zmien_haslo').value == 1) { wynik = false; if (pokaz == true) { info[i++] = '- hasło'; } }
    if (!checkCompare('password', 'password2')) { wynik = false; if (pokaz == true) { info[i++] = 'Błędnie wprowadzono hasła.'; } }
    
    if (wynik == false && info.length > 0 && pokaz == true) {
        var napis = "Proszę poprawnie uzupełnić następujące pola: \n"+info.join("\n");
        alert(napis);
    }
    return wynik;
}

function zmiana_hasla() {
    if (get('zmien_haslo').value == 0) {
        get('tr_haslo').style.display = 'block';
//      get('tr_haslo2').style.display = 'block';
//      get('div_haslo').innerHTML = 'nie zmieniaj hasła';
        get('zmien_haslo').value = 1;
    }
    else {
        get('zmien_haslo').value = 0;
        get('tr_haslo').style.display = 'none';
//      get('tr_haslo2').style.display = 'none';
//      get('div_haslo').innerHTML = 'zmień hasło';
    }
    return true;
}
//-->
