Obtain viewer's ip, location and more

I would like to write a flash program that obtains the viewer’s IP address, then obtains the viewer’s state, and then according to the state it shows a particular picture. So if I put this flash on my website and someone from Massachussetts looks at my website they will see a picture of a MASS license plate, but if someone from NJ looks at the same site they will see a picture of a NJ license plate.

I would appreciate any input from anone on this. How hard is it this to make? Where do I start? ETC.

I am familiar with some PHP, HTML, java-script and I have done alot Flash graphics work but I have not done any ActionScript which will need to be used here. Hope someone will respond.