http://dictionary.reference.com/browse/djin
You’re thinking of a djin, or jinn.
OH MY GOD. dueling pedants.