
function limpiarTextarea(nombre_textarea){
		document.getElementById(nombre_textarea).value='';
}

function insertarCarita(nombre_textarea, carita_texto) {
	
	//IE support
	if (document.selection) {
		nombre_textarea.focus();

		//in effect we are creating a text range with zero
		//length at the cursor location and replacing it
		//with myValue
		sel = document.selection.createRange();
		sel.text = carita_texto;
	}

	//Mozilla/Firefox/Netscape 7+ support
	else if (nombre_textarea.selectionStart || nombre_textarea.selectionStart == '0') {

		//Here we get the start and end points of the
		//selection. Then we create substrings up to the
		//start of the selection and from the end point
		//of the selection to the end of the field value.
		//Then we concatenate the first substring, myValue,
		//and the second substring to get the new value.
		var startPos = nombre_textarea.selectionStart;
		var endPos = nombre_textarea.selectionEnd;
		nombre_textarea.value = nombre_textarea.value.substring(0, startPos)+ carita_texto+ nombre_textarea.value.substring(endPos, nombre_textarea.value.length);
	} else {
		nombre_textarea.value += carita_texto;
	}
} 

