function escribir(texto){
	document.write(texto);
}

function dividir(mitexto,tamanio){
    texto="";
    var palabras = mitexto.split(" ");
    for(k=0;k<palabras.length;k++){
        if(palabras[k].length>tamanio){
            var j=0;
            while(j<palabras[k].length){
                if(j+tamanio>palabras[k].length){
                    texto+=palabras[k].substring(j,palabras[k].length-1)+" ";
                }else{
                    texto+=palabras[k].substring(j,j+tamanio)+"<br>";
                }
                j=j+tamanio;
            }
        }else{
            texto+=palabras[k]+" ";
        }

    }

    return texto;
}

function hide(i)
{
	hideAll(i);
	if (document.getElementById)
	{
		var el = eval("document.getElementById('" + i + "')");
		el.style.display = (el.style.display == "none") ? "block" : "none";
	}
	else if (document.all)
	{
		var el = eval("document.all." + i);
		el.style.display = (el.style.display == "none") ? "block" : "none";

	}
}
function ltrim(cadena){
	while (cadena.substring(0, 1) == ' ')
		cadena = cadena.substring(1, cadena.length);
	return cadena;		
}

function aPeque(texto){
	cadena = texto.substring(0,1).toUpperCase()+texto.substring(1,texto.length).toLowerCase();
	

	return cadena;
}     

function index(){
	f=document.forms[0];
	f.accion.value="";
	f.action="r98aWebAction.do"
	f.submit();
}     


function mostrarCategoria(idSeccion,idCategoria){
	
	f=document.forms[0];	
	f.action="r98aInformacionAction.do";
	f.idSeccion.value=idSeccion;
	f.idCategoria.value=idCategoria;
	f.idBloqueS.value=0;
	f.idBloqueSAnt.value=0;
	f.accion.value="mostrarCategoria";	
	document.forms[0].submit();	
}  


// Función para abrir popup window
function abrepop (url,nombre,ancho,alto,barrascroll) 
{
	var posx = (screen.width - ancho) / 2;
	var posy = (screen.height - alto) / 2 - 50;
	ventana=window.open (url,nombre,"width="+ancho+", height="+alto+",top="+posy+",left="+posx+",scrollbars="+barrascroll+",status=yes")
	ventana.focus();
}     