1function catSetSelectedCSSItem(menuid) { 2 var _host = document.location.host; 3 var _url = document.location.href.substring(document.location.href.indexOf(_host)+_host.length).toLowerCase(); 4 var _anchor; 5 var _parent; 6 var _class; 7 var _image; 8 var _anchors = document.getElementById(menuid).getElementsByTagName('a'); 9 10 var ie = false; 11 var detect = navigator.userAgent.toLowerCase(); 12 if (detect.indexOf('msie') > 0) ie = true; 13 14 if (_url.indexOf('?') != -1) _url = _url.substring(0,_url.indexOf('?')); // must remove query variables 15 16 for (var i=0;i<_anchors.length;i++) { 17 _anchor = _anchors[i].href.substring(document.location.href.indexOf(_host)+_host.length).toLowerCase(); 18 if (_anchor == _url) { 19 _image = _anchors[i].getAttribute('selimg'); // sel img is on anchor 20 if (_image) 21 _anchors[i].style.background = "url("+_image+")"; 22 _parent = _anchors[i].parentNode; // get li node 23 while (_parent) { 24 if (_parent.id == menuid) break; // don't go up infinitely 25 if (_parent.tagName == "LI") { 26 _class = _parent.getAttribute('selcss'); // sel css is on li 27 if (_class) 28 _parent.className = _class; 29 else { // logic below as per partner req't 30 if (ie){ 31 var ver = getInternetExplorerVersion(); 32 if (ver > -1) { 33 if (ver >= 8.0) 34 _class = _parent.getAttribute('class'); 35 else 36 _class = _parent.getAttribute('className'); 37 } 38 } 39 else 40 _class = _parent.getAttribute('class'); 41 42 if (_class) 43 _parent.className = _class+" selected"; 44 else 45 _parent.className = "selected"; 46 //when you mouse over the selected class get removed. fix.. 47 _parent.onmouseout = function(val) { 48 return function() { 49 if (val) 50 this.className = val + " selected"; 51 else 52 this.className = "selected"; 53 } 54 } (_class); 55 56 } 57 } 58 _parent = _parent.parentNode; 59 } 60 break; 61 } 62 } 63} 64 65 66function getInternetExplorerVersion() { 67 var rv = -1; // Return value assumes failure. 68 if (navigator.appName == 'Microsoft Internet Explorer') { 69 var ua = navigator.userAgent; 70 var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); 71 if (re.exec(ua) != null) 72 rv = parseFloat(RegExp.$1); 73 } 74 return rv; 75}
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.