jQuery(document).ready(function(){
		$('#sidebar li h3 .plus').click(function(el){
			$(this).parents('li').addClass('active');
			return false;
		});
		$('#getArchives').click(function(el){
				elm = $(this); 	
				status = '';
				$.ajax({
					 url:'/wp-content/themes/rantiev-theme/scripts/ajax/getArchives.php',
					 beforeSend: function() {
						 elm.hide();
						 $('#archives').append('<img src="/wp-content/themes/rantiev-theme/images/ajax-load.gif" id="getArchivesStatus" />');
					 },
					 success: function(data) {
						 $('#archives').append(data);
						 $('#getArchivesStatus').hide();
					 }
				});						 
		});
		$('#getRecentPosts').click(function(el){
				elm = $(this); 	
				status = '';
				$.ajax({
					 url:'/wp-content/themes/rantiev-theme/scripts/ajax/getRecentPosts.php',
					 beforeSend: function() {
						 elm.hide();
						 $('#recentPosts').append('<img src="/wp-content/themes/rantiev-theme/images/ajax-load.gif" id="getRecentPostsStatus" />');
					 },
					 success: function(data) {
						 $('#recentPosts').append(data);
						 $('#getRecentPostsStatus').hide();
					 } 
				});						 
		});
		
 
	jQuery('a').click(function(){
		link = jQuery(this).attr('href');		
		if(link.indexOf('pdf')>0||link.indexOf('doc')>0||link.indexOf('xls')>0) {
			_gaq.push(['_trackPageview', $(this).attr('href')]);
			console.log('document link ');
		}	
	});
 
});
