Hi im really stressed here with my problem hope someone can help me out please..

So i got this iphone 3g from a friend. He got it for the US from another person. We have no idea what the carrier is or if its factory unlocked or not. The phone was not jailbroken or anything. Then one day my friend updated his iphone 3g to the ios 4.1 which also upgraded his baseband to 06.15.00 so the phone is now locked and no sim here in Bahrain can be used. He asked me if i could unlock it for him so i tried to do so thinking i could use ultrasnow. I jailbroke it first using redsnow 09.6b2 and pointed it on its firmware 4.1 (from iclarified) when it asked for one and the jailbreak went through perfectly.

But then what he forgot to tell me was that there the wifi wasnt working on his phone. There would just be that thing circling next to the connecting to wifi but nothing would show up. So there is no way for me to get into cydia and get the ultrasnow right? So i read thru some forums here and found that the wifi thing is a bug with the ios4 when u update? So i thought of downgrading the phone instead to 3.1.3. When i tried to do that using the full restore where u shift click the restore button and select the 3.1.3 firmware, it was going okay it first but then i got a 1015 error in itunes that the phone cant be restored. So i did the recovery fix (which i was able to succesfully do to another friend's iphone) it almost worked with this one but i coouldnt connect to itunes after coz i get the message::


"The SIM card inserted in this iPhone does not appear to be supported.

Only compatible SIM cards from a supported Carrier may be used to activate iPhone. Please insert the SIM card that came with your iPhone or visit supported Carrier’s store to receive a replacement SIM card"


This is where i am stuck. I dont even know what firmware the phone is currently in after what i did. What do i do here? The phone is on DFU mode at the moment btw. Please help me out guys any help at all will be appreciated. How can i get through this stage and get my friend's phone unlocked and okay?

iPhone 3G, iOS 4.1