/* * Imperitrade Financial Stock Quote Ticker, version 1.5 * (c) 1998-2024 Imperial Network, Todd Schlomer /*--------------------------------------------------------------------------*/ var pe_IMTF_QUOTE_b07e66a7 = 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_b07e66a7'); stockQuoteDiv.innerHTML = "
15 Most Active Stocks
STCX182.86+5.46
VPAX15,936.54+1.44
IMPX392.80+1.15
ICS513.38+0.49
IACF8,024.99+0.40
IMPG1,048.77+0.37
ECBND64.50+0.37
MMA6,845.44+0.29
VPA9,008.95+0.26
VEX239.31-0.21
ECX138.87-0.26
FGB65.69-0.44
IVE66.20-0.46
IMTF43.93-0.48
ICSX404.02-5.73
"; 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_b07e66a7"; 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_b07e66a7'); 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_b07e66a7 != null) { pe_IMTF_QUOTE_b07e66a7.stop(); } } /* Load the stock quotes once the javascript finishes loading */ loadScript("https://quotes.imperitrade.com/scripts/prototype.js", function() { pe_IMTF_QUOTE_b07e66a7 = new PeriodicalExecuter(updateStockQuotes, 20); });