function autoHTML( strSrc,optAtt ) {
// This function will make http,https,ftp,www and email strings clickable.
strSrc = strSrc.replace( /\s(https:\/\/|http:\/\/|ftp:\/\/|www.)([^\s]*)/gi,
' <a href=http://$2 ' + optAtt + '>$1$2</a>' );
strSrc = strSrc.replace( /\s([^\s]*@[^\s]*)/gi,' <a href=mailto:$1>$1</a>' );
return strSrc;
}
function smartRmHTML( strSrc ) {
// Strip off HTML tags. Better than other removeHtml functions out there.
return server.HTMLEncode( strSrc.replace( /<[^<|>]+?>/gi,'' ) );
}
function listAllLinks( strSrc,blnClickable,optAtt ) {
// Extract every link in string and list them in order.
var arrAllLinks
if ( !blnClickable ) {
arrAllLinks = strSrc.match(/(https:\/\/|http:\/\/|ftp:\/\/|www.)([^\s]*)/gi );
return arrAllLinks.join( ',' );
}
else {
arrAllLinks = strSrc.match(/(https:\/\/|http:\/\/|ftp:\/\/|www.)([^\s]*)/gi );
return arrAllLinks.join( ',' ).replace( /(https:\/\/|http:\/\/|ftp:\/\/|www.)([^,]*)/gi,
'<a href=http://$2 ' + optAtt + '>$1$2</a>' );
}
}