// JavaScript Document
var winn;
function abrir(cual,wid,heig,scrol){	
	var LeftP = (screen.width) ? (screen.width-wid)/2 : 0;
	var TopP = (screen.height) ? (screen.height-heig)/2 : 0;
	if(screen.width == 800 || screen.height == 600) scrol = 'auto';
	if(winn){
		if(!winn.closed) winn.close();
		winn = null;
	}
	window.focus();
	winn=eval("open('"+cual+"','','width="+wid+",height="+heig+",top="+TopP+",left="+LeftP+",scrollbars="+scrol+"')");
}

// funciones para el scroll virtual
	
	var array_alturas = new Array(2);
	var condicion, objeto, tm, tm2;
	
	function load_scroll()
	{
		array_alturas[0] = document.getElementById("content_categorias").offsetHeight;
		array_alturas[1] = document.getElementById("content_familias").offsetHeight;
		// deshabilitamos el scroll si no hay altura suficiente
		if(array_alturas[0] <= parseInt(document.getElementById("categorias").style.height))
		{
			document.getElementById("up_categorias").innerHTML = "Categoria<img src='img/bullet_gris_arriba.gif' width='10' height='5' border='0' hspace='25'>";
			document.getElementById("down_categorias").innerHTML = "<img src='img/bullet_gris_abajo.gif' width='10' height='5' border='0' hspace='80' vspace='4'>";			
		}
		if(array_alturas[1] <= parseInt(document.getElementById("familias").style.height))
		{
			document.getElementById("up_familias").innerHTML = "Familia<img src='img/bullet_gris_arriba.gif' width='10' height='5' border='0' hspace='25'>";
			document.getElementById("down_familias").innerHTML = "<img src='img/bullet_gris_abajo.gif' width='10' height='5' border='0' hspace='66' vspace='4'>";			
		}		
	}
	function down(capa)
	{						
		if(capa == 0)
		{	
			condicion = parseInt(document.getElementById("content_categorias").style.top);
			objeto = document.getElementById("content_categorias");
		}
		else
		{
			condicion = parseInt(document.getElementById("content_familias").style.top); 
			objeto = document.getElementById("content_familias");
		}
		if(condicion < 0)
		{
			objeto.style.top = (parseInt(objeto.style.top) + 2) + "px";			
			eval("tm2 = setTimeout('down("+capa+")',15)");
		}
	}
	function up(capa)
	{						
		if(capa == 0)
		{	
			condicion = parseInt(document.getElementById("content_categorias").style.top);
			objeto = document.getElementById("content_categorias");
		}
		else
		{
			condicion = parseInt(document.getElementById("content_familias").style.top); 
			objeto = document.getElementById("content_familias");
		}
		if(condicion > - array_alturas[capa])
		{		
			objeto.style.top = (parseInt(objeto.style.top) - 2) + "px";
			eval("tm = setTimeout('up("+capa+")',15)");
		}			
	}
	