
function newsletter()
{
s=document.location.search
otworz('_newsletter.php'+s);
}


function zamowkatalog()
{
s=document.location.search
otworz('_zamowkatalog.php'+s);
}

function polec()
{
s=document.location.search
otworz('_polec.php'+s);
}


function drukuj()
{
s=document.location.search
otworz('_druk.php'+s);
}

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(/[^±æê³ñó¶¼¿¡ÆÊ£ÑÓ¦¬¯a-zA-Z-\s]/,'');
thisElement.value = thisElement.value.replace(/[^±æê³ñó¶¼¿¡ÆÊ£ÑÓ¦¬¯a-zA-Z-\s]/,'');
thisElement.value = thisElement.value.replace(/[^±æê³ñó¶¼¿¡ÆÊ£ÑÓ¦¬¯a-zA-Z-\s]/,'');
//±æê³ñó¶¼¿¡ÆÊ£ÑÓ¦¯¬
return false;
}


function your_login(thisElement)
{
if (document.rej.login)
{
x=thisElement.value
x = x.replace(/[^±æê³ñó¶¼¿¡ÆÊ£ÑÓ¦¬¯a-zA-Z]/,'');
x = x.replace(/[^±æê³ñó¶¼¿¡ÆÊ£ÑÓ¦¬¯a-zA-Z]/,'');
x = x.replace(/[^±æê³ñó¶¼¿¡ÆÊ£ÑÓ¦¬¯a-zA-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('Proszê wype³niæ pole IMIÊ I NAZWISKO!'):
(!document.rej.miejscowosc.value) ? alert('Proszê wype³niæ pole MIEJSCOWO¦Æ!'):
(!document.rej.kod.value) ? alert('Proszê wype³niæ pole KOD POCZTOWY!'):
(!document.rej.ulica.value) ? alert('Proszê wype³niæ pole ULICA!'):
(!document.rej.telefon.value) ? alert('Proszê wype³niæ pole TELEFON!'):
(!isEmail(document.rej.email.value)) ? alert('Proszê prawid³owo wype³niæ pole E-MAIL!'):
document.rej.submit();

//(!document.rej.firma.value) ? alert('Proszê wype³niæ pole FIRMA!'):
//(!check_nip(document.rej.nip.value)) ? alert('Proszê poprawnie wype³niæ pole NIP!'):

//(!document.rej.login.value) ? alert('Proszê wype³niæ pole LOGIN!'):
//(!document.rej.haslo.value) ? alert('Proszê wype³niæ pole HAS£O!'):
}


