// © 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 = '| March 10, 2010 | DJIA 10,557.51 -6.87 | NASDAQ 2,355.07 +14.39 | S&P 500 1,144.02 +3.58 | Fannie Mae 1.10 +0.03 | General Mills 72.06 -0.01 | Google 568.76 +8.57 | Apple 224.39 +1.37 | Microsoft 28.94 +0.14 | IBM 125.39 -0.16 | Citigroup 3.94 +0.12 | Ford 12.84 +0.04 | GE 16.47 -0.03 | 3M 81.40 -0.59 | Pfizer 17.20 -0.03 | McDonalds 64.76 -0.34 | Target 52.42 -0.44 | Wal-Mart 53.70 -0.05 | Johnson & Johnson 64.30 +0.03 | EURO (in dollars) 1.36 | GOLD 108.22 -1.50 | OIL 71.50 -0.05 ' var contentNewsData = '| March 10, 2010 | Jobless Rate Rose in 30 States In January, Five Hit Records | With Warning, a Hip Device Is Withdrawn | A Consumer Bill Gives Exemption on Payday Loans | US Wholesale Inventories Unexpectedly Fell in January | Google, China to Solve Dispute Soon: Google CEO | Brace for Above-Normal US Hurricane Season | Terra Now Favors CF\'s Bid Over Yara Deal | Home Loan Demand Nudges Higher in Latest Week | US Economy Seen Having Slow Growth in Months Ahead | Senate Poised to Pass Jobless Aid, Tax Breaks | Senate Poised to Pass Jobless Aid, Tax Breaks | Regulators Warn Banks Not to Hike Dividends: Report ' 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('') }