<?
if($_POST['request_source'] != 'evrst_ajax') {
	include(TEMPLATEPATH. '/index.php');
		?>
	<script type="text/javascript">
		$(document).ready(function(){
			clickLink(null, document.URL);
		});
	</script>
	<?
	exit();
}

?>
<div class="news">
	<h1>News</h1>
	<?
	if (!$current_page = get_query_var('paged')){
		$current_page = 1;
	}
		
	query_posts('post_type=post&paged=' . $current_page);
	
	while(have_posts()):the_post();
		?><h2><? the_title(); ?></h2><?
		echo wpautop(wp_trim_words($post->post_content, 55)); ?>
		<a href="<? echo get_permalink($post->ID)?>" class="more-link"><img src="<? echo get_bloginfo('template_directory')?>/img/more.png" width="77" height="18" class="more"/></a>
		<?
	endwhile;
	
	global $wp_query;
	$total = $wp_query->max_num_pages;

	if ( $total > 1 )  {

	$format = 'page/%#%/';
	echo paginate_links(array(
		'base' => get_pagenum_link(1) . '%_%',
		'format' => $format,
		'current' => $current_page,
		'total' => $total,
		'mid_size' => 2,
		'type' => 'list'
	));
}
	
	wp_reset_postdata();
	wp_reset_query();
	?>
</div>