function extractBlockquoteCitations() {
	var quotes = document.getElementsByTagName('blockquote');
	for(var i = 0; i < quotes.length; i++) {
		var title = quotes[i].getAttribute('title');
		if(title !== null && title !== '') {
			var div = document.createElement('div');
			quotes[i].appendChild(div);
			div.innerHTML = title + "<br />";
		}
		var cite = quotes[i].getAttribute('cite');
		if(cite !== '') {
			var a = document.createElement('a');
			a.setAttribute('href', cite);
			a.appendChild(document.createTextNode(a));
			div.className = 'via';
			div.appendChild(a);
			quotes[i].appendChild(div);
		}
	}
}

function addEvent(obj, evType, fn) {
	if(obj.addEventListener) {
		obj.addEventListener(evType, fn, false);
		return true;
	}
	else if(obj.attachEvent) {
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	}
	else {
		return false;
	}
}

addEvent(window, 'load', extractBlockquoteCitations);