﻿function insertFlash(elm, img, url, w, h, l, r, float, padding) {
  if (!document.getElementById(elm)) return;
  var str = '';
  str = '<div style="position:relative; width:' + w + 'px; height:' + h + 'px;float:' + float + ';padding-bottom:' + padding + 'px;margin-left:' + l + 'px;margin-right:' + r + 'px;overflow: hidden;"><a style=" display:block; background:#ffffff; filter:alpha(opacity=0); -moz-opacity:0; -khtml-opacity:0; opacity:0; width:' + w + 'px; height:' + h + 'px; position:absolute; z-index:100; left:0; top:0;" href="' + url + '" target="_blank"></a><embed width="' + w + '" height="' + h + '" src="' + img + '" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
  str += '<div style="position: absolute; left: 0px; bottom: ' + padding + 'px; width: 29px; height: 16px; z-index: 12; background-image: url(/static/images/adleftbottom.png); background-position: initial initial; background-repeat: no-repeat no-repeat;"></div>';
  str += '</div>';
  $("#" + elm).append(str);
}

function insertimg(elm, img, url, w, h, l, r, float, padding) {
  if (!document.getElementById(elm)) return;
  var str = '';
  str = '<div style="position:relative;width:' + w + 'px; height:' + h + 'px;float:' + float + ';padding-bottom: 5px;margin-left:' + l + 'px;margin-right:' + r + 'px;overflow: hidden;"><a href="' + url + '" target="_blank"><img style="padding-bottom:' + padding + 'px;" src="' + img + '" /></a>';
  str += '<div style="position: absolute; left: 0px; bottom: 5px; width: 29px; height: 16px; z-index: 12; background-image: url(/static/images/adleftbottom.png); background-position: initial initial; background-repeat: no-repeat no-repeat;"></div>';
  str += '</div>';
  $("#" + elm).append(str);
}

function insertdl(elm, img, bimg, url, float, padding) {
  var str = '';
  str = '<style>.dldiv{height: 300px;position: fixed;top:20px;z-index: 999;}.dlclose{position:absolute;top:280px;width:98px;height:18px;background-color: #F7F7F7;border:1px solid #d5d5d5;line-height:20px;border-top-style:none;cursor:pointer!important;cursor:hand; font-size:12px;}</style>';
  str += '<div class="dldiv" style="top:' + padding + 'px;' + float + ':10px;" id="dlshowdiv_' + elm + '"><div style="float:' + float + ';width:100px;height:280px;" id="dlshow_' + elm + '"><a target="_blank" href="' + url + '"><img width="100" height="280" border="0" src="' + img + '"></a>';
  str += '<div style="position: absolute; left: 0px; bottom: 5px; width: 29px; height: 16px; z-index: 12; background-image: url(/static/images/adleftbottom.png); background-position: initial initial; background-repeat: no-repeat no-repeat;"></div>';
  str += '</div>';
  if (bimg.length > 0) {
    str += '<div id="dlmain_' + elm + '" style="float: ' + float + '; width: 475px; height: 280px; display: none;"><img src="' + bimg + '" width="475" height="280" /></div>';
  }
  str += '<div id="dlclose_' + elm + '" class="dlclose" style="' + float + ':0; text-align:right">×关闭</div></div>';
  str += '<script type="text/javascript">';
  if (bimg.length > 0) {
    str += '$("#dlshow_' + elm + '").mouseover(function(){$("#dlmain_' + elm + '").show();});$("#dlshow_' + elm + '").mouseout(function(){$("#dlmain_' + elm + '").hide();});';
  }
  str += '$("#dlclose_' + elm + '").click(function(){$("#dlshowdiv_' + elm + '").hide();});';
  str += '</script>';
  document.writeln(str);
}

function insertdlswf(elm, img, bimg, url, float, w, h, padding) {
  var str = '';
  str = '<style>.dldiv{height: 300px;position: fixed;top:20px;z-index: 999;}.dlclose{position:absolute;top:280px;width:98px;height:18px;background-color: #F7F7F7;border:1px solid #d5d5d5;line-height:20px;border-top-style:none;cursor:pointer!important;cursor:hand; font-size:12px;}</style>';
  str += '<div class="dldiv" style="top:' + padding + 'px;' + float + ':10px;" id="dlshowdiv_' + elm + '"><div style="position:relative; width:' + w + 'px; height:' + h + 'px;"><a style=" display:block; background:#ffffff; filter:alpha(opacity=0); -moz-opacity:0; -khtml-opacity:0; opacity:0; width:' + w + 'px; height:' + h + 'px; position:absolute; z-index:100; left:0; top:0;" href="' + url + '" target="_blank"></a><embed width="' + w + '" height="' + h + '" src="' + img + '" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
  str += '<div style="position: absolute; left: 0px; bottom: ' + padding + 'px; width: 29px; height: 16px; z-index: 12; background-image: url(/static/images/adleftbottom.png); background-position: initial initial; background-repeat: no-repeat no-repeat;"></div>';
  str += '</div>';
  str += '<div id="dlclose_' + elm + '" class="dlclose" style="' + float + ':0; text-align:right">×关闭</div></div>';
  str += '<script type="text/javascript">';
  if (bimg.length > 0) {
    str += '$("#dlshow_' + elm + '").mouseover(function(){$("#dlmain_' + elm + '").show();});$("#dlshow_' + elm + '").mouseout(function(){$("#dlmain_' + elm + '").hide();});';
  }
  str += '$("#dlclose_' + elm + '").click(function(){$("#dlshowdiv_' + elm + '").hide();});';
  str += '</script>';
  document.writeln(str);
}

