/***7 * Description : * 对联广告模板 DI (DoubleImage) */ //初始化变量 DI_sLeftImageUrl = "http://www.jxhiway.cn/images/l.swf"; DI_sRightImageUrl = "http://www.jxhiway.cn/images/r.swf"; DI_sClickUrl = "http://www.jxhiway.cn/"; DI_sImageUrl = ""; DI_iImageWidth = parseInt("100"); if (isNaN(DI_iImageWidth)) DI_iImageWidth = 100; DI_iImageHeight = parseInt("300"); if (isNaN(DI_iImageHeight)) DI_iImageHeight = 300; doubleimage_top = 17;// 图片上边距 doubleimage_left = 10;// 图片左边距 doubleimage_right = 10;// 图片右边距 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 function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true);