/***7 * ×ó±ßÌùµ×¸¡¶¯¹ã¸æ´úÂë-LBM (Left Bottom Move) * Created by Moky @ 2006/12/14; */ LBM_sImageName = "images/left_im.jpg"; LBM_sClickUrl = "rszh.asp"; LBM_sImageUrl = ""; LBM_iImageWidth = parseInt("80"); if (isNaN(LBM_iImageWidth)) LBM_iImageWidth = 80; LBM_iImageHeight = parseInt("80"); if (isNaN(LBM_iImageHeight)) LBM_iImageHeight = 80; LBM_iLeft = 10; LBM_iBottom = 140; LBM_iMinTop = 335; /* avoid conflicts with double images */ LBM_iTimeout = 50; /*---- common codes begin ----*/ var __bs__ = navigator.userAgent.indexOf("MSIE") > 0 ? "MSIE" : navigator.userAgent.indexOf("Safari") > 0 ? "Safari" : "others"; var __dt__ = (document.documentElement.clientHeight > 0) && (__bs__ == "MSIE" || document.body.clientHeight > document.documentElement.clientHeight) ? "W3C" : "undefined"; function MK_pageY() { if (__bs__ == "MSIE") { if (__dt__ == "W3C") return document.documentElement.scrollTop; else return document.body.scrollTop; } else { return window.pageYOffset; } } function MK_pageX() { if (__bs__ == "MSIE") { if (__dt__ == "W3C") return document.documentElement.scrollLeft; else return document.body.scrollLeft; } else { return window.pageXOffset; } } function MK_pageH() { if (__bs__ == "Safari") return window.innerHeight; else if (__dt__ == "W3C") return document.documentElement.clientHeight; else return document.body.clientHeight; } function MK_pageW() { if (__bs__ == "Safari") return window.innerWidth; else if (__dt__ == "W3C") return document.documentElement.clientWidth; else return document.body.clientWidth; } function MK_posY(o, v) { if (!o || !o.style) return ; if (v) { o.style.top = parseInt(v) + "px"; } else { return o.style.top; } } function MK_posX(o, v) { if (!o || !o.style) return ; if (v) { o.style.left = parseInt(v) + "px"; } else { return o.style.left; } } function MK_makeAdFodderHTML(sImageUrl, sImageName, iWidth, iHeight) { var _src = sImageUrl == "" ? sImageName : sImageUrl; return (!_src.match(/\.swf$/gi)? '' : '\n' + '\n' + '\n' + '\n' + '' + '' + '') .replace(/\$src\$/gi, _src).replace(/\$height\$/gi, iHeight).replace(/\$width\$/gi, iWidth); } function atoi(s) { var r = parseInt(s); return isNaN(r) ? 0 : r; } function magic_locus(x1, x2, n) { x1 = atoi(x1); x2 = atoi(x2); n = atoi(n); var d = Math.abs(x1 - x2); if (d < n) return magic_locus(x1, x2, d / 2); return n <= 1 ? x1 : (x1 + (n-1) * x2) / n ; } /*---- common codes end ----*/ function LBM_Load() { var style_class ; /* try { if (__bs__ == "MSIE") document.styleSheets[0].addRule('.div_floating_ad', 'position:absolute'); else document.styleSheets[0].insertRule('.div_floating_ad {position:absolute}', document.styleSheets[0].cssRules.length); style_class = 'class="div_floating_ad"'; } catch(e) {*/ style_class = 'style="position: absolute;"'; /* }*/ var _temp = '
' + '$js_ad_content$' + '
'; var _con = MK_makeAdFodderHTML(LBM_sImageUrl, LBM_sImageName, LBM_iImageWidth, LBM_iImageHeight); var _str = _temp.replace(/\$js_ad_click\$/gi, LBM_sClickUrl).replace(/\$js_ad_content\$/gi, _con); document.writeln(_str); setInterval("LBM_Move();", LBM_iTimeout); } function LBM_Move() { try { var _div = document.getElementById('LBM_Div'); var _left = MK_pageX() + LBM_iLeft; var _top = MK_pageY() + MK_pageH() - LBM_iBottom - LBM_iImageHeight; /*-- magic locus begin, add by moky @ 2006/12/29 --*/ _top = magic_locus(_top, MK_posY(_div), 4); var max_y = MK_pageY() + MK_pageH(); if (_top > max_y) _top = max_y; /*-- magic locus end, add by moky @ 2006/12/29 --*/ if (_top < LBM_iMinTop) _top = LBM_iMinTop; MK_posY(_div, _top); MK_posX(_div, _left); } catch(e) {} } /* start */ LBM_Load();