(function(){fcmsJs.Class('fcmsUser_Statistic_Viewcount').inherits(fcmsLib_Core_Class).construct(function(elements){this.webservice=new fcmsUser_Core_Webservice('statistic');this.elements=elements;this.loadElements=[];$A(elements).each(function(i){if(i.getAttribute('data-fCMS-objectType')&&i.getAttribute('data-fCMS-objectId')){this.loadElements.push(i.getAttribute('data-fCMS-objectType')+'-'+i.getAttribute('data-fCMS-objectId'));}}.bind(this));if(this.loadElements.length>0){this.query(this.loadElements);}}).method('query',(function(elements){var data={'queryData':elements};this.webservice.call('getViewcount',data,this.setViewcount.bind(this),'statistic',0);})).method('setViewcount',(function(viewCountData){$A(this.elements).each(function(i){var value=viewCountData.data[i.getAttribute('data-fCMS-objectType')+'-'+i.getAttribute('data-fCMS-objectId')];if(value){fcmsLib_Utils_Html.replaceContent(i,value);}else{fcmsLib_Utils_Html.replaceContent(i,'0');}}.bind(this));}));})();fcmsLib_Core_DataMethods.register('viewcount',{func:function(e){try{var x=new fcmsUser_Statistic_Viewcount(e);}catch(err){fcmsJs.console.error(err);}}});if(typeof fcmsJs==="object"){fcmsJs.loaded("fcmsUser_Statistic");}