// JavaScript Document

/*
MENU PRINCIPAL

*/




 $(document).ready(function(){  
      
        $("ul.subnav").parent().append("<li></li>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)  
      
        $("ul.topnav li").hover(function() { //When trigger is clicked...  
      
            //Following events are applied to the subnav itself (moving subnav up and down)  
            $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click  
      
            $(this).parent().hover(function() {  
            }, function(){  
                $(this).parent().find("ul.subnav li").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up  
            });  
      
            //Following events are applied to the trigger (Hover events for the trigger)  
            }).hover(function() {  
                $(this).addClass("subhover"); //On hover over, add class "subhover"  
            }, function(){  //On Hover Out  
                $(this).removeClass("subhover"); //On hover out, remove class "subhover"  
        });  
      
    }); 
	

/*
BORDAS PAGINA

*/
DD_roundies.addRule('#buscarSite', '5px', true);

/*BANNER SITE*/

$(function(){
	$(".jcarouselB").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		visible: 1,
		auto: 10000,
		speed: 1000,
		mouseWheel: true
		
		})
	})
	


	
$(function(){
	$(".navigation").jCarouselLite({
		btnNext: ".next",
		btnPrev: ".prev",
		visible: 1,
		auto: 10000,
		speed: 1000,
		mouseWheel: true
		
		})
	})
	


/*
SLIDE ALBUM PRINCIPAL

*/


$(function(){
				$('#images').exposure({carouselControls : true,
					imageControls : true,
					pageSize : 5,
					slideshowControlsTarget : '#slideshow',
					onThumb : function(thumb) {
						var li = thumb.parents('li');				
						var fadeTo = li.hasClass('active') ? 1 : 0.3;
						
						thumb.css({display : 'none', opacity : fadeTo}).stop().fadeIn(200);
						
						thumb.hover(function() { 
							thumb.fadeTo('fast',1); 
						}, function() { 
							li.not('.active').children('img').fadeTo('fast', 0.3); 
						});
					},
					onImage : function(image, imageData, thumb) {
						// Check if wrapper is hovered.
						var hovered = $('.exposureWrapper').hasClass('exposureHover');
						
						// Fade out the previous image.
						$('.exposureWrapper > .exposureLastImage').stop().fadeOut(500, function() {
							$(this).remove();
						});
						
						// Fade in the current image.
						image.hide().stop().fadeIn(1000);
						
						if ($.exposure.showThumbs && thumb && thumb.length) {
							thumb.fadeTo('fast', 1).addClass('selected');
						}
					},
					onCarousel : function(firstImage, lastImage) {
						$('.exposureThumbs li').hide().children('img.selected').stop().css('opacity', 0.3).removeClass('selected');
					},
					onSlideshowPlayed : function() {
						$('.exposurePauseSlideshow').css('display','inline');
					}
				});
			});
			



	
function FocusForm(campotext){
	document.getElementById(campotext).focus();
	}
	
function Limpar(campotext, referencia){

if(document.getElementById(campotext).value == referencia){
document.getElementById(campotext).value="";	
	  }else{
document.getElementById(campotext).value= document.getElementById(campotext).value;		  
		  }	
	}

function Preecher(campotext, textoValue){
if(document.getElementById(campotext).value ==""){
	document.getElementById(campotext).value= textoValue;
	}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/*BANNER EVENTOSS*/

$(function(){
   $('#prox-eventos ul').cycle({
     fx: 'fade',
     speed: 2000,
     timeout: 5000,
     next: '#proximo',
     prev: '#anterior',
     pager: '#pager'
   })
 })

