How long was it sitting? Did you use a fuel stabalizer (fuel could be bad). Also check your fuel filler cap...if not sealed properly it will cause irratic idle. Bad head gaskets and the MAF will cause this also. Try cleaning the MAF (use only MAF cleaner). There are several treads on checking for leaking head gaskets.