String.prototype.trim = function () {
    var s = this.replace(/^\s*/, "");
    return s.replace(/\s*$/, "");
}

function validate() {
	ime = document.getElementById('spisiime');
	tekst = document.getElementById('spisitekst');
	
	if (ime.value.trim() == '') {
		alert('Napisi ime!');
		ime.focus();
		return false;
	}
	
	if (tekst.value.trim() == '' || tekst.value == '...') {
		tekst.focus();
		alert('Replaj brez texta?!');
		return false;
	}
	
	return true;
}