function Borrar(Nivel) {
  Total = document.all.length;
  for (i=0;i<Total;i++)
  {
    if (document.all.item(i).nivel==Nivel) {
       document.all.item(i).value="";
    }
  }
}
		var max_size = 150;
		var min_size = 80;
		var tamagnoLetras = 100;
		
		function dzIncreaseFontSize(idElemento) {
			if (document.all || document.getElementById) {	
				var elemento = document.all ? document.all[idElemento] : document.getElementById(idElemento);
				if (elemento) {	
					// el valor est&aacute; indicado en porcentaje:
					if(tamagnoLetras >= max_size){
						alert("No es posible aumentar m&aacute;s el texto")
					}else{
						tamagnoLetras += 10;
						if (elemento.length) 
							for (i=0; i < elemento.length; i++) {
								elemento[i].style.fontSize = (tamagnoLetras+'%');
							}
						else
							elemento.style.fontSize = (tamagnoLetras+'%');				
					}
				}
			}
		}
		
		function dzDecreaseFontSize(idElemento) {
			if (document.all || document.getElementById) {	
				var elemento = document.all ? document.all[idElemento] : document.getElementById(idElemento);
				if (elemento) {	
					// el valor est&aacute; indicado en porcentaje:
					if(tamagnoLetras <= min_size){
						alert("No es posible disminuir m&aacute;s el texto")
					}else{
						tamagnoLetras -= 10;
						if (elemento.length) 
							for (i=0; i < elemento.length; i++) {
								elemento[i].style.fontSize = (tamagnoLetras+'%');
							}
						else
							elemento.style.fontSize = (tamagnoLetras+'%');				
					}
				}
			}
		}
		
		function dzResetFontSize(idElemento) {
			var elemento = document.all[idElemento];
			elemento.body.style.fontSize = '100%';
			document.body.style.fontSize = '100%';
		}			  



function BuscaTextCombo(Obj,Texto){
	for (i=0;i<Obj.length;i++){
    	if (Obj.options[i].text==Texto) {
	      Obj.selectedIndex=i;
    	}
	  }
}

function SynTrim(Texto)
{
    return Texto.replace(/(^\s*)|(\s*$)/g, "");
}

function Mayusculas(Texto){
  Texto.value=Texto.value.toUpperCase();
}



//Obtener las variables traspasadas por la URL con JavaScript

function reem(st1,st2,st3){
    var n=st1.indexOf(st2);
    if (n!=-1){
        var valor1=st1.substring(0,n);
        var valor2=st1.substring(n+st2.length,st1.length);
        return valor1+st3+valor2;
    }
	else {
        return st1;
    }
}

function reem2(st1,st2,st3){
    var n=st1.indexOf(st2);
    if (n!=-1){
        var val1=st1;
        do{
            n=val1.indexOf(st2);
            val1=reem(val1,st2,st3);
        }while(n!=-1);
        return val1;
    }
	else{
        return st1;
    }
}

function limpia(st){
    var valor=reem2(st,"%20"," ");
    return valor;
}

function Request(variable){
    var busca=variable+"=";
    var str1=new String(window.location.search);
    var ind=str1.indexOf(busca);
    if (ind!=-1) {
        var ind2=str1.indexOf("&",ind);
        if (ind2!=-1) {
            return limpia(str1.substring(busca.length+ind,ind2)); 
        }
		else {
            return limpia(str1.substring(busca.length+ind,str1.length)); 
        }
    }
	else {
        return -1;
    }
}

function CargaSubMenu(){
	if (Request("Menu")!=-1 && Request("Padre")!=-1){
		MuestrasubMenu(Request("Padre"),Request("Menu"),"");
	}
}