
/* Functies op geselecteerde tekst */
/* We mogen niet de focus zetten op brood (?) */
function do_bold() { 
   theSelection = document.selection.createRange().text;
   if (theSelection != null && theSelection != '') {
      document.selection.createRange().text = "[b]" + theSelection + "[/b]";
   } else
      alert("Please select text first.");
/*      document.editform.brood.focus(); */
}

function do_italic() { 
   theSelection = document.selection.createRange().text;
   if (theSelection != null && theSelection != '') {
      document.selection.createRange().text = "[i]" + theSelection + "[/i]";
   } else
      alert("Please select text first.");
/*      document.editform.brood.focus(); */
}

function do_site() { 
   theSelection = document.selection.createRange().text;
   if (theSelection != null && theSelection != '') {
      var myLink = prompt("Website URL, incl. http://","");
      if (myLink != null && myLink != '') {
         document.selection.createRange().text = "[site " + myLink + "]" + theSelection + "[/site]";
      }
   } else
      alert("Please select text first.");
/*      document.editform.brood.focus(); */
}

function do_email() { 
   theSelection = document.selection.createRange().text;
   if (theSelection != null && theSelection != '') {
      var myLink = prompt("Enter e-mail:","");
      if (myLink != null && myLink != '') {
         document.selection.createRange().text = "[email " + myLink + "]" + theSelection + "[/email]";
      }
   } else
      alert("Please select text first.");
/*      document.editform.brood.focus(); */
}

/* Functies op cursor positie */
/* Werken niet als je meerdere tekstvelden op 1 pagina wilt gebruiken */
/* Bepaal eerst de positie */
function storeCaret () { 
   if (editform.brood.createTextRange) 
   editform.brood.caretPos = 
   document.selection.createRange().duplicate(); 
}

/* en de functies zelf */
/* (geen) */

