$('html').addClass('js');
$('html').removeClass('nojs');

$(document).ready(function() {
    if ($(window).width() > 960) {	
	$(".art-col").equalHeights();	
	$("#entry-categories .module").equalHeights();		    
	}
	
	 $('input[title]').each(function() {
	  if($(this).val() === '') {$(this).val($(this).attr('title'));}
	  
	  $(this).focus(function() {
	   if($(this).val() === $(this).attr('title')) {$(this).val('').addClass('focused');}
	  });
	  
	  $(this).blur(function() {
	   if($(this).val() === '') {$(this).val($(this).attr('title')).removeClass('focused');}
	  });
	 });	

	 $('textarea[title]').each(function() {
	  if($(this).val() === '') {$(this).val($(this).attr('title'));}
	  
	  $(this).focus(function() {
	   if($(this).val() === $(this).attr('title')) {$(this).val('').addClass('focused');}
	  });
	  
	  $(this).blur(function() {
	   if($(this).val() === '') {$(this).val($(this).attr('title')).removeClass('focused');}
	  });
	 });	

	// Scroll initially if there's a hash (#something) in the url 
	$.localScroll.hash({
		queue:true,
		offset: -10,
		duration:1000
	});
	

	$.localScroll({
		queue:true,
		duration:1000,
		hash:true,
		offset: -10
	});


	$('.fb-feed-item').expander({
	  slicePoint: 130,
	  expandText: '',
	  expandPrefix: ''
	});

	$('.fb-date a').expander({
	  slicePoint: 8,
	  expandText: '',
	  expandPrefix: ''
	});

	$('.hl_recent_tweets li p:first-child').expander({
	  slicePoint: 100,
	  expandText: '',
	  expandPrefix: ''
	});

	$('#featurettes h3').expander({
	  slicePoint: 43,
	  expandText: '',
	});

	$('.art h2').expander({
	  slicePoint: 45,
	  expandText: '',
	});

  $(".info-button").click(function () {
	$("#voting-explanation").fadeToggle();
    });
    
  $(".close-button").click(function () {
	$("#voting-explanation").fadeToggle();
    });    
	
});


