var imgs = new Array();
var imgst = new Array();
var imgsI = 0;

function exoOnLoad(){
  //Focus
  exoSetFocus();
  
  setTimeout("exoQuitarMensajesError();",10000); 
}

function exoCI(control, img) {
  control.src="img/"+img;  
}

function exoQuitarMensajesError (){
    var object = document.getElementById('error');
    if(object != null){
	object.style.filter="revealTrans(duration=3, transition=12)";
	object.filters.revealTrans.apply();
	object.style.visibility="hidden";
	object.filters.revealTrans.play();
    }
    var object = document.getElementById('info');
    if(object != null){
	object.style.filter="revealTrans(duration=3, transition=12)";
	object.filters.revealTrans.apply();
	object.style.visibility="hidden";
	object.filters.revealTrans.play();
    }
}

function exoWO(url) {
  LeftPosition = (screen.width) ? (screen.width-450)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-450)/2 : 0; 
  window.open(url,'exo_window','width=450,height=480,resizable=yes,top='+TopPosition+',left='+LeftPosition+'');  
}

function exoWOC(url,params) {
  window.open(url,'exo_window',params);  
}

function exoCambiarFotos() {
   var titulo = document.getElementById('imagenTitulo');
   var trans = Math.ceil(12*Math.random());
   var image = document.getElementById('nota_img');
   try {
      image.style.filter="revealTrans(duration=1,transition="+trans+")";
      image.filters.revealTrans(duration=1).Apply();
      image.filters.revealTrans(transition=trans).Apply();
      image.filters.revealTrans.Play();
   }catch(e){};
   image.src = 'img/notas/' + imgs[imgsI];
   titulo.innerHTML = imgst[imgsI]; //esto estaba comentado
   imgsI = (imgsI * 1) + (1*1);
   if(imgsI >= imgs.length){
      imgsI = 0;
   }
   setTimeout("exoCambiarFotos()", 20000);	
}

function exoCambiarFotosClick(dir) {
  //var titulo = document.getElementById('nota-imgs');
   var titulo = document.getElementById('imagenTitulo');
   if(dir == 'S'){
      var trans = Math.ceil(12*Math.random());
      var image = document.getElementById('nota_img');
      try {
	 image.style.filter="revealTrans(duration=1,transition="+trans+")";
	 image.filters.revealTrans(duration=1).Apply();
	 image.filters.revealTrans(transition=trans).Apply();
	 image.filters.revealTrans.Play();
      }catch(e){};
      image.src = 'img/notas/' + imgs[imgsI];
      titulo.innerHTML = imgst[imgsI];
      imgsI = (imgsI * 1) + (1*1);
      if(imgsI >= imgs.length){
	 imgsI = 0;
      }
   }
   if(dir == 'A'){
      var trans = Math.ceil(12*Math.random());
      var image = document.getElementById('nota_img');
      try {
	 image.style.filter="revealTrans(duration=1,transition="+trans+")";
	 image.filters.revealTrans(duration=1).Apply();
	 image.filters.revealTrans(transition=trans).Apply();
	 image.filters.revealTrans.Play();
      }catch(e){};
      imgsI = (imgsI * 1) - (2*1);
      if(imgsI < -1){
	 imgsI = (imgs.length * 1) - (2*1);
      }
      if(imgsI < 0){
	 imgsI = (imgs.length * 1) - (1*1);
      }
      image.src = 'img/notas/' + imgs[imgsI];
      titulo.innerHTML = imgst[imgsI];
      imgsI = (imgsI * 1) + (1*1);
      if(imgsI >= imgs.length){
	 imgsI = 0;
      }
   }
}
function exoGeneraSWF (swf, width, height, id){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj2"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+width+'" height="'+height+'"> \n');
	document.write('<param name="movie" value="'+swf+'"> \n');
	document.write('<param name="bgcolor" value="#ffffff">\n');
	document.write('<param name="quality" value="High"> \n');
	document.write('<param name="allowscriptaccess" value="samedomain"> \n');
	document.write('<param name=menu value="false"> \n');
	document.write('<embed src="'+swf+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj2" width="'+width+'" height="'+height+'" quality="High"></embed>'+'\n');
	document.write('</object> \n');
	if(id){
		try {
			document.getElementById(id).style.visibility = 'hidden';
			document.getElementById(id).style.display = 'none';
		}catch(e){}
	}
	
}

function zoomText(Accion,Elemento){
  //inicializacion de variables y parametros
  var obj=document.getElementById(Elemento);
  var max = 200 //tamanio maximo del fontSize
    var min = 70 //tamanio minimo del fontSize
    if (obj.style.fontSize==""){
      obj.style.fontSize="100%";
    }
  actual=parseInt(obj.style.fontSize); //valor actual del tamanio del texto
  incremento=10;// el valor del incremento o decremento en el tamanio
  
  //accion sobre el texto
  if( Accion=="normal" ){
    obj.style.fontSize="100%"
      }
  if( Accion=="aumentar" && ((actual+incremento) <= max )){
    valor=actual+incremento;
    obj.style.fontSize=valor+"%"
      }
  if( Accion=="disminuir" && ((actual+incremento) >= min )){
    valor=actual-incremento;
    obj.style.fontSize=valor+"%"
      }
} 
