var tid;
var obj_titulo;
var obj_texto;
var limite_left;

function inicio() {
	if (document.all) {
		obj_titulo = document.all["titulo"].style;
		obj_texto = document.all["texto"].style;
	} else {
		obj_titulo = document.layers["titulo"];
		obj_texto = document.layers["texto"];
	}
	moverCapa(obj_titulo, -130, null);
	mover_titulo();
}

function mover_titulo() {
	clearTimeout (tid);
	tid=setTimeout ('mover_titulo2()',80);
}

function mover_titulo2() {
	if (leftCapa(obj_titulo) < limite_left) {
		incr_posicion_capa(obj_titulo, 10, 0);
	}
	mover_titulo();
}

function topCapa(capa) {
	if (document.all) {
		return capa.pixelTop;
	} else {
		return capa.top
	}
}

function leftCapa(capa) {
	if (document.all) {
		return capa.pixelLeft;
	} else {
		return capa.left;
	}
}

function incr_posicion_capa(capa, x, y) {
	if (document.all) {
		capa.pixelLeft = capa.pixelLeft + x;
		capa.pixelTop = capa.pixelTop + y;
	} else {
		capa.left = capa.left + x;
		capa.top = capa.top + y;
	}
}

// MoverCapa(): Para no mover en una dirección poner 'null'.
function moverCapa(capa, x, y) {
	if (document.all) {
		if (x != null) {
			capa.pixelLeft = x;
		}
		if (y != null) {
			capa.pixelTop = y;
		}
	} else {
		if (x != null) {
			capa.left = x;
		}
		if (y != null) {
			capa.top = y;
		}
	}
}


function zoom1(nombre) {
if (nombre!=""){
 url = "zoom.htm?imagen=" + escape(nombre);
NV=window.open(url,"Zoom","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=yes,top=50,left=50,width=500,height=300");
NV.focus();

 }
}



// funciones que presentan la imagen en su tomaño normal...
function zoom(img){
  foto1= new Image();
  foto1.src=(img);
  Control(img);
  }
  function Control(img){
  if((foto1.width!=0)&&(foto1.height!=0)){  
  verFoto(img);}  
  else{funcion="Control('"+img+"')";  
  intervalo=setTimeout(funcion,20);}
  }
  
  function verFoto(img){  
  ancho=foto1.width+20;  
  alto=foto1.height+20;  
  cadena="width="+ancho+",height="+alto;  
  ventana=window.open(img,"",cadena); 
   }
