function getdaily(type) {
	$.ajax({
		url: "/ajax/getdaily",
		type: "POST",
		dataType: "json",
		async: false,
		data: { type: type, mode: 'daily'},
		success: function (data){
			$("#"+type+"_content_preview").html(data['data']);
			$("#"+type+"_daily").removeClass('inactive');
			$("#"+type+"_daily").addClass('active');
			$("#"+type+"_toprated").removeClass('active');
			$("#"+type+"_toprated").addClass('inactive');
			jQuery.each($('#'+type+'_content_preview .rating'), function() {
				var data = this.id.split("-");
				$(this).rating('/rating/ajax/vote?identifier=stock%23'+data[1], {maxvalue:5, curvalue:data[2]});
			});
		}

	});
}

function gettoprated(type) {

	$.ajax({
		url: "/ajax/getdaily",
		type: "POST",
		dataType: "json",
		async: false,
		data: { type: type, mode: 'toprated'},
		success: function (data){
			$("#"+type+"_content_preview").html(data['data']);
			$("#"+type+"_daily").removeClass('active');
			$("#"+type+"_daily").addClass('inactive');
			$("#"+type+"_toprated").removeClass('inactive');
			$("#"+type+"_toprated").addClass('active');
			jQuery.each($('#'+type+'_content_preview .rating'), function() {
				var data = this.id.split("-");
				$(this).rating('/rating/ajax/vote?identifier=stock%23'+data[1], {maxvalue:5, curvalue:data[2]});
			});
		}

	});
}
