$(function(){
  
  // BANNER ANIMADO DA HOME
  $('#foto_princ').after('<div id="banner_nav">').cycle({
    fx:     'fade',
    speed:  1000,
    timeout: 8000,
    height: '312px',
    pager:  '#banner_nav',
    before: function(currSlideElement, nextSlideElement, options, forwardFlag){
      $("#link_banner").attr('href', $(nextSlideElement).attr('rel'));

      // COLOCANDO STYLE DE CURSOR PARA MOUSE
      if($(nextSlideElement).attr('rel') != undefined){
        $("#link_banner").css('cursor', 'pointer');
      }
      else{
        $("#link_banner").removeAttr('href');
        $("#link_banner").css('cursor', 'default');
      }
    },
    pagerAnchorBuilder: function(index, e){
      return '<a class="ico_off ico' + (index + 1) + ' png" href="#">' + (index + 1) + '</a>';
    }
  });
  $('#foto_princ').css('visibility', 'visible');

  
  // CERTIFICADOS NA HOME
  $('#navCertificados').cycle({
    fx:     'fade',
    speed:  700,
    timeout: 3000,
	next: 'a.linkCertNext',
	prev: 'a.linkCertPrev'
  });
  $('#navCertificados').css('visibility', 'visible');
  
  $('a.balao').mousemove(function(e){
  	posY = e.pageY - 35;
	posX = e.pageX - 25;
	
  	$("#balao").css('top',posY+'px').css('left',posX+'px').css('display','block').html($(this).attr('title'));
	return (false);
  }).mouseout(function(){
  	$("#balao").css('display','none');
  })
  
  // CLIENTES NA HOME
  $('#navClientes').cycle({
    fx:     'fade',
    speed:  700,
    timeout: 3000,
	next: 'a.linkClieNext',
	prev: 'a.linkCliePrev'
  });
  $('#navClientes').css('visibility', 'visible');
  
});