function getCaretPos(el) {
	if (el.selectionStart) {
		return el.selectionStart;
	} else if (document.selection) {
		el.focus(); 
		var r = document.selection.createRange();
		if (r == null) return 0;
		var re = el.createTextRange(),
		rc = re.duplicate();
		re.moveToBookmark(r.getBookmark());
		rc.setEndPoint("EndToStart", re);
		return rc.text.length;
	}
	return 0;
}

function setCaretPos(el, pos) {
	//alert(pos);
	if (el.setSelectionRange) {
		el.focus();
		el.setSelectionRange(pos, pos);
	}
	else if (el.createTextRange) {
		var r = el.createTextRange();
		r.collapse(true);
		r.moveEnd('character', pos);
		r.moveStart('character', pos);
		r.select();
	}
}

function changeTextArea() {
	var txtArea = document.getElementById("Textarea_OPTIONS");
	var val = txtArea.value;
	var pos = getCaretPos(txtArea);
	//alert(pos);
	var len = val.length;
	var c = ""; //if (pos == len) c = ":";
	txtArea.value = val.substring(0, pos) + "\r\n" + c + val.substring(pos, len);
    //txtArea.value = val.substring(0, pos) + val.substring(pos, val.length);
	setCaretPos(txtArea, pos + 1);
}