Well, I carried out a SMART test and the results said it was working normal and then went on and done an Apple Hardware test and that said the same, everything was okay . . . . . . . . and then, and this is mad this, then after the Apple Hardware test it gave 2 options on the screen, turn off the computer or restart the computer. I clicked on restart, and it closed then restarted, but something wasn't right. All the things I had on the desktop were not there. There was a little multi coloured ball thingy spinning round, and round, and round for ages. For some reason it hadn't found nor loaded finder. I turned it off by holding in the power button. 10 minutes later I turned it on, well i tried to, all i was getting was a plain grey screen with a spinning thingy and it was just stuck there, I tried it several times and it was the same each time. Next I tried other ways to get it on and they never worked so I then put the disk in that came with it and held, I think it was D, or was it C? . . . . not sure now but any way it came on asking if I wanted to install Snow Leopard, I never clicked on that, I went up the top and clicked UTILITIES and wanted to click on REPAIR PERMISSIONS then REPAIR DISK, nothing doing, they were both greyed out and couldn't be clicked on. It was saying the disc could not be repaired and to reformat and re install Snow Leopard.
This was on Wednesday afternoon. I took it to a Computer repair shop on Thursday morning and he said he would have a look and do some tests and phone me up later. 2 hours later he phoned and said the hard drive buggered and he will put a new one in. I said okay, whatever you have to do just get on with it. I got it back on Saturday afternoon and it's like I have a brand new imac here and for the last couple of days I have been on sorting my stuff out again, putting my music, videos and music back and downloading the apps again that I had. Good job I have a 2TB external hard drive here with all my stuff backed up.
So, now that everything is fine and dandy I can go to the Apple site and download a copy of Yosemite and hopefully it will make my machine a lot better cos as I say, I'm still running on Snow Leopard which was on it when I got it at the end of 2009.
Hopefully it is straight forward to upgrade to Yosemite and nothing goes wrong.
Thanks very much for your help and advice people