PageSourceSearch

https://www.semex.com/cookiepolicy2.cgi?lang=en&id=beef

js semex.com collected 2026-10-01 13:07:04 UTC 8,234 bytes, 221 lines download raw bytes

1(function (window, undefined){
2	"use strict";
3	
4	var document = window.document;
5	
6	function log() {
7		if (window.console && window.console.log) {
8			for (var x in arguments) {
9				if (arguments.hasOwnProperty(x)) {
10					window.console.log(arguments[x]);
11				}
12			}
13		}
14	}
15	
16	function AcceptCookie() {
17		if (!(this instanceof AcceptCookie)) {
18			return new AcceptCookie();
19		}
20				
21		this.init.call(this);
22		
23		return this;
24	}
25	
26	AcceptCookie.prototype = {
27		
28		init: function () {
29			var self = this;
30			
31			if(self.readCookie('cookie-policy-en-beef') == null)
32			{
33				self.appendCss();
34				self.addCookieBar();
35			}
36			
37			var clear_cookie_arr = self.getElementsByClass("pjClearCookie", null, "a");
38			if(clear_cookie_arr.length > 0)
39			{
40				self.addEvent(clear_cookie_arr[0], "click", function (e) {
41					if (e.preventDefault) {
42						e.preventDefault();
43					}
44					self.eraseCookie('cookie-policy-en-beef');
45					document.location.reload();
46					return false;
47				});
48			}
49		},
50		getElementsByClass: function (searchClass, node, tag) {
51			var classElements = new Array();
52			if (node == null) {
53				node = document;
54			}
55			if (tag == null) {
56				tag = '*';
57			}
58			var els = node.getElementsByTagName(tag);
59			var elsLen = els.length;
60			var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
61			for (var i = 0, j = 0; i < elsLen; i++) {
62				if (pattern.test(els[i].className)) {
63					classElements[j] = els[i];
64					j++;
65				}
66			}
67			return classElements;
68		},
69		addEvent: function (obj, type, fn) {
70			if (obj.addEventListener) {
71				obj.addEventListener(type, fn, false);
72			} else if (obj.attachEvent) {
73				obj["e" + type + fn] = fn;
74				obj[type + fn] = function() { obj["e" + type + fn](window.event); };
75				obj.attachEvent("on" + type, obj[type + fn]);
76			} else {
77				obj["on" + type] = obj["e" + type + fn];
78			}
79		},
80		createCookie: function (name, value, days){
81			var expires;
82		    if (days) {
83		        var date = new Date();
84		        date.setTime(date.getTime()+(days*24*60*60*1000));
85		        expires = "; expires="+date.toGMTString();
86		    } else {
87		        expires = "";
88		    }
89		    document.cookie = name+"="+value+expires+"; path=/";
90		},
91		readCookie: function (name) {
92		    var nameEQ = name + "=";
93		    var ca = document.cookie.split(';');
94		    for(var i=0;i < ca.length;i++) {
95		        var c = ca[i];
96		        while (c.charAt(0) === ' ') {
97		            c = c.substring(1,c.length);
98		        }
99		        if (c.indexOf(nameEQ) === 0) {
100		            return c.substring(nameEQ.length,c.length);
101		        }
102		    }
103		    return null;
104		},
105		eraseCookie: function (name) {
106			var self = this;
107			self.createCookie(name,"",-1);
108		},
109		appendCss: function()
110		{
111			var self = this;
112			var cssId = 'pjAcceptCookieCss';
113			if (!document.getElementById(cssId))
114			{
115			    var head  = document.getElementsByTagName('head')[0];
116			    var link  = document.createElement('link');
117			    link.id   = cssId;
118			    link.rel  = 'stylesheet';
119			    link.type = 'text/css';
120			    link.href = 'https://fonts.googleapis.com/css?family=Open+Sans';
121			    link.media = 'all';
122			    head.appendChild(link);
123			}
124			
125			var cssCode = "";
126			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn,";
127			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn:after { -webkit-transition: all .5s ease-in-out; -moz-transition: all .5s ease-in-out; -ms-transition: all .5s ease-in-out; -o-transition: all .5s ease-in-out; transition: all .5s ease-in-out; }";
128			cssCode += "#pjAcceptCookieBar { position: fixed; bottom: 0; left: 0; z-index: 9999; overflow-x: hidden; overflow-y: auto; width: 100%; max-height: 100%; padding: 30px 0; background: #FFE4E1; font-family: 'Open Sans', sans-serif; text-align: center; }";
129			cssCode += "#pjAcceptCookieBar * { padding: 0; margin: 0; outline: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }";
130			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarShell { width: 90%; margin: 0 auto; }";
131			cssCode += "#pjAcceptCookieBar a[href^=tel] { color: inherit; }";
132			cssCode += "#pjAcceptCookieBar a:focus,";
133			cssCode += "#pjAcceptCookieBar button:focus { outline: unset; outline: none; }";
134			cssCode += "#pjAcceptCookieBar p { font-size: 18px; line-height: 1.4; color: #000; font-weight: 400; }";
135			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarActions { padding-top: 10px; }";
136			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn { position: relative; display: inline-block; height: 46px;
136 padding: 0 30px; margin:10px; border: 0; background: #c62525; font-size: 18px; line-height: 44px; color: #fff; text-decoration: none; vertical-align: middle; cursor: pointer; border-radius: 0; -webkit-appearance: none; -webkit-border-radius: 0; -webkit-transform: translateZ(0); transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; -moz-osx-font-smoothing: grayscale; }";
137			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn:hover,";
138			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn:focus { text-decoration: none; }";
139			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn:after { position: absolute; top: 0; right: 52%; bottom: 0; left: 52%; z-index: -1; border-bottom: 4px solid #FF0000; background: #333333; content: ''; }";
140			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn:hover:after,";
141			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarBtn:focus:after { right: 0; left: 0; }";
142			cssCode += "@media only screen and (max-width: 767px) {";
143			cssCode += "#pjAcceptCookieBar { padding: 15px 0; }";
144			cssCode += "#pjAcceptCookieBar .pjAcceptCookieBarShell { width: 96%; }";
145			cssCode += "#pjAcceptCookieBar p { font-size: 16px; }";
146			cssCode += "}";
147			
148			var styleElement = document.createElement("style");
149			styleElement.type = "text/css";
150			if (styleElement.styleSheet) {
151			    styleElement.styleSheet.cssText = cssCode;
152			} else {
153				styleElement.appendChild(document.createTextNode(cssCode));
154			}
155			document.getElementsByTagName("head")[0].appendChild(styleElement);
156		},
157		addCookieBar: function(){
158			var self = this;
159			var htmlBar = '';
160
161			document.body.classList.add("bodyLock");
162
163			htmlBar += '<div class="pjAcceptCookieBarShell">';
164			htmlBar += '<form action="#" method="post">';
165			htmlBar += '<p>This website uses cookies to ensure you get the best experience on our website. <a href="/downloads/sitefiles/en/SemexPrivacyPolicy_ENG.pdf" target=new>Learn More</a></p>';
166			htmlBar += '<div class="pjAcceptCookieBarActions">';
167			htmlBar += '<button type="button" class="pjAcceptCookieBarBtn AcceptClickBtn">Accept</button>';
168			htmlBar += '<button type="button" class="pjAcceptCookieBarBtn DeclineClickBtn">Decline</button>';
169			htmlBar += '</div>';
170			htmlBar += '</form>';
171			htmlBar += '</div>';
172			
173			var barDiv = document.createElement('div');
174			barDiv.id = "pjAcceptCookieBar";
175			document.body.appendChild(barDiv);
176			barDiv.innerHTML = htmlBar;
177			
178			self.bindCookieBar();
179		},
180		bindCookieBar: function(){
181			var self = this;
182
183			var btn_arr = self.getElementsByClass("AcceptClickBtn", null, "button");
184			if(btn_arr.length > 0)
185			{
186				self.addEvent(btn_arr[0], "click", function (e) {
187					if (e.preventDefault) {
188						e.preventDefault();
189					}
190					self.createCookie('cookie-policy-en-beef', 'YES', 365);
191					
192					document.body.classList.remove("bodyLock");
193					document.getElementById("pjAcceptCookieBar").remove();
194					return false;
195				});
196			}
197
198			var btn_arr = self.getElementsByClass("DeclineClickBtn", null, "button");
199			if(btn_arr.length > 0)
200			{
201				self.addEvent(btn_arr[0], "click", function (e) {
202					if (e.preventDefault) {
203						e.preventDefault();
204					}
205					self.createCookie('cookie-policy-en-beef', 'NO', 365);
206					
207					document.body.classList.remove("bodyLock");
208					document.getElementById("pjAcceptCookieBar").remove();
209					return false;
210				});
211			}
212
213		}
214	};
215	
216	window.AcceptCookie = AcceptCookie;	
217})(window);
218
219window.onload = function() {
220	AcceptCookie = AcceptCookie();
221}

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.