function add_text(NewCode,theform) {
 theform.message.value+=NewCode
 add_text_var="";
}

function smilie(thesmilie) {
 add_smilie=" "+thesmilie+" ";
 theform = document.nbbform;
 add_text(add_smilie,theform);
 theform.message.focus();
}

function img() {
 code = prompt('Bitte die URL des Bildes eingeben:');
 theform = document.nbbform;
 if (code) {
  add_text('[IMG]' + code + '[/IMG]',theform);
 }
 theform.message.focus();
}

function bold() {
 code = prompt('Bitte den Text eingeben, der fett dargestellt werden soll:');
 theform = document.nbbform;
 if (code) {
  add_text('[B]' + code + '[/B]', theform);
 }
 theform.message.focus();
}

function underline() {
 code = prompt('Bitte den Text eingeben, der unterstrichen dargestellt werden soll:');
 theform = document.nbbform;
 if (code) {
  add_text('[U]' + code + '[/U]', theform);
 }
 theform.message.focus();
}

function italic() {
 code = prompt('Bitte den Text eingeben, der kursiv dargestellt werden soll:');
 theform = document.nbbform;
 if (code) {
  add_text('[I]' + code + '[/I]', theform);
 }
 theform.message.focus();
}

function url() {
 code = prompt('Bitte die URL der Website eingeben:', 'http://');
 theform = document.nbbform;
 if (code) {
  code2= prompt('Bitte den Text eingeben, der angezeigt werden soll (optional):');
  if (code2) {
   add_text('[URL=' + code + ']' + code2 + '[/URL]', theform);
  } else {
   add_text('[URL]' + code + '[/URL]', theform);
  }
 }
 theform.message.focus();
}

function mail() {
 code = prompt('Bitte die E-Mail-Adresse eingeben:');
 theform = document.nbbform;
 if (code) {
  code2= prompt('Bitte den Text eingeben, der angezeigt werden soll (optional):');
  if (code2) {
   add_text('[MAIL=' + code + ']' + code2 + '[/MAIL]', theform);
  } else {
   add_text('[MAIL]' + code + '[/MAIL]', theform);
  }
 }
 theform.message.focus();
}


