function changeBPeriod (period) {
	$('#bRss').attr ('href', '/videos/rss/?order=rating&period='+period+'&view_mode=full');
	jQuery.get ('/', {'section' : 'best', 'bperiod' : period, 'ajax':1},
		function(data, status) {
			if (status == 'success') {
				$('#bday').attr ('class', '');
				$('#bweek').attr ('class', '');
				$('#bmonth').attr ('class', '');
				$('#b'+period).attr ('class', 'pennon');
				$('#bestContainer').html (data);
				return false;
			}
			else {
				return true;
			}
		}, 
		'html'
	);
	return false;
}

function changeBView (view) {
	jQuery.get ('/', {'section' : 'best', 'bview' : view, 'ajax':1},
		function(data, status) {
		}, 
		'html'
	);
	if (view == 'full') {
		$('#bvGallbest').attr ('class', 'galleri2');
	}
	else {
		$('#bvGallbest').attr ('class', 'galleri1');
	}
	return false;
}

function changePPeriod (period) {
	$('#pRss').attr ('href', '/videos/rss/?order=popular&period='+period+'&view_mode=full');
	jQuery.get ('/', {'section' : 'popular', 'pperiod' : period, 'ajax':1},
		function(data, status) {
			if (status == 'success') {
				$('#pday').attr ('class', '');
				$('#pweek').attr ('class', '');
				$('#pmonth').attr ('class', '');
				$('#p'+period).attr ('class', 'pennon');
				$('#popularContainer').html (data);
				return false;
			}
			else {
				return true;
			}
		}, 
		'html'
	);
	return false;
}

function changePView (view) {
	jQuery.get ('/', {'section' : 'popular', 'pview' : view, 'ajax':1},
		function(data, status) {
		}, 
		'html'
	);
	if (view == 'full') {
		$('#bvGallpopular').attr ('class', 'galleri2');
	}
	else {
		$('#bvGallpopular').attr ('class', 'galleri1');
	}
	return false;
}

function watching (page) {
	jQuery.get ('/ajax/watching/'+page+'/', {'ajax':1},
		function(data, status) {
			if (status == 'success') {
				$('#watchingContainer').html (data);
				return false;
			}
			else {
				return true;
			}
		}, 
		'html'
	);
	return false;
}