PageSourceSearch

https://www.worldwidebrands.com/referdetect.js

js worldwidebrands.com collected 2026-09-24 08:35:39 UTC 3,690 bytes, 162 lines download raw bytes

1	var scriptLoc = 'https://affiliates.worldwidebrands.com/rep.asp';
2	
3	var kbId = 0;
4	var queryString = window.location.search.substring(1);
5	var imgdata = '';
6	var subdata = '';
7	var overwrite = 1;
8	var refdata = document.referrer;
9	var daysToLive = 180;
10	var multiDomain = false;
11
12	if (queryString.length > 0)
13	{
14		var pairs = queryString.split('&');
15		
16		for(var i = 0; i < pairs.length; i++)
17		{
18			var pairs2 = pairs[i].split('=');
19			bShowImage = true;	
20			switch(pairs2[0].toLowerCase())
21			{
22				case 'kbid':
23					kbId = pairs2[1];
24					break;
25				case 'oid':
26					kbId = pairs2[1];
27					imgdata = "none";
28					subdata = "none";
29					refdata = "none";
30					bShowImage = false;
31					break;					
32				case 'clearcookie':
33					if (pairs2[1] == 1)
34					{
35						DeleteCookie("kbid");
36					}
37					break;
38				case 'img':
39					imgdata = pairs2[1];
40					break;
41				case 'sub':
42					subdata = pairs2[1];
43					break;
44				default:
45				if (!isNaN(pairs2[0]) && pairs2[0].length > 3) {
46				kbId = pairs2[0];
47				}
48			}
49		} //end for
50	}//end if
51
52
53//	if (GetCookie("affiliate") == null || overwrite == 1)
54//	{
55	
56	
57		if (kbId != 0)
58		{
59			
60			
61			var img = new Image();
62			var url = scriptLoc + '?id=' + kbId;
63			if (imgdata != '')
64			{
65				url += '&img=' + imgdata
66			}
67
68			if (subdata != '')
69			{
70				url += '&sub=' + subdata
71			}
72			if (refdata != '')
73			{
74				url += '&ref=' + refdata;
75			}
76
77			if (bShowImage == true ) {
78			img.src = url;
79			}
80			SetCookie("affiliate", kbId, daysToLive);
81			SetCookie("affiliatesub", subdata, daysToLive);
82			SetCookie("affiliateimg", imgdata, daysToLive);
83			SetCookie("affiliateref", refdata, daysToLive);
84
85		}
86//	}//end if
87	
88	function getCookieVal (offset) 
89	{
90		var endstr = document.cookie.indexOf (";", offset);
91		if (endstr == -1)
92			endstr = document.cookie.length;
93
94		return unescape(document.cookie.substring(offset, endstr));
95	}
96
97	function GetCookie (name) 
98	{
99		var arg = name + "=";
100		var alen = arg.length;
101		var clen = document.cookie.length;
102		var i = 0;
103		
104		while (i < clen) 
105		{
106			var j = i + alen;
107			if (document.cookie.substring(i, j) == arg)
108				return getCookieVal (j);
109			
110			i = document.cookie.indexOf(" ", i) + 1;
111
112			if (i == 0) break; 
113		}
114		
115		return null;
116	}
117
118	function WriteCookie (name, value, expires) 
119	{
120		var argv = SetCookie.arguments;
121		var argc = SetCookie.arguments.length;
122		var path = "/";
123
124			//inserted by Andrew Herron to fix cross-sub-domain cookie compatibility, 05/02/2006
125			if (multiDomain) {
126				rootDomain = document.domain;
127			} else {
128				domain = document.domain;
129				dparts = domain.split(".");
130				if (dparts.length == 3) {
131					rootDomain = dparts[1]+"."+dparts[2];
132				} else {
133					rootDomain = domain;
134				}
135			}
136
137		var secure = (argc > 5) ? argv[5] : false;
138		
139		var cookie = name + "=" + escape(value) +
140			((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
141			((path == null) ? "" : ("; path=" + path)) +
142			((rootDomain == null) ? "" : ("; domain=" + rootDomain)) +
143			((secure == true) ? "; secure" : "");
144		
145		document.cookie = cookie;
146		
147	}
148
149	function DeleteCookie (name) 
150	{
151		var exp = new Date();
152		exp.setTime (exp.getTime() - 1000000000);  // This cookie is history (changed -1 to make it previous time)
153		var cval = GetCookie (name);
154		document.cookie =name + "=" + cval + "; expires=" + exp.toGMTString();
155	}
156
157	function SetCookie(name, value, expiredays)
158	{
159		var expdate = new Date(); 
160		expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * expiredays)); 
161		WriteCookie(name, value, expdate);  
162	}

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.