PageSourceSearch

https://mariomandzukic.com/templates/gk_game/js/gk.scripts.js

js mariomandzukic.com collected 2026-10-02 10:09:41 UTC 6,297 bytes, 192 lines download raw bytes

1// IE checker
2function gkIsIE() {
3  var myNav = navigator.userAgent.toLowerCase();
4  return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
5}
6//
7var page_loaded = false;
8//
9window.addEvent('domready', function() {
10	// NSP suffix showcase
11	document.getElements('.showcase').each(function(wrapper) {
12		if(wrapper.getElement('.nspImageWrapper') && wrapper.getElement('.nspHeader')) {
13			wrapper.getElements('.nspArt').each(function(art) {
14				art.getElement('.nspHeader').inject(art.getElement('.nspImageWrapper'), 'bottom');
15			});
16		}
17	});
18	
19	document.getElements('.showcase-small').each(function(wrapper) {
20		if(wrapper.getElement('.nspImageWrapper') && wrapper.getElement('.nspHeader')) {
21			wrapper.getElements('.nspArt').each(function(art) {
22				art.getElement('.nspHeader').inject(art.getElement('.nspImageWrapper'), 'bottom');
23			});
24		}
25	});
26});
27//
28window.addEvent('load', function() {
29	setTimeout(function() {
30		if(document.id('gkTopBar')) {
31			document.id('gkTopBar').addClass('active');
32		}
33	}, 500);
34	//
35	page_loaded = true;
36	// smooth anchor scrolling
37	new SmoothScroll(); 
38	// style area
39	if(document.id('gkStyleArea')){
40		document.id('gkStyleArea').getElements('a').each(function(element,i){
41			element.addEvent('click',function(e){
42	            e.stop();
43				changeStyle(i+1);
44			});
45		});
46	}
47	// font-size switcher
48	if(document.id('gkTools') && document.id('gkMainbody')) {
49		var current_fs = 100;
50		var content_fx = new Fx.Tween(document.id('gkMainbody'), { property: 'font-size', unit: '%', duration: 200 }).set(100);
51		document.id('gkToolsInc').addEvent('click', function(e){ 
52			e.stop(); 
53			if(current_fs < 150) { 
54				content_fx.start(current_fs + 10); 
55				current_fs += 10; 
56			} 
57		});
58		document.id('gkToolsReset').addEvent('click', function(e){ 
59			e.stop(); 
60			content_fx.start(100); 
61			current_fs = 100; 
62		});
63		document.id('gkToolsDec').addEvent('click', function(e){ 
64			e.stop(); 
65			if(current_fs > 70) { 
66				content_fx.start(current_fs - 10); 
67				current_fs -= 10; 
68			} 
69		});
70	}
71	// K2 font-size switcher fix
72	if(document.id('fontIncrease') && document.getElement('.itemIntroText')) {
73		document.id('fontIncrease').addEvent('click', function() {
74			document.getElement('.itemIntroText').set('class', 'itemIntroText largerFontSize');
75		});
76		
77		document.id('fontDecrease').addEvent('click', function() {
78			document.getElement('.itemIntroText').set('class', 'itemIntroText smallerFontSize');
79		});
80	}
81	// login popup
82	if(document.id('gkPopupLogin') || document.id('gkPopupCart')) {
83		var popup_overlay = document.id('gkPopupOverlay');
84		popup_overlay.setStyles({'display': 'block', 'opacity': '0'});
85		popup_overlay.fade('out');
86
87		var opened_popup = null;
88		var popup_login = null;
89		var popup_login_h = null;
90		var popup_login_fx = null;
91		var popup_cart = null;
92		var popup_cart_h = null;
93		var popup_cart_fx = null;
94
95		if(document.id('gkPopupLogin') && document.id('gkLogin')) {
96			popup_login = document.id('gkPopupLogin');
97			popup_login_fx = new Fx.Morph(popup_login, {duration:500, transition: Fx.Transitions.Circ.easeInOut}).set({'opacity': 0, 'margin-top': -50 }); 
98			document.id('gkLogin').addEvent('click', function(e) {
99				new Event(e).stop();
100				popup_login.setStyle('display', 'block');
101				popup_overlay.setStyle('height', document.body.getScrollSize().y);
102				popup_overlay.fade(0.45);
103
104				setTimeout(function() {
105					popup_login_fx.start({'opacity': 1, 'margin-top': 0});
106					opened_popup = 'login';
107					popup_login.addClass('gk3Danim');
108				}, 450);
109
110				(function() {
111					if(document.id('modlgn-username')) {
112						document.id('modlgn-username').focus();
113					}
114				}).delay(600);
115			});
116		}
117
118		popup_overlay.addEvent('click', function() {
119			if(opened_popup == 'login')	{
120				popup_overlay.fade('out');
121				popup_login.removeClass('gk3Danim');
122				popup_login_fx.start({
123					'opacity' : 0,
124					'margin-top' : -50
125				});
126				setTimeout(function() {
127					popup_login.setStyle('display', 'none');
128				}, 450);
129			}	
130		});
131	}
132
133	var resize_boundary = parseInt(document.getElement('body').getProperty('data-tablet-width'), 10);
134	var small_resize_boundary = parseInt(document.getElement('body').getProperty('data-tablet-small-width'), 10);
135	var mobile_resize_boundary = parseInt(document.getElement('body').getProperty('data-mobile-width'), 10);
136	var col_m = document.id('gkContentWrap');
137	var col_s = document.id('gkSidebar');
138	var col_i = document.id('gkInset');
139
140	if(col_i) {
141		var columnResize = function() {
142			col_m.setStyle('min-height', '0');
143			if(col_s) col_s.setStyle('min-height', '0');
144			col_i.setStyle('min-height', '0');
145			
146			if(window.getSize().x > resize_boundary) {
147				var col_m_h = col_m.getSize().y;
148				var col_s_h = (col_s) ? col_s.getSize().y : 0;
149				var col_i_h = col_i.getSize().y;
150				var max = col_m_h;
151				if(max < col_s_h) max = col_s_h;
152				if(max < col_i_h) max = col_i_h;
153				col_m.setStyle('min-height', max + "px");
154				if(col_s) col_s.setStyle('min-height', max + "px");
155				col_i.setStyle('min-height', (max + 35) + "px");
156			} else if(window.getSize().x <= resize_boundary && window.getSize().x > mobile_resize_boundary) {
157				var col_m_h = col_m.getSize().y;
158				var col_i_h = col_i.getSize().y;
159				var max = col_m_h;
160				if(max < col_i_h) max = col_i_h;
161				if(col_s) col_s.setStyle('min-height', "0");
162				col_m.setStyle('min-height', max + "px");
163				col_i.setStyle('min-height', max + "px");
164			}
165		}
166		
167		columnResize();
168		
169		setTimeout(function() { columnResize(); }, 1000);
170		setTimeout(function() { columnResize(); }, 2500);
171		setTimeout(function() { columnResize(); }, 5000);
172		setTimeout(function() { columnResize(); }, 10000);
173	
174		window.addEvent('resize', function() {
175			columnResize();
176		});
177	}
178});
179// function to set cookie
180function setCookie(c_name, value, expire) {
181	var exdate=new Date();
182	exdate.setDate(exdate.getDate()+expire);
183	document.cookie=c_name+ "=" +escape(value) + ((expire==null) ? "" : ";expires=" + exdate.toUTCString());
184}
185// Function to change styles
186function changeStyle(style){
187	var file1 = $GK_TMPL_URL+'/css/style'+style+'.css';
188	var file2 = $GK_TMPL_URL+'/css/typography/typography.style'+style+'.css';
189	new Asset.css(file1);
190	new Asset.css(file2);
191	Cookie.write('gk_game_j25_style', style, { duration:365, path: '/' });
192}

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.