//-------------------------------------------------
// Insert Bold [b][/b] tags into the textarea
//-------------------------------------------------

function add_bold_text(){
  var currentText = document.all('myText').value;
  var newText = prompt("Enter the text you want to bold");
  var boldText = "[b]" + newText + "[/b]";
  var fullText = currentText + boldText;
    document.all('myText').value = fullText;
  //var demoText = fullText.replace("\n","<br>");
  //  document.all('demo').innerHTML = demoText;
  //  document.all('myText').focus();
}

//-------------------------------------------------
// Insert Italic [i][/i] tags into the textarea
//-------------------------------------------------

function add_italic_text(){
  var currentText = document.all('myText').value;
  var newText = prompt("Enter the text you want to italicize");
  var italicText = "[i]" + newText + "[/i]";
  var fullText = currentText + italicText;
    document.all('myText').value = fullText;
}

//-------------------------------------------------
// Insert Underline [u][/u] tags into the textarea
//-------------------------------------------------

function add_underline_text(){
  var currentText = document.all('myText').value;
  var newText = prompt("Enter the text you want to underline");
  var underlineText = "[u]" + newText + "[/u]";
  var fullText = currentText + underlineText;
    document.all('myText').value = fullText;
}

//-------------------------------------------------
// Insert List [list] tags into the textarea
//-------------------------------------------------

function add_list_text(){
  var currentText = document.all('myText').value;
  var newText = prompt("Enter the text you want to list");
  var listText = "\r[list]" + newText;
  var fullText = currentText + listText;
    document.all('myText').value = fullText;
}

//-------------------------------------------------
// Insert Hyperlink [link=] tags into the textarea
//-------------------------------------------------

function add_url_text(){
  var currentText = document.all('myText').value;
  var newText = prompt("Enter the website url you want to display");
  var urlText = "[link=" + newText + "]";
  var newText2 = prompt("Enter the link text you want to display");
  var urlText2 = newText2 + "[/link]";
  var fullText = currentText + urlText + urlText2;
    document.all('myText').value = fullText;    
}

//-------------------------------------------------
// Insert Image [img=] tags into the textarea
//-------------------------------------------------

function add_img_text(){
  var currentText = document.all('myText').value;
  var newText = prompt("Enter the image location you want to display");
  var imgText = "[img=" + newText + "]";
  var fullText = currentText + imgText;
    document.all('myText').value = fullText;
}
