/* * Imperitrade Financial Stock Quote Ticker, version 1.5 * (c) 1998-2019 Imperial Network, Todd Schlomer /*--------------------------------------------------------------------------*/ var pe_IMTF_QUOTE_0bea5b87 = null; var _IMTF_LOAD_JS = false; if (typeof _IMTF_STOCK_JS_LOADED == "undefined") { _IMTF_STOCK_JS_LOADED = true; _IMTF_LOAD_JS = true; } if (_IMTF_LOAD_JS) { var scriptTags = document.getElementsByTagName('script'); for (var i = 0; i < scriptTags.length; i++) { if ((scriptTags[i].src != null) && scriptTags[i].src.match('prototype.js')) { _IMTF_LOAD_JS = false; scriptTags[i].id = "_IMTF_PrototypeJS"; break; } } } /* Display the section that will contain the stock quotes */ var stockQuoteDiv = document.createElement('div'); stockQuoteDiv.setAttribute('id', 'IMTF_QUOTE_0bea5b87'); stockQuoteDiv.innerHTML = "
15 Most Active Stocks
FGB154.12+3.93
ICS196.85+2.31
VPAX2,733.61+1.68
STCX172.54+1.24
IACF2,108.64+0.78
MMA3,064.85+0.73
DJOX155.90+0.51
IMPG816.84+0.40
AIIF613.77-0.40
IMPX394.84-0.45
VPA1,410.27-0.52
STORMB172.67-0.52
ICMF534.47-0.60
VEBND98.12-0.96
DJBND66.15-2.23
"; var scripts = document.getElementsByTagName('script'); for (var i = 0; i < scripts.length; i++) { var scriptSrcStr = String(scripts[i].src); if ((scriptSrcStr.indexOf('quotes.imperitrade.com') > 0) && (scriptSrcStr.indexOf('.js') < 0) && (scripts[i].id == "")) { scripts[i].parentNode.insertBefore(stockQuoteDiv, scripts[i]); scripts[i].id = "_IMTF_IMTF_QUOTE_0bea5b87"; break; } } /* Function to load scripts dynamically and call a function once its completed */ function loadScript(src, callback) { var script = null; if (_IMTF_LOAD_JS) { script = document.createElement("script"); if (script.addEventListener) { script.addEventListener("load", callback, false); } else if (script.attachEvent) { script.attachEvent("onreadystatechange", function() { loadScript.callbackIE(callback); } ); } script.type = 'text/javascript'; script.src = src; script.id = "_IMTF_PrototypeJS"; document.getElementsByTagName("head")[0].appendChild(script); } else { try { script = $('_IMTF_PrototypeJS'); } catch (err) { } if (script == null) { setTimeout(loadScript(src, callback), 50); } callback(); } } loadScript.callbackIE = function(callback) { var target = window.event.srcElement; if (target.readyState == "loaded") callback.call(target); }; /* Function to generate a random number */ function generateRandom() { return parseInt(Math.random() * 99999999); } /* Function to update the stock quotes */ function updateStockQuotes() { new Ajax.Request('/proxy.php?url=' + encodeURIComponent('https://quotes.imperitrade.com/dsp_quote.cfm'), { method: 'get', parameters: { cnt: 15, header: '1', volume: '0', width: '100%', symbols: '', type: 'stock', tableHeader: '0', ajaxMember: 1, rand: generateRandom() }, onSuccess: function(transport) { var stockTicker = $('IMTF_QUOTE_0bea5b87'); if (transport.responseText.match('Imperitrade Stock Ticker 1.5')) { stockTicker.update(transport.responseText); } else { stopStockQuotes(); } }, onFailure: function(transport) { stopStockQuotes(); }, onException: function(transport) { stopStockQuotes(); } }); } function stopStockQuotes() { if (pe_IMTF_QUOTE_0bea5b87 != null) { pe_IMTF_QUOTE_0bea5b87.stop(); } } /* Load the stock quotes once the javascript finishes loading */ loadScript("https://quotes.imperitrade.com/scripts/prototype.js", function() { pe_IMTF_QUOTE_0bea5b87 = new PeriodicalExecuter(updateStockQuotes, 20); });