this.sele="";
function getsele(text){
	sele = document.selection.createRange().text||document.getSelection();
	sele = (sele!=null || sele!=undefined)?sele:"";
}
function pozitie(text) { 
	if (text.createTextRange) {
		text.acum = document.selection.createRange().duplicate();		
	}
}

function adauga(text) {
	if (document.commentForm.comment_comment.createTextRange && document.commentForm.comment_comment.acum) {      
		var acum = document.commentForm.comment_comment.acum;      
		acum.text = acum.text.charAt(acum.text.length - 1) == ' ' ?
		text + ' ' : text;
	}
	else document.commentForm.comment_comment.value += text;
	document.commentForm.comment_comment.focus(acum)
	sele="";
}

function modifica(ce){
	deadaugat="["+ce+"]"+sele+"[/"+ce+"]";
	adauga(deadaugat);
}