/*****************************
*
*	Text To Link Favelet
*	v1.0
*	last revision: 02.10.2004
*	steve@slayeroffice.com
*
*	-- please notify me of any modifications you make to this so that i can update my version --
*
*****************************/

function m(s){
	w='';h='http://';
	for(k=0;k<s.length;k++){
		j=s[k];
		if(l(j)){
			j=j.replace(h,'');
			w+='<a rel=a href='+h+j+'>'+h+j+'</a> ';
		}else{
			w+=j+' ';
		}
	}
	return w;
}

function l(n){
	t=Array('http','.net','.com','.org','.edu','www.');
	p=0;while(t[p]){if(n.indexOf(t[p])>-1)return 1;p++;}
	return 0;
}

d=document;
g=d.getElementsByTagName('*');
i=0;
while(g[i]){
	f=g[i];
	v=f.childNodes;
	if(f.rel!='a'){
		e=0;
		while(v[e]){
			c=v[e];
			if(c.nodeType==3){
				o=d.createElement('span');
				o.rel='a';
				o.innerHTML=m(c.data.split(' '));
				f.insertBefore(o,c);
				f.removeChild(c);
			}
		e++;
		}
	}
i++;
}

