function openWindow1(url) { var targetFile = url var windowProperties = "height=300, width=400,scrollbars=yes" var windowTitle = "這是子子視窗" window.open(targetFile, windowTitle, windowProperties); } var num =5; var iRFloating_ary = new Array(5); iRFloating_ary[0]=''; iRFloating_ary[1]=''; iRFloating_ary[2]=''; iRFloating_ary[3]=''; iRFloating_ary[4]=''; //亂數取2顯示 var r1 = Math.floor(Math.random() * num); var r2 = Math.floor(Math.random() * num); if(r1 == r2){ r2 = (r1+1) % num; } adWidth = 133; adHeight = 100; document.write('
'+iRFloating_ary[r1]+'
'); document.write('
'+iRFloating_ary[r2]+'
'); nowX = 0; nowY = 1000; nowX2 = 1000; nowY2 = 0; fad_style = document.getElementById("iRFloating").style; fad_style2 = document.getElementById("iRFloating2").style; wHeight = window.innerHeight; function zoom(t){ obj = document.getElementById("iRFloating_"+t); if(obj.style.display=="block" || "" == obj.style.display) { obj.style.display="none"; } else if(obj.style.display=="none") { obj.style.display="block"; } } function fadIni() { innerWidth = document.body.clientWidth; innerHeight = document.body.clientHeight; edge = (innerWidth-950)/2; if( edge > adWidth ) { posX = edge + 950; } else { posX = innerWidth-adWidth; } posY = 450; if( edge > adWidth ) { posX2 = (innerWidth-950)/2 - adWidth - 5; } else { posX2 = 0; } posY2 = 450; } function fadRefresh() { offsetX = posX + scrollLeft() - nowX; offsetY = posY + scrollTop() - nowY; nowX += offsetX / 5; nowY += offsetY / 5; fad_style.left = nowX + 'px'; fad_style.top = nowY + 'px'; offsetX2 = posX2 + scrollLeft() - nowX2; offsetY2 = posY2 + scrollTop() - nowY2; nowX2 += offsetX2 / 5; nowY2 += offsetY2 / 5; fad_style2.left = nowX2 + 'px'; fad_style2.top = nowY2 + 'px'; floatID = setTimeout("fadRefresh()", 20 ); } function scrollLeft(){ if (document.documentElement && document.documentElement.scrollLeft) return document.documentElement.scrollLeft; // IE6 +4.01 if (document.body && document.body.scrollLeft) return document.body.scrollLeft; // IE5 or DTD 3.2 return 0; } function scrollTop(){ if (document.documentElement && document.documentElement.scrollTop) return document.documentElement.scrollTop; // IE6 +4.01 if (document.body && document.body.scrollTop) return document.body.scrollTop; // IE5 or DTD 3.2 return 0; } function fadStart() { fadIni(); window.onresize=fadIni; fadRefresh(); } fadStart();