// © 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 = '| July 29, 2010 | DJIA 10,497.88 -39.81 | NASDAQ 2,264.56 | S&P 500 1,106.13 | Fannie Mae 0.00 | General Mills 35.44 | Google 484.35 | Apple 260.96 | Microsoft 25.95 | IBM 128.43 | Citigroup 4.09 | Ford 12.91 | GE 16.05 | 3M 86.69 | Pfizer 15.00 | McDonalds 69.77 | Target 51.80 | Wal-Mart 51.13 | Johnson & Johnson 57.83 | EURO (in dollars) 1.31 | GOLD 113.78 | OIL 0.00 ' var contentNewsData = '| July 29, 2010 | Toyota Says to Recall 412,000 Cars in United States | Foreclosure Hot Spots Improve, but Trouble Seen Ahead | Nvidia Lowers Sales Outlook; Shares Fall | Former Enron CEO Skilling Seeks Release From Prison | Express Scripts Profit Rises, but Shares Fall | Visa Results Improve, Top Analysts\' Expectations | Arizona Will Quickly Appeal Immigration Ruling: Governor | Senate Panel Backs Yellen, Raskin, Diamond for Fed | Symantec Shares Take Hit as Sales Disappoint | Panera Expects to Hire 25K Employees: CEO Shaich | Beige Book: Some US Districts See Growth Slowing | Facebook Beats Back Patent Infringement Claim ' 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('') }