Fire, Water, Electric, Grass, Psychic, Dragon, Dark, and Ice are special types, so they run off of youe Special Attack rating.
Everything else runs off of your physical attack rating.
Also note, In G/S/C at least, Hidden Power runs off of whatever type it is (I.E. If it's a Dark-type attack, it runs off of Sp. Attack), but Hidden Power is always a physical attack, so the attack "Counter" will always be successful against it, no matter the type. (Like I said, this is true in Gold/Silver, I haven't tried it yet in Ruby/Sapphire.)