// JavaScript Document<script language="JavaScript" type="text/JavaScript">
function Ventana(Titulo,Path)
{
	if(newWindow!=null)
	{
		newWindow.close
	}
	
	var newWindow = window.open("","","status=no,menubar=no,scrollbars=no");
	if (newWindow != null) {
	
		var newContent = "<HTML><HEAD><TITLE>"
		newContent += Titulo
		newContent += "</TITLE></HEAD>"

		AnchoMas=0
		AltoMas=0
		if(EsNavegador("opera","win"))
		{
			AnchoMas=10
			AltoMas=36
		}
		else if(EsNavegador("msie","win"))
		{
			AltoMas=30
		}
		else if(EsNavegador("firefox","win"))
		{
			AnchoMas=7
			AltoMas=55
		}
		else if(EsNavegador("mozilla","win"))
		{
			AnchoMas=7
			AltoMas=42
		}
		else if(EsNavegador("opera","mac"))
		{
			AltoMas=20
		}
		else if(EsNavegador("msie","mac"))
		{
			AltoMas=0
		}
		else if(EsNavegador("safari","mac"))
		{
			AltoMas=20
		}
		else if(EsNavegador("firefox","mac"))
		{
			AltoMas=8
		}
		else if(EsNavegador("mozilla","mac"))
		{
			AltoMas=10
		}
		onload='onLoad="window.resizeTo(document.images[0].width+'+AnchoMas+',document.images[0].height+'+AltoMas+')"'
		newContent += "<body LEFTMARGIN=0 TOPMARGIN=0 "+onload+"><IMG SRC="+Path+'>'
		newContent += "</body></HTML>"
		newWindow.document.write (newContent)
		/*	
		IMG=newWindow.document.images[0]
		i=0
		do
		{
			i++
		}
		while(IMG.height<=0)

		newWindow.resizeTo(IMG.width+10,IMG.height+30)*/
		
		newWindow.document.close()
	}
}
function EsNavegador()
{
	var ua = navigator.userAgent.toLowerCase();
	nav=true
	for(var i=0;i<arguments.length;i++)
	{
		if(ua.indexOf(arguments[i]) == -1 )
		{
			nav=false
		}
	}
	/*if(nav)
	{
		for(var i=0;i<arguments.length;i++)
		{
			alert(arguments[i])
		}
	}*/
	return(nav)

}

function Paginar(url,cajaTexto,regPorPagina,totalPaginas,nomVariable,alerta)
{
	pag=new Number(cajaTexto.value)
	
	if(pag<=0 || pag>totalPaginas || isNaN(pag))
	{
		alerta=alerta+' "'+cajaTexto.value+'"'
		alert(alerta)
	}
	else
	{
		registro=(pag*regPorPagina)-regPorPagina+1
		url=url+nomVariable+"="+registro+"&"+Math.round(Math.random()*123456789)
		window.location.href=url
	}
}

function PaginarRetorno(url,cajaTexto,regPorPagina,totalPaginas,nomVariable,alerta,evento)
{
	if(evento.keyCode==13)
	{
		Paginar(url,cajaTexto,regPorPagina,totalPaginas,nomVariable,alerta)
	}
}

