hi ,
It is very difficult to identify all mobile device,but you can use
http://www.hand-interactive.com/resources/detect-mobile-javascript.htmthis link
^ to detect some of smart phone.
you need to check all mobile device(you wont to target) and check it's user agent and add more if condition in given sample code.
you can also use CSS3 media query.
but it is more better if you do this on server side as it is more robust ans sever requests also contain client user agent value