Simple mobile skin auto change

Although there is presently an extension designed to automatically change to various mobile skins (iPhone, Blackberry, etc), it doesn't seem to be working for the current version of MediaWiki (as of 08-09-2010). The following code snippet allows for detection of an iPhone, followed by automatic switching of the skin / theme to an iPhone-compatible one (in this case, WPtouch). Add this code to your LocalSettings.php file (replacing the current $wgDefaultSkin variable) after installing the iPhone-compatible skin. This will make the default skin "wptouch" if an iPhone, "vector" otherwise. Modify as needed.