// --- Adicionar aos favoritos do browser

function addFav(){

    var url      = "http://www.casamericalatina.pt";
    var title    = "Casa da América Latina";
    if (window.sidebar) window.sidebar.addPanel(title, url,"");
    else if(window.opera && window.print){
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',url);
        mbm.setAttribute('title',title);
        mbm.click();
    }
    else if(document.all){window.external.AddFavorite(url, title);}
}


//--- MenuLeft ---

$(document).ready(
      function() {
        $('ul.menuLeft li.menu_item').click(
			
          function() {
			$('ul.menuLeft li.menu_item').removeClass('activo');
            $(this).toggleClass('activo');
            //return false;
          }
        );
        /* $('ul.menuLeft li.menu_item').hover(
          function() {
            //$(this).addClass('activo');
          },
          function() {
            $(this).removeClass('activo');
          }
        ); */
      }
    );
	
//--- Marquee == Acontece ==

$(function () {
        // basic version is: $('div.demo marquee').marquee() - but we're doing some sexy extras
        
        $('div.acontece_marquee marquee').marquee('pointer').mouseover(function () {
            $(this).trigger('stop');
        }).mouseout(function () {
            $(this).trigger('start');
        }).mousemove(function (event) {
            if ($(this).data('drag') == true) {
                this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
            }
        }).mousedown(function (event) {
            $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
        }).mouseup(function () {
            $(this).data('drag', false);
        });
    }); 

	
//--- Marquee == BannerRotary ==

/*	
$(function () {
        // basic version is: $('div.demo marquee').marquee() - but we're doing some sexy extras
        
        $('div.bannerRotary marquee').marquee('bannerMarquee').mouseover(function () {
            $(this).trigger('stop');
        }).mouseout(function () {
            $(this).trigger('start');
        }).mousemove(function (event) {
            if ($(this).data('drag') == true) {
                this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
            } 
        }).mousedown(function (event) {
            $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
        }).mouseup(function () {
            $(this).data('drag', false);
        });
    });	
*/
	
//--- Preloading de Imagens
function preloadImages() {

		var namesImagesToPreload = new Array( );    
		
        namesImagesToPreload[0]= '/temas/default/imgs/maskDataDestaque.png';
        namesImagesToPreload[1]= '/temas/default/imgs/pt/labelProximosEventos.gif';
		namesImagesToPreload[2]='/temas/default/imgs/pt/labelDestaquesHome.gif';
		namesImagesToPreload[3]='/temas/default/imgs/pt/labelAconteceHome.gif';
        namesImagesToPreload[4]='/temas/default/imgs/pt/labelAmericaLatinaHome.gif';
		namesImagesToPreload[5]='/temas/default/imgs/pt/labelMultimediaHome.gif';
        for($k=0;$k<namesImagesToPreload.length;$k++){
			image2 = new Image();
			image2.src = namesImagesToPreload[$k];
		}
}

preloadImages();
		

				




