var HeaderReplacer = new Class({
			collection : [],
			initialize : function() {
				try {
					this.collection = $$('h1[title^=/], h2[title^=/], h3[title^=/]');
				} catch (e) {
				}
				return this;
			},
			include : function(headers) {
				switch ($type(headers)) {
					case 'array' :
						headers.each(function(header) {
									if (this.check(header)) {
										this.collection.include(header);
									}
								}, this);
						break;
					case 'element' :
						if (this.check(headers)) {
							this.collection.include(headers);
						}
						break;
				}
				return this;
			},
			check : function(header) {
				if (header.get('tag').match(/^h(1|2|3)$/)
						&& header.get('title').match('^/images')) {
					return true;
				}
				return false;
			},
			replace : function() {
				if (this.collection.length) {
					$each(this.collection, function(h) {
								var img = new Element('img', {
											'src' : h.get('title'),
											'title' : h.get('text').trim()
										});
								h.empty().adopt(img);
							});
				}
			}
		});
