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 
		//alert("Podany adres e-mail jest niepoprawny!"); 
		return false; 
}

function isEmail(e) {
	if (e.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) 
		return true; 
	else 
		//alert("Podany adres e-mail jest niepoprawny!"); 
		return false; 
}

function isTel(t) {
	if (t.match(/^[\(\)0-9- ]+$/)) 
		return true; 
	else 
		//alert("Podany adres e-mail jest niepoprawny!"); 
		return false; 
}

function isKod(t) {
	if (t.match(/^[0-9]{2}-[0-9]{3}$/)) 
		return true; 
	else 
		//alert("Podany adres e-mail jest niepoprawny!"); 
		return false; 
}

/*
********************************************************
*/
function spr_form(f) {
	
	if  (!isLiczba(f.ilosc.value)) {
		alert('Podaj poprawną ilość!');
		f.ilosc.focus();
		return false;
	}
	
	if  (!isKod(f.kod.value)) {
		alert('Podaj poprawny kod!');
		f.kod.focus();
		return false;
	}
	
	if  (!isTel(f.telefon.value)) {
		alert('Podaj poprawny telefon!');
		f.telefon.focus();
		return false;
	}
	
	if  (!isEmail(f.email.value)) {
		alert('Podaj poprawny email!');
		f.email.focus();
		return false;
	}
	
	//alert('OK');
	
	return true;
}

