jQuery.fn.textNodes = function() {
var ret = [];
this.contents().each(function() {
var fn = arguments.callee;
if(this.nodeType == 3) {
ret.push(this);
} else if(this.nodeType==1 &&!(
this.tagName.toLowerCase()=='script' ||
this.tagName.toLowerCase()=='head' ||
this.tagName.toLowerCase()=='iframe' ||
this.tagName.toLowerCase()=='textarea' ||
this.tagName.toLowerCase()=='option' ||
this.tagName.toLowerCase()=='style' ||
this.tagName.toLowerCase()=='title' ||
this.tagName.toLowerCase()=='a')){
jQuery(this).contents().each(fn);
}
});
return ret;
}

jQuery.fn.jungleautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:filejungle.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:filejungle.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.fsautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:fileserve.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:fileserve.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.smautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:sharingmatrix.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:sharingmatrix.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.fsonicautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:filesonic.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:filesonic.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.upautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:uploading.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:uploading.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.rsautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:uploadstation.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:uploadstation.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.sfautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:shareflare.net)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:shareflare.net)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.sfautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:oron.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:oron.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.fpostautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:filepost.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:filepost.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

jQuery.fn.hfautolink = function() {
re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:wupload.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:wupload.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
this.each(function(i){
jQuery.each($(this).textNodes(), function(i, node){
text = node.nodeValue;
if(re_link3.test(text)){
newNode=document.createElement('span');
text=jQuery('<div/>').text(text).html();
newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
node.parentNode.replaceChild(newNode, node);
}
});
});
}

$(function() {
$("div").hfautolink();
$("div").fsautolink();
$("div").upautolink();
$("div").sfautolink();
$("div").rsautolink();
$("div").jungleautolink();
$("div").fpostautolink();
$("div").smautolink();
$("div").fsonicautolink();
});
