$(document).ready(function() {
	
	$('a.lightbox').lightBox(); 
	
	$('.search-text').focus(function() {
		$(this).val("");
	});
	
	if (document.getElementById("outros-destaques")) {
			$("#outros-destaques h3 a").click(function() {
				id = $(this).attr("rel");
				foto_media = $(id).find("img").attr("rel");
				descricao = $(id).find("#outros-destaques-descricao").html();
				titulo = $(id).find("h3 a").html();
				link = $(id).find("a").attr("href");
				$("#destaque-principal").find("a").attr("href", link);
				$("#destaque-principal").find(".foto-medio img").attr("src", foto_media);
				$("#destaque-principal").find("h3 a").html(titulo);
				$("#destaque-principal").find("#destaque-descricao").html(descricao);
				return false;
			});
	}
	$('#destaque-slide').show();  
	$("#destaque-slide").cycle();
	$('#eventos-principal').show();  
	$("#eventos-principal").cycle();
    $(function () {
        // basic version is: $('div.demo marquee').marquee() - but we're doing some sexy extras
        
        $('#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);
        });
    });
});