// © Lundberg & Associates - Implementation and customization of: // © Dynamic Drive (www.dynamicdrive.com) - Cross browser Marquee script // 11-22-08 Lundberg - Modify default marquee length, height, and background color. // 11-23-08 Lundberg - Modify document.write statement to leave table open for adding Get Quote table data // 11-24-08 Lundberg - Converted js to php fileExternalize the data ticker data file. // 12-02-08 Lundberg - Added PHP function to escape the news string. //Specify the marquee's width (in pixels) var marqueewidth="800px" //Specify the marquee's height var marqueeheight="18px" //Specify the marquee's marquee speed (larger is faster 1-10) var marqueespeed=3 //configure background color: var marqueebgcolor="#e6e6e6" //Pause marquee onMousever (0=no. 1=yes)? var pauseit=1 //Specify the marquee's content (don't delete tag) //Keep all content on ONE line, and backslash any single quotations (ie: that\'s great): // PRL - The content of the ticker is pulled from an external file named market-data.txt. // The file is located in the same directory as this script. // Consider moving this to a different location // PRL - the following line is used for debugging - this sets the string manually. //var marqueecontent='Nov 25, 2008 ' var contentPrefix = '' //var contentMarketData = '| December 4, 2008 | NASDAQ 1445.56 -46.82 | S&P 500 845.22 -25.52 | USD to EURO 0.7817 | EURO to USD 1.2792 | GOLD 767.05 | OIL 1.00 | DOW JONES 8376.24 -215.45 | GOOGLE 274.34 -5.09 ' //var contentNewsData=' | Hand over militants, India tells Pakistan | U.S. warned India of maritime attack | Bio terror attack likely by 2013, panel says | Commentary: How we lost faith in Wall Street | \'Brain fingerprinting\' may bump metal detectors ' var contentMarketData = '| January 3, 2012 | DJIA 0.00 | NASDAQ 2,648.72 +43.57 | S&P 500 1,277.06 +19.46 | Fannie Mae 0.00 | General Mills 40.30 -0.11 | Google 665.41 +19.51 | Apple 411.23 +6.23 | Microsoft 26.77 +0.81 | IBM 186.30 +2.42 | Citigroup 28.33 +2.02 | Ford 11.13 +0.37 | GE 18.36 +0.45 | 3M 83.49 +1.76 | Pfizer 21.97 +0.33 | McDonalds 98.84 -1.49 | Target 51.12 -0.10 | Wal-Mart 60.33 +0.57 | Johnson & Johnson 65.88 +0.30 | EURO (in dollars) 1.31 | GOLD 155.92 +3.93 | OIL 0.00 ' var contentNewsData = '| January 3, 2012 | Housing’s Huge Supply and Demand Imbalance | Gas Prices Are as Low as They\'ll Get: Gulf Oil CEO | A Gathering Storm Over ‘Right to Work’ in Indiana | Iran Tells Departed US Carrier Not to Return | Tight Race in Iowa Kicks Off 2012 Campaign on Tuesday | US Hopes New Iran Sanctions More Scalpel Than Axe | On Wall Street, a Renewed Optimism for Deals | Signs Point to Lukewarm Consumer Spending in 2012 | Fed Plans to Start Forecasting Changes in Interest Rate | Total Signs $2.3 Billion Shale Deal With Chesapeake | Murdoch Splashes Views on Twitter; Backs Santorum | US Investors Sue Lloyds Chiefs Over HBOS ' var contentSuffix = '| ' var marqueecontent=contentPrefix + contentMarketData + contentNewsData + contentMarketData + contentNewsData + contentMarketData + contentNewsData + contentMarketData + contentNewsData + contentMarketData + contentNewsData + contentSuffix //// NO NEED TO EDIT BELOW THIS LINE //////////// marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS var copyspeed=marqueespeed var pausespeed=(pauseit==0)? copyspeed: 0 var iedom=document.all||document.getElementById if (iedom) var actualwidth='' var cross_marquee, ns_marquee function populate(){ if (iedom){ cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee cross_marquee.style.left=0+"px" // Content starts out filling the div, then scrolls from there cross_marquee.innerHTML=marqueecontent actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth } else if (document.layers){ ns_marquee=document.ns_marquee.document.ns_marquee2 ns_marquee.left=0 // Content starts out filling the div, then scrolls from there ns_marquee.document.close() actualwidth=ns_marquee.document.width } lefttime=setInterval("scrollmarquee()",20) } window.onload=populate function scrollmarquee(){ if (iedom){ if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)) cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px" else cross_marquee.style.left=parseInt(marqueewidth)+8+"px" } else if (document.layers){ if (ns_marquee.left>(actualwidth*(-1)+8)) ns_marquee.left-=copyspeed else ns_marquee.left=parseInt(marqueewidth)+8 } } if (iedom||document.layers){ with (document){ if (iedom){ write('
') write('
') write('
') write('
') } else if (document.layers){ write('') write('') write('') }