        function insertBB(strTxt,strTag,strTag2,strTag3) {
                var row = false;
                if (!strTxt) {
                        if (strTag == 'URL'){
                                row = prompt('Bitte einen Linkname angeben (optional):\n', '');
                                strTxt = prompt('Bitten den Text eingeben, der formatiert werden soll:\n['+strTag+']xxx[\/'+strTag3+']', strTag2);
                        }
                        else if (strTag == 'BLASC'){
                                row = prompt('Name des Gegenstandes enzeigen:\n', '');
                                strTxt = prompt('BLASC nummer des Gegenstandes eingeben:\n['+strTag+']xxx[\/'+strTag3+']', strTag2);
                        }
                        else{
                                strTxt = prompt('Bitten den Text eingeben, der formatiert werden soll:\n['+strTag+']xxx[\/'+strTag3+']', strTag2);
                        }
                }
                if( strTxt=='http://' || null ) return '';
                return '['+ strTag + (row ? '='+ strTxt : '') +']'+ (row ? row : strTxt) +'[\/'+ strTag3 +']';
        }

        function bbcode(strTag,strTag2,strTag3) {
                var        objEditor = document.post.message,
                           blnIe = document.selection,
                           intStart = objEditor.selectionStart;

                objEditor.focus();
                if(blnIe) {
                        var sel = blnIe.createRange();
                        sel.text = insertBB(sel.text,strTag,strTag2,strTag3);
                } else if (intStart) {
                        intEnd = objEditor.selectionEnd;
                        objEditor.value =
                                objEditor.value.substring(0,intStart) +
                                insertBB( objEditor.value.substring(intStart,intEnd), strTag, strTag2, strTag3) +
                                objEditor.value.substring(intEnd,objEditor.value.length);
                } else
                        objEditor.value += insertBB('',strTag,strTag2,strTag3);
        }
        function bbc_highlight(something, mode)
        {
                something.style.backgroundImage = "url(" + smf_images_url + (mode ? "/pics/bbcodes/bbc_hoverbg.gif)" : "/pics/bbcodes/bbc_bg.gif)");
        }
