function TitleGenerator(containerid) {

	this.containerid = containerid;

}
TitleGenerator.prototype.Replace = function(tagname,settingsxml,imagewidth) {
		var w = imagewidth ? imagewidth : xWidth(this.containerid);
		var replacebody = document.getElementById(this.containerid);
		var o = replacebody.getElementsByTagName(tagname);
	for(var i=0;i<o.length;i++) {
			// Check that object has child
			if(o[i].firstChild != null)
			{
			    var heading = o[i].firstChild.nodeValue;
			    o[i].innerHTML = "<img src='/common/titlegenerator.aspx?title="+encodeURIComponent(heading)+"&width="+w+"&settingsxml="+encodeURIComponent(settingsxml)+"' alt='"+heading+"' border=0>";
			}
		}
}
