
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit ) {
		field.value = field.value.substring( 0, maxlimit );
		alert('Nemozete pisati vise od ' + maxlimit + ' slova.');
		return false;
	} else {
		countfield.value = maxlimit - field.value.length;
		return true;
	}
}

function hide(title, ID, change) {
	if (document.all) {
		target = eval("document.all."+ID);
		source = eval("document.all.set"+ID);

		if (target.style.display != "block") {
			displayset = "block";
			newHTML = '<a target="_self" href="javascript:hide('+title+',\''+ID+'\',true)">-- less --</a>';
		} else {
			displayset = "none";
			newHTML = '<a target="_self" href="javascript:hide('+title+',\''+ID+'\',true)">-- more --</a>';
		}
		target.style.display = displayset;
		if (change==true) source.innerHTML = newHTML;
			if (title != "") {
			title.style.background = "#CCCCCC";
			title.style.fontWeight = "bold";
			//title.style.color = "black";
		}
	}
}

function go_forum() {

	if (textCounter(frm_forum.txt_comment,frm_forum.counter,500) == true) {
		document.frm_forum.submit();
	} else {
		frm_forum.txt_comment.value = "";
	}
}
