PageSourceSearch

https://secure.cbn.com/scripts/s_code_community.aspx

js cbn.com collected 2026-09-24 08:29:57 UTC 17,309 bytes, 424 lines download raw bytes

1
2
3// Set Date Variables
4sOm_MinuteOfDay = "269";
5sOm_DayOfYear = "267";
6sOm_Year = "2026";
7sOm_Day = "24";
8sOm_Month = "9";
9
10// Set Contact Variables - legacy
11sOm_ContactSource = "";
12sOm_ContactID = "Value_Not_Set";
13sOm_ContactLoggedIn = "not_registered_or_cleared_data";
14sOm_ContactDetails = "" ;
15sOm_ContactLtvGroup = ""; 
16sOm_Level = "";
17sOm_Motivation = "041181";
18sOm_FeaturedContentID = "";
19sOm_CountryCode = "";
20
21// Set Contact Obj
22var cbn_obj;
23cbn_obj = {
24			source:              "",
25			id:                  "Value_Not_Set",
26			login_status:        false,
27			login_status_msg:    "not_registered_or_cleared_data",
28			ltvg:                "",
29			don_cbn:             false,
30			level:               "",
31			acc_lnk:             false,
32			acc_lnk_lvl_name:    "",
33			motivation:          "041181",
34			em:					 "",
35			first:				 "",
36			last:				 ""
37        };
38
39// additional motivation code check for referrers 
40try { 
41	sOm_sDefaultMotivationCodes = "041181,042875,042876,042877,042878,042879,042880,046536,046537,046538,046539,048381";
42	if (sOm_sDefaultMotivationCodes.indexOf(sOm_Motivation) >=0) {
43		if (location.href.indexOf('superbook.cbn') >=0) {
44			sOm_sReferrerURL = document.referrer.toLowerCase();
45			if ((sOm_sReferrerURL.indexOf(".google.c") > -1) || (sOm_sReferrerURL.indexOf("com.google") > -1)) {
46				sOm_Motivation = "048683";
47				cbn_obj.motivation = "048683";
48			} else if (sOm_sReferrerURL.indexOf(".bing.c") > -1) {
49				sOm_Motivation = "048684";	
50				cbn_obj.motivation = "048684";	
51			} else if (sOm_sReferrerURL.indexOf("facebook.com") > -1) {
52				sOm_Motivation = "048685";	
53				cbn_obj.motivation = "048685";	
54			} else if (sOm_sReferrerURL.indexOf("youtube.com") > -1) {
55				sOm_Motivation = "048687";	
56				cbn_obj.motivation = "048687";	
57			} else if (sOm_sReferrerURL.indexOf("pinterest.com") > -1) {
58				sOm_Motivation = "048688";	
59				cbn_obj.motivation = "048688";	
60			} else if (sOm_sReferrerURL.indexOf("twitter.com") > -1 || sOm_sReferrerURL.indexOf("/t.co/") > -1) {
61				sOm_Motivation = "048686";	
62				cbn_obj.motivation = "048686";	
63			} else if (sOm_sReferrerURL.indexOf("instagram.com") > -1) {
64				sOm_Motivation = "048689";	
65				cbn_obj.motivation = "048689";	
66			} else if (sOm_sReferrerURL.indexOf("yahoo.com") > -1) {
67				sOm_Motivation = "048691";	
68				cbn_obj.motivation = "048691";	
69			} else if (sOm_sReferrerURL.indexOf("duckduckgo.com") > -1) {
70				sOm_Motivation = "048690";	
71				cbn_obj.motivation = "048690";	
72			}
73		}
74		else if (location.href.indexOf('cbn.com') >= 0
75			&& location.href.indexOf('superbook.cbn') < 0
76			&& location.href.indexOf('/cbnnews') < 0
77		) {
78			sOm_sReferrerURL = document.referrer.toLowerCase();
79			if ((sOm_sReferrerURL.indexOf(".google.c") > -1) || (sOm_sReferrerURL.indexOf("com.google") > -1)) {
80				sOm_Motivation = "042712";
81				cbn_obj.motivation = "042712";
82			} else if (sOm_sReferrerURL.indexOf(".bing.c") > -1) {
83				sOm_Motivation = "042713";	
84				cbn_obj.motivation = "042713";	
85			} else if (sOm_sReferrerURL.indexOf("facebook.com") > -1) {
86				sOm_Motivation = "041055";	
87				cbn_obj.motivation = "041055";	
88			} else if (sOm_sReferrerURL.indexOf("youtube.com") > -1) {
89				sOm_Motivation = "042272";	
90				cbn_obj.motivation = "042272";	
91			} else if (sOm_sReferrerURL.indexOf("pinterest.com") > -1) {
92				sOm_Motivation = "048709";	
93				cbn_obj.motivation = "048709";	
94			} else if (sOm_sReferrerURL.indexOf("twitter.com") > -1 || sOm_sReferrerURL.indexOf("/t.co/") > -1) {
95				sOm_Motivation = "042273";	
96				cbn_obj.motivation = "042273";	
97			} else if (sOm_sReferrerURL.indexOf("instagram.com") > -1) {
98				sOm_Motivation = "048708";	
99				cbn_obj.motivation = "048708";	
100			} else if (sOm_sReferrerURL.indexOf("yahoo.com") > -1) {
101				sOm_Motivation = "048707";	
102				cbn_obj.motivation = "048707";	
103			} else if (sOm_sReferrerURL.indexOf("duckduckgo.com") > -1) {
104				sOm_Motivation = "048706";	
105				cbn_obj.motivation = "048706";	
106			}
107		}
108		else if (location.href.indexOf('cbnisrael.org') >=0) {
109			sOm_sReferrerURL = document.referrer.toLowerCase();
110			if ((sOm_sReferrerURL.indexOf(".google.c") > -1) || (sOm_sReferrerURL.indexOf("com.google") > -1)) {
111				sOm_Motivation = "048673";
112				cbn_obj.motivation = "048673";
113			} else if (sOm_sReferrerURL.indexOf(".bing.c") > -1) {
114				sOm_Motivation = "048674";	
115				cbn_obj.motivation = "048674";	
116			} else if (sOm_sReferrerURL.indexOf("facebook.com") > -1) {
117				sOm_Motivation = "048675";	
118				cbn_obj.motivation = "048675";	
119			} else if (sOm_sReferrerURL.indexOf("youtube.com") > -1) {
120				sOm_Motivation = "048677";	
121				cbn_obj.motivation = "048677";	
122			} else if (sOm_sReferrerURL.indexOf("pinterest.com") > -1) {
123				sOm_Motivation = "048697";	
124				cbn_obj.motivation = "048697";	
125			} else if (sOm_sReferrerURL.indexOf("twitter.com") > -1 || sOm_sReferrerURL.indexOf("/t.co/") > -1) {
126				sOm_Motivation = "048676";	
127				cbn_obj.motivation = "048676";	
128			} else if (sOm_sReferrerURL.indexOf("instagram.com") > -1) {
129				sOm_Motivation = "048696";	
130				cbn_obj.motivation = "048696";	
131			} else if (sOm_sReferrerURL.indexOf("yahoo.com") > -1) {
132				sOm_Motivation = "048699";	
133				cbn_obj.motivation = "048699";	
134			} else if (sOm_sReferrerURL.indexOf("duckduckgo.com") > -1) {
135				sOm_Motivation = "048698";	
136				cbn_obj.motivation = "048698";	
137			}
138		}
139		else if (location.href.indexOf('/cbnnews') >=0) {
140			sOm_sReferrerURL = document.referrer.toLowerCase();
141			if ((sOm_sReferrerURL.indexOf(".google.c") > -1) || (sOm_sReferrerURL.indexOf("com.google") > -1)) {
142				sOm_Motivation = "048678";
143				cbn_obj.motivation = "048678";
144			} else if (sOm_sReferrerURL.indexOf(".bing.c") > -1) {
145				sOm_Motivation = "048679";	
146				cbn_obj.motivation = "048679";	
147			} else if (sOm_sReferrerURL.indexOf("facebook.com") > -1) {
148				sOm_Motivation = "048680";	
149				cbn_obj.motivation = "048680";	
150			} else if (sOm_sReferrerURL.indexOf("youtube.com") > -1) {
151				sOm_Motivation = "048682";	
152				cbn_obj.motivation = "048682";	
153			} else if (sOm_sReferrerURL.indexOf("pinterest.com") > -1) {
154				sOm_Motivation = "048694";	
155				cbn_obj.motivation = "048694";	
156			} else if (sOm_sReferrerURL.indexOf("twitter.com") > -1 || sOm_sReferrerURL.indexOf("/t.co/") > -1) {
157				sOm_Motivation = "048681";	
158				cbn_obj.motivation = "048681";	
159			} else if (sOm_sReferrerURL.indexOf("instagram.com") > -1) {
160				sOm_Motivation = "048695";	
161				cbn_obj.motivation = "048695";	
162			} else if (sOm_sReferrerURL.indexOf("yahoo.com") > -1) {
163				sOm_Motivation = "048693";	
164				cbn_obj.motivation = "048693";	
165			} else if (sOm_sReferrerURL.indexOf("duckduckgo.com") > -1) {
166				sOm_Motivation = "048692";	
167				cbn_obj.motivation = "048692";	
168			}
169		}
170		else if (location.href.indexOf('ob.org') >=0) {
171			sOm_sReferrerURL = document.referrer.toLowerCase();
172			if ((sOm_sReferrerURL.indexOf(".google.c") > -1) || (sOm_sReferrerURL.indexOf("com.google") > -1)) {
173				sOm_Motivation = "048663";
174				cbn_obj.motivation = "048663";
175			} else if (sOm_sReferrerURL.indexOf(".bing.c") > -1) {
176				sOm_Motivation = "048664";	
177				cbn_obj.motivation = "048664";	
178			} else if (sOm_sReferrerURL.indexOf("facebook.com") > -1) {
179				sOm_Motivation = "048665";	
180				cbn_obj.motivation = "048665";	
181			} else if (sOm_sReferrerURL.indexOf("youtube.com") > -1) {
182				sOm_Motivation = "048668";	
183				cbn_obj.motivation = "048668";	
184			} else if (sOm_sReferrerURL.indexOf("pinterest.com") > -1) {
185				sOm_Motivation = "048705";	
186				cbn_obj.motivation = "048705";	
187			} else if (sOm_sReferrerURL.indexOf("twitter.com") > -1 || sOm_sReferrerURL.indexOf("/t.co/") > -1) {
188				sOm_Motivation = "048667";	
189				cbn_obj.motivation = "048667";	
190			} else if (sOm_sReferrerURL.indexOf("instagram.com") > -1) {
191				sOm_Motivation = "048704";	
192				cbn_obj.motivation = "048704";	
193			} else if (sOm_sReferrerURL.indexOf("yahoo.com") > -1) {
194				sOm_Motivation = "048711";	
195				cbn_obj.motivation = "048711";	
196			} else if (sOm_sReferrerURL.indexOf("duckduckgo.com") > -1) {
197				sOm_Motivation = "048712";	
198				cbn_obj.motivation = "048712";	
199			}
200		}
201		else if (location.href.indexOf('orphanspromise.org') >=0) {
202			sOm_sReferrerURL = document.referrer.toLowerCase();
203			if ((sOm_sReferrerURL.indexOf(".google.c") > -1) || (sOm_sReferrerURL.indexOf("com.google") > -1)) {
204				sOm_Motivation = "048662";
205				cbn_obj.motivation = "048662";
206			} else if (sOm_sReferrerURL.indexOf(".bing.c") > -1) {
207				sOm_Motivation = "048669";	
208				cbn_obj.motivation = "048669";	
209			} else if (sOm_sReferrerURL.indexOf("facebook.com") > -1) {
210				sOm_Motivation = "048670";	
211				cbn_obj.motivation = "048670";	
212			} else if (sOm_sReferrerURL.indexOf("youtube.com") > -1) {
213				sOm_Motivation = "048672";	
214				cbn_obj.motivation = "048672";	
215			} else if (sOm_sReferrerURL.indexOf("pinterest.com") > -1) {
216				sOm_Motivation = "048700";	
217				cbn_obj.motivation = "048700";	
218			} else if (sOm_sReferrerURL.indexOf("twitter.com") > -1 || sOm_sReferrerURL.indexOf("/t.co/") > -1) {
219				sOm_Motivation = "048671";	
220				cbn_obj.motivation = "048671";	
221			} else if (sOm_sReferrerURL.indexOf("instagram.com") > -1) {
222				sOm_Motivation = "048701";	
223				cbn_obj.motivation = "048701";	
224			} else if (sOm_sReferrerURL.indexOf("yahoo.com") > -1) {
225				sOm_Motivation = "048703";	
226				cbn_obj.motivation = "048703";	
227			} else if (sOm_sReferrerURL.indexOf("duckduckgo.com") > -1) {
228				sOm_Motivation = "048702";	
229				cbn_obj.motivation = "048702";	
230			}
231		}
232	}
233} catch (e) { } 
234
235// additional DFP variable configuration
236function dfp_isArray(obj) { if (obj.constructor.toString().indexOf("Array") == -1) { return false; } else { return true; } }
237try { 
238if (sOm_Level == "") { bPnr = "unknown";} else {bPnr = "true";} 
239if (typeof(dfp_sSection1) == "undefined") {
240	var dfp_sSection1 = "";
241	var dfp_sSection2 = "";
242	var dfp_sSection3 = "";
243	var dfp_sSection4 = "";
244	var dfp_sSection5 = "";
245	var dfp_sSection6 = "";
246}
247dfp_sections = location.href.replace("https:\/\/","").replace("http:\/\/","").split("\/");
248if (dfp_isArray(dfp_sections)) {
249 	if (dfp_sections.length > 0) {  dfp_sSection1 = dfp_sections[0]; }
250	if (dfp_sections.length >
250 1) {  dfp_sSection2 = dfp_sections[1]; }
251	if (dfp_sections.length > 2) {  dfp_sSection3 = dfp_sections[2]; }
252	if (dfp_sections.length > 3) {  dfp_sSection4 = dfp_sections[3]; }
253	if (dfp_sections.length > 4) {  dfp_sSection5 = dfp_sections[4]; }
254	if (dfp_sections.length > 5) {  dfp_sSection6 = dfp_sections[5]; }
255}
256
257} catch (e) { } 
258
259function preGtmGetURLParam(strParamName) {
260	var strReturn = '';
261	try {
262		var strHref = window.location.href;
263		if (strHref.indexOf("?") > -1) {
264			var strQueryString = '';
265			if (strHref.indexOf("#") > strHref.indexOf("?")) {
266				strQueryString = strHref.substr(strHref.indexOf("?")+1, strHref.indexOf("#")-strHref.indexOf("?")-1);
267			} else {
268				strQueryString = strHref.substr(strHref.indexOf("?")+1);
269			}
270			var aQueryString = strQueryString.split("&");
271			for (var iParam = 0; iParam < aQueryString.length; iParam++) {
272				if (aQueryString[iParam].toLowerCase().indexOf(strParamName.toLowerCase() + "=") == 0) {
273					var aParam = aQueryString[iParam].split("=");
274					strReturn = aParam[1];
275					break;
276				}
277			}
278		}
279	} catch (err) {}
280
281	return decodeURIComponent(strReturn);
282}
283
284function cbnCreateMobileCausePage(div_id,base_url,base_url_parameters,width,height,scrolling) {
285	try {
286
287		// Redirect to Givesmart directly for international users
288		fetch('https://www1.cbn.com/custom/api/geo.php?addgeo=1')
289		.then(response => response.json())
290		.then(data => {
291			if (data.country_code != "US") {
292				window.location.href = base_url;
293			}
294		});
295
296		// May not needed anymore
297		if (typeof(sOm_CountryCode) != "undefined" && sOm_CountryCode != "US" && sOm_CountryCode != "") {
298			window.location.replace(base_url);
299		}
300
301		var parent_div = document.getElementById(div_id);
302		var iframe = document.createElement("iframe");
303		var search_parameters = window.location.search;
304		if ((scrolling !== undefined) && (scrolling === true)) {
305			scrolling = "yes";
306		} else {
307			scrolling = "no";
308		}
309
310		// if no mot nor utm_term nor utm_mot
311		if (search_parameters.toLowerCase().indexOf("utm_mot") < 0
312			&& (search_parameters.toLowerCase().indexOf("?mot") < 0 && search_parameters.toLowerCase().indexOf("&mot") < 0)
313			&& search_parameters.toLowerCase().indexOf("utm_term") < 0) 
314		{ 
315				if ((typeof(cbn_obj) != "undefined") && (typeof(cbn_obj.motivation) != "undefined") && (cbn_obj.motivation != "")) {
316					// Base URL contains "?"
317					// E.g. https://app.mobilecause.com/form/t_WMsw?vid=qdno1
318					if (base_url.includes("?")) {
319						search_parameters = search_parameters + "&" + "mot=" + cbn_obj.motivation + "&"
320                                                + "utm_term=" + cbn_obj.motivation;
321					// URI is empty
322					} else {
323						search_parameters = (search_parameters === "" ? "?" : search_parameters + "&") 
324						+ "mot=" + cbn_obj.motivation + "&"
325						+ "utm_term=" + cbn_obj.motivation;
326					}
327				}
328		}	
329
330		let tempMot;
331		// Make sure there is utm_mot, some sites rely to this param alone as far as I was told
332		// Ensure utm_term is also same as mot param
333
334		// If there is mot, but no utem_term
335		if ((search_parameters.toLowerCase().indexOf("?mot") >= 0 && search_parameters.toLowerCase().indexOf("&mot") >= 0)
336			&& search_parameters.toLowerCase().indexOf("utm_term") < 0) 
337		{
338				// Base URL contains "?"
339				// E.g. https://app.mobilecause.com/form/t_WMsw?vid=qdno1
340				if (base_url.includes("?")) {
341					tempMot = preGtmGetURLParam('mot');
342					// Replace ? to & E.g. ?mot=123456 to &mot=123456
343					search_parameters = search_parameters.replace('?', '&') + "&" + "utm_term=" + tempMot;
344				// URI is empty
345				} else {
346					tempMot = preGtmGetURLParam('mot');
347					search_parameters = (search_parameters === "" ? "?" : search_parameters + "&") + "utm_term=" + tempMot;
348				}
349		}
350
351		// If there is utm_mot only
352		// No mot nor utm_term
353		if (search_parameters.toLowerCase().indexOf("utm_mot") >= 0
354			&& search_parameters.toLowerCase().indexOf("utm_term") < 0
355			&& (search_parameters.toLowerCase().indexOf("?mot") < 0 && search_parameters.toLowerCase().indexOf("&mot") < 0)) 
356		{
357				// Base URL contains "?"
358				// E.g. https://app.mobilecause.com/form/t_WMsw?vid=qdno1
359				if (base_url.includes("?")) {
360					tempMot = preGtmGetURLParam('utm_mot');
361					search_parameters = search_parameters.replace('?', '&') + "&" + "utm_term=" + tempMot;
362				// URI is empty
363				} else {
364					// utm_term should be same as utm_mot, if there is no mot
365					tempMot = preGtmGetURLParam('utm_mot');
366					search_parameters = (search_parameters === "" ? "?" : search_parameters + "&") + "utm_term=" + tempMot;
367				}
368		}
369
370		// If there is utm_term only
371		// No mot nor utm_mot
372		if (search_parameters.toLowerCase().indexOf("utm_term") >= 0
373			&& search_parameters.toLowerCase().indexOf("utm_mot") < 0
374			&& (search_parameters.toLowerCase().indexOf("?mot") < 0 && search_parameters.toLowerCase().indexOf("&mot") < 0))
375
376		{
377				// Base URL contains "?"
378				// E.g. https://app.mobilecause.com/form/t_WMsw?vid=qdno1
379				if (base_url.includes("?")) {
380					tempMot = preGtmGetURLParam('utm_term');
381					search_parameters = search_parameters.replace('?', '&') + "&" 
382					+ "mot=" + tempMot;
383				// URI is empty
384				} else {
385					// mot should be same as utm_term, if there is no mot
386					tempMot = preGtmGetURLParam('utm_term');
387					search_parameters = (search_parameters === "" ? "?" : search_parameters + "&") 
388					+ "mot=" + tempMot;
389				}
390		}
391
392		// Handles single MOT only E.g. handles ?mot=123 instead of ?mot=123&mot=5677
393                // If there is one mot only and Base URL contains "?"
394                if ((search_parameters.toLowerCase().indexOf("?mot") >= 0 
395			&& search_parameters.toLowerCase().indexOf("&mot") < 0)
396			&& search_parameters.toLowerCase().indexOf("utm_mot") < 0
397                        && search_parameters.toLowerCase().indexOf("utm_term") < 0
398			&& base_url.includes("?")
399		)
400		{
401			tempMot = preGtmGetURLParam('mot');
402			// Replace ? to & E.g. ?mot=123456 to &mot=123456
403			search_parameters = search_parameters.replace('?', '&') + "&" + "utm_term=" + tempMot;
404		}
405
406		search_parameters = search_parameters + (base_url_parameters === "" ? "" : (search_parameters === "" ? "?" : "&") + base_url_parameters);
407		iframe.setAttribute("src", base_url + search_parameters)
408		//iframe.setAttribute("width", width);
409		//iframe.setAttribute("height", height);
410		iframe.setAttribute("frameborder", "0");
411		iframe.setAttribute("style", "position: absolute; width: " + width + "; height: " + height + "; top: 0; left: 0;");
412		iframe.setAttribute("marginwidth", "10px");
413		iframe.setAttribute("marginheight", "10px");
414		iframe.setAttribute("scrolling", scrolling);
415		iframe.setAttribute("allowfullscreen", "allowfullscreen");
416		parent_div.appendChild(iframe);
417	} catch (e) { } 
418}
419
420/* 
421ref: https://secure.cbn.com/ 
422*/
423
424

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.