You're getting some good advice here so far -- I would add that the very NOTION of what you are asking is broken. What you have there is browser and/or device sniffing, something you have ZERO business doing on a website in the first place. It most always breaks sooner than later, and it fails to take into account the ENTIRE reason HTML exists...
Device neutral delivery of content.
IF you have your HTML written properly, with proper separation of presentation from content, using an elastic semi-fluid layout, it's not rocket science to re-arrange the layout to best fit the capabilities (usually width) of the device it's being shown on using media queries -- the so called "responsive layout".
Said media queries should be based on the needs of the content, NOT the device. Thinking specific devices is a waste of time because there are ENDLESS devices, there will be all sorts of new devices coming along -- you can't plan for all that. All you can plan for is having the content auto-adjust to fit whatever space is available.
Sniffing the UA string and specific designs for specific devices? No future-proofing, way more work, and on the whole a complete waste of time and effort.