I actually came up with a really great idea and I plan on hiring a top-notch web designer to create this for me. I'm a little worried, however, about hiring a freelancer because I'm afraid they'll either steal my idea or resell the website files they created for me. Is there any kind of legal agreement that will hold up in court and allow me to go after them if worst comes to worst?
For the idea, an NDA (non disclosure agreement) will do fine. It is in general illegal to take the design and code and such so a contract will do little to stop them if they want to do it. My advice is to stick away from shadier looking coders and keep all the work in your country.
atty's are in it for the money, unless you are a multi million dollar company and willing spend lots to defend your good name, then maybe, less then that, an atty would say its life, move on...and your designer does not have to do the dirty deed, anyone that sees your website can have it duplicated by any coder, no atty is going to give you the time of day because you think you have a good idea, they do not care about you, or what someone else did too you unless they know they can get a high dollar amount, and know they can win, otherwise it would be a waste of their time.
Despite what the post above implies; not all attorneys are crooks. Many of us are hardworking individuals who take the client's problems to heart and consider their problems to be our problems. There are many ways to protect your ideas including NDA's and contracts. It is the enforcement that becomes expensive. A good lawyer will ask you for what you are trying to accomplish and come up with ways to protect you that will not cost you an arm and a leg. Good legal advice before you procede will often save you thousands of dollars by avoiding the problems that could arise.
Lately a lot of people have been sending me NDA's to sign before they will even discuss hiring me for their project, so it looks as if it is getting more and more prevalent. You always have to be careful to read them before you sign, particularly if you have your own websites and domains. A lot of people will try to insert terms of non-compete in there as well and half the time it is inevitable that I will already have a website, blog or Facebook page that could be considered direct competition..so I never sign those....only the ones that are about their particular idea, files or website.