Given line 20, I think the below if/else can be simplified a bit (would replace line 31 to 43):

```
var onMobile = ( (('ontouchstart' in w) || ('onmsgesturechange' in w)) && (screen.width<=768) );
if (m=='false ||
   (!onMobile && p=='mobile') ) {
  redirectToDesktop();
} else if (m=='true' ||
             (onMobile && p=='desktop') ) {
  redirectToMobile(); 
}
```

Should do the same, but is a bit more readable, IMO. Just a proposal.