/* Creamos la función para adpartar la ventana a la imagen */
function vimagen(imagen) {

/* Definimos dos variables, una para el alto y otro para el ancho de la imagen */
var altoImagen = imagen.height;
var anchoImagen = imagen.width;

/* La primera condición. Se ejecuta si el navegador es IE. Redimensiona la ventana 
según el ancho y alto de la imagen y agrega un par de pixeles más */
	if (navigator.appName.indexOf("Microsoft") != -1) {
		self.resizeTo(anchoImagen+30,altoImagen+140);
	}

/* Si el navegador es Firefox se ejecuta esta condición. La ventana se redimensiona
según el alto y ancho de la imagen. El navegador no tiene en cuenta las barras de 
herramientas, barra de estado, bordes y scrollbar de la ventana */
	if (navigator.appName == "Netscape") {
		window.innerWidth = anchoImagen;
		window.innerHeight = altoImagen;
	}

} // Fin de la función AdaptarVentana()


/// Scroll en la barra de estado, (C) Pedro Maicas, 1996.
var txt=" WEB OFICIAL ©2008 Fervorosa Hermandad Sacramental y Cofradía de Nazarenos"
+ " del Santísimo Cristo del Desamparo y Abandono, Nuestro Padre Jesús de la Humildad"
+ " y Nuestra Señora de los Dolores (Cerro del Águila ) ## WEB OFICIAL ## ";
function scroll()
{
window.status=txt;
txt=txt.substring(1,txt.length)+txt.charAt(0);
window.setTimeout("scroll()",150);
}

   function cerrar() { 
    var ventana = window.self; 
    ventana.opener = window.self; 
    ventana.close(); 
   } 
   
   function abreSinNavegacion(){ 
   	var url640x480 = "noticias.htm";
	var url800x600 = "noticias.htm";
	var url1024x768 = "noticias.htm";
	if ((screen.width == 640) && (screen.height == 480)) 
		pag1= url640x480;
	else if ((screen.width == 800) && (screen.height == 600))
		pag1= url800x600;
	else if((screen.width == 1024) && (screen.height == 768))
		pag1= url1024x768;
	else pag1= url640x480;
    derecha=(screen.width);
  	arriba=(screen.height);
    string="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+derecha+",height="+arriba+",left=0,top=0";
       //open('noticias.htm', '', 'location=no,resizable=1,scrollbars=1,menubar=no,status=yes,toolbar=0'); 
    cerrar();
    open('noticias.htm','principal','location=no,resizable=1,scrollbars=1,menubar=no,status=yes,toolbar=0'); 
 
   } 


function verfoto(img, ancho, alto){
  derecha=(screen.width-ancho)/2;
  arriba=(screen.height-alto)/2;
  string="toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
//  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left=0,top=0";
  fin=window.open(img,"",string);
}

{var xwin= null;
function abrirventana (URL){ 
	//window.close();
	var w = (screen.width-12);
	var h = (screen.height-120);
	xwin=window.open(URL,"CERRO", "width="+w+", top=0, left=0,height="+h+", toolbar=no, status=no ,scrollbars=yes, menubar=no, location=no, resizable=yes");
if(parseInt(navigator.appVersion) >= 4){xwin.window.focus();}
	} 
} 

function voy (valor){ 
	if 	( valor > '0' ) { javascript:abrirventana(valor);} 

}

function ir(Url, ancho, alto,derecha,scrol,marco){
//  derecha=(screen.width-ancho)/2;
//  arriba=(screen.height-alto)/2;
//  derecha='210';
  //derecha='+dere+';
  arriba='0';
  string="toolbar=0,scrollbars="+scrol+",location=0,statusbar=0,menubar=0,resizable=0,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
//  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left=0,top=0";
  fin=window.open(Url,"DOLORESDELCERRO",string);
}

function lugar(Url, ancho, alto,arriba,derecha,scrol,marco){
//  derecha=(screen.width-ancho)/2;
//  arriba=(screen.height-alto)/2;
//  derecha='210';
  //derecha='+dere+';
  //arriba='0';
  string="toolbar=0,scrollbars="+scrol+",location=0,statusbar=0,menubar=0,resizable=0,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
//  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left=0,top=0";
  fin=window.open(Url,marco,string);
}

function avisar(Url, ancho, alto,scrol,marco){
//  derecha=(screen.width-ancho)/2;
//  arriba=(screen.height-alto)/2;
  derecha='210';
  arriba='0';
  string="toolbar=0,scrollbars="+scrol+",location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
//  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left=0,top=0";
  fin=window.open(Url,"AVISO",string);
}
function verpdf(Url, ancho, alto,scrol){
//  derecha=(screen.width-ancho)/2;
//  arriba=(screen.height-alto)/2;
  derecha='0';
  arriba='0';
  string="toolbar=0,scrollbars="+scrol+",location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
//  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left=0,top=0";
  fin=window.open(Url,"PDF",string);
}
function ver(Url, ancho, alto,scrol,marco){
//  derecha=(screen.width-ancho)/2;
//  arriba=(screen.height-alto)/2;
  derecha='25';
  arriba='25';
  string="titlebar=no,toolbar=no,scrollbars="+scrol+",location=no,statusbar=yes,menubar=no,resizable=no,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";
//  string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left=0,top=0";
  fin=window.open(Url,marco,string);
}
