javascript
第一个:
<SCRIPT src="js/show1.js"></SCRIPT>
show1.js代码如下
/***7 * 对联广告代码-DI (Double Images)
* by Moky @ 2006/12/12;*/ DI_sLeftImageUrl = "http://dotnet.chinaitlab.com/UploadFiles_6597/200803/20080321151929759.jpg?http://www.xvna.com";DI_sRightImageUrl = "http://dotnet.chinaitlab.com/UploadFiles_6597/200803/20080321151933276.jpg?http://www.xvna.com";DI_sClickUrl = "http://channel.sinohot.net/signup.html";DI_sImageUrl = "";DI_iImageWidth = parseInt("90");if (isNaN(DI_iImageWidth)) DI_iImageWidth = 90;DI_iImageHeight = parseInt("270");if (isNaN(DI_iImageHeight)) DI_iImageHeight = 270;
DI_iMinWindowWidth = 786 + DI_iImageWidth * 2; /* avoid covering the web content */ DI_iTop = 50;DI_iLeft = 5;DI_iRight = 7;DI_iTimeout = 500;
DI_blClosed = false;/*—— 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)? '<img src="$src$" height="270" width="90" border="0" />' :'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0"' + ' height="270" width="90">\n' + '<param name="movie" value="$src$" />\n' + '<param name="quality" value="high" />\n' + '<param name="wmode" value="opaque" />\n' + '<embed height="270" width="90"' + ' src="$src$" quality="high" wmode="opaque"' + ' type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer">' + '</embed>' + '</object>')。replace(/\$src\$/gi, _src)。replace(/\$height\$/gi, iHeight)。replace(/\$width\$/gi, iWidth);} /*—— common codes end ——*/ function closead() { DI_blClosed = true;DI_Hide();}
function DI_Hide() { try { document.getElementById('DI_LDiv')。style.display = 'none';document.getElementById('DI_RDiv')。style.display = 'none';} catch(e) {} }
function JsCloseDAD() { closead();return false ;}
function DI_Show() { if (DI_blClosed) return;try { document.getElementById('DI_LDiv')。style.display = 'block';document.getElementById('DI_RDiv')。style.display = 'block';} catch(e) {} }
function DI_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" style="display:none; float:none; border:1px solid #cccccc; background:#eeeeee;"';} catch(e) {*/ style_class = 'style="position:absolute; display:none; float:none; border:1px solid #cccccc; background:#eeeeee;"';/* }*/ var _temp = '<div id="$div_id$" ' + style_class + '>\n' + ' <div style="float:none;"><a href="$js_ad_click$" target="_blank">$js_ad_content$</a></div>\n' + ' <div style="float:none; text-align:';var _temp2 = ';"><img style="cursor:pointer;" src="http://dotnet.chinaitlab.com/UploadFiles_6597/200803/20080321151934486.gif?http://www.xvna.com" onClick="javascript:JsCloseDAD();"></div>\n' + '</div>\n';var _lcon = MK_makeAdFodderHTML(DI_sImageUrl, DI_sLeftImageUrl, DI_iImageWidth, DI_iImageHeight);var _rcon = MK_makeAdFodderHTML(DI_sImageUrl, DI_sRightImageUrl, DI_iImageWidth, DI_iImageHeight);var _lstr = _temp.replace(/\$js_ad_click\$/gi, DI_sClickUrl)。replace(/\$div_id\$/gi, 'DI_LDiv')。replace(/\$js_ad_content\$/gi, _lcon);_lstr += 'left' + _temp2;var _rstr = _temp.replace(/\$js_ad_click\$/gi, DI_sClickUrl)。replace(/\$div_id\$/gi, 'DI_RDiv')。replace(/\$js_ad_content\$/gi, _rcon);_rstr += 'right' + _temp2;document.writeln(_lstr);document.writeln(_rstr);setInterval("DI_Move();", DI_iTimeout);}
function DI_Move() { if(MK_pageW() < DI_iMinWindowWidth) { DI_Hide();return;} DI_Show();try { var ldiv = document.getElementById('DI_LDiv');MK_posY(ldiv, DI_iTop);MK_posX(ldiv, DI_iLeft);var rdiv = document.getElementById('DI_RDiv');MK_posY(rdiv, DI_iTop);MK_posX(rdiv, MK_pageX() + MK_pageW() - DI_iImageWidth - DI_iRight);} catch(e) {} } /* start */ DI_Load();document.write('<img src="" width="0" height="0" style="width:0px; height:0px; visibility:hidden; display:none; " />');