function AjustaImagen() 
{ 
     var NS = document.all;
     if(!NS){self.moveTo((self.screen.width - self.outerWidth) / 2, (self.screen.height - self.outerHeight) / 2);}
     else{self.moveTo((self.screen.width-document.body.clientWidth) / 2, (self.screen.height-document.body.clientHeight) / 2);}
     self.focus();  
}

function AbrirVentana(URL,ancho,alto)
{ 

var Izquierda = (screen.width) ? (screen.width-ancho)/2 : 0;
var Top = (screen.height) ? (screen.height-alto)/2 : 0;

if (screen.width <=800)
{
	ancho = ancho * 0.8;
	alto = alto * 0.8;
}

var ventana = null;
ventana = window.open("/detalleimagen.shtml?"+URL+"&Imagen%20detallada&" + ancho +"&" + alto, "_Blank", "toolbar=no,location=no,status=no,menubar=no,scrollbars=no, left='+Izquierda+',top='+Top+', width="+ancho+",height="+alto);

}


function OpenWindow(url,nombre,settings) 
{ 

  window.open(url,nombre,settings); 

}

function CalcularRuta(origen,destino)
{
if (origen == '') 
	alert('Debe indicar un origen para calcular la ruta');
else { 
var w = 800, h = 600;
if (document.all || document.layers) {
   w = screen.availWidth;
   h = screen.availHeight;
}
var popW = 799, popH = 559;
var leftPos = (w-popW)/2, topPos = (h-popH)/2;
var maparuta="http://www.campsa.es/esp/infinito/gcampsa/ruta/calcular/resolv_iti.asp?origen="+escape(origen)+"&destino="+escape(destino)+"";
window.open(maparuta,'mapapop','scrollbars=yes,width='+popW+',height='+popH+',left='+leftPos+',top='+topPos+',toolbar=yes,menubar=no,personalbar=no,resizable=yes');
}
return false;	

}

