// JavaScript Document
/*lista = function() {
	if (document.all&&document.getElementById) {
		cssdd_raiz = document.getElementById('cssdd');
		for (i=0; i<cssdd_raiz.childNodes.length; i++) {
			nodo = cssdd_raiz.childNodes[i];
			if (nodo.nodeName=='LI') {
				nodo.onmouseover=function() {
					this.className+=' over';
				}
				nodo.onmouseout=function() {
					this.className=this.className.replace(' over', '');
				}
			}
		}
	}
}
window.onload=lista;
//FUNCIONES PROPIAS

*/
///////////////////////////////////////////////
function busqueda(elcombo,textoBuscar){
		
		if(document.getElementById(textoBuscar).value!=""){
			var aux=0;
			var found=false;
			while(aux<document.getElementById(elcombo).length){
				//alert(alta_nota.combo_usuarios.options[aux].text+" y puse:"+alta_nota.buscar.value);
				
				var texto_busca=document.getElementById(textoBuscar).value;
				texto_busca=texto_busca.toLowerCase(); 
				
				var texto_en_combo=document.getElementById(elcombo).options[aux].text;
				texto_en_combo=texto_en_combo.toLowerCase(); 
				
				if(texto_en_combo.search(texto_busca)!=-1){
					//alta_nota.combo_usuarios.selectedIndex=aux;
					found=true;
					document.getElementById(elcombo).selectedIndex=aux;
					if(!confirm("Encontrado:\n"+document.getElementById(elcombo).options[aux].text+"\nContinuar buscando?")){
					break;
					}
							
				}
				
				aux++;
			}
			if(!found){
			
				alert("No se encontraron coincidencias. \n\n (No olvide acentos)");
			}
			
		}
		
}
///////////////////////////////////////////////

function despliega(num){
		if(document.getElementById("id"+num).style.display=="none"){
			document.getElementById("id"+num).style.display=""
			
		}else{
			document.getElementById("id"+num).style.display="none"
			
		}

}

function muestra(num){
			document.getElementById("id"+num).style.display=""
					}
function oculta(num){
			document.getElementById("id"+num).style.display="none"
					}
//////////////////////////////////////////////ç
 
  function str_replace(sReplaceThis, sWithThis, sString) { 
    if (sReplaceThis != "" && sReplaceThis != sWithThis) {
      var counter = 0;
      var start = 0;
      var before = "";
      var after = "";
      while (counter<sString.length) {
        start = sString.indexOf(sReplaceThis, counter);
        if (start == -1){
         break;
         } else {
           before = sString.substr(0, start);
           after = sString.substr(start + sReplaceThis.length, sString.length);
           sString = before + sWithThis + after;
           counter = before.length + sWithThis.length;
          }
        }
      }
   return sString;
  }

/////////////////////////////VALIDO ENTER
function validoEnter(codigo){
	
	if(codigo==13){
		return false;
	}
	
	
}