web/static/res/js/incdetectmobile.js
author Edwin Razafimahatratra <edwin@robotalismsoft.com>
Wed, 16 Jan 2013 08:26:00 +0100
changeset 78 8c3f0b94d056
permissions -rw-r--r--
big commit after problems

function IsSmartphone() {
	return DetectUagent("android") ||
    	DetectUagent("iphone") ||
    	DetectUagent("ipod") ||
    	DetectUagent("symbian") ||
    	DetectUagent("series60") ||
    	DetectUagent("windows phone") ||    	
    	(DetectUagent("windows nt") && DetectUagent("arm")) || // Windows 8 on phone and surface!
    	DetectUagent("blackberry");    	
}

function IsIpad() {
    return DetectUagent("ipad");    		
}

function DetectUagent(name){
    return (navigator.userAgent.toLowerCase().search(name) > -1);
}