1var ClearText = true; 2 var BrowserDetect = { 3 init: function () { 4 this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; 5 this.version = this.searchVersion(navigator.userAgent) 6 || this.searchVersion(navigator.appVersion) 7 || "an unknown version"; 8 this.OS = this.searchString(this.dataOS) || "an unknown OS"; 9 }, 10 searchString: function (data) { 11 for (var i=0;i<data.length;i++) { 12 var dataString = data[i].string; 13 var dataProp = data[i].prop; 14 this.versionSearchString = data[i].versionSearch || data[i].identity; 15 if (dataString) { 16 if (dataString.indexOf(data[i].subString) != -1) 17 return data[i].identity; 18 } 19 else if (dataProp) 20 return data[i].identity; 21 } 22 }, 23 searchVersion: function (dataString) { 24 var index = dataString.indexOf(this.versionSearchString); 25 if (index == -1) return; 26 return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); 27 }, 28 dataBrowser: [ 29 { string: navigator.userAgent, 30 subString: "OmniWeb", 31 versionSearch: "OmniWeb/", 32 identity: "OmniWeb" 33 }, 34 { 35 string: navigator.vendor, 36 subString: "Apple", 37 identity: "Safari" 38 }, 39 { 40 prop: window.opera, 41 identity: "Opera" 42 }, 43 { 44 string: navigator.vendor, 45 subString: "iCab", 46 identity: "iCab" 47 }, 48 { 49 string: navigator.vendor, 50 subString: "KDE", 51 identity: "Konqueror" 52 }, 53 { 54 string: navigator.userAgent, 55 subString: "Firefox", 56 identity: "Firefox" 57 }, 58 { 59 string: navigator.vendor, 60 subString: "Camino", 61 identity: "Camino" 62 }, 63 { // for newer Netscapes (6+) 64 string: navigator.userAgent, 65 subString: "Netscape", 66 identity: "Netscape" 67 }, 68 { 69 string: navigator.userAgent, 70 subString: "MSIE", 71 identity: "Explorer", 72 versionSearch: "MSIE" 73 }, 74 { 75 string: navigator.userAgent, 76 subString: "Gecko", 77 identity: "Mozilla", 78 versionSearch: "rv" 79 }, 80 { // for older Netscapes (4-) 81 string: navigator.userAgent, 82 subString: "Mozilla", 83 identity: "Netscape", 84 versionSearch: "Mozilla" 85 } 86 ], 87 dataOS : [ 88 { 89 string: navigator.platform, 90 subString: "Win", 91 identity: "Windows" 92 }, 93 { 94 string: navigator.platform, 95 subString: "Mac", 96 identity: "Mac" 97 }, 98 { 99 string: navigator.platform, 100 subString: "Linux", 101 identity: "Linux" 102 } 103 ] 104 105 }; 106 function SearchClear(fieldObject) 107 { 108 109 if(ClearText==true) 110 { 111 fieldObject.select(); 112 } 113 } 114 function SearchGoogleAlternate() 115 { 116 var SearchText = document.getElementById('GoogleSearch'); 117 SearchText = escape(SearchText.value ); 118 var link = "/Pages/Search.aspx?q=" + SearchText; 119 window.location= link; 120 } 121 function SearchGoogle(InputBox) 122 { 123 //Get the text box and redirect via Javascript to Google search appliance 124 var SearchText = InputBox; 125 SearchText = escape(SearchText.value ); 126 var link = "/Pages/Search.aspx?q=" + SearchText; 127 window.location= link; 128 } 129 function OverrrideForms(InputBox) 130 { 131 if(event.keyCode == 13) //keyCode 13 is used to recognize enter Key press. 132 { 133 var theForm = document.forms['aspnetForm']; 134 if (!theForm) { 135 theForm = document.aspnetForm; 136 } 137 theForm.onsubmit = function() {return false;}; 138 SearchGoogle(InputBox); 139 } 140 } 141
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.