	var starttag = '<span class="rrr">';
	var closingtag = '</span>';
	
		//devuelve todos los nodos de tipo TEXT del documento en un array
		function deepText(hoo, fun){
		    var A= [];
		    fun=fun || function(h){return h};
		    if(hoo){
		        hoo= hoo.firstChild;
		        while(hoo!= null){
		            if(hoo.nodeType== 3){
		                A[A.length]= fun(hoo);
		            }
		            else A= A.concat(arguments.callee(hoo, fun));
		            hoo= hoo.nextSibling;
		        }
		    }
		    return A;
		}
		
		
		//recorre en profundidad todos los nodos que cuelgan de root
		//y le aplica el método highlight
		function deepHighlight(root, arr){
			
		    var cummtxt = '';
		    if(root){
		        var hoo= root.firstChild;
		        
		        while(hoo!= null){
		            var txt = '';
		            
		            if(hoo.nodeType== 3){	//TEXT NODES
		              txt = highlight(arr, hoo.data);
		            } else if(hoo.nodeType== 1) {	//ELEMENT NODES
		            	if (hoo.attributes!= null) {
			            	var pars = '';
			            	for (var i=0;i<hoo.attributes.length;i++) {
			            		var itm = hoo.attributes[i].nodeValue;
			            		if (itm.indexOf('"')>=0) {
			            			pars = pars + ' ' + hoo.attributes[i].nodeName +'=\''+itm+'\'';
			            		} else {
			            			pars = pars + ' ' + hoo.attributes[i].nodeName +'="'+itm+'"';
			            		}
			            	}
			            }
		            	txt = '<'+hoo.nodeName+pars+'>'+deepHighlight(hoo, arr)+'</'+hoo.nodeName+'>';
		            }
		            hoo= hoo.nextSibling;
		            cummtxt = cummtxt + txt;
		        }

		    }
		    return cummtxt;
		}
		
		function highlight(arr, txt) {
			for (var i=0;i<arr.length;i++) {
				var regExp = new RegExp('\\b'+arr[i]+'\\b','gi');
				txt = txt.replace(regExp,starttag+arr[i]+closingtag);
			}
			return txt;
		}
		
		function resalta(texto, separator) {			
			
			var arr = texto.split(separator); 
			var clean = new Array();
			var cont = 0;
			var done ='';
			for (var i=0;i<arr.length;i++) {
			
				if (starttag.toUpperCase().indexOf(arr[i].toUpperCase())==-1) {
					if (done.indexOf('|'+arr[i]+'|')==-1) {
						clean[cont] = arr[i];
						done = done + '|'+arr[i]+'|';
						cont = cont + 1;
					}
				}
			}		
			document.body.innerHTML = deepHighlight(document.body, clean);
		}
		
		
