detect if webpage is pinned to ios home screen

+ code reformat

More info about iOS pinned webpage mode:
http://developer.apple.com/library/safari/#documentation/appleapplications/reference/safariwebcontent/ConfiguringWebApplications/ConfiguringWebApplications.html#//apple_ref/doc/uid/TP40002051-CH3-SW1