TheMadScientist - 10:32 am on Mar 14, 2011 (gmt 0)
No you should be fine as long as their mobile bot get the mobile version and the regular bot gets the regular version, so they get the same content a visitor gets. It's what wilderness said 'browser dependent' content. Cloaking is more content 'switching' for GoogleBot specifically.
For instance if you show your visitors: Welcome to Example.Com, but to GoogleBot you show Welcome to WebmasterWorld, because you want to rank for WebmasterWorld instead of what's on your website that would be cloaking.
One note about your PHP: ereg() is depricated, it's better to use preg_match. ;)
Finally: Welcome to WebmasterWorld!