Web effects browser and operating system type
var browserdetect={
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 ";
},
Searchstring:function (data) {
for (Var i=0;i<data.length;i++) {
var datastring=data[i].string;
var Dataprop=data[i].prop;
this.versionsearchstring=data[i].versionsearch| | data[i].identity;
if (datastring) {
if (Datastring.indexof (data[i].substring)!=-1)
return data[i].identity;
}
else if (Dataprop)
return data[i].identity;
}
},
Searchversion:function (datastring) {
var index=datastring.indexof (this.versionsearchstring);
if (index==-1) return;
Return parsefloat (datastring.substring (index+this.versionsearchstring.length+1));
},
Databrowser: [
{string:navigator.useragent,substring: "OmniWeb", Versionsearch: "omniweb/", Identity: "OmniWeb"},
{string:navigator.vendor,substring: "Apple", Identity: "Safari"},
{prop:window.opera,identity: "Opera"},
{string:navigator.vendor,substring: "Icab", Identity: "Icab"},
{string:navigator.vendor,substring: "KDE", Identity: "Konqueror"},
{string:navigator.useragent,substring: "Firefox", Identity: "Firefox"},
{string:navigator.vendor,substring: "Camino", Identity: "Camino"},
{string:navigator.useragent,substring: "Netscape", Identity: "Netscape"},
{string:navigator.useragent,substring: "MSIE", Identity: "Explorer", Versionsearch: "MSIE"},
{string:navigator.useragent,substring: "Gecko", Identity: "Mozilla", Versionsearch: "rv"},
{string:navigator.useragent,substring: "Mozilla", Identity: "Netscape", Versionsearch: "Mozilla"}
],
Dataos: [
{string:navigator.platform,substring: "Win", Identity: "Windows"},
{string:navigator.platform,substring: "Mac", Identity: "Mac"},
{string:navigator.platform,substring: "Linux", Identity: "Linux"}
]
};
Browserdetect.init ();