function replace(parentid, nodeType) {
	var content = document.getElementById(parentid);
	var nodes = content.getElementsByTagName(nodeType);
	for(i=nodes.length-1; i>=0; i--) {
		var node = nodes[i];
		if (node.firstChild && node.firstChild.nodeName.toLowerCase() == 'span') {
			var text = node.firstChild.firstChild.nodeValue;
			var img = new Image();
			img.src = 'heading/' + parentid + '_' + nodeType + '/' + text + '.png';
			node.removeChild(node.firstChild);
			node.appendChild(img);
		} 
	}
}