function AddText(text)
{
  if (document.aktuell.Artikel.createTextRange && document.aktuell.Artikel.caretPos)
  {
    var caretPos = document.aktuell.Artikel.caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
    text + ' ' : text;
  }
  else document.aktuell.Artikel.value += text;
  document.aktuell.Artikel.focus(caretPos)
}

function email()
{
  mailtitle = prompt("Name of the email adress: (otpional)","");
  maillocation = prompt("Type the emailadress:","mailto:");

  if ((maillocation != null) && (maillocation != ""))
  {
    if ((mailtitle != null) && (mailtitle != ""))
    {
      AddTxt = '<a href="' + maillocation + '">' + mailtitle + '</a>';
      AddText(AddTxt);
    }
    else
    {
      AddTxt = '<a href="' + maillocation + '">' + maillocation + '</a>';
      AddText(AddTxt);
    }
  }
}


function bold()
{
  AddTxt="<b></b>";
  AddText(AddTxt);
}

function italicize()
{
  AddTxt="<i></i>";
  AddText(AddTxt);
}


function url(){
  urltitle = prompt("Name of the link: (otpional)","");
  urllocation = prompt("Type the link:","http://");

  if ((urllocation != null) && (urllocation != ""))  {
    if ((urltitle != null) && (urltitle != ""))    {
      AddTxt = '<a href="' + urllocation + '"  target="_blank">' + urltitle + '</a>';
      AddText(AddTxt);
    }
    else    {
      AddTxt = '<a href="' + urllocation + '" target="_blank">' + urllocation + '</a>';
      AddText(AddTxt);
    }
  }
}

function underline()
{
  AddTxt="<u></u>";
  AddText(AddTxt);
}



