
function showHideCommentForm(show) {
	var field = document.getElementById('newCommentLayer');
	if(field.style.display == "none") {
		field.style.display = "block";
		//document.images['menu_marker'].src = IMGPATH+"comments_pointer_down.gif";
	} else {
		if(show == 1) return;
		field.style.display = "none";
		//document.images['menu_marker'].src = IMGPATH+"comments_pointer.gif";
	}
}

function countMsgCharacters(obj,chars) {
	msg= obj.value;
	len = msg.length;
	if (len >chars){
		obj.value=msg.substr(0,charscount);

	}else{
		charscount=len
	}

	document.getElementById('remainingChars').value=chars-charscount;
}

function emoticon(text,txtarea) {
	text = ' ' + text + ' ';
	if (txtarea.createTextRange && txtarea.caretPos) {
		var caretPos = txtarea.caretPos;
		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
		txtarea.focus();
	} else {
		txtarea.value  += text;
		txtarea.focus();
	}
}
