1var ifidSiteCatalyst = { 2 buildCookiesArray : function() { 3 var cookiesArray = document.cookie.split(';'); 4 var cookieRexExp = /^(.*)=(.*)/; 5 for(i=0,ii=cookiesArray.length; i<ii; i++){ 6 var cookieResult = cookieRexExp.exec(cookiesArray[i]); 7 ifidSiteCatalyst.ifidCookies[cookieResult[0]]=cookieResult[1]; 8 } 9 }, 10 getPageName : function(pName) { 11 pName = pName.replace(/(^https{0,1}:\/\/.*)(\/.*)/gi,"$2")/*remove http(s) & www.domain*/.replace(/^\/(.*)/,"$1")/*remove leading '/'*/; 12 pName += this.getPNameHeader('calcs');// get calcs header. 13 pName += this.getPNameHeader('financialcontent'); // get financial content header. 14 return pName; 15 }, 16 getChannel : function(channel) { 17 return channel; 18 }, 19 getHier : function(hierarchy) { 20 return hierarchy; 21 }, 22 getSearchResultsCount : function() { 23 var searchRegExp = /Results\s*<b>\d*<\/b>\s*-\s*<b>\d*<\/b>\s*of\s*about\s*<b>(\d*)<\/b>/i; 24 var searchResults = searchRegExp.exec(document.getElementById("search").innerHTML); 25 var returnString=""; 26 if(searchResults != null && typeof searchResults!="undefined") { 27 if(typeof searchResults[1] != "undefined"){ 28 returnString = searchResults[1]; 29 } 30 } 31 return returnString; 32 }, 33 getPNameHeader : function(type) { 34 var returnString=""; 35 if(type=="calcs") { 36 if(document.forms["calculator"]){ 37 var testRegExp = /<h2>\s*(.*)<\/h2>/i; // assumes it is the first <h2> within the 'calculator' form. 38 var testString = document.forms["calculator"].innerHTML; 39 } 40 } 41 if(type=="financialcontent") { 42 if(document.getElementById("sANDpContent")){ 43 var testRegExp = /<h1>\s*(.*)<\/h1>/i; // assumes it is the first <h1> within 'sANDpContent' div. 44 var testString = document.getElementById("sANDpContent").innerHTML; 45 } 46 } 47 if(typeof testString != "undefined" && testString != null && typeof testRegExp != "undefined" && testRegExp != null){ 48 var resultArry = testRegExp.exec(testString); 49 returnString = (resultArry != null && typeof resultArry != "undefined")?' | ' + resultArry[1]:''; 50 } 51 return returnString; 52 }, 53 getWCServerName : function(sessionid) { 54 var returnVal = "none"; // default 55 if(typeof ifidSiteCatalyst.ifidCookies[sessionid] != "undefined"){ 56 var serverid = ifidSiteCatalyst.ifidCookies[sessionid]; 57 var serverRegExp = /\.(.*)?/; 58 var tempstring = serverRegExp.exec(serverid); 59 returnVal = (tempstring != null && typeof tempstring != "undefined")?tempstring[1]:"none"; 60 } 61 return returnVal; 62 }, 63 getIBUserStatus : function(scibuser) { 64 var returnVal = "IB non-User"; // default 65 if(typeof ifidSiteCatalyst.ifidCookies[scibuser] != "undefined"){ 66 if(ifidSiteCatalyst.ifidCookies[scibuser]=="true") returnVal = "IB User"; 67 } 68 return returnVal; 69 }, 70 getIFSNum : function(ifsnum) { 71 ifsnum = ifsnum.replace(/[^0-9]/gi,''); 72 if(ifsnum.length<5){ 73 ifsnum = ifsnum.replace(/(.*)/,"0$1"); 74 } 75 ifsnum = ifsnum.match(/.{0,5}/); 76 return ifsnum; 77 }, 78 init : function () { 79 ifidSiteCatalyst.pageName = (typeof arguments[0] != "undefined")?this.getPageName(arguments[0]):this.getPageName(document.location.href); 80 ifidSiteCatalyst.channel = (typeof arguments[1] != "undefined")?this.getChannel(arguments[1]):""; 81 82 var cookiesArray = document.cookie.split(';'); 83 ifidSiteCatalyst.ifidCookies = new Array(cookiesArray.length); 84 var cookieRegExp = /^(.*)=(.*)?/; 85 for(i=0,ii=cookiesArray.length; i<ii; i++){ 86 var cookieResult = cookieRegExp.exec(cookiesArray[i]); 87 if(cookieResult != null){ /* cookie has no value (null) */ 88 if(typeof cookieResult[1] != "undefined") { 89 var key=cookieResult[1].replace(/^\s*(\S*)\s*?/,"$1"); 90 var value=(typeof cookieResult[2] != "undefined")?cookieResult[2].replace(/^\s*(\S*)\s*?/,"$1"):""; 91 ifidSiteCatalyst.ifidCookies[key]=value; 92 } 93 } 94 } 95 96 ifidSiteCatalyst.server = ifidSiteCatalyst.getWCServerName("JSESSIONID"); 97 ifidSiteCatalyst.ibUserStatus = ifidSiteCatalyst.getIBUserStatus("SCIBUser"); 98 /* pulling hier out. 99 ifidSiteCatalyst.hier = (typeof arguments[2] != "undefined")?this.getHier(arguments[2]):""; 100 */ 101 } 102}
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.