Completely clean iphone as if it never happened

I searched the forums and found some stuff but I kind of didn't understand if it applied to what I wanted to do. I was wondering if there is a way to completely start over with my iPhone 3G. I want to go back to the "Virgin" state. Is there a way or guide that will take my iPhone back as if I never Jailbroke it? I got this one thing that changes my clock on my iphone to a custom one but even after I restored it the thing is still there and got me denied when I took my iPhone in for repair! I want to do something as if I was doing a reformat for a computer. Thanks in advanced sorry if I didnt search hard enough.