/***************************************************** LLAMADAS A JS EXTERNOS ****************************************************/
document.write('<script language="javascript" type="text/javascript" src="js/DOMobjetos.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/navegador.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/ventana.js"></script>');
document.write('<script language="javascript" type="text/javascript" src="js/scroll.js"></script>');
/*************************************************************************************************************************************/

newWindow=null
function Ventana(Titulo,Path)
{
if(newWindow!=null)
{
newWindow.close
}

newWindow = window.open(Path,'','status=no,statusbar=no,menubar=no,resizable=no,toolbar=no,titlebar=no,top=0px,left=0px,width=1024px,height=768px');
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",";sv")){
AnchoMas=12
AltoMas=65
}else if(EsNavegador("msie","win")){
AnchoMas=12
AltoMas=65
}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
}
swLeft=window.screen.availWidth/2
swTop=window.screen.availHeight/2

eventoOnLoad='window.resizeTo(this.width+'+AnchoMas+',this.height+'+AltoMas+');'
/*eventoOnLoad +="window.left="+swLeft+"-(this.width/2);"
eventoOnLoad +="window.top="+swTop+"-(this.height/2);"*/
eventoOnLoad +="window.moveTo(ajustar("+swLeft+"-(this.width/2)),ajustar("+swTop+"-(this.height/2)))"
//alert(eventoOnLoad)
newContent += "<script>function ajustar(tamano){if(tamano>0){return(tamano)}else{return(1)}}"
newContent += "</script><BODY LEFTMARGIN=0 TOPMARGIN=0><IMG SRC="+Path+' onLoad="'+eventoOnLoad+'">'
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()
{
user = navigator.userAgent;
user=user.toLowerCase()
tope=arguments.length
gBoo_Navegador=true

for(var i=0;i<tope;i++)
{
if(user.indexOf(arguments[i]) == -1 ){
gBoo_Navegador=false
}
}

/*if(nav)
{
for(var i=0;i<arguments.length;i++)
{
alert(arguments[i])
}
}*/
return(gBoo_Navegador)

}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function abrir_detalle(theURL)
{
window.open(theURL,'','width=500,height=300,top=20,left=60,scrollbars=yes');
}


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)
	}
}
