function add(open, end){
	var tArea = document.replyForm.message;
	var sct = tArea.scrollTop;
	var open = (open)? open : "";
	var end = (end)? end : "";
	var sl;

	if(isIE){
		tArea.focus();
		var curSelect = document.selection.createRange();
		if(arguments[2]){
			curSelect.text = open + arguments[2] + "]" + curSelect.text + end;
		} else {
			curSelect.text = open + curSelect.text + end;
		}
	} else if(!isIE && typeof tArea.selectionStart != "undefined"){
		var selStart = tArea.value.substr(0, tArea.selectionStart);
		var selEnd = tArea.value.substr(tArea.selectionEnd, tArea.value.length);
		var curSelection = tArea.value.replace(selStart, "").replace(selEnd, "");

		if(arguments[2]){
			sl = selStart + open + arguments[2] + "]" + curSelection + end;
			tArea.value = sl + selEnd;
		} else {
			sl = selStart + open + curSelection + end;
			tArea.value = sl + selEnd;
		}

		tArea.setSelectionRange(sl.length, sl.length);
		tArea.focus();
		tArea.scrollTop = sct;
	} else {
		tArea.value += (arguments[2])? open + arguments[2] + "]" + end : open + end;
	}
}
