/*
Theme Name: Zeit
Theme URI: http://polarblau.com/
Description: Journal or newspaper- like theme
Author: Polarblau


Application Javascript
==============================================================
*/

var mason;
var mason_width;
var mason_gutter;

(function($){
	$(function(){
		// Masonry
		$('#content .blocks').imagesLoaded(mason());
		// AJAX pagination

/* sorry, disabled due to an error in navigating through backspace key...

		var url = window.location;
		if (url.hash.match(/^#l=/)) window.location = url.hash.replace('#l=', '');
		$('#content .page-navigation a').live('click', function(){
			$('#content .page-navigation').addClass('loading');
			var link = this.href;
			$.get(link, function(result){ 
				window.location.hash = "#l="+link;
				$('#content').replaceWith(result); 
				mason(); 
			});
			return false;
		});
*/
	});
})(jQuery);

/*
mason = function(target) {
	jQuery(target || '#content .blocks').masonry({ itemSelector: '.block' }); 
};
*/

mason = function() {
	jQuery('#content .blocks').masonry({
		columnWidth: mason_width,
		gutterWidth: mason_gutter,
		itemSelector: '.block',
		isAnimated: false,
		animationOptions: {
			duration: 200,
			easing: 'linear',
			queue: false
		}
	});
}

