Professional Documents
Culture Documents
if(typeof(mim_ad_params)==='object'){
for(var mim_ad_index in mim_ad_params){
ad.data[mim_ad_index] =
mim_ad_params[mim_ad_index];
}
}
var adSpan = "<span id='" + sn + "'
style='float:left;margin:0px;padding:0px;height:0px;width:0px;float:left;'
frameborder=0 scrolling='no' marginwidth='0' marginheight='0'></span>";
if(typeof(mim_ad_pos) !=="undefined"){
var adContainerDom =
document.getElementById(mim_ad_pos);
}else{
var adContainerDom = false;
}
if(ad.data.view_type ==1 &&
mim_isset(ad.data.view_position) && ad.data.view_position == 1){
api.writeBefore(adSpan,adContainerDom);
}else{
api.write(adSpan, adContainerDom);
}
if (!document.getElementById(sn)) {
var log = {
type: "write error",
sn: sn,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
var ctid = sn + "_ct";
var span = document.getElementById(ctid);
if (!span) {
var wrap = "";
if (typeof mim_sax_click_url_unesc != "undefined") {
ad.data.staff[0].landing_page = mim_sax_click_url_unesc
+ escape(ad.data.staff[0].landing_page)
}
switch (parseInt(ad.data.view_type)) {
case 2:
wrap = api.genFuChuangWrapper(ad,
ad.data.staff[0]);
break;
case 4:
if (ad.data.staff[0].type == 1 ||
ad.data.staff[0].type == "AD_IMAGE" || ad.data.staff[0].type == 2 ||
ad.data.staff[0].type == "AD_FLASH") {
api.renderBgAd(ad, ad.data.staff[0]);
return
}
break;
case 8:
api.renderDirect(ad, ad.data.staff[0]);
return;
break;
case 32:
wrap = api.genDitongWrapper(ad, ad.data.staff[0]);
break;
case 64:
api.renderMobileApp(ad, ad.data.staff[0]);
return;
break;
case 128:
api.renderMobileView(ad, ad.data.staff[0]);
return;
break;
case 256:
wrap = api.genChayeWrapper(ad, ad.data.staff[0]);
break;
case 512:
wrap = api.genDuiLianWrapper(ad, ad.data.staff[0]);
break;
case 1024:
case 1025:
default:
wrap = api.genNormal(ad, ad.data.staff[0])
}
if (ad.data.staff[0].type == 1 || ad.data.staff[0].type ==
"AD_IMAGE") {
this.renderPic(ad, ad.data.staff[0], wrap)
}else {
if (ad.data.staff[0].type == 5 || ad.data.staff[0].type
== "AD_REDIRECT") {
api.renderDirect(ad, ad.data.staff[0])
}
else {
if (ad.data.staff[0].type == 2 ||
ad.data.staff[0].type == "AD_FLASH") {
this.renderSwf(ad, ad.data.staff[0], wrap)
}
else {
if (ad.data.staff[0].type == 8 ||
ad.data.staff[0].type == "AD_JS") {
if (ad.data.staff[0].text.indexOf("http")
== -1) {
ad.data.staff[0].text = "http://" +
ad.data.staff[0].text
}
this.renderJs(ad, ad.data.staff[0], wrap)
}
else {
if (ad.data.staff[0].type == 7 ||
ad.data.staff[0].type == "AD_IFRAME") {
if
(ad.data.staff[0].text.indexOf("http") == -1) {
ad.data.staff[0].text = "http://" +
ad.data.staff[0].text
}
this.renderIFRAME(ad, ad.data.staff[0],
wrap)
}
else {
if (ad.data.staff[0].type == 5 ||
ad.data.staff[0].type == "AD_TEXT" || ad.data.staff[0].type == 6 ||
ad.data.staff[0].type == "AD_VIDEO" || ad.data.staff[0].type == 9 ||
ad.data.staff[0].type == "AD_HTML") {
this.renderHTML(ad,
ad.data.staff[0], wrap)
}
else {
if (
}els
}
}
}
}
}
}
}
object.addEventListener('mousedown', function(e){
_this
= this;
e.pr
mim_
mim_
mim_
mim_
this
wind
}, f
},
false);
object.addEventListener('touchstart', function(e){
_this
= this;
mim_
mim_
var
mim_
mim_
this
wind
if( Math.ab
e.pr
}
}, f
},
false);
}
}
}
delete api.Info[sn]
};
api.genToolbarWrapper = function(ad, staff) {
var newWidth = staff.width;
var newHeight = staff.height;
var wrap = document.createElement("div");
wrap.id = ad.sn + "_wrap";
var wrap_content =
document.createElement("div");
wrap_content.id = ad.sn + "_content";
wrap_content.style.margin = "auto";
wrap_content.style.width = newWidth +"px";
wrap_content.style.height = newHeight +"px";
wrap_content.style.position = 'fixed';
if(staff.has_text == 0 &&
parseInt(staff.width) < minPicSize){
wrap_content.style.display = 'none';
}
if(staff.colum1 == 4){
wrap_content.style.right = 0;
wrap_content.style.bottom = 0;
}
else if (staff.colum1 == 6) {
wrap_content.style.left = 0;
wrap_content.style.bottom = 0;
}
//api.createCloseBtn(ad, staff, wrap,
wrap_content, 7); //创建关é—按钮
wrap.appendChild(wrap_content);
return wrap;
}
function dragIt(e){
this.style.left = mim_params.initX + e.pageX - mim_params.firstX +
'px';
this.style.top = mim_params.initY + e.pageY - mim_params.firstY +
'px';
}
function swipeIt(e){
var contact = e.touches;
this.style.left = mim_params.initX + contact[0].pageX -
mim_params.firstX + 'px';
this.style.top = mim_params.initY + contact[0].pageY -
mim_params.firstY + 'px';
}
if(mim_isset(ad.data.view_position)){
var centerPos = (1 - (staff.width /
document.body.clientWidth))/2*100;
var centerPosV = (1 - (staff.height /
document.body.clientHeight))/2*100;
switch(ad.data.view_position) {
case "1":
wrap.style.top = "0px";
wrap.style.left = centerPos + "%";
break;
case "2":
wrap.style.top = "0px";
wrap.style.right = "0px";
break;
case "3":
wrap.style.top = centerPosV + "%";
wrap.style.right = "0px";
break;
case "5":
wrap.style.bottom = "0px";
wrap.style.left = centerPos + "%";
break;
case "6":
wrap.style.bottom = "0px";
wrap.style.left = "0px";
break;
case "7":
wrap.style.top = centerPosV + "%";
wrap.style.left = "0px";
break;
case "8":
wrap.style.top = "0px";
wrap.style.left = "0px";
break;
default:
wrap.style.right = "10px";
wrap.style.bottom = "250px";
wrap.style._position = "absolute";
wrap.style._bottom =
"expression(eval(document.compatMode && document.compatMode=='CSS1Compat')
? documentElement.scrollTop+(documentElement.clientHeight-
this.clientHeight) - 1 : document.body.scrollTop
+(document.body.clientHeight-this.clientHeight) - 1);"
wrap.style._right =
"expression(offsetParent.scrollRight);"
break;
}
}else{
wrap.style.right = "0px";
wrap.style.bottom = "0px";
}
var wrap_content = document.createElement("div");
wrap_content.id = ad.sn + "_content";
wrap_content.style.position = "relative";
wrap_content.style.width = "100%";
wrap_content.style.height = "100%";
api.createCloseBtn(ad, staff, wrap,
wrap_content, 2, false); //创建关é—按钮
wrap.appendChild(wrap_content);
return wrap
};
if( typeof(mim_ad_params)!=="undefined" ){
var _full = mim_isset(mim_ad_params.full) ? mi
var _width = mim_isset(mim_ad_params.width) ? mim_ad_pa
var _height = mim_isset(mim_ad_params.height) ?
mim_ad_params.height :null;
if(mim_isset(mim_ad_params.autoClose) &&
mim_ad_params.autoClose>0){
setTimeout("mim_hide_ad()",
mim_ad_params.autoClose);
}
if(_full != null){
wrap_content.style.width = "100%";
winWidth = document.body.clientWidth;
var newHeight = winWidth/_m_stuff.width *
_m_stuff.height;
wrap_content.style.height = newHeight +
"px";
}
if(_width != null){
if(_width == "full"){
wrap_content.style.width = "100%";
}else if(_width == "auto"){
wrap_content.style.width = "auto";
}{
wrap_content.style.width = _width +
"px";
}
}
if(_height != null){
if(_height == "full"){
wrap_content.style.height = "100%";
}else if(_height == "auto"){
wrap_content.style.height = "auto";
}else{
wrap_content.style.height = _height +
"px";
}
}
}
return wrap
};
if(mim_isset(ad.data.view_position)){
var centerPos = (1 - (staff.width /
document.body.clientWidth))/2*100;
var centerPosV = (1 - (staff.height /
document.body.clientHeight))/2*100;
switch(ad.data.view_position) {
case "1":
wrap.style.top = "0px";
wrap.style.left = centerPos + "%";
break;
case "2":
wrap.style.top = "0px";
wrap.style.right = "0px";
break;
case "3":
wrap.style.top = centerPosV + "%";
wrap.style.right = "0px";
break;
case "5":
wrap.style.bottom = "0px";
wrap.style.left = centerPos + "%";
break;
case "6":
wrap.style.bottom = "0px";
wrap.style.left = "0px";
break;
case "7":
wrap.style.top = centerPosV + "%";
wrap.style.left = "0px";
break;
case "8":
wrap.style.top = "0px";
wrap.style.left = "0px";
break;
default:
wrap.style.right = "0px";
wrap.style.bottom = "0px";
break;
}
}else{
wrap.style.right = "0px";
wrap.style.bottom = "0px";
}
var wrap_content = document.createElement("div");
wrap_content.id = ad.sn + "_content";
wrap_content.style.position = "relative";
wrap_content.style.width = "100%";
wrap_content.style.height = "100%";
api.createCloseBtn(ad, staff, wrap, wrap_content, 6); //创建关
api.createTip(ad, staff, wrap, wrap_content); //
创建广告敕示
wrap.appendChild(wrap_content);
return wrap
};
//创建关é—按钮
api.createCloseBtn(ad, staff, wrap, wrap_content, 7);
api.createTip(ad, staff, wrap, wrap_content); //
创建广告敕示
wrap.appendChild(wrap_content);
wrap.appendChild(chaye_bg);
return wrap;
};
c_wrap.appendChild(tip_wrap);**/
wrap_content.appendChild(c_wrap);
}
api.createUnion = function(p,ad){
if(mim_union === false){
return ;
}
if(ad.data.w < 10 || ad.data.h < 10){
return;
}
if(typeof(mim_union) === "object"
||(typeof(ad.data.webunion_text)!=="undefined"&&typeof(ad.data.webunion_org
)!=="undefined" )){
if(typeof(mim_union) !== "object"){
mim_union = {};
}
/*if( typeof(ad.data.webunion_text)!=="undefined" ){
mim_union.text = ad.data.webunion_text;
}
if( typeof(ad.data.webunion_org)!=="undefined" ){
mim_union.text_short = ad.data.webunion_org;
}
if( typeof(ad.data.webunion_link)!=="undefined" ){
mim_union.link = ad.data.webunion_link;
}*/
if(typeof(mim_union.text)!=="undefined" &&
typeof(mim_union.text_short)!=="undefined" && mim_union.text_short.length >
0 ){
var union_html =
document.createElement('a');
union_html.id = "ad_supplier";
if(typeof(mim_union.link)!=="undefined"){
union_html.href = mim_union.link;
union_html.target = "_blank";
}
union_html.innerHTML = '<em>' +
mim_union.text + '</em><span>' + mim_union.text_short + '</span>';
var union_style=
document.createElement('style');
union_style.innerHTML =
"a#ad_supplier{display: block; cursor:pointer; position: absolute; top: 0;
left: 0; height: 1.5rem; padding:0 5px; overflow: hidden; background:
rgba(0,0,0,0.8); color:#FFFFFF; font-size:0.8rem; font-family:Microsoft
Yahei; text-decoration:none; text-align:center; line-height: 1.5rem;
outline: 0;}a#ad_supplier em{display:none; font-
style:normal;}a#ad_supplier:hover{padding:0 10px; background:
rgba(0,0,0,0.5);}a#ad_supplier:hover em{display:inline;}a#ad_supplier:hover
span{display:none;}";
p.append(union_html);
p.append(union_style);
}
}
}
wrap.appendChild(wrap_content);
var p = document.createElement("div");
var c = '<div id="ad_colse_container" style="position: absolute;
right: 0px; top: 0px; z-index:
2147483647;display:none;">'+closeDiv+'</div>';
var html = '<div id="'+ad.sn+'_div" style="width:100%;
height:100%; overflow :hidden; position:fixed; left:0px; top:0px;z-
index:998;"><div style=" right:0px; bottom:0px; position:absolute;z-
index:999;font-size: 0;">' + c + '<img style="width:' + staff.width +
"px;height:" + staff.height + 'px;"
onclick="BCMain.renderMobileViewIframe(\'' + ad.sn + "','" +
staff.landing_page + "');BCMain.click_js('" + click_js + "','" +
escape(ad.data.third_click_js) + "','" + ad.sn + "','" + ad.data.aid +
"','"+ad.data.pushid + '\');" src="' + staff.addr + '" /></div> <iframe
style="border:0; transition:width 0.5s; -moz-transition:width 0.5s; -
webkit-transition:width 0.5s; -o-transition:width 0.5s;
position:fixed;right:0px;" id="' + ad.sn + '_i" width="0" height="0" src=""
border="0" scroll="no" ></iframe></div> ';
p.innerHTML = html;
wrap.childNodes[0].appendChild(p);
var d = document.getElementById(ad.sn);
if (!d || !d.parentNode) {
var log = {
type: "show error",
typecode: "pic",
error: "get adid empty",
sn: ad.sn,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
else {
d.parentNode.insertBefore(wrap, d)
}
api.show_js(show_js, escape(ad.data.third_show_js), ad.sn,
ad.data.aid, ad.data.pushid);
var log = {
type: "show ok",
typecode: "bg",
aid: ad.data.aid,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
};
api.renderMobileViewIframe = function(sn, addr){
var iframe = document.getElementById(sn + "_i");
var src = iframe.getAttribute("src");
if (!src) {
iframe.src = addr;
console.log("EM")
}
var width = iframe.getAttribute("width");
if (width == 0) {
iframe.width = "100%";
iframe.height = "100%"
}else {
iframe.width = "0";
iframe.height = "0"
}
iframe.border = "0";
};
api.renderMobileApp = function(ad, staff){
var para = "?";
if (typeof ad.data.aid != "undefined") {
para += "&aid=" + ad.data.aid
}
if (typeof ad.data.pushid != "undefined") {
para += "&pushid=" + ad.data.pushid
}
if (typeof ad.data.spid != "undefined") {
para += "&spid=" + ad.data.spid
}
if (typeof ad.data.cid != "undefined") {
para += "&cid=" + ad.data.cid
}
if (typeof ad.data.src != "undefined") {
para += "&src=" + ad.data.src
}
if (typeof staff.slotid != "undefined") {
para += "&slotid=" + staff.slotid
}
var click_js = ad.data.click_js + para;
var show_js = ad.data.show_js + para;
api.load("http://cdn.tanx.com/t/tanxmobile/mraid.js", function(){
var img = document.createElement("img");
img.style.width = staff.width + "px";
img.style.height = staff.height + "px";
img.onload = function(){
mraid.show();
api.show_js(show_js, escape(ad.data.third_show_js), ad.sn,
ad.data.aid,ad.data.pushid);
var log = {
type: "show ok",
typecode: "bg",
aid: ad.data.aid,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
};
img.src = staff.addr;
img.onclick = function(){
mraid.open(staff.landing_page);
api.click_js(click_js, escape(ad.data.third_click_js),
ad.sn, ad.data.aid,ad.data.pushid);
return false
};
wrap = api.genNormal(ad, staff);
wrap.childNodes[0].appendChild(img);
var d = document.getElementById(ad.sn);
if (!d || !d.parentNode) {
var log = {
type: "show error",
typecode: "pic",
error: "get adid empty",
sn: ad.sn,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
else {
d.parentNode.insertBefore(wrap, d)
}
})
};
api.renderDirect = function(ad, staff){
var para = "?";
if (typeof ad.data.aid != "undefined") {
para += "&aid=" + ad.data.aid
}
if (typeof ad.data.pushid != "undefined") {
para += "&pushid=" + ad.data.pushid
}
if (typeof ad.data.spid != "undefined") {
para += "&spid=" + ad.data.spid
}
if (typeof ad.data.cid != "undefined") {
para += "&cid=" + ad.data.cid
}
if (typeof ad.data.src != "undefined") {
para += "&src=" + ad.data.src
}
if (typeof staff.slotid != "undefined") {
para += "&slotid=" + staff.slotid
}
var click_js = ad.data.click_js + para;
var show_js = ad.data.show_js + para;
api.show_js(show_js, escape(ad.data.third_show_js), ad.sn,
ad.data.aid,ad.data.pushid);
var log = {
type: "show ok",
typecode: "bg",
aid: ad.data.aid,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log);
api.click_js(click_js, escape(ad.data.third_click_js), ad.sn,
ad.data.aid,ad.data.pushid);
staff.landing_page = staff.landing_page.replace("%URL%",
document.location);
if (staff.landing_page.indexOf("http") == -1) {
staff.landing_page = "http://" + staff.landing_page
}
setTimeout(function(){
try {
top.location.replace(staff.landing_page)
}
catch (e) {
document.location.replace(staff.landing_page)
}
}, 1000)
};
api.renderBgAd = function(ad, staff){
var para = "?";
if (typeof ad.data.aid != "undefined") {
para += "&aid=" + ad.data.aid
}
if (typeof ad.data.pushid != "undefined") {
para += "&pushid=" + ad.data.pushid
}
if (typeof ad.data.spid != "undefined") {
para += "&spid=" + ad.data.spid
}
if (typeof ad.data.cid != "undefined") {
para += "&cid=" + ad.data.cid
}
if (typeof ad.data.src != "undefined") {
para += "&src=" + ad.data.src
}
if (typeof staff.slotid != "undefined") {
para += "&slotid=" + staff.slotid
}
var click_js = ad.data.click_js + para;
var show_js = ad.data.show_js + para;
if (staff.landing_page.indexOf("http") == -1) {
staff.landing_page = "http://" + staff.landing_page
}
api.api_bg_loading(staff.landing_page, show_js,
ad.data.third_show_js, click_js, ad.data.third_click_js, ad.sn,
ad.data.aid, ad.data.pushid)
};
api.renderPic = function(ad, staff, wrap){
var p = document.createElement("div");
if (ad.data.view_type != 1 && ad.data.view_type != 32 &&
ad.data.view_type != 256) {
p.style.height = ad.data.h + "px";
}
p.style.width = "100%";
p.style.overflow = "hidden";
p.style.fontSize = "0";
var para = "?";
if (typeof ad.data.aid != "undefined") {
para += "&aid=" + ad.data.aid
}
if (typeof ad.data.pushid != "undefined") {
para += "&pushid=" + ad.data.pushid
}
if (typeof ad.data.spid != "undefined") {
para += "&spid=" + ad.data.spid
}
if (typeof ad.data.cid != "undefined") {
para += "&cid=" + ad.data.cid
}
if (typeof ad.data.src != "undefined") {
para += "&src=" + ad.data.src
}
if (typeof staff.slotid != "undefined") {
para += "&slotid=" + staff.slotid
}
var click_js = ad.data.click_js + para;
var show_js = ad.data.show_js + para;
var href = "";
if (typeof staff.landing_page != "undefined" && staff.landing_page
!= "undefined") {
if (staff.landing_page.indexOf("http") == -1) {
staff.landing_page = "http://" + staff.landing_page
}
//href = " href='http://" + api._redirect +
"/stat.log.redirect?url=" + escape(staff.landing_page) + "' ";
var href = " href='"+staff.landing_page+"' ";
}
if(ad.data.view_type == 1 || ad.data.view_type == 32 ||
ad.data.view_type == 256){
p.innerHTML = "<a
onclick='javascript:BCMain.click_js(\"" + click_js + '","' +
escape(ad.data.third_click_js) + '","' + ad.sn + '","' + ad.data.aid +'","'
+ ad.data.pushid + "\");' style='' " + href + " target='_blank'><img
width='100%' src='" + staff.addr + "'/></a>";
}else{
p.innerHTML = "<a onclick='javascript:BCMain.click_js(\"" +
click_js + '","' + escape(ad.data.third_click_js) + '","' + ad.sn + '","' +
ad.data.aid +'","'+ad.data.pushid+ "\");' style='' " + href + "
target='_blank'><img width='100%' height='" + staff.height + "' src='" +
staff.addr + "'/></a>";
}
api.createUnion(p,ad);
api.show_js(show_js, escape(ad.data.third_show_js), ad.sn,
ad.data.aid,ad.data.pushid);
if (wrap != "") {
wrap.childNodes[0].appendChild(p)
}
var d = document.getElementById(ad.sn);
if (!d || !d.parentNode) {
var log = {
type: "show error",
typecode: "pic",
error: "get adid empty",
sn: ad.sn,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}else {
if (wrap != "") {
d.parentNode.appendChild(wrap);
if(ad.data.view_type == 512){
var closeHtml =
document.createElement("div");
closeHtml.style.width = "100%";
closeHtml.style.background =
"rgba(0,0,0,0.7)";
closeHtml.style.fontSize = "10px";
closeHtml.style.lineHeight = "22px";
closeHtml.style.textAlign = "center";
closeHtml.style.color = "#FFFFFF";
closeHtml.style.cursor = "pointer";
closeJs =
"javascript:document.getElementById('" + wrap.id +
"').style.display='none'; javascript:document.getElementById('" + wrap.id +
"_right').style.display='none';";
closeHtml.setAttribute("onclick",
closeJs);
if(staff.has_text == 0 &&
parseInt(staff.width) < minPicSize){
closeHtml.style.display =
'none';
}
closeHtml.innerText = "close";
wrap.appendChild(closeHtml);
var node =
document.getElementById(wrap.id).parentNode.lastChild.cloneNode(true);
node.id = node.id+"_right";
node.style.left = "auto";
document.getElementById(wrap.id).parentNode.appendChild(node);
}
}else {
d.parentNode.insertBefore(p, d);
}
var log = {
type: "show ok",
typecode: "pic",
aid: ad.data.aid,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
};
api.renderSwf = function(ad, staff, wrap){
var p = document.createElement("div");
p.style.height = ad.data.h + "px";
p.style.width = "100%";
p.style.overflow = "hidden";
var para = "?";
if (typeof ad.data.aid != "undefined") {
para += "&aid=" + ad.data.aid
}
if (typeof ad.data.pushid != "undefined") {
para += "&pushid=" + ad.data.pushid
}
if (typeof ad.data.spid != "undefined") {
para += "&spid=" + ad.data.spid
}
if (typeof ad.data.cid != "undefined") {
para += "&cid=" + ad.data.cid
}
if (typeof ad.data.src != "undefined") {
para += "&src=" + ad.data.src
}
if (typeof staff.slotid != "undefined") {
para += "&slotid=" + staff.slotid
}
var click_js = ad.data.click_js + para;
var show_js = ad.data.show_js + para;
var h = '<div style="height: ' + ad.data.h + "px; width: " +
ad.data.w + 'px; overflow: hidden;position:relative;margin:auto;">';
if (typeof staff.landing_page != "undefined" && staff.landing_page
!= "undefined") {
if (staff.landing_page.indexOf("http") == -1) {
staff.landing_page = "http://" + staff.landing_page
}
//var href = "http://" + api._redirect +
"/stat.log.redirect?url=" + escape(staff.landing_page);
var href = " href='"+staff.landing_page+"' ";
h += "<a onclick=\"javascript:BCMain.click_js('" + click_js +
"','" + escape(ad.data.third_click_js) + "','" + ad.sn + "','" +
ad.data.aid + "','"+ad.data.pushid + '\');" ' + href + ' target="_blank"
style="position: absolute;left:0px;top: 0px;width:' + ad.data.w +
"px;height:" + ad.data.h + 'px">';
h += '<object type="img/gif" style="border:0px" border=0>';
h += '<img width="100%" src="http://' + api._js +
'/assets/images/null.gif" style="border:0px" height="100%" />';
h += "</object>";
h += "</a> "
}
h += '<object width="' + ad.data.w + '" height="' + ad.data.h +
'">';
h += '<param name="movie" value="' + staff.addr + '">';
h += '<param name="wmode" value="transparent">';
h += '<embed src="' + staff.addr + '" type="application/x-
shockwave-flash" menu="false" wmode="transparent" style="width:' +
ad.data.w + "px;height:" + ad.data.h + 'px"/>';
h += "</object>";
h += "</div>";
p.innerHTML = h;
api.createUnion(p,ad);
if (wrap != "") {
wrap.childNodes[0].appendChild(p)
}
api.show_js(show_js, escape(ad.data.third_show_js), ad.sn,
ad.data.aid, ad.data.pushid);
var d = document.getElementById(ad.sn);
if (!d || !d.parentNode) {
var log = {
type: "show error",
typecode: "swf",
error: "get adid empty",
sn: ad.sn,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
else {
if (wrap != "") {
d.parentNode.appendChild(wrap);
//d.parentNode.insertBefore(wrap, d);
if(ad.data.view_type == 512){
var closeHtml =
document.createElement("div");
closeHtml.style.width = "100%";
closeHtml.style.background =
"rgba(0,0,0,0.7)";
closeHtml.style.fontSize = "10px";
closeHtml.style.lineHeight = "22px";
closeHtml.style.textAlign = "center";
closeHtml.style.color = "#FFFFFF";
closeHtml.style.cursor = "pointer";
closeJs =
"javascript:document.getElementById('" + wrap.id +
"').style.display='none'; javascript:document.getElementById('" + wrap.id +
"_right').style.display='none';";
closeHtml.setAttribute("onclick",
closeJs);
closeHtml.innerText = "close";
wrap.appendChild(closeHtml);
var node =
document.getElementById(wrap.id).parentNode.lastChild.cloneNode(true);
node.id = node.id+"_right";
node.style.left = "auto";
document.getElementById(wrap.id).parentNode.appendChild(node);
}
}
else {
d.parentNode.insertBefore(p, d);
}
var log = {
type: "show ok",
typecode: "swf",
aid: ad.data.aid,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
};
api.renderJs = function(ad, staff, wrap){
var click_js = show_js = "";
var para = "?";
if (typeof ad.data.aid != "undefined") {
para += "&aid=" + ad.data.aid
}
if (typeof ad.data.pushid != "undefined") {
para += "&pushid=" + ad.data.pushid
}
if (typeof ad.data.spid != "undefined") {
para += "&spid=" + ad.data.spid
}
if (typeof ad.data.cid != "undefined") {
para += "&cid=" + ad.data.cid
}
if (typeof ad.data.src != "undefined") {
para += "&src=" + ad.data.src
}
if (typeof staff.slotid != "undefined") {
para += "&slotid=" + staff.slotid
}
if (ad.data.click_js) {
click_js = ad.data.click_js + para
}
if (ad.data.show_js) {
show_js = ad.data.show_js + para
}
var href = "";
if (typeof staff.landing_page != "undefined" && staff.landing_page
!= "undefined") {
if (staff.landing_page.indexOf("http") == -1) {
staff.landing_page = "http://" + staff.landing_page
}
//href = " href='http://" + api._redirect +
"/stat.log.redirect?url=" + escape(staff.landing_page) + "' ";
var href = " href='"+staff.landing_page+"' ";
}
if (show_js != "") {
api.show_js(show_js, escape(ad.data.third_show_js), ad.sn,
ad.data.aid, ad.data.pushid)
}
// api.createTip(ad, staff, wrap, wrap_content); //
创建广告敕示
var d = document.getElementById(ad.sn);
if (!d || !d.parentNode) {
var log = {
type: "show error",
typecode: "js",
error: "get adid empty",
sn: ad.sn,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
else {
var jsUrl =
staff.text.indexOf('?') > -1 ? (staff.text + '&cdmid=' + ad.sn + '_wrap') :
staff.text;
api.js(jsUrl, function(){});
var log = {
type: "show ok",
typecode: "js",
aid: ad.data.aid,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
};
api.renderIFRAME = function(ad, staff, wrap){
var click_js = show_js = "";
var para = "?";
if (typeof ad.data.aid != "undefined") {
para += "&aid=" + ad.data.aid
}
if (typeof ad.data.pushid != "undefined") {
para += "&pushid=" + ad.data.pushid
}
if (typeof ad.data.spid != "undefined") {
para += "&spid=" + ad.data.spid
}
if (typeof ad.data.cid != "undefined") {
para += "&cid=" + ad.data.cid
}
if (typeof ad.data.src != "undefined") {
para += "&src=" + ad.data.src
}
if (typeof staff.slotid != "undefined") {
para += "&slotid=" + staff.slotid
}
if (ad.data.click_js) {
click_js = ad.data.click_js + para
}
if (ad.data.show_js) {
show_js = ad.data.show_js + para
}
var href = "";
if (typeof staff.landing_page != "undefined" && staff.landing_page
!= "undefined") {
if (staff.landing_page.indexOf("http") == -1) {
staff.landing_page = "http://" + staff.landing_page
}
//href = " href='http://" + api._redirect +
"/stat.log.redirect?url=" + escape(staff.landing_page) + "' ";
var href = " href='"+staff.landing_page+"' ";
}
var p = document.createElement("iframe");
p.frameBorder = "0";
p.style.overflow = "hidden";
p.style.border = "0px";
p.style.cssFloat = "left";
p.style.width = "100%";
p.style.height = "100%";
p.setAttribute("sn", ad.sn);
p.setAttribute("src", staff.text);
p.setAttribute("aid", ad.data.aid);
p.setAttribute("scrolling", "no");
api.createUnion(p,ad);
if (ad.data.third_click_js) {
p.setAttribute("third_click_js", ad.data.third_click_js)
}
if (show_js != "") {
api.show_js(show_js, escape(ad.data.third_show_js), ad.sn,
ad.data.aid, ad.data.pushid)
}
var d = document.getElementById(ad.sn);
if (!d || !d.parentNode) {
var log = {
type: "show error",
typecode: "js",
error: "get adid empty",
sn: ad.sn,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
else {
if (wrap != "") {
wrap.childNodes[0].appendChild(p);
api.writeO(wrap, d);
if(ad.data.view_type == 512){
var closeHtml =
document.createElement("div");
closeHtml.style.width = "100%";
closeHtml.style.background =
"rgba(0,0,0,0.7)";
closeHtml.style.fontSize = "10px";
closeHtml.style.lineHeight = "22px";
closeHtml.style.textAlign = "center";
closeHtml.style.color = "#FFFFFF";
closeHtml.style.cursor = "pointer";
closeJs =
"javascript:document.getElementById('" + wrap.id +
"').style.display='none'; javascript:document.getElementById('" + wrap.id +
"_right').style.display='none';";
closeHtml.setAttribute("onclick",
closeJs);
closeHtml.innerText = "close";
wrap.appendChild(closeHtml);
var node =
document.getElementById(wrap.id).parentNode.lastChild.cloneNode(true);
node.id = node.id+"_right";
node.style.left = "auto";
document.getElementById(wrap.id).parentNode.appendChild(node);
}
}
else {
api.writeO(p, d)
}
var log = {
type: "show ok",
typecode: "js",
aid: ad.data.aid,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
};
api.createCss = function(href){
var head = document.getElementsByTagName('HEAD').item(0);
ele = document.createElement("link");
ele.type = "text/css";
ele.rel = "stylesheet";
ele.href = href;
head.appendChild(ele);
}
this.createCss("http://"+api._js+"/assets_admin/css/video-js.css");
this.createCss("http://"+api._js+"/assets_admin/css/videojs.ads.css");
this.createCss("http://"+api._js+"/assets_admin/css/videojs.vast.css");
api.load("http://"+api._js+"/assets_admin/js/video.js","http://"+ap
i._js+"/assets_admin/js/videojs.ads.js","http://"+api._js+"/assets_admin/js
/vast-
client.js","http://"+api._js+"/assets_admin/js/videojs.vast.js","http://"+a
pi._js+"/assets_admin/js/es5.js",function() {
var video_content = '';
var video_width = 320;
var video_height = 480;
var p = document.createElement("div");
p.setAttribute('class', 'video-body');
/* by zx 2018-01-05 no height */
//height:'+video_height+'px; width:'+video_width+'px; margin:0 auto;
top:50%; left:50%; margin-top:-'+video_height/2+'px; margin-left:-
'+video_width/2+'px;
// video_content +='<div class="video-body">';
video_content += '<div class="bc-video-container"
id="video-container" style="position:absolute;display:none;">';
video_content += '<video id="vid2" class="video-js
vjs-default-skin vjs-big-play-centered" autoplay controls preload="auto"
poster="#" data-setup="{}" height="auto" width="auto">';
//video_content += '<source src="#"
type="video/mp4">';
//video_content += '<source src="#"
type="video/webm">';
//video_content += '<source src="#"
type="video/ogg">';
video_content += '<p>Video Playback Not
Supported</p>';
video_content += '</video>';
video_content += '<div style="position:absolute;
top:0px; right:0; width:30px; height:30px;display: none;"><a
onClick="javascript:document.getElementById(\'video-
container\').style.display = \'none\';
document.getElementById(\'vid2_html5_api\').muted = true;"
style="width:30px;height:30px;float:right;background:url(/assets_admin/img/
close2.png);"></a></div>';
video_content += '</div>';
//video_content += '</div>';
p.innerHTML = video_content;
wrap.childNodes[0].style.display = 'block';
wrap.childNodes[0].appendChild(p);
var d = document.getElementById(ad.sn);
if (!d || !d.parentNode) {
var log = {
type: "show error",
typecode: "pic",
error: "get adid empty",
sn: ad.sn,
pushid: ad.data.pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
}
else {
d.parentNode.insertBefore(wrap, d)
}
api.createTip(ad, staff, wrap,
wrap.querySelector('#video-container')); // 创建广告敕示
api.createCloseBtn(ad, staff, wrap, wrap.querySelector('#video-
container'), 0); //创建关é—按钮
// document.body.innerHTML = video_content;
var vid2 =
videojs('vid2',{preload:"auto",autoplay:true},function(){
this.play();
});
vid2.muted(false);
vid2.ads();
vid2.vast({
url: staff.text
});
setTimeout("document.getElementById('video-
container').style.display = 'none';
document.getElementById('vid2_html5_api').muted =
true;",ad.data.view_time);
});
}
if(typeof(mim_params)==='object'){
for(var mim_index in mim_params){
para +=
"&"+mim_index+"="+mim_params[mim_index]
}
}
var w_width = document.body.clientWidth ? document.body.clientWidth
: document.body.scrollWidt;
var s_width = window.screen.width ? window.screen.width :
window.screen.availHeight;
var zoom = w_width / s_width;
if (zoom == 1) {
para += "&mobileFixed=1"
}
else {
para += "&mobileFixed=0"
}
para += "&width_page=" + w_width;
para += "&width_screen=" + s_width;
para += "&url=" + escape(window.location.href);
mim_aid = mim_spid = mim_src = mim_viewtype = mim_w = mim_h =
mim_atype = mim_pushid = mim_slotid = undefined;
var log = {
type: "start",
pushid: pushid,
sn: sn,
referer: document.referrer,
url: document.location.href
};
api.log(log);
if (typeof mim_infod != "undefined") {
_ads = "http://" + mim_infod + "/"
}
else {
_ads = "http://" + api._ads + "/"
}
api.InfoJS = _ads + "info.js" + para;
api.js(api.InfoJS, function(){
if( typeof(api.Info[sn].errno) === "number" &&
api.Info[sn].errno == 1 ){
if(typeof(mim_reload_when_error)!=="undefined" &&
mim_reload_when_error == 1){
api.js(api.InfoJS+"&condition=no_ad",
function(){
var log = {
type: "loaded",
pushid: pushid,
sn: sn,
referer: document.referrer,
url: document.location.href
};
api.log(log);
api.run(sn)
})
}
}else{
var log = {
type: "loaded",
pushid: pushid,
sn: sn,
referer: document.referrer,
url: document.location.href
};
api.log(log);
api.run(sn);
setTimeout("mim_auto_close()",duration);
}
})
};
api.api_bg_show_js = function(){
api.show_js(api._bg_show_js, escape(api._bg_thrid_show_js),
api._bg_sn, api._bg_aid, ad.data.pushid);
var log = {
type: "show ok",
typecode: "bg",
aid: api._bg_aid,
pushid: api._bg_pushid,
referer: document.referrer,
url: document.location.href
};
api.log(log)
};
api.api_bg_click_js = function(){
api.click_js(api._bg_click_js, escape(api._bg_thrid_click_js),
api._bg_sn, api._bg_aid,api._bg_pushid)
};
api.api_bg_loading = function(url, show_js, third_show_js, click_js,
third_click_js, sn, aid, pushid){
api._bg_url = api.url = url;
api._bg_show_js = show_js;
api._bg_thrid_show_js = third_show_js;
api._bg_click_js = click_js;
api._bg_thrid_click_js = third_click_js;
api._bg_aid = aid;
api._bg_sn = sn;
api._bg_pushid = pushid;
this.api_bg_set_parameter(url);
if (this.ver.ie || this.ver.tt) {
api.write(this.ver._d1);
api.write(this.ver._d2)
}
if (this.ver.cr || this.ver.sf) {
api.write(this.ver._d4)
}
this.api_bg_open();
window.focus()
};
api.api_bg_set_parameter = function(url){
this.d = document;
this.u = navigator.userAgent;
this.stimer = 0;
this.w = window.screen.width;
this.h = window.screen.height;
this.url = url;
this.ver = {
ie: /MSIE/.test(this.u),
ie6: !/MSIE 7\.0/.test(this.u) && /MSIE 6\.0/.test(this.u) &&
!/MSIE 8\.0/.test(this.u) && !/MSIE 9\.0/.test(this.u),
oldie: /MSIE 6\.0/.test(this.u) || /MSIE 7\.0/.test(this.u) ||
/MSIE 8\.0/.test(this.u),
tt: /TencentTraveler/.test(this.u),
i360: /360SE/.test(this.u),
webkit: /WebKit/.test(this.u),
cr: /Chrome/.test(this.u),
cr27: /Chrome\/27/.test(this.u),
ff: /Firefox/.test(this.u),
sf: /Safari/.test(this.u),
op: /Opera/.test(this.u),
sg: /MetaSr/.test(this.u) && /WebKit/.test(this.u),
sgall: /MetaSr/.test(this.u),
mt: /Maxthon/.test(this.u) && /WebKit/.test(this.u),
mtie: /Maxthon/.test(this.u) && /IE/.test(this.u),
gg: window.google && window.chrome,
_d1: '<object id="_pp_xcy_01" width="0" height="0"
classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"></object>',
_d2: '<object id="_pp_xcy_02"
style="position:absolute;left:1px;top:1px;width:1px;height:1px;"
classid="clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A"></object>',
_d4: '<div id="_pp_xcy_04" style="display:none"><form action="'
+ this.url + '" method="get" name="__form_xcy" target="_blank"><input
type="submit" style="display:none" id="__sumit_xcy"/></form></div>'
}
};
api.api_bg_kdopen = function(){
try {
document.forms.__form_xcy.submit()
}
catch (e) {
document.getElementById("__sumit_xcy").click()
}
window.focus()
};
api.api_bg_reopen = function(){
this.api_bg_open()
};
api.api_bg_open = function(){
api.api_bg_show_js();
if (this.ver.sg && this.ver.sf) {
if (this.api_bg_interceptClick()) {
api.api_bg_click_js();
return
}
}
if (!this.ver.gg && !this.ver.cr && !this.ver.op && !this.ver.sg &&
!this.ver.mt && !this.ver.sf) {
if (this.api_bg_wopen()) {
api.api_bg_click_js();
return
}
}
else {
if (this.ver.webkit && !this.ver.sg && !this.ver.mt &&
!this.ver.cr27) {
if (this.api_bg_wopen()) {
api.api_bg_click_js();
return
}
}
}
if (api.stimer == 0) {
api.stimer = setTimeout("BCMain.api_bg_init()", 15)
}
};
api.api_bg_hrefopen = function(){
try {
var c = document.createElement("a");
c.setAttribute("href", api.url);
c.setAttribute("target", "_blank");
c.setAttribute("style", "display:none;");
var b = document.createEvent("MouseEvents");
b.initMouseEvent("click", false, false, window, 0, 0, 0, 0, 0,
true, false, false, false, 0, null);
c.dispatchEvent(b);
return true
}
catch (q) {
return false
}
};
api.api_bg_wopen = function(){
if (this.ver.ie || this.ver.tt) {
document.getElementById("_pp_xcy_01");
document.getElementById("_pp_xcy_02");
var obj = document.getElementById("_pp_xcy_02");
if (!obj) {
return
}
var wPop = null;
if (!this.ver.ie6) {
try {
var wPop = obj.DOM.Script.open(api.url, "_blank", b);
if (wPop) {
try {
wPop.blur();
window.focus();
wPop.focus();
return true
}
catch (q) {
}
}
}
catch (q) {
}
}
try {
if (this.ver.ie6 && !this.ver.sgall) {
setTimeout(function(){
var obj = document.getElementById("_pp_xcy_02");
try {
var wPop = obj.DOM.Script.open(api.url,
"_blank", "");
if (wPop) {
wPop.blur();
window.focus()
}
else {
if (a.ver.sg) {
}
}
}
catch (q) {
}
}, 10);
document.getElementById("_pp_xcy_01").launchURL(api.url, "_blank")
}
else {
document.getElementById("_pp_xcy_01").launchURL(api.url)
}
return true
}
catch (q) {
}
}
var b = "height=" + api.h + ",width=" + api.w +
",left=0,top=0,toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=y
es,resizable=yes";
if (this.ver.sg || this.ver.mt) {
var j = 'window.open("/", "_blank", "' + b + '")'
}
else {
if (!this.ver.mtie) {
var j = 'window.open("' + api.url + '", "_blank", "' + b +
'")'
}
}
var m = null;
try {
m = eval(j)
}
catch (q) {
}
if (m) {
if (this.ver.sg || this.ver.mt) {
m.location.href = api.url
}
try {
m.blur();
window.focus();
return true
}
catch (q) {
}
return m
}
return false
};
api.api_bg_interceptClick = function(){
var tmpId = "__lgUnion_a__" + Math.ceil(Math.random() * 100);
var tmp = document.createElement("a");
tmp.href = bql_ed_open_url;
tmp.id = tmpId;
tmp.target = "_blank";
tmp.style.position = "absolute";
tmp.style.zIndex = "2147483647";
tmp.style.backgroundColor = "#fff";
tmp.style.opacity = "0.01";
tmp.style.filter = "alpha(opacity:1)";
tmp.style.display = "block";
tmp.style.top = "0px";
tmp.style.left = "0px";
document.body.appendChild(tmp);
var el = document.getElementById(tmp.id);
var m = setInterval(function(){
var d = document.body;
e = document.documentElement;
document.compatMode == "BackCompat" ? t = d.scrollTop : t =
e.scrollTop == 0 ? d.scrollTop : e.scrollTop;
el.style.top = t + "px";
el.style.width = "100%";
if (d.clientHeight < 500) {
el.style.height = 600 + "px"
}
else {
el.style.height = d.clientHeight + "px"
}
}, 200);
api.api_bg_linkUp(tmpId);
el.onclick = function(e){
api.api_bg_removeInterceptClick(el, m);
this.firstcgm = null
};
if (this.firstcgel == null) {
this.firstcgel = el;
this.firstcgm = m
}
};
api.api_bg_removeInterceptClick = function(el, m){
setTimeout(function(){
el.parentNode.removeChild(el)
}, 200);
clearInterval(m)
};
api.api_bg_linkUp = function(obj){
var tmp = document.getElementsByTagName("a");
var tmps = tmp.length;
for (var i = 0; i < tmps; i++) {
if (tmp[i].id.indexOf(obj) != -1) {
tmp[i].style.zIndex = 2147483647;
tmp[i].style.display = "block"
}
else {
if (tmp[i].style.zIndex == 2147483647) {
tmp[i].style.zIndex--
}
}
}
};
api.api_bg_clickpppp = function(){
api.api_bg_uinit();
BCMain.api_bg_click_js();
var m = api.api_bg_wopen();
return m
};
api.api_bg_uinit = function(){
try {
if (api.stimer > 0) {
clearInterval(api.stimer);
api.stimer = 0
}
if (document.attachEvent) {
document.detachEvent("onclick", BCMain.api_bg_clickpppp)
}
else {
if (document.addEventListener) {
document.removeEventListener("click",
BCMain.api_bg_clickpppp, false)
}
}
if (this.ver.webkit) {
document.onkeydown = null
}
}
catch (q) {
}
};
api.attachEvent = false;
api.api_bg_init = function(){
try {
if (!BCMain.attachEvent) {
if (document.attachEvent) {
document.attachEvent("onclick",
BCMain.api_bg_clickpppp)
}
else {
if (document.addEventListener) {
document.addEventListener("click",
BCMain.api_bg_clickpppp, false)
}
}
BCMain.attachEvent = true
}
window.oldonkeydown = window.onkeydown;
if (typeof document.onkeydown == "function") {
if (typeof document.onkeydown == "object" &&
this.ver.webkit) {
document.onkeydown = function(){
api.api_bg_kdopen();
api.api_bg_uinit();
window.oldonkeydown()
}
}
else {
if (typeof document.onkeydown == "function" &&
this.ver.webkit) {
if
(document.onkeydown.toString().indexOf("__form_xcy") < 0) {
document.onkeydown = function(){
BCMain.api_bg_kdopen();
api.api_bg_uinit();
window.oldonkeydown()
}
}
}
}
}
}
catch (q) {
}
}
})(window, "BCMain");
function mim_isset(variableName){
try { if (typeof(variableName) == "undefined") { return false; } else {
return true; } } catch (e) { }
return false;
}
function mim_resize_ditong(){
var newWidth = _m_stuff.width;
var newHeight = _m_stuff.height;
var winWidth = document.body.clientWidth;
var winHeight = document.body.clientHeight;
var wrap = document.getElementById(_m_ad.sn + '_wrap');
if(_m_ismobile){
newWidth = winWidth;
newHeight = newWidth/_m_stuff.width * _m_stuff.height;
wrap.style.width = newWidth +"px";
wrap.style.height = newHeight +"px";
}else{
wrap.style.left = (winWidth - newWidth)/2 + "px";
}
}
function mim_resize_chaye(){
try {
var wrap = document.getElementById(_m_ad.sn + '_wrap');
var newWidth = _m_stuff.width;
var newHeight = _m_stuff.height;
var winWidth = document.body.clientWidth;
var winHeight = document.body.clientHeight;
var winHeight = (document.documentElement.scrollHeight
>document.documentElement.clientHeight) ?
document.documentElement.scrollHeight :
document.documentElement.clientHeight;
if(_m_ismobile){
newWidth = winWidth;
newHeight = newWidth/_m_stuff.width *
_m_stuff.height;
}else if(_m_stuff.width > winWidth*0.618){
newWidth = winWidth*0.618;
newHeight = newWidth/_m_stuff.width *
_m_stuff.height;
}
var pos_x = (winWidth - newWidth)/2;
var pos_y = (winHeight - newHeight)/2;
wrap.style.width = newWidth + "px";
wrap.style.height = newHeight + "px";
wrap.style.left = "50%";
wrap.style.top = "50%";
wrap.style.margin = "-"+newHeight/2+"px 0 0 -
"+newWidth/2+"px";
}catch (exception) {
console.log(exception.message );
}
}
function mim_resize_qianru(){
var newWidth = _m_stuff.width;
var newHeight = _m_stuff.height;
var winWidth = document.body.clientWidth;
var winHeight = document.body.clientHeight;
if(_m_ismobile && (mim_isset(_m_ad.data.view_position) &&
_m_ad.data.view_position%4 == 1)){
newWidth = winWidth;
newHeight = newWidth/_m_stuff.width * _m_stuff.height;
var wrap = document.getElementById(_m_ad.sn + '_content');
wrap.style.width = newWidth + "px";
wrap.style.height = newHeight + "px";
}
if(mim_isset(_m_ad.data.view_position) && _m_ad.data.view_position
== 1){
var wrapClose =
document.getElementById('ad_colse_container');
wrapClose.style.right = (winWidth - newWidth)/2 + 5 +"px";
}
}
function mim_resize_fuchuang(){
if(mim_isset(_m_ad.data.view_position)){
var centerPos = (1 - (_m_stuff.width /
document.body.clientWidth))/2*100;
var centerPosV = (1 - (_m_stuff.height /
document.body.clientHeight))/2*100;
var wrap = document.getElementById(_m_ad.sn + '_wrap');
if(_m_ad.data.view_position % 4 == 1 &&
document.body.clientWidth > _m_stuff.width){
wrap.style.left = centerPos + "%";
}else if(_m_ad.data.view_position % 4 == 3 &&
document.body.clientHeight > _m_stuff.height){
wrap.style.top = centerPosV + "%";
}
}
}
function mim_resize_duilian(){
}
function mim_auto_close(){
try {
if (typeof(_m_ad.data.view_type) == "undefined") {
console.log("no ad");
return false;
}
else {
var wrap = document.getElementById(_m_ad.sn + '_wrap');
wrap.style.display = "none";
/*
if(_m_ad.data.view_type == 1 &&
(mim_isset(_m_ad.data.view_position) && _m_ad.data.view_position == 1)){
var wrap = document.getElementById(_m_ad.sn
+ '_wrap');
wrap.style.display = "none";
}else if(_m_ad.data.view_type == 256){
var wrap = document.getElementById(_m_ad.sn
+ '_wrap');
wrap.style.display = "none";
}
*/
}
}
catch (e) {
}
}
/**
* å¢žåŠ å…³é—按钮 6秒钟åŽæ˜¾ç¤º
*/
function close_btn_show () {
var wrap = document.getElementById(_m_ad.sn + '_wrap');
if(wrap)
var $btn = wrap.querySelector('#ad_colse_container');
if($btn)
$btn.style.display = 'block';
}
window.onresize=function(){
try {
if (typeof(_m_ad.data.view_type) == "undefined") {
return false;
}
else {
if (_m_ad.data.view_type == 1) {mim_resize_qianru();}
if (_m_ad.data.view_type == 2)
{mim_resize_fuchuang();}
if (_m_ad.data.view_type == 32)
{mim_resize_ditong();}
if (_m_ad.data.view_type ==
256){mim_resize_chaye();}
if (_m_ad.data.view_type ==
512){mim_resize_duilian();}
}
}
catch (e) {
}
}
BCMain.show();
BCMain.third_req();
var showAfterCloseTime = 6000;
setTimeout("close_btn_show()", showAfterCloseTime);
//setTimeout("mim_auto_close()",duration);