// front-end javascripts go here

$(function() {
  // cufon stuff
	Cufon.replace('.unit h1', { fontFamily: 'Interstate' });
	Cufon.replace('.unit h4', { fontFamily: 'Interstate' });
	Cufon.replace('#maincolumn h3', { fontFamily: 'Gotham' });
	Cufon.replace('#logo h2', { fontFamily: 'Interstate' });
	Cufon.replace('#logo h1', { fontFamily: 'Gotham' });
	Cufon.replace('.smallunit h1', { fontFamily: 'Interstate' });
	Cufon.replace('#recent h3', { fontFamily: 'ChunkFive' });
	Cufon.replace('#extracolumn h2', { fontFamily: 'ChunkFive' });
	Cufon.replace('.votecontrols .votecount', { fontFamily: 'Gotham' });
	Cufon.replace('.votecontrols .votecomment', { fontFamily: 'Gotham' });

  // corner stuff
  $('.unit .content').corner("bottom 8px");
	$('.votecontrols').corner("4px");
	$('#poll').corner("6px");
	$('#favourites').corner("6px");
	$('#recent').corner("6px");
	
  // text field stuff
  $('input[type=text], input[type=password]').addClass('textfield');
  $('input[type=submit]').addClass('submit');
  
  // show a sweet poll animation
  $.each($('.result-bar'), function() {
    var item = $(this);
    var width = item.attr('percent');
    item.animate({width: width, opacity: 1}, 1100);
  });
  
  //facebox
  $('a[rel*=facebox]').facebox();
  
  
  // alert/error stuff
  $('#notification-bar').slideDown();
  
  $('body').click(function() { 
    $('#notification-bar').slideUp();
    $('#warning').fadeOut();
  })
});
