jQuery.fn.autolink = function () {
	return this.each( function(){
		var re = /((http|https|ftp):\/\/[\w?=&.\/-;#~%-]+(?![\w\s?&.\/;#~%"=-]*>))/g;
		$(this).html( $(this).html().replace(re, '<a href="$1">$1</a> ') );
	});
}

jQuery.fn.autotwitter = function () {
	return this.each( function(){
		var re = /(\s+\@)(\w{6,})/g;
		$(this).html( $(this).html().replace(re, '$1<a href="http://twitter.com/$2" target="_blank">$2</a> ') );
	});
}

jQuery.fn.mailto = function () {
	return this.each( function() {
		var re = /(([a-z0-9*._+]){1,}\@(([a-z0-9]+[-]?){1,}[a-z0-9]+\.){1,}([a-z]{2,4}|museum)(?![\w\s?&.\/;#~%"=-]*>))/g
		$(this).html( $(this).html().replace( re, '<a href="mailto:$1";>$1</a>' ) );
	});
}

jQuery.fn.highlight = function (text, o) {
	return this.each( function(){
		var replace = o || '<span class="highlight">$1</span>';
		$(this).html( html.replace( new RegExp('('+text+'(?![\\w\\s?&.\\/;#~%"=-]*>))', "ig"), replace) );
	});
}

// Accordion - from http://designreviver.com/tutorials/jquery-examples-horizontal-accordion/
//
/*
$(document).ready(function(){
	lastBlock = $(".visible");
	maxWidth = 250;
	minWidth = 75;	

	$(".haccont").hover(
		function(){
			$(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
			$(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
			lastBlock = this;
		}
	);
});
*/

