
function onlydigits(thisElement)
{
thisElement.value = thisElement.value.replace(/[^\d]/,'');
thisElement.value = thisElement.value.replace(/[^\d]/,'');
thisElement.value = thisElement.value.replace(/[^\d]/,'');
return false;
}

function onlydigits_(thisElement)
{
thisElement.value = thisElement.value.replace(/[^\d\s()-]/,'');
thisElement.value = thisElement.value.replace(/[^\d\s()-]/,'');
thisElement.value = thisElement.value.replace(/[^\d\s()-]/,'');
return false;
}

function isDigit_or_Sign(e)
{
var valids = "1234567890 -()"
for (var i=0 ; i < e.length ; i++ )
{if (valids.indexOf(e.charAt(i)) == -1 ) return false;}
}

function isPostcode(e)
{
e.value = e.value.replace(/[^0-9-]/,'');
e.value = e.value.replace(/[^0-9-]/,'');
return false;
}


function onlyLetters(thisElement)
{
thisElement.value = thisElement.value.replace(/[^±celno¶¼z”CELNO¦¬Za-zA-Z-\s]/,'');
thisElement.value = thisElement.value.replace(/[^±celno¶¼z”CELNO¦¬Za-zA-Z-\s]/,'');
thisElement.value = thisElement.value.replace(/[^±celno¶¼z”CELNO¦¬Za-zA-Z-\s]/,'');
//±celno¶¼z”CELNO¦Z¬
return false;
}


function your_login(thisElement)
{
if (document.rej.login)
{
x=thisElement.value
x = x.replace(/[^±celno¶¼z”CELNO¦¬Za-zA-Z]/,'');
x = x.replace(/[^±celno¶¼z”CELNO¦¬Za-zA-Z]/,'');
x = x.replace(/[^±celno¶¼z”CELNO¦¬Za-zA-Z]/,'');
//±celno¶¼z”CELNO¦Z¬
document.rej.login.value=x;
}
return false;
}


function isEmail(who) {
var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
return(email.test(who));
}

function  check_nip(nip)
{
wagi= new Array (6,5,7,2,3,4,5,6,7);
for (i=0;i<15;i++) nip=nip.replace(/[^\d]/,'');
sk=0; 
for (i=0;i<9;i++) 
sk=sk+parseInt(nip.charAt(i))*wagi[i];
sk=(sk % 11); if (sk==10) sk='0';
return ( sk==parseInt(nip.charAt(i)) )
}




function sprawdz()
{
(!document.rej.nazwisko_imie.value) ? alert('Prosze wypelnic pole IMIE I NAZWISKO!'):
(!document.rej.miejscowosc.value) ? alert('Prosze wypelnic pole MIEJSCOWO¦C!'):
(!document.rej.kod.value) ? alert('Prosze wypelnic pole KOD POCZTOWY!'):
(!document.rej.ulica.value) ? alert('Prosze wypelnic pole ULICA!'):
(!document.rej.telefon.value) ? alert('Prosze wypelnic pole TELEFON!'):
(!isEmail(document.rej.email.value)) ? alert('Prosze prawidlowo wypelnic pole E-MAIL!'):
(!document.rej.haslo.value) ? alert('Prosze wypelnic pole HASLO!'):
(!document.rej.haslo1.value) ? alert('Prosze wypelnic pole POWTORZ HASLO!'):
(!(document.rej.haslo.value == document.rej.haslo1.value)) ? alert('Hasla nie sa jednakowe. Poprawnie wypelnij pola HASLO i POWTORZ HASLO'):
document.rej.submit();

//(!document.rej.firma.value) ? alert('Prosze wypelnic pole FIRMA!'):
//(!check_nip(document.rej.nip.value)) ? alert('Prosze poprawnie wypelnic pole NIP!'):

//(!document.rej.login.value) ? alert('Prosze wypelnic pole LOGIN!'):
//(!document.rej.haslo.value) ? alert('Prosze wypelnic pole HASLO!'):
}


