function create_link(parent_element, tag){
	if(parent_element instanceof jQuery){
		var this_parent_element = parent_element;
	} else {
		var this_parent_element = $(parent_element);
	}	
	$(tag+"[title^='http://']",this_parent_element).each(function (){
		var this_element = $(this);
		this_element.unbind('click');
		this_element.bind('click', function(event){
			event.stopPropagation();
			var attr = this_element.attr('target');
			if (typeof attr !== 'undefined' && attr !== false) {
				window.open(this_element.attr('title'));
			} else {
				location.href = this_element.attr('title');
			}  
		});
	});
}
$(document).ready(function() {
	create_link($('body'),'span');
	create_link($('body'),'img');
	create_link($('body'),'h2');
});
