Here's what is going to be used in v3.4:
function AddText(NewCode) {
if (document.PostTopic.Message.createTextRange && document.PostTopic.Message.caretPos) {
var caretPos = document.PostTopic.Message.caretPos;
caretPos.text = NewCode;
} else {
document.PostTopic.Message.value+=NewCode;
}
document.PostTopic.Message.focus();
}
function bold() {
var text = getText();
if (helpstat) {
alert("Bold Tag Makes the enclosed text bold.\n\nUSE: [b]This is some bold text[/b]");
} else if (basic) {
AddTxt="[b]" + text + "[/b]";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be made BOLD.",text);
} else {
txt=prompt("Text to be made BOLD.","Text");
}
if (txt!=null) {
AddTxt="[b]" + txt + "[/b]";
AddText(AddTxt);
}
}
}
function getText() {
if (document.PostTopic.Message.createTextRange && document.PostTopic.Message.caretPos) {
return document.PostTopic.Message.caretPos.text;
} else {
return '';
}
}