// © 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 15, 2010 | DJIA 10,583.43 -41.26 | NASDAQ 2,349.30 -18.36 | S&P 500 1,142.81 -7.18 | Fannie Mae 1.05 -0.03 | General Mills 72.49 +0.12 | Google 558.32 -21.22 | Apple 220.72 -5.88 | Microsoft 29.08 -0.19 | IBM 127.52 -0.42 | Citigroup 3.85 -0.12 | Ford 13.38 +0.04 | GE 17.01 -0.03 | 3M 81.01 -0.37 | Pfizer 17.06 -0.02 | McDonalds 66.09 +0.56 | Target 52.98 -0.10 | Wal-Mart 55.25 +1.35 | Johnson & Johnson 64.18 | EURO (in dollars) 1.37 | GOLD 108.04 +0.09 | OIL 71.50 -0.05 ' var contentNewsData = '| March 15, 2010 | Boston Scientific Suspends ICD Sales | Production, Manufacturing Trends Paint Mixed Picture | Capital One Credit Card Defaults Fall, but BofA\'s Rise | Merck Blood Thinner Appears Safe, Effective: Study | PepsiCo to Buy Back $15 Billion in Shares | AAA Governments Safe, but Risks Grow: Moody\'s | Auditor Could Face Liability in Lehman Case | Toyota Cuts Prius Output on Slowing Sales | Deal Is Near for the Sale of Hilfiger | AIG to Withhold $21 Million in Bonuses from Staff | JPMorgan, Hopu Hired on $3.1 Billion CNOOC-Bridas Deal | Dodd Bill Earns Praise From GOP—But Not Votes ' 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('') }