/**
 * 
 * @param {Object} local_conf
 */
AgroTuningTopListShort = function (local_conf) {
    if (typeof jQuery === 'undefined') {
         throw 'AgroTuningTopListShort exception: jQuery not found.';
    }
	//
    var conf = {};

	conf.boxId = null;

	/**
	 * 
	 */
    var init = function (local_conf) {
		conf = jQuery.extend(conf, local_conf);

		//
		new List({
		    boxId: conf.boxId,
		    listAjaxUrl: '/ajax/pojedynki-toplist-short,tPeriod,{timeSort}?packsize='+local_conf.packsize,
		    params: {timeSort: ['7D', '30D', 'TOTAL']},
		    get: function(liJQ, params){
		        return {
		            imageSrc: liJQ.find('.thumbnail .image img').attr('src'),
		            imageLink: liJQ.find('.thumbnail .image a').attr('href'),
		            place: liJQ.find('.thumbnail .place .value').text(),
		            battlesWonCount: liJQ.find('.stats .value').text(),
		            authorLink: liJQ.find('.author .user a').attr('href'),
		            authorName: liJQ.find('.author .user a').text()};
		    },
		    set: function(liJQ, data, params){		    	
		        liJQ.find('.thumbnail .image img').attr('src', data.imageSrc);
		        liJQ.find('.thumbnail .image a').attr('href', data.imageLink);
		        liJQ.find('.thumbnail .place .value').text(data.place);		        
		        liJQ.find('.stats .value').text(data.battlesWonCount);
		        liJQ.find('.author .user a').attr('href', data.authorLink);
		        liJQ.find('.author .user a').text(data.authorName);
		    },
		    after: function(params) {
				jQuery('#' + conf.boxId + ' .seeMore a')
					.attr('href', jQuery('#' + conf.boxId + ' .listFunctions .sort .active a').attr('href'));
			},
			fadeSpeed: 200});

        //
        init = function () {};
    };

	//
    jQuery(document).ready(
        function () {
            init(local_conf);
        });
};
