/***7 * Description : * 对联广告模板 DI (DoubleImage) */ //初始化变量 DI_sLeftImageUrl = "../images/left.gif"; DI_sRightImageUrl = "../images/right.gif"; DI_sClickUrl = "http://60.172.244.3/Files/LEFT02/主题实践活动专栏.htm"; DI_sImageUrl = ""; DI_iImageWidth = parseInt("90");// 浮动窗口宽度 if (isNaN(DI_iImageWidth)) DI_iImageWidth = 90;// 浮动窗口宽度 DI_iImageHeight = parseInt("300");// 浮动窗口高度 if (isNaN(DI_iImageHeight)) DI_iImageHeight = 300;// 浮动窗口高度 doubleimage_top = 120;// 图片上边距 doubleimage_left = 5;// 图片左边距 doubleimage_right = 5;// 图片右边距 window_width_min = 800 + DI_iImageWidth * 2; // 窗口最小宽度 time_out = 500;// 调整位置时间间隔 scrollbar_width = 20;// 滚动条宽度 document.ns = navigator.appName == "Netscape"; // 浏览器类型 DI_blClosed = false; // 关闭广告(提供给flash使用的关闭接口) function closead() { DI_blClosed = true; DI_Hide(); } // 隐藏广告 function DI_Hide() { DI_LeftDiv.style.visibility='hidden'; DI_RightDiv.style.visibility='hidden'; } // 显示广告 function DI_Show() { if (DI_blClosed) return; DI_LeftDiv.style.visibility='visible'; DI_RightDiv.style.visibility='visible'; } // 显示广告内容 function DI_ShowContent(ImageUrl, ImageName, iWidth, iHeight) { var str, pos; var sSrc = ImageUrl; if (ImageUrl!="") { //image not played by adverisement system sSrc = ImageUrl; } else { //image played by adverisement system sSrc = ImageName; } str = /.swf/; pos = sSrc.search(str); if (pos==-1) document.write(""); else document.write("\n\n\n\n"); } // 加载广告 function DI_Load() { if (DI_sLeftImageUrl == "Tencent QQ") { return ; } if (document.ns) { document.write(""); DI_ShowContent(DI_sLeftImageUrl); document.write(""); document.write(""); DI_ShowContent(DI_sRightImageUrl); document.write(""); } else { document.write("
"); DI_ShowContent(DI_sImageUrl, DI_sLeftImageUrl, DI_iImageWidth, DI_iImageHeight); document.write("
"); document.write("
"); DI_ShowContent(DI_sImageUrl, DI_sRightImageUrl, DI_iImageWidth, DI_iImageHeight); document.write("
"); } DI_Move(); } // 浮动广告 function DI_Move() { if (document.body.offsetWidth < window_width_min) { DI_Hide(); setTimeout("DI_Move();", time_out); return; } DI_Show(); if (document.ns) { document.DI_LeftDiv.pageX = doubleimage_left; document.DI_LeftDiv.pageY = doubleimage_top; document.DI_RightDiv.pageX = window.innerWidth - DI_iImageWidth - doubleimage_right - scrollbar_width; document.DI_RightDiv.pageY = doubleimage_top; } else { DI_LeftDiv.style.top = doubleimage_top; DI_LeftDiv.style.left = doubleimage_left; DI_RightDiv.style.top = doubleimage_top; DI_RightDiv.style.left = document.body.offsetWidth - DI_iImageWidth - doubleimage_right - scrollbar_width; } setTimeout("DI_Move();", time_out); } //-- start DI_Load(); //-- end