﻿
        var d=document, imgs = new Array(), txts = new Array(), zInterval = null, current=0, pause=false;
        var colors = new Array(), logos = new Array(), icurrent=0;
        colors[0] = '#666666';
        colors[1] = '#8EC63F'; 
        colors[2] = '#1B1B76';
        var timing = 800;

        function logo_init()
        {
            var logoDIV = $('img_container');
            logos = logoDIV.getElements('img');

	        var ieffectFx = new Fx.Tween(logos[icurrent],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': 1000
	        }).start('opacity',0,1);
	        
	        setTimeout(logo_xfade,3000);
        }

        function logo_xfade()
        {
	        var nIndex = logos[icurrent+1]?icurrent+1:0;
	        var ieffectFx = new Fx.Tween(logos[icurrent],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': 1000
	        }).start('opacity',1,0);	        
	        var ieffectFxn = new Fx.Tween(logos[nIndex], 
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': 1000
	        }).start('opacity', 0,1);
	       icurrent = nIndex;
	       setTimeout(logo_xfade,3000);
        }

        function so_init()
        {
            var imgDIV = $('inner_banner_imagen');
            var txtDIV = $('inner_banner_texto');
            imgs = imgDIV.getElements('img');
            txts = txtDIV.getElements('div');

	        var effectFxi = new Fx.Tween(imgs[current],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': timing
	        }).start('left',360,0);
	        var effectFxt = new Fx.Tween(txts[current],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': timing
	        }).start('left',600,120);
	       $('banner_texto').style.backgroundColor = colors[current];
	        
	        setTimeout(so_xfade,6000);
        }

        function so_xfade()
        {
	        var nIndex = imgs[current+1]?current+1:0;
	        var effectFx = new Fx.Tween(imgs[current],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': timing
	        }).start('left',0,-360);	        
	        var effectFxn = new Fx.Tween(imgs[nIndex],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': timing
	        }).start('left',360,0);
	        var effectFxt = new Fx.Tween(txts[current],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': timing
	        }).start('left',120,-380);	        
	        var effectFxtn = new Fx.Tween(txts[nIndex],  
	        {
	            'transition': Fx.Transitions.Sine.easeOut,
	            'duration': timing
	        }).start('left',600,120);

	       var fx = new Fx.Tween($('banner_texto'), {duration:timing, wait:false});
	       fx.start('background-color',colors[nIndex]);
	        
	       current = nIndex;
	       setTimeout(so_xfade,6000);
        }
        function acordeon(menu){
	                var myAccordion = new Fx.Accordion($('submenu'), 'li.toggler', 'ul.element', {
		                display: menu,
		                opacity: false,
		                onActive: function(toggler, element){
			                toggler.setStyle('color', '#333333');
		                },
		                onBackground: function(toggler, element){
			                toggler.setStyle('color', '#897676');
		                }
	                });

        }
        function irA(vinculo){
            var myFx = new Fx.Scroll(window).toElement(vinculo);
       }
