$(document).ready(function() {
  $('object').wrap("<div style='text-align:center'></div>");
  $("#form_comment").hide();
  $("h3.comente").click(function(){
     $("#form_comment").toggle('fast');
  });
  $(".btvotar").click(function(event){
    var boolValid = false;
    $('#form-enquete input:radio').each(function() {
      if ( $(this).is(':checked') ) {
        boolValid = true;
      }
    });
    if (boolValid == true){
      $("#form-enquete").submit();
      event.preventDefault();
    }
    if (boolValid == false){
      alert("Selecione uma das alternativas!");
      event.preventDefault();
    }
  });
  $("#bt-submit").click(function(event){
    var boolValid = false;
    $('#form-enquete-detail input:radio').each(function() {
      if ( $(this).is(':checked') ) {
        boolValid = true;
      }
    });
    if (boolValid == true){
      $("#form-enquete").submit();
    }
    if (boolValid == false){
      alert("Selecione uma das alternativas!");
      event.preventDefault();
    }
  });
});
function rotateDestaques(){
  $("#news-rotate ul").cycle({
    'fx': 'fade',
    'next': '.next',
    'prev': '.prev',
    'pager': '#nav'
  });
}

function twitter(usuario){
  new TWTR.Widget({
    version: 2,
    type: 'profile',
    rpp: 2,
    interval: 6000,
    width: 380,
    height: 150,
    theme: {
      shell: {
        background: '#94e4e8',
        color: '#ffffff'
      },
      tweets: {
        background: '#ffffff',
        color: '#444444',
        links: '#0c929e'
      }
    },
    features: {
      scrollbar: false,
      loop: false,
      live: false,
      hashtags: true,
      timestamp: true,
      avatars: true,
      behavior: 'all'
    }
  }).render().setUser(usuario).start();
}
