function isInt(inputString){x = parseInt(inputString);if (isNaN(x)) return false;return true;}	function isFloat(x) {n = parseFloat(x);if (isNaN(x)) return false;return true;}function isLiczba(e) {if (e.match(/^[ 0-9]+[\.]?([0-9]+)?$/)) return true; else return false; }function isEmail(e) {if (e.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) return true; else return false; }function isTel(t) {if (t.match(/^[\(\)0-9- ]+$/)) return true; else return false; }function isKod(t) {if (t.match(/^[0-9]{2}-[0-9]{3}$/)) return true; else return false; }function isAlphanumeric(t){var alphaExp = /^[0-9a-zA-Z]+$/;if(t.match(alphaExp)){return true;}else{return false;}}var polaArr = new Array();var ile_pol = 0;var form_ok = false;var f_wstecz = false;function spr_forme(f) {if (f_wstecz) {return true;}ok = true;for (i=0; i<polaArr.length && ok; i++) {n = polaArr[i];obj = document.getElementsByName(n)[0];ok = (obj.value!='');if (!ok) {alert('Wypełnij obowiązkowe pola');obj.focus();continue;}switch (n) {case 'email': {ok = isEmail(obj.value);if (!ok) {alert('Podaj poprawny e-mail');obj.focus();}else {em2 = document.getElementsByName(n+'2')[0];ok = (em2.value==obj.value);if (!ok) {alert('Podane e-maile są różne');obj.focus();}	}break;}case 'haslo': {	ok = isAlphanumeric(obj.value); if (!ok) {alert('Hasło musi mieć sięskładać z liter lub cyfr');obj.focus();}else { ok = (obj.value.length >= 5);if (!ok) {alert('Hasło musi mieć przynajmniej 5 zaków');obj.focus();}else {	em2 = document.getElementsByName(n+'2')[0];ok = (em2.value==obj.value);if (!ok) {alert('Podane hasła są różne');obj.focus();}}}break;}case 'kod': {ok = isKod(obj.value);if (!ok) {alert('Podaj poprawny kod pocztowy w formacie xx-xxx');obj.focus();}break;}}}if (ok) {obj = document.getElementsByName('telefon')[0];if (obj.value!='') {	ok = (isTel(obj.value) && obj.value.length>=9);if (!ok) {alert('Podaj poprawny nr telefonu');obj.focus();}}}if (ok) {obj = document.getElementById('regulamin');if (obj!=null) {ok = (obj.checked==1);if (!ok) {alert('Musisz zaznaczyć pole, że zapoznałeś(-aś) sięz regulaminem');obj.focus();}else {obj = document.getElementById('dane_osobowe');if (obj!=null) {ok = (obj.checked==1);if (!ok) {alert('Musisz zaznaczyć pole, że świadomy(a) jesteś bezpieczeństwa transakcji w serwisie.');obj.focus();}}	}}}form_ok = ok;return ok;}function ustaw_max(pole, d, info){if (pole.value.length>d){pole.value = pole.value.substr(0,d);alert('Ilość znaków została wyczerpana!');}i = document.getElementById(info);if (i!='undefined')i.innerHTML = pole.value.length;}
