* Indexes turn lower in afternoon trading
* Fall in crude oil weighs on energy shares
* Investors unnerved by Canadian parliament shooting
* Indexes down: Dow 0.61 pct, S&P 500 0.38 pct, Nasdaq 0.43 pct
By Yasmeen Abutaleb
NEW YORK, Oct 22 (Reuters) - U.S. stocks turned lower in afternoon trading on Wednesday, with major indexes erasing earlier gains as a shooting at the Canadian parliament unnerved investors and Boeing and Biogen sold off following results.
Indexes had traded in positive territory for much of the session, putting the S&P 500 on track for a fifth straight day of gains. Earnings initially drove the move higher, with technology and material shares up on the back of strong results.
Market benchmarks began drifting lower in late morning after a gunman fatally wounded a soldier in Ottawa, the Canadian capital, and then entered the country's parliament buildings chased by police. By early afternoon, the market had given up earlier gains.
The shooting in Ottawa is "the only news event I'm seeing here that could be spooking this market. There's nothing else other than technical points," said Paul Mendelsohn, chief investment strategist at Windham Financial Services in Charlotte, Vermont.
Biogen Idec was the biggest drag on the S&P 500, falling 5.1 percent to $310.04 after sales of its big-selling new multiple sclerosis drug, Tecfidera, fell short of Wall Street's lofty expectations. It also reported a higher-than-expected quarterly profit and raised its full-year earnings forecast.
Boeing Co lost 4.4 percent to $121.57 despite reporting higher-than-expected earnings and lifting its outlook, as analysts raised concern about the costs of the 787 Dreamliner. Its decline comes after a rise of 5.8 percent over the four previous sessions.
Along with healthcare and industrial names, energy shares were among the day's biggest decliners, off 0.9 percent as crude oil lost 1.7 percent.
On the upside, Yahoo Inc and Broadcom rallied a day after both tech companies reported better-than-expected revenue.
Broadcom shares climbed 6.1 percent to $39.62 while Yahoo was up 5.2 percent at $42.25; the two made up the S&P 500's top percentage gainers.
In the latest economic data, consumer prices rose 0.1 percent in September as energy costs fell broadly, painting a weak inflation picture that could give the Federal Reserve room to keep interest rates low for a while.
At 2:09 p.m. the Dow Jones industrial average fell 100.73 points, or 0.61 percent, to 16,514.08, the S&P 500 lost 7.4 points, or 0.38 percent, to 1,933.88 and the Nasdaq Composite dropped 19.19 points, or 0.43 percent, to 4,400.29.
Declining issues outnumbered advancing ones on the NYSE by 1,813 to 1,194, for a 1.52-to-1 ratio on the downside; on the Nasdaq, 1,793 issues fell and 844 advanced for a 2.12-to-1 ratio favoring decliners.
The benchmark S&P 500 index was posting 44 new 52-week highs and 1 new low; the Nasdaq Composite was recording 53 new highs and 25 new lows. (Editing by Nick Zieminski)