/* * Imperitrade Financial Stock Quote Ticker, version 1.5 * (c) 1998-2019 Imperial Network, Todd Schlomer /*--------------------------------------------------------------------------*/ var pe_IMTF_QUOTE_7feb796c = 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_7feb796c'); stockQuoteDiv.innerHTML = "
15 Most Active Stocks
VPA1,463.22+1.54
MMA3,238.36+0.88
IMPG854.62+0.65
ECX134.44+0.62
IACF2,249.29+0.60
STCX169.35+0.51
IVE297.17+0.37
AIIF645.36-0.42
STORMB171.56-0.44
MCBND40.08-0.86
IMC138.65-1.48
ECBND62.80-1.56
DJOX151.76-2.26
NAVX160.82-4.15
IMPX377.75-8.06
"; 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_7feb796c"; 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_7feb796c'); 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_7feb796c != null) { pe_IMTF_QUOTE_7feb796c.stop(); } } /* Load the stock quotes once the javascript finishes loading */ loadScript("https://quotes.imperitrade.com/scripts/prototype.js", function() { pe_IMTF_QUOTE_7feb796c = new PeriodicalExecuter(updateStockQuotes, 20); });