jQuery Mobile Switch code not working?

Can anyone tell me if there is something wrong with this code? The idea is that if there is a mobile device detected it will switch to a different page template. The problem is that the result is a blank page (apparently an Error 404 page from what Chrome is returning). The templates mobile.php and standard.php do work because I tested them, which brings me to believe that there is something wrong with this code.

 * @author      Christian Schuelling
 * @package     Joomla!
 * @subpackage  Was Wenns Regnet
 * @link        http://whykiki.de
 * @email       info@whykiki.de
 * @copyright   Christian Schuelling
 * Was Wenns Regnet
 * Copyright (C) 2012 Christian Schuelling

defined( '_JEXEC' ) or die( 'Restricted access' );

////////////////////////////////////////////////////////// hier kommt lädt man allen relevanten Stuff, den man braucht, der aber keine Ausgabe macht.

// Gib mir den Menü Kram
$itemid = JRequest::getVar('Itemid');
$menu = &JSite::getMenu();
$active = $menu->getItem($itemid);
$params = $menu->getParams( $active->id );
$pageclass = $params->get( 'pageclass_sfx' );

include 'Mobile_Detect.php';
$detect = new Mobile_Detect();

if ($detect->isMobile()):	

Is there anything in the error log that would indicate a problem with this script or one associated with it? There isn’t really much to go on here. Especially, for people who are not familiar with the Joomla or that specific component being used.

Hello, oddz.
No error log to supply. It’s part of a jQuery Mobile package created by the author above. I event tested the package itself as is and still came up with the same result. I emailed the creator and have not received a response. Would I be better posting this in the CMS forum? I figured since it was PHP related I’d post it here.

Well in an effort to narrow down the culprit I would recommend going to line by line adding echo and exit until the script fails. When the script fails you know the culprit is than the line right before the echo/exit debugging.

Continued jQuery Mobile Switch code not working?