/* DEVICE AND BROWSER DETECTION ================================================== */ if(typeof VMM != 'undefined' && typeof VMM.Browser == 'undefined') { VMM.Browser = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; this.device = this.searchDevice(navigator.userAgent); this.orientation = this.searchOrientation(window.orientation); }, searchOrientation: function(orientation) { if ( orientation == 0 || orientation == 180) { return "portrait"; } else if ( orientation == 90 || orientation == -90) { return "landscape"; } else { return "normal"; } }, searchDevice: function(d) { if (d.match(/Android/i) || d.match(/iPhone|iPod/i)) { return "mobile"; } else if (d.match(/iPad/i)) { return "tablet"; } else if (d.match(/BlackBerry/i) || d.match(/IEMobile/i)) { return "other mobile"; } else { return "desktop"; } }, searchString: function (data) { for (var i=0;i