function RenderBlockquoteCitations() {
    var quotes = document.getElementsByTagName('blockquote');
    for (var i = 0; i < quotes.length; i++) {
        
        var class_value = quotes[i].getAttribute('class')
        var do_autocite = 1;
        if (class_value) {
            var class_list = class_value.split(' ');
            for (var x = 0; x < class_list.length; x++) {
                if (class_list[x] === 'no_autocite') {
                    do_autocite = 0;
                    break;
                }
            }
        }
 
        if(do_autocite) {
            var cite = quotes[i].getAttribute('cite');
            var cite_string = quotes[i].getAttribute('title');
    
            if (cite_string == undefined ) {
                cite_string = cite;
            }

            // if (cite_string == undefined && cite == undefined) break;
            
            var citation_string = '<cite class="blockquotecite">';
            if (cite) {
                citation_string += '<a target="_blank" href="' + cite + '">' + cite_string + '</a>'; 
            }
            else {
                citation_string += cite_string;
            }
            citation_string += '</cite>';
            if (cite_string) {
                var div = document.createElement('p');
                div.className = 'blockquotecite';
                div.innerHTML = citation_string;
                quotes[i].appendChild(div);
            }
        }
    }
}

YAHOO.util.Event.onDOMReady(RenderBlockquoteCitations);