//
//AntiSpam Script 1.0
//Copyright 2006 Jan Haensli, Switzerland, jan[AT]haensli.ch :-)
//
//You are welcome to use this script, as long as you don't remove the copyright notice.
//Credits on your website are appreciated as well!
//
//http://www.haensli.ch/antispam
//

function as1(elementName,c,mode){
	var pos,ar;
	ar = document.getElementsByName(elementName);
	if(mode=='1'){
		for(i=0;i<ar.length;i++){
			ar[i].href=ar[i].href.replace(c,'@');
			ar[i].id = null;
		}
	return;
	}
	if(mode=='2'){
		for(i=0;i<ar.length;i++){
			ar[i].innerHTML=ar[i].innerHTML.replace(c,'@');
			ar[i].id = null;
		}
	return;
	}
	if(mode=='3'){
		for(i=0;i<ar.length;i++){
			ar[i].href=ar[i].href.replace(c,'@');
			ar[i].innerHTML=ar[i].innerHTML.replace(c,'@');
			ar[i].id = null;
		}
	return;		
	}		
}
	
function as2(ref,c,mode){
	if(mode=='1' || mode=='3'){
		ref.href=ref.href.replace(c,'@');
	}
	if(mode=='2' || mode=='3'){
		ref.innerHTML=ref.innerHTML.replace(c,'@');
	}
}

