// fade imágenes

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

///// Abre ventana con html dentro

var ImprimeVentana
function carolina(destino,ancho,alto,resi,scroll) {
	if (ImprimeVentana != null && !ImprimeVentana.closed) {
		VentanaVieja = ImprimeVentana;
		VentanaVieja.name = "VentanaVieja";
		VentanaVieja.close();
	 }
	ImprimeVentana=window.open(destino,"VentanaNueva","toolbar=no,location=no, status=no,menubar=no,left=0,top=0,resizable="+resi+",scrollbars="+scroll+",width="+ancho+",height="+alto);
	if (ImprimeVentana.opener == null)	{
		ImprimeVentana.opener = carolina;
	}
		ImprimeVentana.opener.name = "VentanaOriginal";
        ImprimeVentana.focus();
}

function closeWin()	{
	this.close();
	ImprimeVentana = null;
}

///// Ventanita fotos anula botón derecho del mouse
// usa también closeWin() declarada antes.
var MuestraVentana
function marcos(imagen,ancho,alto,titulo) 
{
	if (MuestraVentana != null && !MuestraVentana.closed) {
		CuadroViejo = MuestraVentana;
		CuadroViejo.name = "CuadroViejo";
		CuadroViejo.close();
	 }
	MuestraVentana=window.open("","CuadroNuevo","toolbar=no,location=no, status=no,menubar=no,left=0,top=0,resizable=no,scrollbars=no,width="+ancho+",height="+alto);
	MuestraVentana.document.write("<html><head><title>"+titulo+"</title>");
	MuestraVentana.document.write("<script language=\"JavaScript\">");
	MuestraVentana.document.write("var mensaje=\"Derechos reservados por los autores. Prohibida su reproducción.\";");
	MuestraVentana.document.write("function nosepuede(A){if (document.all){if (event.button == 2) {alert(mensaje);	return false;	}}");
	MuestraVentana.document.write("if(document.layers){if(A.which == 3){alert(mensaje);return false;}	}}");
	MuestraVentana.document.write("if(document.layers){document.captureEvents(Event.MOUSEDOWN);}document.onmousedown=nosepuede;");
	MuestraVentana.document.write("</script>");
	MuestraVentana.document.write("</head><body>");
	MuestraVentana.document.write('<div style="position:absolute;width:'+ancho+'px;height:'+alto+'px;left:0px;top:0px">');
	MuestraVentana.document.write("<img src="+imagen+" alt=\""+titulo+"\"></div></body></html>");
	MuestraVentana.document.close();
	if (MuestraVentana.opener == null)	{
		MuestraVentana.opener = carolina;
	}
		MuestraVentana.opener.name = "VentanaOriginal";
        MuestraVentana.focus();
}

///// Abre ventana fija con imagen dentro (tapices,mapas)

var ImprimeVentana
function leandro(imagen,titulo) 
{
	if (ImprimeVentana != null && !ImprimeVentana.closed) {
		VentanaVieja = ImprimeVentana;
		VentanaVieja.name = "VentanaVieja";
		VentanaVieja.close();
	 }
	ImprimeVentana=window.open("","VentanaNueva","toolbar=no,location=no, status=no,menubar=no,left=0,top=0,resizable=yes,scrollbars=yes,width=550,height=400");
	ImprimeVentana.document.write("<html><head><title>"+titulo+"</title>");
	ImprimeVentana.document.write("</head><body>");
	ImprimeVentana.document.write('<div style="position:absolute;width:550px;height:400px;left:0px;top:0px">');
	ImprimeVentana.document.write("<img src="+imagen+"></div></body></html>");
	ImprimeVentana.document.close();
	if (ImprimeVentana.opener == null)	{
		ImprimeVentana.opener = leandro;
	}
		ImprimeVentana.opener.name = "VentanaOriginal";
        ImprimeVentana.focus();
}
function closeWin()
	{
		this.close();
		ImprimeVentana = null;
	}


///// Over imagenes

var iex = navigator.appName=="Microsoft Internet Explorer"?true:false;
var fi = iex?'filters.alpha.opacity':'style.MozOpacity'
var opaMax= iex?100:1;
var opaMin= iex?50:0.5;
var inc = iex?5:0.05;
function subir(cual){
opa = new Number(eval('cual.' + fi))
eval('cual.' + fi + '= opa + inc')
if(opa< opaMax){
	tiempo2=setTimeout("subir(imagen)",20)
	}
if(opa == opaMax){
	clearTimeout(tiempo2)
	}
}
function bajar(cual){
imagen = cual
opa = new Number(eval('cual.' + fi))
eval('cual.' + fi + '= opa + inc')
if(opa > opaMin){
	eval('cual.' + fi + '= opa - inc')
	tiempo=setTimeout("bajar(imagen)",20)
	}
if(opa == opaMin){
	clearTimeout(tiempo);
	subir(imagen)
	}
}
if(iex){
with(document){
	write ('<style type="text/css" >')
	write ('#pepe {')
	write ('filter: alpha(opacity=100)}')
	write ('</style>')
	}
}
else{
window.onload=function(){
	document.getElementById('pepe').style.MozOpacity = 1
	}
}

