var $R={mouseOffset:{},mouseDownTime:"",mouseUpTime:"",init:function(){this.createDom(),this.hoverEvent(),this.bindEvent(),this.pvSend()},createDom:function(){var e=[],t="https:"==document.location.protocol?"https":"http";window.adsData&&($.each(window.adsData.ads,function(n,r){r.img=t+"://imgx.mediav.com/rimg.png?img="+encodeURIComponent(r.img)+"&resizetype=2&axisreset=1&size="+w+"x"+h;var i="";r.clktk&&(i=r.clktk.join(",")),e.push('
'),e.push('

'),e.push('

'),e.push('


'),e.push("
")}),$(".imgContent").html(e.join("")))},hoverEvent:function(){$(".content").on("mouseenter",function(){$(this).find(".main_img").removeClass("scaleImg").addClass("scaleImg"),$(this).find(".go_default").hide(),$(this).find(".go_active").show()}).on("mouseleave",function(){$(this).find(".main_img").removeClass("scaleImg"),$(this).find(".go_active").hide(),$(this).find(".go_default").show()})},pvSend:function(){var e=this;window.adsData&&window.adsData.adstk&&$.each(window.adsData.adstk,function(t,n){e.sendLog(n)})},sendLog:function(e){var t=new Image;t.onload=t.onerror=function(){t=null},t.src=e},bindEvent:function(){var e=this;$(".trackTarget").on("mousedown",function(t){e.getOffset(t.clientX,t.clientY),e.mouseDownTime=(new Date).getTime()}),$(".trackTarget").on("click",function(){var t=$(this).attr("data-clk"),n=$(this).attr("data-curl");e.mouseUpTime=(new Date).getTime(),t&&(t=t.replace("__EVENT_TIME_START__",e.mouseDownTime).replace("__EVENT_TIME_END__",e.mouseUpTime).replace("__OFFSET_X__",parseInt(e.mouseOffset.x)).replace("__OFFSET_Y__",parseInt(e.mouseOffset.y)).replace("__ADSPACE_W__",w).replace("__ADSPACE_H__",h),$.each(t.split(","),function(t,n){e.sendLog(n)})),n=n.replace("__EVENT_TIME_START__",e.mouseDownTime).replace("__EVENT_TIME_END__",e.mouseUpTime).replace("__OFFSET_X__",parseInt(e.mouseOffset.x)).replace("__OFFSET_Y__",parseInt(e.mouseOffset.y)).replace("__ADSPACE_W__",w).replace("__ADSPACE_H__",h),window.open(n,"mediav"+e.mouseUpTime)})},getOffset:function(e,t){var n=$(".content")[0].getBoundingClientRect(),r=e-n.left,i=t-n.top;this.mouseOffset={x:r,y:i}}};$R.init();