PageSourceSearch

https://www.nationalfuel.com/wp-content/themes/nationalfuel/assets/js/cookie.js?ver=2.2

js nationalfuel.com collected 2026-10-03 20:48:48 UTC 10,264 bytes, 329 lines download raw bytes

1$(document).ready(function () {
2	var customerLocation = Cookies.get('NFGLocation');
3	var customerType = Cookies.get('NFGType');
4	var customerLocationHtml = '';
5	var customerTypeHtml = '';
6	var search = window.location.href.indexOf('?');
7	$(".ny-business-class").hide();
8	$(".ny-home-class").hide();
9	$(".pa-business-class").hide();
10	$(".pa-home-class").hide();
11	$(".oh-business-class").hide();
12	$(".oh-home-class").hide();
13	$(".ny-home-business-utility-nav").hide();
14	$(".pa-home-business-utility-nav").hide();
15	$(".oh-home-business-utility-nav").hide();
16
17	if (customerLocation == undefined) {
18		$(".ny-home-business-utility-nav").show();
19		console.log('undefined location');
20	} else {
21		$("." + customerLocation + "-home-business-utility-nav").show();
22	}
23	if (cookieinfo.locationtype == 'Yes' && (customerLocation == undefined || customerType == undefined)) {
24		if (customerLocation == undefined && customerType == undefined && search < 1) {
25			customerBothPopup();
26		} else if (customerLocation == undefined & customerType !== undefined) {
27			customerLocationPopup()
28		} else if (customerType == undefined && customerLocation !== undefined) {
29			customerTypePopup()
30		}
31	} else {
32		var locationNames = { 'ny': 'In New York', 'pa': 'In Pennsylvania', 'oh': 'In Ohio' };
33		customerLocationHtml = locationNames[customerLocation] || '';
34		customerTypeHtml = (customerType === 'home') ? 'For My Home' : 'For My Business';
35		visibleclass = '.' + customerLocation + '-' + customerType + '-class';
36		$(visibleclass).show();
37		$("#customer-location-text").text(customerLocationHtml);
38		$("#customer-type-text").text(customerTypeHtml);
39	}
40});
41
42function customerTypePopup() {
43	$.magnificPopup.open({
44		items: {
45			src: '#customer_type_select'
46		},
47		type: 'inline',
48		showCloseBtn: false
49	}, 0);
50}
51
52function setCustomerTypeCookie(type) {
53	var customerLocation = Cookies.get('NFGLocation');
54	var customerType = Cookies.get('NFGType');
55	var visibleclass = '.' + customerLocation + '-' + customerType + '-class';
56	var currURL = utility_redirects.current_url;
57	var currTemplate = utility_redirects.current_template;
58	var redirectList = utility_redirects.page_list;
59	if (type !== customerType) {
60		$(visibleclass).hide();
61	}
62	$.magnificPopup.close({
63		items: {
64			src: '#customer_type_select'
65		},
66		type: 'inline',
67		showCloseBtn: false
68	}, 0);
69
70	if (type === 'business') {
71		Cookies.set('NFGType', 'business');
72		$("#customer-type-text").text("For My Business");
73		visibleclass = '.' + customerLocation + '-business-class';
74		$(visibleclass).show();
75		dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'business' });
76		if (currTemplate !== 'page-templates/home-utility.php') {
77			for (row of redirectList) {
78				for (page in row) {
79					if (currURL === row[page]) {
80						var newURL = row[customerLocation + '_business_url'];
81						window.location = newURL;
82					}
83				}
84			}
85		}
86	}
87	if (type === 'home') {
88		Cookies.set('NFGType', 'home');
89		$("#customer-type-text").text("For My Home");
90		visibleclass = '.' + customerLocation + '-home-class';
91		$(visibleclass).show();
92		dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'home' });
93		if (currTemplate !== 'page-templates/home-utility.php') {
94			for (row of redirectList) {
95				for (page in row) {
96					if (currURL === row[page]) {
97						var newURL = row[customerLocation + '_home_url'];
98						window.location = newURL;
99					}
100				}
101			}
102		}
103	}
104}
105
106function customerLocationPopup() {
107	$.magnificPopup.open({
108		items: {
109			src: '#customer_location_select'
110		},
111		type: 'inline',
112		showCloseBtn: false
113	}, 0);
114}
115
116function setCustomerLocationCookie(type) {
117	var customerLocation = Cookies.get('NFGLocation');
118	var customerType = Cookies.get('NFGType');
119	var visibleclass = '.' + customerLocation + '-' + customerType + '-class';
120	var currURL = utility_redirects.current_url;
121	var currTemplate = utility_redirects.current_template;
122	var redirectList = utility_redirects.page_list;
123	if (type !== customerLocation) {
124		$(visibleclass).hide();
125	}
126	$.magnificPopup.close({
127		items: {
128			src: '#customer_location_select'
129		},
130		type: 'inline',
131		showCloseBtn: false
132	}, 0);
133
134	$(".ny-home-business-utility-nav").hide();
135	$(".pa-home-business-utility-nav").hide();
136	$(".oh-home-business-utility-nav").hide();
137	$("." + customerLocation + "-home-business-utility-nav").show();
138
139	if (type === 'ny') {
140		Cookies.set('NFGLocation', 'ny');
141		$("#customer-location-text").text("In New York");
142		visibleclass = '.ny-' + customerType + '-class';
143		$(visibleclass).show();
144		dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'ny' });
145		if (currTemplate !== 'page-templates/home-utility.php') {
146			for (row of redirectList) {
147				for (page in row) {
148					if (currURL === row[page]) {
149						var newURL = row['ny_' + customerType + '_url'];
150						window.location = newURL;
151					}
152				}
153			}
154		}
155	}
156	if (type === 'pa') {
157		Cookies.set('NFGLocation', 'pa');
158		$("#customer-location-text").text("In Pennsylvania");
159		visibleclass = '.pa-' + customerType + '-class';
160		$(visibleclass).show();
161		dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'pa' });
162		if (currTemplate !== 'page-templates/home-utility.php') {
163			for (row of redirectList) {
164				for (page in row) {
165					if (currURL === row[page]) {
166						var newURL = row['pa_' + customerType + '_url'];
167						window.location = newURL;
168					}
169				}
170			}
171		}
172	}
173	if (type === 'oh') {
174		Cookies.set('NFGLocation', 'oh');
175		$("#customer-location-text").text("In Ohio");
176		visibleclass = '.oh-' + customerType + '-class';
177		$(visibleclass).show();
178		dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'oh' });
179		if (currTemplate !== 'page-templates/home-utility.php') {
180			for (row of redirectList) {
181				for (page in row) {
182					if (currURL === row[page]) {
183						var newURL = row['oh_' + customerType + '_url'];
184						window.location = newURL;
185					}
186				}
187			}
188		}
189	}
190}
191
192function customerBothPopup() {
193	$.magnificPopup.open({
194		items: {
195			src: '#customer_both_select'
196		},
197		type: 'inline',
198		showCloseBtn: false,
199		closeOnBgClick: false
200	}, 0);
201}
202
203function setCustomerBothCookie(type) {
204	$.magnificPopup.close({
205		items: {
206			src: '#customer_both_select'
207		},
208		type: 'inline',
209		showCloseBtn: false,
210		closeOnBgClick: false
211	}, 0);
212
213	var currURL = utility_redirects.current_url;
214	var currTemplate = utility_redirects.current_template;
215	var redirectList = utility_redirects.page_list;
216
217	switch (type) {
218		case 'business-ny':
219			Cookies.set('NFGLocation', 'ny');
220			Cookies.set('NFGType', 'business');
221			$("#customer-location-text").text("In New York");
222			$("#customer-type-text").text("For My Business");
223			$(".ny-business-class").show();
224			dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'business-ny' });
225			if (currTemplate !== 'page-templates/home-utility.php') {
226				for (row of redirectList) {
227					for (page in row) {
228						if (currURL === row[page]) {
229							var newURL = row['ny_business_url'];
230							window.location = newURL;
231						}
232					}
233				}
234			}
235			break;
236		case 'home-ny':
237			Cookies.set('NFGLocation', 'ny');
238			Cookies.set('NFGType', 'home');
239			$("#customer-location-text").text("In New York");
240			$("#customer-type-text").text("For My Home");
241			$(".ny-home-class").show();
242			dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'home-ny' });
243			if (currTemplate !== 'page-templates/home-utility.php') {
244				for (row of redirectList) {
245					for (page in row) {
246						if (currURL === row[page]) {
247							var newURL = row['ny_home_url'];
248							window.location = newURL;
249						}
250					}
251				}
252			}
253			break;
254		case 'business-pa':
255			Cookies.set('NFGLocation', 'pa');
256			Cookies.set('NFGType', 'business');
257			$("#customer-location-text").text("In Pennsylvania");
258			$("#customer-type-text").text("For My Business");
259			$(".pa-business-class").show();
260			dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'business-pa' });
261			if (currTemplate !== 'page-templates/home-utility.php') {
262				for (row of redirectList) {
263					for (page in row) {
264						if (currURL === row[page]) {
265							var newURL = row['pa_business_url'];
266							window.location = newURL;
267						}
268					}
269				}
270			}
271			break;
272		case 'home-pa':
273			Cookies.set('NFGLocation', 'pa');
274			Cookies.set('NFGType', 'home');
275			$("#customer-location-text").text("In Pennsylvania");
276			$("#customer-type-text").text("For My Home");
277			$(".pa-home-class").show();
278			dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'home-pa' });
279			if (currTemplate !== 'page-templates/home-utility.php') {
280				for (row of redirectList) {
281					for (page in row) {
282						if (currURL === row[page]) {
283							var newURL = row['pa_home_url'];
284							window.location = newURL;
285						}
286					}
287				}
288			}
289			break;
290		case 'business-oh':
291			Cookies.set('NFGLocation', 'oh');
292			Cookies.set('NFGType', 'business');
293			$("#customer-location-text").text("In Ohio");
294			$("#customer-type-text").text("For My Business");
295			$(".oh-business-class").show();
296			dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'business-oh' });
297			if (currTemplate !== 'page-templates/home-utility.php') {
298				for (row of redirectList) {
299					for (page in row) {
300						if (currURL === row[page]) {
301							var newURL = row['oh_business_url'];
302							window.location = newURL;
303						}
304					}
305				}
306			}
307			break;
308		case 'home-oh':
309			Cookies.set('NFGLocation', 'oh');
310			Cookies.set('NFGType', 'home');
311			$("#customer-location-text").text("In Ohio");
312			$("#customer-type-text").text("For My Home");
313			$(".oh-home-class").show();
314			dataLayer.push({ event: 'Link Click', 'eventCategory': 'Customer Type Selector', 'eventLabel': 'home-oh' });
315			if (currTemplate !== 'page-templates/home-utility.php') {
316				for (row of redirectList) {
317					for (page in row) {
318						if (currURL === row[page]) {
319							var newURL = row['oh_home_url'];
320							window.location = newURL;
321						}
322					}
323				}
324			}
325			break;
326		default:
327	}
328
329}

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.