$(document).keydown(function(e) {
	var key = 0;

	if(e == null) {
		key = event.keyCode;
	} else {
		key = e.which;
	}

	switch(key) {
		// Go left
		case 39:
			if($(".next").length > 0) {
				location.href = $(".next").attr("href");
			}
			break;
			
		// Go right
		case 37:
			if($(".previous").length > 0) {
				location.href = $(".previous").attr("href");
			}
			break;
	}
});
