checkDetect = function(){
var Detect = {
webkit: /(AppleWebKit)[ \/]([\w.]+)/,
ipad: /(ipad).+\sos\s([\d+\_]+)/i,
windows: /(windows\d*)\snt\s([\d+\.]+)/i,
iphone: /(iphone)\sos\s([\d+\_]+)/i,
ipod: /(ipod).+\sos\s([\d+\_]+)/i,
android: /(android)\s([\d+\.]+)/i
};
var ua = window.navigator.userAgent,
browser = Detect.webkit.exec(ua),
ios = /\((iPhone|iPad|iPod)/i.test(ua),
//["iPhone OS 5_1", "iPhone", "5_1"]
tmp = [],
N = {},
match = [];
for(i in Detect){
match = Detect[i].exec(ua);
if(match){
tmp = Detect[i].exec(ua);
}
}
N = {
system : tmp[1].toLowerCase(),
version : tmp[2].replace(/(\_|\.)/ig, ‘.‘).toLowerCase(),
browser : browser ? browser[1].toLowerCase() : ‘apple/webkit‘,
ios: ios
}
return N;
}