I'm not sure you've given us enough information about exactly what you want to do--tell us more.
Update: Now we have a better idea what you want to do. I recommend you sketch out with pseudo-code the outlines of what you want to do, then start asking focused questions--this one is a little broad.