// © 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 = '| February 4, 2012 | DJIA 0.00 | NASDAQ 2,905.66 +45.98 | S&P 500 1,344.90 +19.36 | Fannie Mae 0.00 | General Mills 39.85 -0.08 | Google 596.33 +11.22 | Apple 459.68 +4.56 | Microsoft 30.24 +0.29 | IBM 193.64 +2.11 | Citigroup 33.54 +1.55 | Ford 12.79 +0.53 | GE 19.02 +0.27 | 3M 87.73 +0.30 | Pfizer 21.20 +0.09 | McDonalds 100.01 +1.39 | Target 52.14 +0.14 | Wal-Mart 62.03 +0.09 | Johnson & Johnson 65.64 +0.05 | EURO (in dollars) 1.32 | GOLD 167.64 -3.41 | OIL 0.00 ' var contentNewsData = '| February 4, 2012 | Micron Technology CEO Dies in Plane Crash | The \'Fragile Consumer\' Is Feeling Better: Clorox CEO | Chug It: How to Play the Current Beer Market | Unemployment Rate Hinges on Much More Than Hiring | Super Bowl XLVI: It\'s All About the Second Screen | NY Sues Banks, Alleges Electronic Mortgage Fraud | Food Companies: We\'re Ready for the Super Bowl | Congressional Insider Trading Ban Passes Senate | Is Goldman Trying to Fire Its PR Director? | US Services Sector Jumps to Highest Level in a Year | US Payrolls Jump as Unemployment Falls to 8.3% | SEC Is Avoiding Tough Sanctions for Large Banks ' 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) document.write('') 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.write(marqueecontent) 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){ //document.write('
') if (iedom){ write('
') write('
') write('
') write('
') } else if (document.layers){ write('') write('') write('') }