(function($) {

$.fn.clickUrl = function() {
	var regexp = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
	this.each(function() {
		$(this).html(
			$(this).html().replace(regexp,"<a href=\"$1\" target=\"_blank\">$1</a>")
		);
	});
	return $(this);
}
 
$.fn.stripHTML = function() {
	var regexp = /<("[^"]*"|'[^']*'|[^'">])*>/gi;
	this.each(function() {
		$(this).html(
			$(this).html().replace(regexp,"")
		);
	});
	return $(this);
}
 
$.fn.escapeHTML = function() {
	this.each(function() {
		$(this).html(
			$(this).html()
				.replace(/&/g,'&amp;')
				.replace(/</g,'&lt;')
				.replace(/>/g,'&gt;')
				.replace(/"/g,'&quot;')
		);
	});
	return $(this);
}

})(jQuery);

