function format(strTag) /* b,u,i,img */
{
  objEditor = document.eintragen.news;
  blnIe     = document.selection;
  blnMoz    = (objEditor.selectionStart || objEditor.selectionStart == '0');
  if (blnIe)
  {
    objEditor.focus();
    strTxt = document.selection.createRange().text
    if (strTxt == '')
    {
      if (strTag == 'img')
      {
        strTxt = prompt('Bitte den Bildpfad eingeben','http://');
      }
      else {
             strTxt = prompt('Bitte den Text eingeben','');
           }
    }
    if ((strTxt != "") && (strTxt != null) && (strTxt != "http://"))
    {
      document.selection.createRange().text='['+strTag+']'+strTxt+'[\/'+strTag+']';
      document.selection.createRange().select();
    }
    else {
           alert("Bitte Zeichen bzw. einen gültigen Pfad angeben !");
           return;
         }
  }
  else if (blnMoz)
  {
    intStart = objEditor.selectionStart;
    intEnd = objEditor.selectionEnd;
    strTxt = String(objEditor.value).substring(intStart,intEnd);
    if (strTxt == '')
    {
      if (strTag == 'img')
      {
        strTxt = prompt('Bitte den Bildpfad eingeben','http://');
      }
      else {
             strTxt = prompt('Bitte den Text eingeben','');
           }
    }
    if ((strTxt != "") && (strTxt != null) && (strTxt != "http://"))
    {
      objEditor.value = String(objEditor.value).substring(0, intStart) +'['+strTag+']'+strTxt+'[\/'+strTag+']'+ String(objEditor.value).substring(intEnd, objEditor.value.length);
      objEditor.focus();
    }
    else {
           alert("Bitte Zeichen bzw. einen gültigen Pfad angeben !");
           return;
         }
  }
  else
  {
    if (strTag == 'img')
    {
      strTxt = prompt('Bitte den Bildpfad eingeben','http://');
    }
    else {
           strTxt = prompt('Bitte den Text eingeben','');
         }
    if ((strTxt != "") && (strTxt != null) && (strTxt != "http://"))
    {
      objEditor.value+='['+strTag+']'+strTxt+'[\/'+strTag+']';
    }
    else {
           alert("Bitte Zeichen bzw. einen gültigen Pfad angeben !");
           return;
         }
  }
}

function urltext()          /* url */
{
  description=prompt("Beschreibung der URL (optional)","")
  if (description!=null)
  {
    url=prompt("Bitte Pfad der URL eingeben","http://");
    if ((url != "") && (url != null) && (url != "http://"))
    {
      if (description == "")
      {
        description = url;
      }
      document.eintragen.news.value=document.eintragen.news.value+"[url="+url+"]"+description+"[/url]";
      document.eintragen.news.focus();
    }
    else alert("Bitte einen gültigen Pfad angeben !");
  }
}

function Smiley(Zeichen)
{
  objEditor = document.eintragen.news;
  blnIe     = document.selection;
  blnMoz    = (objEditor.selectionStart || objEditor.selectionStart == '0');
  if (blnIe)
  {
    objEditor.focus();
    document.selection.createRange().text = '['+Zeichen+']';
    document.selection.createRange().select();
  }
  else if (blnMoz)
  {
    intStart = objEditor.selectionStart;
    intEnd = objEditor.selectionEnd;
    objEditor.value = String(objEditor.value).substring(0, intStart) + '['+Zeichen+']' + String(objEditor.value).substring(intEnd, objEditor.value.length);
    objEditor.focus();
  }
  else {
         objEditor.value += '['+Zeichen+']';
         objEditor.focus();
       }
}

function Rights()
{
  if (document.userconf.adm.checked == true)
  {
    document.userconf.nws.checked = true;
    document.userconf.gal.checked = true;
    document.userconf.gbk.checked = true;
  }
}

