function quote(author, message) {
        var c = document.getElementById('comment_body');
        if(!c) return;
        var o         = c.value;
        message = message.replace(/^[\s\r\n]+/, '').replace(/[\s\r\n]+$/, '');
        c.value = '<blockquote><cite>' + author + ' ñêàçàë(à):</cite> ' + message + '</blockquote>\n\n' + o;
        var l        = c.value.length;
}

function insertSnippet(target, type) {
        var txt = document.getElementById(target);
        if(!txt) return;

        var content = '';

        switch(type) {
                case 'link':
                        var link = prompt('Ââåäèòå àäðåñ ññûëêè','');
                        if(link == null) return;
                        var name = prompt('Ââåäèòå òåêñò ññûëêè','');
                        if(name == null) return;
                        content  = '<a href="' + link + '">' + name + '</a>';
                        break;

                case 'image':
                        var image = prompt('Ââåäèòå àäðåñ êàðòèíêè','');
                        if(image == null) return;
                        content  = '<img src="' + image + '" />';
                        break;

                case 'bold':
                        var text = prompt('Ââåäèòå òåêñò','');
                        if(text == null) return;
                        content  = '<b>' + text + '</b>';
                        break;

                case 'italic':
                        var text = prompt('Ââåäèòå òåêñò','');
                        if(text == null) return;
                        content  = '<i>' + text + '</i>';
                        break;

                case 'underline':
                        var text = prompt('Ââåäèòå òåêñò','');
                        if(text == null) return;
                        content  = '<u>' + text + '</u>';
                        break;

                default:
                        var tagged = prompt('Enter ' + type + ' content','');
                        if(tagged == null) return;
                        content  = '<' + type + '>' + tagged + '</' + type + '>';
                        break;
        }

        if(document.selection) {
                txt.focus();
                sel = document.selection.createRange();
                sel.text = content;
        } else if(txt.selectionStart || txt.selectionStart == 0) {
            var startPos = txt.selectionStart;
            var endPos          = txt.selectionEnd;
            txt.value          = txt.value.substring(0, startPos) + content + txt.value.substring(endPos, txt.value.length);
        } else {
                txt.value += content;
        }
}  