(function($){$.fn.FonqiLinkify=function(urlLimit){var pattern1=/(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;var pattern2=/(^|[^\/])(www\.[\S]+(\b|$))/gim;var pattern3=/(\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,6})/gim;if(urlLimit!=undefined){var content=this.html();var matches1=content.match(pattern1);if(!matches1)for(var i=0;i<matches1.length;i++){var url=matches1[i];content=content.replace(url,'<a href="'+url+'" target="_blank">'+cropUrl(url,urlLimit)+"</a>")}var matches2=content.match(pattern2);
if(!matches2)for(var i=0;i<matches2.length;i++){var url=matches2[i];url=url.substring(1,url.length);content=content.replace(url,'<a href="http://'+url+'" target="_blank">'+cropUrl(url,urlLimit)+"</a>")}content=content.replace(pattern3,'<a href="mailto:$1">$1</a>');return this.html(content)}return this.html(this.html().replace(pattern1,'<a href="$1" target="_blank">$1</a>').replace(pattern2,'$1<a href="http://$2" target="_blank">$2</a>').replace(pattern3,'<a href="mailto:$1">$1</a>'))}})(jQuery);
(function($){$.log=function(debug){if(window.console&&console.debug)console.debug(debug)}})(jQuery);function cropUrl(rawUrl,maxLength){var croppedUrl=rawUrl.replace("http://","");var parts=croppedUrl.split("/");var host=parts[0];var path="";for(i=1;i<parts.length;i++)path+="/"+parts[i];if(path.length>maxLength)path=path.substr(0,maxLength)+"...";return host+path};
