iMac has a black screen, could it be the Inverter?

Been looking through similar posts but my problem appears to be different to those i have read.

I have no way of connecting the imac to another display at the moment, but everything appears to be functioning correctly except the dead lcd. I managed to get a cd to play in itunes by putting in a cd so im guessing its not a problem with the logic board?

First time this happened was about three days ago, the screen went to black but with a hint of brightness.So after shutdown and leaving for a few minutes the screen is back to normal.

Yesterday the same thing happened, and after rebooting i would get the usual grey apple start up screen and now to a completely black screen at the point you would login. After many attempts, i now have just a black screen at start up with no apple after the chime. I can still play a CD.

Ive managed to find the same inverter i need online, but would like some opinions on this before i go ahead and buy. Hopefully there is not a problem with the LCD. Thanks for any advice! Great site BTW!