PageSourceSearch

https://pollinator.org/pollinator.org/craftcss/js/custom-js-3.js

js pollinator.org collected 2026-09-24 08:53:17 UTC 26,682 bytes, 802 lines download raw bytes

1
2
3/* Variables */
4var navHeight = $("div#top-bar").height() + $("div.navbar-header").height();
5
6
7/* Functions */
8
9// Move footer down when page resizes
10var bumpIt = function() {
11		var padding_bottom =  $('.footer').height();
12  	// $('.main').css('padding-bottom', padding_bottom);
13	},
14	didResize = false;
15
16bumpIt();
17
18// Set height of inline images
19var sizeInlineImages = function() {
20		$('.img-sm').height($('.img-sm').width() * (2/3));
21		$('.figure-sm').height($('.figure-sm').width() * (2/3));
22		$('.img-lg').height($('.img-lg').width() * (1/3));
23		$('.figure-lg').height($('.figure-lg').width() * (1/3));
24	},
25	didResize = false;
26
27sizeInlineImages();
28
29/* .thumb-sm: max-width:300; max-height:225; */
30/* .thumb-md: max-width:500; max-height:375; */
31var sizeThumbnails = function() {
32		$('.thumb-sm').height(function() {
33			var curr_width = $( this ).width();
34			var new_height = curr_width * (3/4);
35			if( new_height < 225 ) {
36				return new_height;
37			} else {
38				$(this).width(300);
39				return 225;
40			}
41		});
42
43		$('.thumb-md').height(function() {
44			var curr_width = $( this ).width();
45			var new_height = curr_width * (3/4);
46			if( new_height < 375 ) {
47				return new_height;
48			} else {
49				$(this).width(500);
50				return 375;
51			}
52		});
53
54		$('div.resources-thumb').height($('div.resources-thumb').width() * (2/3));
55	},
56	didResize = false;
57
58sizeThumbnails();
59
60// Darken background images. Takes a DOM element and a number between 0 - 1
61function addBGTint(elem,tint) {
62	var style="";
63	if ( elem.attr("style") !== undefined ) {
64		var curr_style = elem.attr("style");
65		if ( curr_style.match(/url\(+(.)+\)/) ) {
66			var img_location = curr_style.match(/url\(+(.)+\)/)[0];
67			var new_bg_style = "background-image: linear-gradient(to right,rgba(0,0,0," + tint.toString()+"), rgba(0,0,0,"+tint.toString()+")), "+img_location;
68			var start_bg = curr_style.indexOf("background-image");
69			if ( start_bg > 0 ) {    // Append new background-image to end
70				curr_style = curr_style.substring(0,start_bg);
71				style = curr_style + new_bg_style;
72			}	else { // Append new background-image to front
73				curr_style = curr_style.substring(curr_style.indexOf(";"));
74				style = new_bg_style + curr_style;
75			}
76		} else {
77			style = curr_style;
78		}
79	}
80	elem.attr("style",style);
81}
82
83
84/* * * ON READY * * */
85$(document).ready(function(){
86
87
88});
89
90
91/* * *  ON  LOAD * * */
92$(window).load(function(){
93
94	// Push content up above footer
95	bumpIt();
96
97	// Offset page scroll by height of nav bar if URL goes to an anchor
98	if(window.location.href.match(/\#/)) {
99		var target = $(window.location.href.substr(window.location.href.indexOf('#')));  // Get anchor from end of URL
100		target = target.length ? target : $('[name= ' + this.hash.slice(1) + ']');
101		if(target.length) {
102			var scrollTo = target.offset().top - 30;
103			scrollTo = $(window).width() <= 768 ? scrollTo : scrollTo - navHeight;
104			$('html, body').animate({
105				scrollTop: scrollTo
106			}, 1000);
107		}
108	}
109
110	// Smooth scrolling to Anchor Links
111	$(document).on('click', 'a[href^="#"]', function(){ // for anchors inserted programmatically
112		var target = $(this.hash);  // Get anchor from end of URL
113		target = target.length ? target : $('[name= ' + this.hash.slice(1) + ']');
114		if(target.length) {
115			var scrollTo = target.offset().top - 30;
116			scrollTo = $(window).width() <= 768 ? scrollTo : scrollTo - navHeight;
117			$('html, body').animate({
118				scrollTop: scrollTo
119			}, 1000);
120		}
121	});
122
123 	// Hide 'to-top' button on click too
124 	$(document).on('click', 'a.to-top', function(){
125
126 		$('a.to-top').hide();
127 	});
128 	// Add onclick function to all anchor links
129 	$(document).on('click', "a[href^='#']:not(.to-top)", function(){
130 		$('a.to-top').show();
131 	});
132
133	// Size thumbnails
134	sizeInlineImages();
135	sizeThumbnails();
136
137	// Add hover function to thumbnails
138	if ($('.resources-thumb').length) {
139		$('div.resources-thumb > a').hover(
140			function() { addBGTint( $(this).prev(), .75 ) },
141			function() { addBGTint( $(this).prev(), .3 )}
142		);
143	}
144});
145
146
147
148/* * * RESIZE  * * */
149$(window).resize(function() {
150	didResize = true;
151	bumpIt();
152	sizeInlineImages();
153	sizeThumbnails();
154});
155
156
157setInterval(function() {
158	if(didResize){
159		didResize = false;
160		bumpIt();
161		sizeInlineImages();
162		sizeThumbnails();
163	}
164}, 250);
165
166
167
168/* * * SCROLL * * */
169
170// Hide/show toggle button on scroll
171var position, direction, previous;
172$(window).scroll(function() {
173
174if($(window).width() <= 768 ) {
175
176	if( $(this).scrollTop() >= position ) {
177  	direction = 'down';
178  	if( $(this).scrollTop() > navHeight ) {
179    	if(direction !== previous) {
180    		$('nav.site-header').addClass('hide');
181      	previous = direction;
182      	navHeight = 0;
183     	}
184    }	else {
185    	$("nav.site-header").offset({top: -$(this).scrollTop()});
186    }
187  } else {
188     direction = 'up';
189     $("nav.site-header").css("top", "0");
190     if(direction !== previous){
191     	$('nav.site-header').removeClass('hide');
192     	previous = direction;
193     	navHeight = $("div#top-bar").height() + $("div.navbar-header").height();
194     }
195  }
196	position = $(this).scrollTop();
197
198}
199});
200
201/*Zip/Postal Code Form*/
202
203function getCookie(cname) {
204    var name = cname + "=";
205    var decodedCookie = decodeURIComponent(document.cookie);
206    var ca = decodedCookie.split(';');
207    for(var i = 0; i <ca.length; i++) {
208        var c = ca[i];
209        while (c.charAt(0) == ' ') {
210            c = c.substring(1);
211        }
212        if (c.indexOf(name) == 0) {
213            return c.substring(name.length, c.length);
214        }
215    }
216    return "";
217}
218
219// Error handler for Zip Code (American)
220
221$('.post_code .form-control').keyup(function(){
222	if ($(this).val().length != 5 || $(this).val().match(/[a-z]/i)) {
223		$(this).addClass('wrong');
224	} else {
225		$(this).removeClass('wrong');
226	}
227	if ($(this).hasClass('wrong')) {
228		$(this).css({
229			'border-color': 'red'
230		})
231	} else {
232		$(this).css({
233			'border-color': 'green'
234		})
235	}
236})
237
238//Zip code field (American)
239var code = $('.post_code .form-control');
240
241$('.post_code').submit(function(e){
242	e.preventDefault();
243
244	if (code.hasClass('wrong')) {
245		alert('Please check the entered zip code and resubmit');
246		return false;
247	} else {
248		document.cookie = "code=";
249		var post_code = $('.post_code input').val();
250		document.cookie = "code="+post_code+"; path=/";
251		window.location.href = 'https://pollinator.org/guides_code?c=' + post_code;
252	}
253})
254
255// Postal code error handler (Canadian)
256$('.canada_code .form-control').keyup(function(){
257	 if (($(this).val().length != 3) ){
258		$(this).addClass('wrong');
259	} else {
260		$(this).removeClass('wrong');
261	}
262	if ($(this).hasClass('wrong')) {
263		$(this).css({
264			'border-color': 'red'
265		})
266	} else {
267		$(this).css({
268			'border-color': 'green'
269		})
270	}
271})
272
273//Postal Code field (Canadian)
274code = $('.canada_code .form-control');
275
276$('.canada_code').submit(function(e){
277	e.preventDefault();
278
279	if (code.hasClass('wrong')) {
280		alert('Please check the entered postal code and resubmit');
281		return false;
282	} else {
283		document.cookie = "code=";
284		var canada_code = $('.canada_code input').val();
285		document.cookie = "code="+canada_code+"; path=/";
286		window.location.href = 'https://pollinator.org/guides_canada?c=' + canada_code;
287	}
288})
289
290// Start form logic
291
292$(document).ready(function(){
293	var url = window.location.pathname;
294	var link, image;
295	var countTotal = 0; 
296	var countYes = 0;
297	const urlParams = new URLSearchParams(window.location.search);
298
299	if (url == '/guides_code') {
300		const cookie = urlParams.get('c');
301
302		// JSON Zip Code Call (American)
303
304		$.getJSON('//pollinator.org/pollinator.org/craftcss/js/convertcsv.json', function (json) {
305			var array = [];
306			for (var key in json) {
307			    if (json.hasOwnProperty(key)) {
308			        var item = json[key];
309			        array.push({
310			            1: item.FIELD1,
311			            2: item.FIELD2,
312			            3: item.FIELD3,
313			            4: item.FIELD4
314			        });
315					}
316			}
317
318			// Zip Code matching logic (American)
319			for (var i = 0; i < array.length; i++) {
320				countTotal++;
321				// console.log(countTotal);
322				if (array[i][1] == cookie) {
323					countYes++;
324					console.log("This is the one " + array[i][1] + ' ' + countYes);
325					
326					link = array[i][4];
327			    switch (link) {
328			      case "https://pollinator.org/PDFs/Guides/Adirondack.May.2024.rx8.pdf":
329			        image = "Images/Guides/Adirondack.jpg";
330			        break;
331
332			      case "https://pollinator.org/PDFs/Guides/AmericanSemiDesert.May.2024.rx13.pdf":
333			        image = "Images/Guides/americansemidesert.jpg";
334			        break;
335
336			      case "https://pollinator.org/PDFs/Guides/ArizonaNewMexico.May.2024.rx7.pdf":
337			        image = "Images/Guides/ArizonaNewMexico.jpg";
338			        break;
339
340				case "https://pollinator.org/PDFs/Guides/BlackHills.May.2024.rx7.pdf":
341			        image = "Images/Guides/black-hills-thumb.jpg";
342			        break;
343
344			      case "https://pollinator.org/PDFs/Guides/Calif.Coastal.Chaparral.May.2024.rx5.pdf":
345			        image = "Images/Guides/Calif.Coastal.Chaparral.jpg";
346			        break;
347
348			      case "https://pollinator.org/PDFs/Guides/CalifCoastalSteppe.May.2024.rx6.pdf":
349			        image = "Images/Guides/CA.Coastal.jpg";
350			        break;
351
352			      case "https://pollinator.org/PDFs/Guides/Calif.Coastal.Woodland.May.2024.rx4.pdf":
353			        image = "Images/Guides/Calif.Coastal.Woodland.jpg";
354			        break;
355
356			      case "https://pollinator.org/PDFs/Guides/Calif.Dry.Steppe.May.2024.rx6.pdf":
357			        image = "Images/Guides/Calif.DrySteppe.jpg";
358			        break;
359
360			      case "https://pollinator.org/PDFs/Guides/CascadeMixedrx8FINAL.pdf":
361			        image = "Images/Guides/CascadeMixed.jpg";
362			        break;
363
364			      case "https://pollinator.org/PDFs/Guides/CentralAppalachian.May.2024.rx6.pdf":
365			        image = "Images/Guides/CentralAppalachian.jpg";
366			        break;
367
368			      case "https://pollinator.org/PDFs/Guides/Chihuahuan.May.2024.rx7.pdf":
369			        image = "Images/Guides/Chihuahuan.jpg";
370			        break;
371
372			      case "https://pollinator.org/PDFs/Guides/ColoradoPlateau.May.2024.rx4.pdf":
373			        image = "Images/Guides/colorado-plateau-thumb.jpg";
374			        break;
375
376			      case "https://pollinator.org/PDFs/Guides/EasternBroadleafContinental.May.2024.rx13.pdf":
377			        image = "Images/Guides/EBFContinental.jpg";
378			        break;
379
380			      case "https://pollinator.org/PDFs/Guides/EasternBroadleaf.Oceanic.TOCinteractive.May.2024.rx20.pdf":
381			        image = "Images/Guides/EasternBroadleaf.Oceanic.jpg";
382			        break;
383
384				case "https://pollinator.org/PDFs/Guides/Florida.Everglades.May.2024.rx6.pdf":
385			        image = "Images/Guides/everglades-thumb.jpg";
386			        break;
387
388			      case "https://pollinator.org/PDFs/Guides/GreatPlains.Steppe.2020.May.2024.rx7.pdf":
389			        image = "Images/Guides/great-plains-steppe-thumb.jpg";
390			        break;
391
392				case "https://pollinator.org/PDFs/Guides/Great.Plains.Palouse.Dry.Steppe.May.2024.rx5.pdf":
393			        image = "Images/Guides/great-plains-palouse.jpg";
394			        break;
395
396				case "https://pollinator.org/PDFs/Guides/GreatPlainsSteppeShrub.May.2024.rx5.pdf":
397			        image = "Images/Guides/great-plains-steppe-shurb-thumb.jpg";
398			        break;
399
400			      case "https://pollinator.org/PDFs/Guides/HawaiianIsland.EcoRegGuide.Feb.2014.May.2024.rx15.pdf":
401			        image = "Images/Guides/HawaiianIsland.EcoRegGuide.FINAL.jpg";
402			        break;
403
404			      case "https://pollinator.org/PDFs/Guides/IntermtSemidesrt342.May.2024.rx5.pdf":
405			        image = "Images/Guides/intermountainsemidesert.jpg";
406			        break;
407
408			      case "https://pollinator.org/PDFs/Guides/Intermt.SemiDsrt.Desert.May.2024.rx6.pdf":
409			        image = "Images/Guides/intermountain-semidesert.jpg";
410			        break;
411
412			      case "https://pollinator.org/PDFs/Guides/Laurentian.May.2024.rx12.pdf":
413			        image = "Images/Guides/Laurentian.jpg";
414			        break;
415
416			      case "https://pollinator.org/PDFs/Guides/LowerMississRiverine.May.2024.rx4.pdf":
417			        image = "Images/Guides/LowerMississippiRiverine.jpg";
418			        break;
419
420			      case "https://pollinator.org/PDFs/Guides/MiddleRockyMt.May.2024.rx11.pdf":
421			        image = "Images/Guides/MiddleRockyMt.jpg";
422			        break;
423
424			      case "https://pollinator.org/PDFs/Guides/NevadaUtah.May.2024.rx4.pdf":
425			        image = "Images/Guides/Nevada-Utah.jpg";
426			        break;
427
428			      case "https://pollinator.org/PDFs/Guides/OuachitaMixed.May.2024.rx5.pdf":
429			        image = "Images/Guides/Ouachita.jpg";
430			        break;
431
432			      case "https://pollinator.org/PDFs/Guides/OuterCoastal.May.2024.rx9.pdf":
433			        image = "Images/Guides/OuterCoastal.jpg";
434			        break;
435
436			      case "https://pollinator.org/PDFs/Guides/OzarkBroadleaf.May.2024.rx3.pdf":
437			        image = "Images/Guides/ozarkbroadleaf.jpg";
438			        break;
439
440			      case "https://pollinator.org/PDFs/Guides/PrairieParkland.May.2024.rx14.pdf":
441			        image = "Images/Guides/PrairieParkland.jpg";
442			        break;
443
444			      case "https://pollinator.org/PDFs/Guides/PrairieParklandSubtrp.May.2024.rx7.pdf":
445			        image = "Images/Guides/PraireSubtropical.jpg";
446			        break;
447
448			      case "https://pollinator.org/PDFs/Guides/PacificLowland.May.2024.rx11.pdf":
449			        image = "Images/Guides/PacificLowland.jpg";
450			        break;
451
452			      case "https://pollinator.org/PDFs/Guides/NorthRockyMt.ForestSteppe.May.2024.rx6.pdf":
453			        image = "Images/Guides/northern-rockymnt-forest.jpg";
454			        break;
455
456			      case "https://pollinator.org/PDFs/Guides/SierranSteppe.May.2024.rx9.pdf":
457			        image = "Images/Guides/sierran-steppe.jpg";
458			        break;
459
460			      case "https://pollinator.org/PDFs/Guides/SoutheastMixedForest.May.2024.rx7.pdf":
461			        image = "Images/Guides/SouthEastMixedForest.jpg";
462			        break;
463
464			      case "https://pollinator.org/PDFs/Guides/SouthwestPlateauPlains.May.2024.rx5.pdf":
465			        image = "Images/Guides/southwest.jpg";
466			        break;
467
468			      case "https://pollinator.org/PDFs/Guides/S.RockyMt.Steppe.May.2024.rx5.pdf":
469			        image = "Images/Guides/southernrocky-mtnsteppe.jpg";
470			        break;
471
472				  case "https://www.pollinator.org/pollinator.org/assets/generalFiles/AlaskaTemp_Continental.edits.Feb.2026.rx7.pdf":
473			        image = "Images/Guides/alaska-temp-continental.jpg";
474			        break;
475
476			      case "https://www.pollinator.org/pollinator.org/assets/generalFiles/AlaskaTemp_Coastal.edits.Feb.2026.rx6.pdf":
477			        image = "Images/Guides/alaska-temp-coastal.jpg";
478			        break;
479
480			    }
481			    $('.pdf_zip a').attr('href', link);
482			    $('.pdf_zip a').html(array[i][2]+"<img src="+image+" class='img-responsive thumbnail'>");
483					
484				
485				}
486				
487				// Error Message 
488				if (countYes === 0 && countTotal === json.length) {
489					$('.pdf_zip').html('<h1>We dont have a guide for ' + cookie +' at this time, please check your input and try again</h1> Email <a href="mailto:[email protected]">[email protected]</a> for more information.');
490				}
491			}
492
493			
494		
495			
496			
497		}
498
499		
500		
501		);
502
503		//JSON Postal Code call (Canadian)
504	} else if (url == '/guides_canada') {
505		const cookie = urlParams.get('c').toUpperCase();
506		var totalCountCanada = 0;
507		var totalYesCanada = 0;
508
509		$.getJSON('//pollinator.org/pollinator.org/craftcss/js/canadaconvertcsv-2.json', function (json) {
510			var array = [];
511			for (var key in json) {
512			    if (json.hasOwnProperty(key)) {
513						var item = json[key];
514			        array.push({
515			            1: item.FIELD1,
516			            2: item.FIELD2,
517			            3: item.FIELD3
518			        });
519			    }
520			}
521
522
523			for (var i = 0; i < array.length; i++) {
524				totalCountCanada++; 
525				if (array[i][1] == cookie) {
526					totalYesCanada++;
527
528				var links = array[i][3].split(/\s*,\s*/);
529
530				var reg_name = array[i][2].split(/\s*,\s*/);
531
532				for (var j = 0; j < links.length; j++) {
533
534					link = links[j];
535
536					reg_name_single = reg_name[j];
537
538					//Strange Postal Code name matching.... (Canadian)
539
540					switch (reg_name_single) {
541
542					    	case "98":
543					        name_region = 'Algonquin-Lake Nipissing';
544					        break;
545
546					        case "99":
547					        name_region = 'Southern Laurentians';
548					        break;
549
550					        case "101":
551					        name_region = 'Central Laurentians';
552									break;
553
554					        case "130":
555					        name_region = 'Prince Edward Island';
556					        break;
557
558					        case "132":
559					        name_region = 'St-Lawrence Lowlands';
560					        break;
561
562					        case "134":
563					        name_region = 'Manitoulin-Lake Simcoe';
564					        break;
565
566					        case "135":
567					        name_region = 'Lake Erie Lowland';
568					        break;
569
570					        case "156":
571					        name_region = 'Aspen Parkland';
572					        break;
573
574					        case "162":
575					        name_region = 'Lake Manitoba Plain';
576					        break;
577
578					        case "192":
579					        name_region = 'Pacific Ranges';
580					        break;
581
582					        case "193":
583					        name_region = 'Western Vancouver Island';
584					        break;
585
586					        case "194":
587					        name_region = 'Eastern Vancouver Island';
588					        break;
589
590					        case "195":
591					        name_region = 'Georgia-Puget Basin';
592					        break;
593
594					        case "196":
595					        name_region = 'Lower Mainland';
596									break;
597
598									case "124":
599					        name_region = 'Southwest Nova Scotia Uplands';
600									break;
601
602									case "127":
603					        name_region = 'South-central Nova Scotia Uplands';
604									break;
605
606									case "128":
607					        name_region = 'Nova Scotia Highlands';
608									break;
609
610									case "157":
611					        name_region = 'Moist Mixed Grasslands';
612									break;
613
614									case "158":
615					        name_region = 'Fescue Grassland ';
616									break;
617
618									case "159":
619					        name_region = 'Mixed Grassland';
620									break;
621									
622									
623
624					    	default: 
625					        name_region = "";
626					         break;
627
628				    	}
629							// Postal code guide logic (Canadian)
630					switch (link) {
631
632				      case "https://pollinator.org/pollinator.org/assets/generalFiles/Algonquin.2016.ver18.pdf":
633				        image = "https://pollinator.org/pollinator.org/assets/generalImages/Algonquin-thumb.jpg";
634				        image_french = "https://pollinator.org/pollinator.org/assets/generalImages/Lecoregion-dalgonquin-la-nipissing.jpg";
635				        french_link = "https://pollinator.org/pollinator.org/assets/generalFiles/Algonquin.French.2016.ver14-1.pdf";
636				        break;
637
638				      case "https://pollinator.org/pollinator.org/assets/generalFiles/SouthernLaurentian-2016.pdf":
639				     	image_french = "https://pollinator.org/pollinator.org/assets/generalImages/SouthernLaurentian-FRENCH-2016.jpg";
640				        french_link = "https://pollinator.org/pollinator.org/assets/generalFiles/SouthernLaurentian-FRENCH-2016.pdf";
641				        image = "https://pollinator.org/pollinator.org/assets/generalImages/SouthernLaurentian-2016.jpg";
642				        break;
643
644				      case "https://pollinator.org/pollinator.org/assets/generalFiles/CentralLaurentian-2016.pdf":
645				      	image_french = "https://pollinator.org/pollinator.org/assets/generalImages/CentralLaurentian-FRENCH-2016.jpg";
646				        french_link = "https://pollinator.org/pollinator.org/assets/generalFiles/CentralLaurentian-FRENCH-2016.pdf";
647				        image = "https://pollinator.org/pollinator.org/assets/generalImages/CentralLaurentian-2016.jpg";
648				        break;
649
650				      case "https://pollinator.org/pollinator.org/assets/generalFiles/StLawrence-2016.pdf":
651				      	image_french = "https://pollinator.org/pollinator.org/assets/generalImages/StLawrence-FRENCH-2016.jpg";
652				        french_link = "https://pollinator.org/pollinator.org/assets/generalFiles/StLawrence-FRENCH-2016.pdf";
653				        image = "https://pollinator.org/pollinator.org/assets/generalImages/StLawrence-2016.jpg";
654				        break;
655
656				      case "https://pollinator.org/pollinator.org/assets/generalFiles/Manitoulin.LakeSimcoe.2016.ver17.pdf":
657				      	image_french = "https://pollinator.org/pollinator.org/assets/generalImages/Manitoulin.LakeSimcoe.French.2016.ver10.jpg";
658				        french_link = "https://pollinator.org/pollinator.org/assets/generalFiles/Manitoulin.LakeSimcoe.French.2016.ver10.pdf";
659				        image = "https://pollinator.org/pollinator.org/assets/generalImages/ManitoulinLakeSimcoe-thumb.jpg";
660				        break;
661
662				      case "https://pollinator.org/pollinator.org/assets/generalFiles/LakeErieLowlands.2016.ver15.pdf":
663				      	image_french = "";
664				        french_link = "";
665				        image = "https://pollinator.org/pollinator.org/assets/generalImages/LakeErieLowlands.jpg";
666				        break;
667
668				      case "https://pollinator.org/pollinator.org/assets/generalFiles/AspenParkland.2017.ver8.pdf":
669				      	image_french = "";
670				        french_link = "";
671				        image = "https://pollinator.org/pollinator.org/assets/generalImages/aspen.jpg";
672				        break;
673
674				      case "https://pollinator.org/pollinator.org/assets/generalFiles/LakeManitoba.2017.ver4.pdf":
675				      	image_french = "";
676				        french_link = "";
677				        image = "https://pollinator.org/pollinator.org/assets/generalImages/lakeman.jpg";
678				        break;
679
680				      case "https://pollinator.org/pollinator.org/assets/generalFiles/LowerMainland-2017.pdf":
681				      	image_french = "";
682				        french_link = "";
683				        image = "https://pollinator.org/pollinator.org/assets/generalImages/LowerMainland-2016.jpg";
684				        break;
685
686				      case "https://pollinator.org/pollinator.org/assets/generalFiles/PrinceEdw.Isl.2017.ver4.pdf":
687				      	image_french = "";
688				        french_link = "";
689				        image = "https://pollinator.org/pollinator.org/assets/generalImages/Chihuahuan.jpg";
690				        break;
691
692				      case "https://pollinator.org/pollinator.org/assets/generalFiles/Pacific.Ranges.2017.ver4.pdf":
693				      	image_french = "";
694				        french_link = "";
695				        image = "https://pollinator.org/pollinator.org/assets/generalImages/Pacific.Ranges.2017.jpg";
696				        break;
697
698				      case "https://pollinator.org/pollinator.org/assets/generalFiles/W.Vancouver.Isl.2017.ver3.pdf":
699				      	image_french = "";
700				        french_link = "";
701				        image = "https://pollinator.org/pollinator.org/assets/generalImages/W.Vancouver.Isl.2017.ver3.png";
702				        break;
703
704				      case "https://pollinator.org/pollinator.org/assets/generalFiles/E.
704Vancouver.Isl.2017.ver6.pdf":
705				      	image_french = "";
706				        french_link = "";
707				        image = "https://pollinator.org/pollinator.org/assets/generalImages/E.Vancouver.Isl.2017.ver6.png";
708				        break;
709
710							// Addition Dec 2018 todo: add images
711				      case "https://pollinator.org/pollinator.org/assets/generalFiles/Southwest.NS.Uplands.pdf":
712				      	image_french = "";
713				        french_link = "";
714				        image = "/Images/Guides/southwest-nova-scotia-uplands-thumb-min.jpg";
715								break;
716
717							case "https://pollinator.org/pollinator.org/assets/generalFiles/SouthCentral.NovaScotiaUplands.low.pdf":
718				      	image_french = "";
719				        french_link = "";
720				        image = "/Images/Guides/south-central-nova-scotia-uplands-thumb-min.jpg";
721								break;
722
723							case "https://pollinator.org/pollinator.org/assets/globals/NS.Highlands.pdf":
724				      	image_french = "";
725				        french_link = "";
726				        image = "https://pollinator.org/Images/Guides/nova-scotia-highlands-thumb-min.jpg";
727								break;
728
729							case "https://pollinator.org/pollinator.org/assets/generalFiles/MoistMixGrass_157.2017.ver3.pdf":
730				      	image_french = "";
731				        french_link = "";
732				        image = "/Images/Guides/moist-mixed-grasslands-min.jpg";
733								break;
734							
735							case "https://pollinator.org/pollinator.org/assets/generalFiles/FescueGrasslnd_158.2017.ver4.pdf":
736				      	image_french = "";
737				        french_link = "";
738				        image = "/Images/Guides/fescue-grasslands-thumb-min.jpg";
739								break;
740							
741							case "https://pollinator.org/pollinator.org/assets/generalFiles/MixedGrasslnd_159.2017.ver2.pdf":
742				      	image_french = "";
743				        french_link = "";
744				        image = "/Images/Guides/mixed-grassland-eco-thumb-min.jpg";
745								break;
746
747
748				       default: 
749				        image_french = "";
750				        french_link = "";
751				        image = "https://pollinator.org/pollinator.org/assets/generalImages/Georgia.PugetBasin.2017.ver3.png";
752				         break;
753
754			    	}
755						
756						// Display both English and French guide if available (Canadian)
757				    if (image != '' && image_french != '') {
758
759				    	$('.pdf_zip').append("<a href="+link+" class='new_file col-md-6 canadian-guide' target='_blank'>"+name_region+"<img src="+image+" class='img-responsive canadian-image thumbnail'></a>");
760				    	$('.pdf_zip').append("<a href="+french_link+" class='new_file col-md-6 canadian-guide' target='_blank'>"+name_region+"<img src="+image_french+" class='img-responsive thumbnail canadian-image'></a>");
761				    	
762				    	$('.pdf_zip a.fr').css("display", "none");
763
764						$('.pdf_zip a.us').css("display", "none");
765
766							// Only display English guide if French guide unavailable (Canadian)
767					}  else if (image != '' && image_french == '') {
768
769						$('.pdf_zip').append("<a href="+link+" class='new_file col-md-6 canadian-guide' target='_blank'>"+name_region+"<img src="+image+" class='img-responsive thumbnail canadian-image'></a>");
770				  
771				  		$('.pdf_zip a.fr').css("display", "none");
772
773						$('.pdf_zip a.us').css("display", "none");
774
775					
776					}
777			    }
778
779					// If postal code matches the JSON sheet but there is no guide available (Canadian)
780			    if ($('.pdf_zip a.new_file').length < 1) {
781						$('.pdf_zip').html('For help finding the right guide for you, please call 415-362-1137 or email <a href="mailto:[email protected]">[email protected]</a>');
782					}
783				
784					;
785				}
786
787			// Error Message 
788				if (totalYesCanada === 0 && totalCountCanada === json.length) {
789				$('.pdf_zip').html('<h1>We dont have a guide for ' + cookie +' at this time, please check your input and try again</h1> Email <a href="mailto:[email protected]">[email protected]</a> for more information. <br> <br> <a class="btn toblog btn-success" href="javascript:history.back()">Go Back</a>');
790				}
791					//Error Handler if postal code does not match the JSON sheet (Canadian)
792			// 		else {
793			// 			$('.pdf_zip').html('Looks like we dont have a guide for you just yet, please call 415-362-1137 or email <a href="mailto:[email protected]">[email protected]</a>')
794			// }
795			}
796
797		
798
799		});
800	}
801})
802

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.