//dal je polje ispunjeno?
function checkRequired(str, classNormal, classError)	{ 
	var myArray = str.split(",");
	var res = false;

	for (x = 0; x < myArray.length; x++) {
		var obj = document.getElementById(myArray[x])
		if (obj.value.trim() == "") {
			// prazan string:
			obj.className = classError;
			res = false;
		} else {
			obj.className = classNormal;
			res = true;
		}
	}
	return res;
}


String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {
	return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
	return this.replace(/\s+$/,"");
}
