var oFloatScrollTool = { ParentObj:[], ReportObj:[], Header:[], ScrollBar:[] }; var oDynaDispElem = {}; const conSysNM = 'StockTW'; const conMobileMode = false; const conTestMode = false; const conIsLogin = false; const conRowMarkBGC = '#fff2cc'; const conFontSize06 = 6; const conFontSize07 = 7; const conFontSize08 = 8; const conFontSize09 = 9; const conFontSize10 = 10; const conFontSize11 = 11; const conFontSize12 = 12; const conFontSize13 = 13; const conFontSize14 = 14; const conFontSize15 = 15; const conFontSize16 = 16; const conFontSize17 = 17; const conFontSize18 = 18; const conFontSize19 = 19; const conFontSize20 = 20; const conFontSize21 = 21; const conFontSize22 = 22; const conFontSize23 = 23; const conFontSize24 = 24; const conLineHeight08 = 8; const conLineHeight09 = 9; const conLineHeight10 = 10; const conLineHeight11 = 11; const conLineHeight12 = 12; const conLineHeight13 = 13; const conLineHeight14 = 14; const conLineHeight15 = 15; const conLineHeight16 = 16; const conLineHeight17 = 17; const conLineHeight18 = 18; const conLineHeight19 = 19; const conLineHeight20 = 20; const conLineHeight21 = 21; const conLineHeight22 = 22; const conLineHeight23 = 23; const conLineHeight24 = 24; const conLineHeight25 = 25; const conLineHeight26 = 26; const conLineHeight27 = 27; const conLineHeight28 = 28; //如果瀏覽器不支援JSON則載入json2.js (一定要放最前面) ////////////////////////////////////////////////////////// /* 停用2024/7/10 if (typeof (JSON) == 'undefined') { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = '/Library/js/JSON-js-master/json2.js'; document.getElementsByTagName('head')[0].appendChild(script); } */ ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Initialize ////////////////////////////////////////////////////////////////////////////////////////////// function Initial(oParm) { if (oParm == undefined) { oParm = {}; } if (conSysNM == "StockTW") { InitStockTW(); } if (conSysNM == "StockCN") { InitStockCN(); } if ('SCROLL2Y' in oParm) { if (IsNumeric(oParm.SCROLL2Y)) { if (oParm.SCROLL2Y > 0 && PageYOffset() == 0) { window.scrollTo({ top:oParm.SCROLL2Y }); // window.scrollTo({ top:oParm.SCROLL2Y, behavior:'smooth' }); } } } ShowDynaDispElem(); ShowFloatScrollTool(); // if ('StockPainter' in window) { RepaintStockChart(StockPainter); } //放最後面 } function InitStockTW() { AddStockBrowseList('TW'); } function InitStockCN() { AddStockBrowseList('CN'); } function AddStockBrowseList(sArea) { var s, arr, i //將目前瀏覽的STOCK_ID加入Cookie var sSTOCK_ID = Trim(UCase(getUrlParameter('STOCK_ID'))); if (sArea == 'TW' && Len(sSTOCK_ID) >= 4 && IsNumeric(Left(sSTOCK_ID,4)) || sArea == 'CN' && Len(sSTOCK_ID) == 8 && IsNumeric(Mid(sSTOCK_ID,3) && (Left(sSTOCK_ID,2) == 'SH' || Left(sSTOCK_ID,2) == 'SZ'))) { var sCookieNM = sArea + '_STOCK_BROWSE_LIST'; if (sCookieNM != '') { //將新的STOCK_ID加入字串中 var s = '|' + NVL(getCookie(sCookieNM)) + '|'; if (s == '||') { s = sSTOCK_ID; } else { s = Replace(s, '|' + sSTOCK_ID + '|', '|'); //清掉舊的 s = sSTOCK_ID + Left(s,Len(s)-1); //前面加入新的 } //將清單維持在20個 arr = Split(s,"|"); s = ''; for (i=0; i < 20 && i < arr.length; i++) { s = s + (s==''?'':'|') + arr[i]; } setCookie(sCookieNM, s, 365, '/'); } } }