function quote_post(post_or_comment, info_id, login_of_quote) {  
    if (login_of_quote == 'guest') first_tag = '[quote]';
    else first_tag = '[quote=' + login_of_quote + ']';
    commenting_text = document.getElementById('text-' + post_or_comment + '-' + info_id).innerHTML;
    main_pattern = /(<div class=["]?quote["]?>Цитата <span class=["]?b0["]?>)([a-z0-9_-]*)<[/]span><hr class=["]?hr_l["]?>([\s\S]*)(<[/]div>)/i;
    second_pattern = /(<[/]div>)([\s\S]*)(<div class=["]?quote["]?>Цитата <span class=["]?b0["]?>)([a-z0-9_-]*)<[/]span><hr class=["]?hr_l["]?>/i;
    while (commenting_text.search(main_pattern) != -1) {
        commenting_text = commenting_text.replace(main_pattern, "[quote=$2]$3[/quote]");
        commenting_text = commenting_text.replace(/\[quote=\]/i, "[quote]");
    }
    while (commenting_text.search(second_pattern) != -1) {
        commenting_text = commenting_text.replace(second_pattern, "[/quote]$2[quote=$4]");
        commenting_text = commenting_text.replace(/\[quote=\]/i, "[quote]");
    }
    document.getElementById('comment_text').innerText = document.getElementById('comment_text').innerText + first_tag + commenting_text + "[/quote]\n";
    //alert(document.getElementById('comment_text').innerText);
}