(function(){ var self=this;window.ppliveadsystem={},window.onerror=function(){},self._aduid||(self._aduid=+new Date);var util=function(){var a=this,b=function(){function a(k,l){l=l||document;var m=/^[\w\-_#]+$/.test(k);if(!m&&l.querySelectorAll)return b(l.querySelectorAll(k));if(k.indexOf(",")>-1){for(var n=k.split(/,/g),o=[],p=0,q=n.length;q>p;++p)o=o.concat(a(n[p],l));return j(o)}var r,s=k.match(e),t=s.pop(),u=(t.match(g)||i)[1],v=!u&&(t.match(f)||i)[1],w=!u&&(t.match(h)||i)[1];if(v&&!w&&l.getElementsByClassName)r=b(l.getElementsByClassName(v));else if(r=!u&&b(l.getElementsByTagName(w||"*")),v&&(r=d(r,"className",RegExp("(^|\s)"+v+"(\s|$)"))),u){var x=l.getElementById(u);return x?[x]:[]}return s[0]&&r[0]?c(s,r):r}function b(a){try{return Array.prototype.slice.call(a)}catch(b){for(var c=[],d=0,e=a.length;e>d;++d)c[d]=a[d];return c}}function c(a,b,d){var e=a.pop();if(">"===e)return c(a,b,!0);var j,k,l,m=[],n=-1,o=(e.match(g)||i)[1],p=!o&&(e.match(f)||i)[1],q=!o&&(e.match(h)||i)[1],r=-1;for(q=q&&q.toLowerCase();j=b[++r];){k=j.parentNode;do if(l=!q||"*"===q||q===k.nodeName.toLowerCase(),l=l&&(!o||k.id===o),l=l&&(!p||RegExp("(^|\s)"+p+"(\s|$)").test(k.className)),d||l)break;while(k=k.parentNode);l&&(m[++n]=j)}return a[0]&&m[0]?c(a,m):m}function d(a,b,c){for(var d,e=-1,f=-1,g=[];d=a[++e];)c.test(d[b])&&(g[++f]=d);return g}var e=/(?:[\w\-\.#]+)+(?:\[\w+?=(['"])?(?:\\1|.)+?\1\])?|\*|>/gi,f=/^(?:[\w\-_]+)?\.([\w\-_]+)/,g=/^(?:[\w\-_]+)?#([\w\-_]+)/,h=/^([\w\*\-_]+)/,i=[null,null],j=function(){var a=+new Date,b=function(){var b=1;return function(c){var d=c[a],e=b++;return d?!1:(c[a]=e,!0)}}();return function(c){for(var d,e=c.length,f=[],g=-1,h=0;e>h;++h)d=c[h],b(d)&&(f[++g]=d);return a+=1,f}}();return a}();return{$:b,agent:window.navigator.userAgent.toLowerCase(),set:function(a,b,c){var d=encodeURIComponent(b),e=864e5;if("number"==typeof c){var f=c;f=new Date,f.setTime(f.getTime()+c*e),c&&(d+="; expires="+f.toUTCString())}document.cookie=a+"="+d},get:function(a){var b=document.cookie.match(new RegExp("(^| )"+a+"=([^;]*)(;|$)"));return null!==b?decodeURIComponent(b[2]):null},isClient:function(){try{if(a.external&&external.GetObject("@pplive.com/ui/mainwindow;1"))return!0}catch(b){}return!1},plt:function(){return a.plt||(a.plt=util.isClient()?"clt":"web"),a.plt},isIpad:function(){return util.agent.match(/(iphone|ipad|ipod)/i)?!0:!1},sendMonitor:function(a){if(a&&"string"==typeof a)for(var b=a.split("|")||[],c=(new Image,0),d=b.length;d>c;c++)setTimeout(function(a){return function(){var c=new Image(1,1);c.onload=c.onerror=function(){},c.src=b[a]+(/\?/.test(b[a])?"&":"?")+"rnd="+ +new Date}}(c),1500*c)},queryToObject:function(a){if(!a||""===a)return{};for(var b,c={},d=a.split("&"),e=0;d[e];)b=d[e].split("="),c[b[0]]=b[1],e++;return c}}}.call(this);!function(a){function b(a,b){var c=/^(?:(\+|-)=)?(-?\d+(?:\.\d+)?)(px|)$/,d=c.exec(b);if(d)return{operator:d[1]?d[1]:"",num:d[2]?d[2]:"",unit:d[3]?d[3]:""};throw new Error("传入参数不能运行动画")}function c(a,c,d,e){var f=d.speed||1e3,g=20;navigator.userAgent.indexOf("MSIE 8.0")>0&&(g=80),a.ani||(a.ani={}),_ads.each(c,function(c,d){a.ani[d]||(a.ani[d]=[]);var h=b(d,c),i={};h.operator||(i.end=c);var j;if(h.num){var k=0;i.callback=e,i.begin=function(){var c=_ads.getAppliedStyle(a,d);i.start=c;var l=b(d,c);h.operator&&(i.end=1*l.num+("+"===h.operator?1*h.num:-1*h.num)+h.unit,h=b(d,i.end));var m=h.num-l.num,n=m/f*g,o=m/n;j=setInterval(function(){k++;var b=1*l.num+n*k+h.unit;_ads.setStyle(a,d,b),k>=o&&(_ads.setStyle(a,d,i.end),e&&i.callback.call(i),clearInterval(j),a.ani[d].shift(),a.ani[d].length&&a.ani[d][0].begin())},g)},i.finish=function(){j&&clearInterval(j)},1===a.ani[d].push(i)&&i.begin()}},this)}function d(a,b){for(var c in a.ani){var d=a.ani[c].length;d&&(a.ani[c][0].finish(),a.ani[c][0].callback&&a.ani[c][0].callback.call(this),_ads.setStyle(a,c,a.ani[c][d-1].end),a.ani[c].length=0,b&&b())}}a.AniModule={},a.AniModule.animation=c,a.AniModule.stop=d}(window),function(){var a=this;_ads={};var b={},c=Array.prototype,d=Object.prototype;Function.prototype;var e=d.hasOwnProperty,f=c.forEach,g=Object.keys;_ads.isIE=!-[1],_ads.keys=g||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)e.call(a,c)&&b.push(c);return b},_ads.each=function(a,c,d){if(null!=a)if(f&&a.forEach===f)a.forEach(c,d);else if(a.length===+a.length){for(var e=0,g=a.length;g>e;e++)if(c.call(d,a[e],e,a)===b)return}else for(var h=_ads.keys(a),e=0,i=h.length;i>e;e++)if(c.call(d,a[h[e]],h[e],a)===b)return},_ads.getAppliedStyle=function(a,b){function c(a){var b=a.replace(/[A-Z]/g,function(a){return"-"+a.charAt(0).toLowerCase()});return b}function d(a){var b=a.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()});return b}var e="";return"opacity"==b&&_ads.isIE?e=a.filters("alpha").opacity/100:window.getComputedStyle?e=a.ownerDocument.defaultView.getComputedStyle(a,null).getPropertyValue(c(b)):a.currentStyle&&(e=a.currentStyle[d(b)]),e},_ads.setStyle=function(a,b,c){"opacity"==b&&_ads.isIE?a.style.filter="alpha(opacity="+100*c+")":void 0!==a.style[b]?a.style[b]=c:a[b]=c},_ads.events={withoutChildFunction:function(a){return function(b){for(var c=b.relatedTarget;c!=this&&c;)try{c=c.parentNode}catch(b){break}c!=this&&a(b)}},add:function(a,b,c,d){b=b.toLowerCase(),a.addEventListener?"mouseenter"===b?a.addEventListener("mouseover",this.withoutChildFunction(c),d):"mouseleave"===b?a.addEventListener("mouseout",this.withoutChildFunction(c),d):a.addEventListener(b,function(){c()},d):a.attachEvent?a.attachEvent("on"+b,function(){c()}):a["on"+b]=function(){c()}},remove:function(a,b,c){b=b.toLowerCase(),a.removeEventListener?a.removeEventListener(a,b,c):a.detachEvent&&a.detachEvent("on"+b,c)}}}.call(this);var template = function(a) {
function b(a, b) {
return '
";
}
function c(a, b, c, d) {
var e = '',
f = '';
return d ? e.replace("$img", f) : f;
}
function d(a, b, c, d) {
var e = '',
f = '';
return d ? e.replace("$flash", f) : f;
}
function e(a, b, c, d) {
var e = "adcode_" + a;
window[e] = function () {
try {
return decodeURIComponent(b);
} catch (a) {
return b;
}
}();
try {
document.domain = "pptv.com";
} catch (f) { }
return '';
}
function no_iframe(a, b, c, d) {
var e = "adcode_" + a;
window[e] = function () {
try {
return decodeURIComponent(b);
} catch (a) {
return b;
}
}();
try {
document.domain = "pptv.com";
} catch (f) { }
var adCode = "afp_" + a;
var adContainer = document.getElementById(adCode);
var html = '';
setHTML(adContainer ,html,true);
}
// o: container to set the innerHTML
// html: html text to set.
// clear: if true, the container is cleared first (children removed)
function setHTML(o, html, clear) {
if (clear) o.innerHTML = "";
// Generate a parseable object with the html:
var dv = document.createElement("div");
dv.innerHTML = html;
// Handle edge case where innerHTML contains no tags, just text:
if (dv.children.length===0){ o.innerHTML = html; return; }
for (var i = 0; i < dv.children.length; i++) {
var c = dv.children[i];
// n: new node with the same type as c
var n = document.createElement(c.nodeName);
// copy all attributes from c to n
for (var j = 0; j < c.attributes.length; j++)
n.setAttribute(c.attributes[j].nodeName, c.attributes[j].nodeValue);
// If current node is a leaf, just copy the appropriate property (text or innerHTML)
if (c.children.length == 0)
{
switch (c.nodeName)
{
case "SCRIPT":
if (c.text) n.text = c.text;
break;
default:
if (c.innerHTML) n.innerHTML = c.innerHTML;
break;
}
}
// If current node has sub nodes, call itself recursively:
else setHTML(n, c.innerHTML, false);
o.appendChild(n);
}
}
function set360Adv(a, showid, w, num) {
var bannerScript = document.createElement("script"),
img = document.createElement("img");
bannerScript.type = "text/javascript";
bannerScript.src = "//static.mediav.com/js/mvf_pm_slider.js";
img.src = "//sr4.pplive.cn/cms/21/14/6223fc49e3dc08a3cf4a9ab62b6315b2.png";
img.className = 'jiaobiao';
img.style.position = 'absolute';
img.style.left = 0;
img.style.bottom = 0;
img.style.width = '25px';
img.style.height = '15px';
img.style.zIndex = 1;
document.getElementsByTagName('head')[0].appendChild(bannerScript);
bannerScript.onload = bannerScript.onreadystatechange = function () {
if (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete') {
BANNER_SLIDER({ "w": w, "showid": showid, "rshowid": showid, "inject": "inlay", "layout": "magicCubeScene", "style": "magicCube", "row": "1", "line": num, "placeholderId": "afp_" + a.posid });
document.getElementById("afp_" + a.posid).appendChild(img);
}
};
}
a.cfg = {};
var f = document,
g = (f.body, f.getElementById("afp_" + a.posid));
if (g && a && a.material && a.material[0]) {
var h = a.material[0],
i = /\.(?:gif|GIF|jpg|JPG|jpeg|JPEG|png|PNG)/,
j = /\.(?:swf|SWF)/,
k = "";
if (a.extendedfield && a.extendedfield.js == 1) {// 360广告投放
var showid = 'Vc7zTx',
w = 700,
num = 8;
if (a.posid == 202514) {
showid = 'hgTEI9';
w = 310;
num = 1;
} else {
g.style.padding = '1px 0';
}
set360Adv(a, showid, w, num);
} else {
if (h.src && i.test(h.src)) {
k = c(h.src, h.w, h.h, h.ln);
} else {
if (h.src && j.test(h.src)) {
k = d(h.src, h.w, h.h, h.ln);
} else {
if (!h.src && h.text) {
if ("JS" == h.type) {
//是否需要在iframe中
if(h.isNeedIframe == 1 || h.isNeedIframe == ''){
k = e(a.posid, h.text, '100%', h.h);
}else{
k = no_iframe(a.posid, h.text, '100%', h.h);
}
} else {
h.type.indexOf("TEXTLINK") > -1 && (k = b(h.text, h.ln, h.tcol, h.tsize));
}
}
}
}
}
if (k) {
g.innerHTML = k;
}
var isStat = true;
g.style.display = "block";
if(isStat){a && a.stat && util.sendMonitor(a.stat);isStat=false;}
g.onclick = function () {
a.monitor && a.monitor.click && util.sendMonitor(a.monitor.click);
};
a.cfg && a.cfg.reflash && setTimeout(function () {
a._util.getdata(a._util.setPars(a.posid));
}, 1e3 * a.cfg.reflash);
if (a.posid && 201760 == a.posid) {
var l = "sp_callback_201760",
m = "";
"undefined" != typeof window[l] && window[l](m);
}
}
};var tpl = { '201046':function(d){ template(d);},'201047':function(d){ template(d);}};var dataPars = '201046_201047';var ppads_skeyword = "";var sectionid = "";var sidStr1= "";var _util={dataUrl:"//de.as.pptv.com/webdelivery/webafp?ap={pars}&ct=json&referrer={referrer}&o={o}&pageUrl={pageUrl}&username={username}&skeyword={skeyword}",dataZoneUrl:"//zone.pptv.com/pptv/webafp?ap={pars}&ct=json",pageUrl:window.location.href,getUid:function(){return self._aduid++},getRccId:function(){var reg=new RegExp("(^|\\?|&|#)"+"rcc_id"+"=([^]*)(&|#|$)","i");if(reg.test(location.href)){return decodeURIComponent(RegExp.$2.replace(/\+/g," "))}var d=(window.ppads_skeyword||"",util.get("sctx")||""),e=d&&util.queryToObject(d).o?util.queryToObject(d).o:"0";return e},log:function(a,b){b=b||"default";var c=encodeURIComponent,d={serviceUrl:"//web.data.pplive.com/pe/1.html?",newImg:new Image,adr:c(_util.pageUrl),sadr:"as.aplus.pptv.com",line:"0",et:"js",n:c("ERROR_"+b+"_"+a.message)},e=d.serviceUrl+"et="+d.et+"&adr="+d.adr+"&sadr="+d.sadr+"&n="+d.n+"&line="+d.line+"&t="+ +new Date;try{window.console&&console.error("As-aplus Error log : ",decodeURIComponent(e))}catch(f){}d.newImg.src=e,d.newImg=null},setPars:function(a,b){if(b&&b.indexOf("zone.pptv.com/pptv/")>-1){return _util.dataZoneUrl.replace("{pars}",a)}var c=util.get("PPName")?util.get("PPName").split("$")[0]:"",e=_util.getRccId();var sidStr,chidStr="";try{var isMobileWebCfg=(typeof(window.webcfg.result)!=="undefined")?true:false;sidStr=isMobileWebCfg?"&sid="+window.webcfg["result"]["web_config"]["cid"]:"&sid="+window.webcfg["id"];chidStr=isMobileWebCfg?"&chid="+window.webcfg["result"]["web_config"]["pid"]:"&chid="+window.webcfg["pid"]}catch(e){sidStr,chidStr=""}_util.dataUrl+=sidStr;_util.dataUrl+=chidStr;sectionid.length>0?_util.dataUrl+=sidStr1:"";return _util.dataUrl.replace("{pars}",a).replace("{referrer}",encodeURIComponent(document.referrer)).replace("{o}",encodeURIComponent(e)).replace("{pageUrl}",encodeURIComponent(_util.pageUrl)).replace("{username}",encodeURIComponent(c)).replace("{skeyword}",encodeURIComponent(ppads_skeyword))},pareData:function(a){var b;if(a&&"object"==typeof a){for(var c in a){b=a[c],b._util=_util;try{b&&tpl[c]&&tpl[c](b)}catch(d){_util.log(d,"pareData >> "+c)}b.monitor&&b.monitor.start&&b.monitorStart!==!1&&util.sendMonitor(b.monitor.start)}}},getdata:function(a){var b=document,c=b.createElement("script"),d=b.getElementsByTagName("head")[0],e="call"+_util.getUid();window[e]=_util.pareData,c.src=a+"&callback="+e,c.async=!0,c.charset="utf-8",d.insertBefore(c,d.firstChild)},parseQuery:function(a){if("string"==typeof a){for(var b,c={},d=a.split("&"),e=0;d[e];){b=d[e].split("="),c[b[0]]=b[1],e++}return c}var f=[];for(var g in a){f.push(g+"="+a[g])}return f.join("&")}};try{_util.getdata(_util.setPars(dataPars,window.location.href)),window.location.href.indexOf("debugadsystem")>-1&&window.console&&(this.debugadsystem=util)}catch(e){_util.log(e,"_util.getdata")};})();