Oh Millions of reasons your computer could crash, maybe it is spyware or adware do u mean by freeze crash yea, it is proberly a virus run your favourite virus scanner regulary- And if u say it happens when u r online i bet that it is a virus i had that problem once my broadband was super slow, it was a virus using my bandwith to send huge amounts of Data- As i say run your virus scanner if u dont have one get AVG from www.grisoft.com
also you should always have a firewall on when on the internet you can get a free on call Sygate serarch on google for it, if that dosent work post some info about your hardware
Hope that helps !!!!!!!!!!!!!!!