﻿// Archivo JScript

/* Funciones para Greybox*/
 function popup(){
            var tok = String(document.location).split("/");
            tok.pop();
            return tok.join("/");
        }
        var GB_ROOT_DIR = popup()+"/js/greybox/";
    
 function PlayMarquesina(){
            document.getElementById('ObjMarqueee').start();
        }
 
 
 var ArrayScrollAmount = new Array(0, 3, 6, 9, 12, 15, 18, 21);
 var IndiceSA=3;
 var BtnIzquierdo=1;
 var BtnDerecho=-1;
 
 function Cambia(valor){
    var SA=document.getElementById('ObjMarqueee').scrollAmount;
    var direction=document.getElementById('ObjMarqueee').direction;
    
    alert("valor=" + valor + " direccion=" + direction + " SA=" + SA);
    
    if(SA>0){
        IndiceSA=IndiceSA+valor;
        document.getElementById('ObjMarqueee').scrollAmount=ArrayScrollAmount[IndiceSA];
        }
    if(SA==0){
            if(direction=='right'){
                document.getElementById('ObjMarqueee').direction='left';
                BtnDerecho=-1;
                BtnIzquierdo=1;
                }
            if(direction=='left'){
                document.getElementById('ObjMarqueee').direction='right';  
                BtnDerecho=1;
                BtnIzquierdo=-1;
                }
        
         IndiceSA++;
         document.getElementById('ObjMarqueee').scrollAmount=ArrayScrollAmount[IndiceSA];
        }
    
    document.getElementById('btn').value=document.getElementById('ObjMarqueee').scrollAmount;
          
    }
 
 function Down(){
    var SA=document.getElementById('ObjMarqueee').scrollAmount;
    if(SA>=-20)
        document.getElementById('ObjMarqueee').scrollAmount=SA-1;
    }
 
/* Fin Funciones para Greybox*/


/*Funciones para aunmentar o disminuir texto*/

function cambiarTamano(tam){
  
  var miRegla;
  if (document.all){
    miRegla = document.styleSheets[0].rules;
    }
  else{
    miRegla = document.styleSheets[0].cssRules;
    }
   
   AumentarDisminuir(miRegla, ".texto_noticia", tam);
   AumentarDisminuir(miRegla, ".texto_noticia A", tam);
   AumentarDisminuir(miRegla, ".titulo_bloque_noticia_home", tam);
   
   
   AumentarDisminuir(miRegla, ".texto_fecha_publicacion_noticia", tam);
   AumentarDisminuir(miRegla, ".LinkNoticiaArchivoNoticia", tam);
   
   AumentarDisminuir(miRegla, ".texto_bloque_noticia_home", tam);
   AumentarDisminuir(miRegla, ".ver_mas_noticia_home A", tam);
   AumentarDisminuir(miRegla, ".ver_mas_noticia_home A:hover", tam);
   AumentarDisminuir(miRegla, ".LinkArchivoNoticias", tam);
   AumentarDisminuir(miRegla, "#fecha", tam);
   
   AumentarDisminuir(miRegla, "#TablaCabecera_Titulo", tam);
   AumentarDisminuir(miRegla, "#TablaCabecera_FechaPublicacion", tam);
     
   }

function AumentarDisminuir(miRegla, regla, tam){
	for (i=0; reg=miRegla[i]; i++) {
		size = reg.style.fontSize;
		if (size!='' && reg.selectorText.toLowerCase() == regla.toLowerCase()){
			    size=parseFloat(size)+tam+'px';
			    reg.style.fontSize=size;
			}
		}
	}

/**** función para manejar el teclado ****/
function pulsar(e,obj) {
  tecla = (document.all) ? e.keyCode : e.which;
  if (tecla==13 || tecla==32) obj.onclick;
}





/*******************************************/
function Swap(IdBoton, Estado){
    carpeta='imagenes/botones/imagenes/';
    if(Estado=='ON')
        {
        document.getElementById("SuperiorIzquierda_" + IdBoton).style.backgroundImage  =  "url('" + carpeta + "boton_ON_01.gif')";
        document.getElementById("SuperiorCentro_" + IdBoton).style.backgroundImage     =  "url('" + carpeta + "boton_ON_02.gif')"; 
        document.getElementById("SuperiorDerecha_" + IdBoton).style.backgroundImage    =  "url('" + carpeta + "boton_ON_03.gif')"; 
        document.getElementById("IzquierdaMedio_" + IdBoton).style.backgroundImage     =  "url('" + carpeta + "boton_ON_04.gif')"; 
        document.getElementById("CentroContenido_" + IdBoton).style.backgroundImage    =  "url('" + carpeta + "boton_ON_05.gif')"; 
        document.getElementById("DerechaMedio_" + IdBoton).style.backgroundImage       =  "url('" + carpeta + "boton_ON_06.gif')"; 
        document.getElementById("InferiorIzquierda_" + IdBoton).style.backgroundImage  =  "url('" + carpeta + "boton_ON_07.gif')"; 
        document.getElementById("InferiorCentro_" + IdBoton).style.backgroundImage     =  "url('" + carpeta + "boton_ON_08.gif')"; 
        document.getElementById("InferiorDerecha_" + IdBoton).style.backgroundImage    =  "url('" + carpeta + "boton_ON_09.gif')"; 
        }
    if(Estado=='OFF')
        {
        document.getElementById("SuperiorIzquierda_" + IdBoton).style.backgroundImage =  "url('" + carpeta + "boton_01.gif')"; 
        document.getElementById("SuperiorCentro_" + IdBoton).style.backgroundImage    =  "url('" + carpeta + "boton_02.gif')";
        document.getElementById("SuperiorDerecha_" + IdBoton).style.backgroundImage   =  "url('" + carpeta + "boton_03.gif')";
        document.getElementById("IzquierdaMedio_" + IdBoton).style.backgroundImage    =  "url('" + carpeta + "boton_04.gif')";
        document.getElementById("CentroContenido_" + IdBoton).style.backgroundImage   =  "url('" + carpeta + "boton_05.gif')";
        document.getElementById("DerechaMedio_" + IdBoton).style.backgroundImage      =  "url('" + carpeta + "boton_06.gif')";
        document.getElementById("InferiorIzquierda_" + IdBoton).style.backgroundImage =  "url('" + carpeta + "boton_07.gif')";
        document.getElementById("InferiorCentro_" + IdBoton).style.backgroundImage    =  "url('" + carpeta + "boton_08.gif')";
        document.getElementById("InferiorDerecha_" + IdBoton).style.backgroundImage   =  "url('" + carpeta + "boton_09.gif')";
        
        }
}
