First question of dectection. Usually done with javascript. Go to a site such as http://www.webmonkey.com and search for 'browser detection' and you should get some good tutorials on how to play around with browser detection. I'm not exactly sure ware the variables are created but somewhere in the http headers are variables about browser and OS plus more. Browsers like Opera just change this variable. Get a packet sniffer, knoppix-std (security tools distro) has a bunch of good ones. With a packet sniffer you can read all the info in the ip and udp packets that are floating around your network which will give some good practice and help you answer your questions.

DeafLamb