you can go get a manual on your car at advanced auto parts or some store like that and it will tell you the wiring scheme. If not you can find someone to put them in for cheap. And for the idle problem, like Lude said, try the TPS Sensor

I had a idle problem on my car a while back and it turned out to be the fuel injectors, heh go figure, they were over spraying.