Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-gb) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5)
Hmm, what kind of help, specifically, were you looking for? Guidance on the concepts behind your queries? Or just code that you can copy-and-paste? Or, perhaps, something in between? The more specific you can be in the kind of help you're seeking, the more specific we can be in our answers.
P.S. You'll find many of the members here much less willing to help with copy-and-paste solutions (which is not really programming) and much more willing to help guide you to your own discovery of the solution. (At least, that's my understanding.)