/*
Copyright 2012, KISSY UI Library v1.30rc
MIT Licensed
build time: Jul 11 21:25
*/
KISSY.add("ua/base",function(i,e){var f=i.Env.host,b=f.navigator.userAgent,g="",c="",a,j=[6,9],f=f.document.createElement("div"),k,d={webkit:e,trident:e,gecko:e,presto:e,chrome:e,safari:e,firefox:e,ie:e,opera:e,mobile:e,core:e,shell:e},h=function(a){var b=0;return parseFloat(a.replace(/\./g,function(){return 0===b++?".":""}))};f.innerHTML="<\!--[if IE {{version}}]><s></s><![endif]--\>".replace("{{version}}","");k=f.getElementsByTagName("s");if(0<k.length){c="ie";d[g="trident"]=0.1;if((a=b.match(/Trident\/([\d.]*)/))&&
a[1])d[g]=h(a[1]);b=j[0];for(j=j[1];b<=j;b++)if(f.innerHTML="<\!--[if IE {{version}}]><s></s><![endif]--\>".replace("{{version}}",b),0<k.length){d[c]=b;break}}else if((a=b.match(/AppleWebKit\/([\d.]*)/))&&a[1]){d[g="webkit"]=h(a[1]);if((a=b.match(/Chrome\/([\d.]*)/))&&a[1])d[c="chrome"]=h(a[1]);else if((a=b.match(/\/([\d.]*) Safari/))&&a[1])d[c="safari"]=h(a[1]);if(/ Mobile\//.test(b))d.mobile="apple";else if(a=b.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))d.mobile=a[0].toLowerCase()}else if((a=
b.match(/Presto\/([\d.]*)/))&&a[1]){if(d[g="presto"]=h(a[1]),(a=b.match(/Opera\/([\d.]*)/))&&a[1]){d[c="opera"]=h(a[1]);if((a=b.match(/Opera\/.* Version\/([\d.]*)/))&&a[1])d[c]=h(a[1]);if((a=b.match(/Opera Mini[^;]*/))&&a)d.mobile=a[0].toLowerCase();else if((a=b.match(/Opera Mobi[^;]*/))&&a)d.mobile=a[0]}}else if((a=b.match(/MSIE\s([^;]*)/))&&a[1]){if(d[g="trident"]=0.1,d[c="ie"]=h(a[1]),(a=b.match(/Trident\/([\d.]*)/))&&a[1])d[g]=h(a[1])}else if(a=b.match(/Gecko/)){d[g="gecko"]=0.1;if((a=b.match(/rv:([\d.]*)/))&&
a[1])d[g]=h(a[1]);if((a=b.match(/Firefox\/([\d.]*)/))&&a[1])d[c="firefox"]=h(a[1])}d.core=g;d.shell=c;d._numberify=h;return d});KISSY.add("ua/css",function(i,e){var f=i.Env.host.document.documentElement,b="",g;i.each("webkit,trident,gecko,presto,chrome,safari,firefox,ie,opera".split(","),function(c){if(g=e[c]){b=b+(" ks-"+c+(parseInt(g)+""));b=b+(" ks-"+c)}});f.className=i.trim(f.className+b)},{requires:["./base"]});
KISSY.add("ua/extra",function(i,e){var f=i.Env.host,b=f.navigator.userAgent,g,c,a={},j=e._numberify;if(b.match(/360SE/))a[c="se360"]=3;else if(b.match(/Maxthon/)&&(g=f.external)){c="maxthon";try{a[c]=j(g.max_version)}catch(k){a[c]=0.1}}else if(f=b.match(/TencentTraveler\s([\d.]*)/))a[c="tt"]=f[1]?j(f[1]):0.1;else if(b.match(/TheWorld/))a[c="theworld"]=3;else if(f=b.match(/SE\s([\d.]*)/))a[c="sougou"]=f[1]?j(f[1]):0.1;c&&(a.shell=c);i.mix(e,a);return e},{requires:["ua/base"]});
KISSY.add("ua",function(i,e){return i.UA=e},{requires:["ua/extra","ua/css"]});
