Here's a link on how to replace.Here is the part.Dealer cost is 322.00,shop cost is 233.00.The parts you will need are the master cylinder,brake fluid and a bleeder kit.Easy to do.
it sounds like either a fuel leak or a bad fuel pump. have you noticed a drop in horsepower? Although it sounds like a fuel problem i had an eclipse that did the same thing and it turned out to be bad battery terminal connections. but my vehicle being warmed up or not had nothing to do with it which is why i have suggested the fuel being the issue, i hope this helps :)
Check the charging relay if working. You can find it in the fuse box which is either in the engine compartment or under the dashboard on the drivers side legroom.