$(document).ready(function() {
	if (navigator.appVersion.indexOf("Win")!=-1) 
		var windows = true;
	else
		var windows = false;
	if (windows) {
		$('.essay_container').columnize({height: 459+17+17, width: 320, lastNeverTallest:true, buildOnce:true}); 
	} else {
		$('.essay_container').columnize({height: 459, width: 320, lastNeverTallest:true, buildOnce:true}); 
	}
	
	$('.right_arrow').show();
})

var currentCol = 0;

function essay_position() {
	$('.essay_container').css('margin-left',(-currentCol*320)+'px');
	if (currentCol != 0) {
		$('.left_arrow').show();
	} else {
		$('.left_arrow').hide();
	}
	
	var maxCol = $('.essay_container div').length-3;

	if (currentCol<maxCol) {
		$('.right_arrow').show();	
	} else {			
		$('.right_arrow').hide();	
	}
	
}

function essay_left() {
	currentCol-=2;
	essay_position();
}

function essay_right() {
	currentCol+=2;
	essay_position();
}