function insertss(elm, id, img, bimg, url, w, h, filetype) {
  var str = ''; var classid = ''; if (w == 1000) { classid = 'fang_x1000'; } else { classid = 'fang'; }
  str = '<div class="' + classid + '"><dl style="position:relative;margin: 0px auto; width: ' + w + 'px; display: block;" id="js_ads_banner_top_' + id + '">';
  if (filetype == 'swf') {
    str += '<div style="position:relative; width:' + w + 'px; height:' + h + 'px;"><a style=" display:block; background:#ffffff; filter:alpha(opacity=0); -moz-opacity:0; -khtml-opacity:0; opacity:0; width:' + w + 'px; height:' + h + 'px; position:absolute; z-index:100; left:0; top:0;" href="' + url + '" target="_blank"></a><embed width="' + w + '" height="' + h + '" src="' + img + '" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></div>';
  } else {
    str += '<a href="' + url + '" target="_blank"><img style="padding-bottom:5px;" src="' + img + '" /></a>';
  }
  str += '<div style="position: absolute; left: 0px; bottom: 5px; width: 29px; height: 16px; z-index: 12; background-image: url(/static/images/adleftbottom.png); background-position: initial initial; background-repeat: no-repeat no-repeat;"></div>';
  str += '</dl><dl style="margin: 0px auto; width: ' + w + 'px; display: none;" id="js_ads_banner_top_slide_' + id + '"><a href="' + url + '" target="_blank"><img style="padding-bottom:5px;" src="' + bimg + '"></a></dl>';
  str += '</div>';
  $("#" + elm).append(str);
}

function insertBaPing(url, img, title) {
  document.write("<div id='baping' style='width:700px; height:400px; position:fixed; z-index:999;'>");
  document.write("<div style='text-align:right;'><a href='javascript:void(0);' onclick='closeba();'><img src='/static/images/close.gif' alt='关闭' /></a></div>");
  document.write("<div><a href='" + url + "' target='_blank'><img src='" + img + "' alt='" + title + "' /></a></div>");
  document.write("<div style='position: absolute; left: 0px; bottom: 5px; width: 29px; height: 16px; z-index: 12; background-image: url(/static/images/adleftbottom.png); background-position: initial initial; background-repeat: no-repeat no-repeat;'></div>");
  document.write("</div>");
}

function showid(idname) { var isIE = (document.all) ? true : false; var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6); var newbox = document.getElementById(idname); newbox.style.zIndex = '9999'; newbox.style.display = 'block'; newbox.style.position = !isIE6 ? 'fixed' : 'absolute'; newbox.style.top = newbox.style.left = '50%'; newbox.style.marginTop = -newbox.offsetHeight / 2 + 18 + 'px'; newbox.style.marginLeft = -newbox.offsetWidth / 2 + 'px'; function newbox_iestyle() { newbox.style.marginTop = document.documentElement.scrollTop - newbox.offsetHeight / 2 + 18 + 'px'; newbox.style.marginLeft = document.documentElement.scrollLeft - newbox.offsetWidth / 2 + 'px'; }; if (isIE6) { newbox_iestyle(); window.attachEvent('onscroll', function () { newbox_iestyle(); }) } };

function insertshichuang(url, img, title) {  //调图片视窗
  document.write("<style type='text/css'>");
  document.write("#eMeng{position:fixed; bottom:0px; width:320px; right:0px; z-index:100000}");
  document.write("*html #eMeng{position:absolute;left:expression(eval((document.documentElement.clientHeight ? document.documentElement : document.body).scrollLeft+(document.documentElement.clientHeight ? document.documentElement : document.body).clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));top:expression(eval((document.documentElement.clientHeight ? document.documentElement : document.body).scrollTop+(document.documentElement.clientHeight ? document.documentElement : document.body).clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)))}");
  document.write("</style>");
  document.write("<div id='eMeng'><div style='height:24px;width:320px;'><span style='float:right;margin-top:2px;margin-right:10px;'>");
  document.write("<img id='close_pop' style='cursor:pointer' onclick='closeshichuang();' src='/static/images/close.gif' /><img id='view_pop' onclick='showshichuang();' style='cursor:pointer; display:none;' src='/static/images/top.gif' /></span></div>");
  document.write("<div id='eContents'><a href='" + url + "' target='_blank'><img src='" + img + "' alt='" + title + "' width='320' height='240' /></a></div></div>");
}

function closeshichuang() {
  document.getElementById('eContents').style.display = 'none';
  document.getElementById('close_pop').style.display = 'none';
  document.getElementById('view_pop').style.display = 'block';
}
function showshichuang() {
  document.getElementById('eContents').style.display = 'block';
  document.getElementById('close_pop').style.display = 'block';
  document.getElementById('view_pop').style.display = 'none';
};
function formdialog(url, width, height) {
  layer.open({
    type: 2,
    area: [width + 'px', height + 'px'],
    skin: 'layui-layer-rim', //加上边框
    content: [url, 'no']
  });
}
function insertwap(elm, img, url) {
  if (!document.getElementById(elm)) return;
  str = '<div style="position: relative;">';
  str += '<a href="' + url + '"><img style="padding-bottom:5px;width:100%;" src="' + img + '" /></a>';
  str += '<div style="position: absolute; left: 0px; bottom: 5px; width: 29px; height: 16px; z-index: 12; background-image: url(/static/images/adleftbottom.png); background-position: initial initial; background-repeat: no-repeat no-repeat;"></div>';
  str += '<div>';
  $("#" + elm).append(str);
}
