function validateForm() {
	valid = true;
	errors = "";
	
	if ($("#ev_name").val() == "") {
		valid= false;
		if(errors != "") {
			errors = errors + "\n";
		}
		errors = errors + "Please fill in your name";
	}
	
	var str = $("#ev_phone").val();
	var pattern = /^[0-9\-\+\sw]{7,20}$/;
	if(str.search(pattern) == -1) {             
		valid= false ;
		if(errors != "") {
			errors = errors + "\n";
		}
		errors = errors + "The telefon number can only contain numbers, characters +,- and space, must have between 7 and 20 characters long. Extention number should be given after letter w, for example '+48 555 555 555 w 30' ";
	}
	
	if(errors != "") {
		alert(errors);
	}
	return valid;
}

$(document).ready(function() {
	/*
	$("#ev_time").focus(function() {
		$("#ev_time").val("");
	});
	*/
	
	$("#ev_kontakt").submit(function() {
		return validateForm();		
	});
});

