function initPostFilters() {
	if (_feedIsPersonal) {
		return false;
	}
	
	var languages = new Array();
	$('#filterForm input.language').each(function() {
		if (this.checked) {
			languages.push(this.value);
		}
	});
	
	_feedLanguages = languages.join(',');
	
	_feedMultiLanguage = $('#filterMultiLanguage:checked').val() == '1' ? '1' : '';
	
	_feedTypes = $('#filterTwitter:checked').val() == '1' ? 'blog,twitter' : 'blog';
	
	// save the 3 params in cookie
	$.post('/inc/ajax/ajaxSetCookie.php', { 'feedLanguages' : _feedLanguages, 'feedMultiLanguage' : _feedMultiLanguage, 'feedFilterType' : _feedTypes});
}

$(function(){	
	//first load, all is checked
	//initPostFilters();
	
	var params = {};
	if (LISTING_VIEW_ID == LISTING_VIEW_COMMUNE) {
		params = {
			zip: _feedZip
		};
	} else if (LISTING_VIEW_ID == LISTING_VIEW_SEARCH || LISTING_VIEW_ID == LISTING_VIEW_NEWS) {
		params = {
			keywords: _feedKeywords
		};
	}
	
	if (params.length > 0) {
		params = $.extend({}, blankFeedParams, params);
	}
	
	//loadPosts(true, params);
		
	$('#filterForm .reloadPosts').change(function() {
		initPostFilters();
		loadPosts(true, params);
	});
	
	$('#morePosts a').click(function(){
		++_feedPage;
		loadPosts(false, params);
		
		return false;
	});

})	