var g_objWindow = ''; var strURL = "/savefile/publish95.htm"; var strWidth = "360"; var strHeight = "480"; var strTop = ""; var strLeft = ""; var strShowTime = "90"; var strDelay = "0"; var strName = "name"; var strTitle = "手續費優惠活動!"; var strPopupFocus = "1"; var strPopup1Time = "1"; var strPath = "/w/popup/"; strWidth = ( isNaN(parseInt(strWidth,10)) ? 0 : parseInt(strWidth,10) ) ; strHeight = ( isNaN(parseInt(strHeight,10)) ? 0 : parseInt(strHeight,10) ) ; strTop = ( isNaN(parseInt(strTop,10)) ? '' : parseInt(strTop,10) ) ; strLeft = ( isNaN(parseInt(strLeft,10)) ? '' : parseInt(strLeft,10) ) ; strShowTime = ( isNaN(parseInt(strShowTime,10)) ? 0 : parseInt(strShowTime,10) ) ; strDelay = ( isNaN(parseInt(strDelay,10)) ? 0 : parseInt(strDelay,10) ) ; // 要引用有 readCookie , saveCookie 的 js if (strPopup1Time == "1") { // 連線後,只 show 一次 popup if (readCookie('popup') != "1") { // 判斷是不是已經 show 過 setTimeout('OpenPopup()',strDelay*1000); saveCookie('popup','1',0,'/'); } } else { setTimeout('OpenPopup()',strDelay*1000); } function OpenPopup() { // 如果 Width = 0 , Height = 0 , 視窗大小會用預設值。 // 如果 Top 或 Left 其中一個是無值的。就將視窗開在 正中間。 if (strTop == '' || strLeft == '') { strTop = ((screen.height - strHeight)/2) -15; //因為視窗有邊,還有上面的標題列 strLeft = ((screen.width - strWidth)/2) -5; //因為視窗有邊 } var s = ''; s = s + 'width=' + strWidth; s = s + ',height=' + strHeight; s = s + ',top=' + strTop; s = s + ',left=' + strLeft; s = s + ',status=no,toolbar=no,menubar=no,scrollbars=no,location=no,directories=no,resizable=no'; strURL = strPath + 'popupWindow.asp'; g_objWindow = window.open(strURL,strName,s); if (strPopupFocus == '1') { g_objWindow.focus(); } else { window.focus(); } if (strShowTime != '' && strShowTime != '0') { //setTimeout('ClosePopup()',strShowTime*1000); } } function ClosePopup() { if (typeof(g_objWindow) == 'object') { g_objWindow.close(); } }