PC restarts while changing between users

Hi guys
last night my computer restarted while I was searching on internet(by firefox) and after that it worked well but today when I wanted to turn on the computer, pc was working but monitor wasn't showing anything just a black screen with the mouse pointer! I couldn't do anything so I just turn it off from pc. 2hours later I turnrd it on and everything was fine until I switched between users and again it restarted and the black screen was showing! I don't know what's wrong? is it the Ram? is it graphic card? or operating system? or maybe power system because I usually keep my computer turned on for 8 hours.
what should I do when black screen appears with a mouse pointer on it!? could you help me out?I really need my computer...
by the way the fans are working fine.

1G graphic card
2 cores
window XP
 
Back