PageSourceSearch

https://www.hitachiglobalairpower.com/js/en/r1/common.js

js hitachiglobalairpower.com collected 2026-10-07 16:15:06 UTC 12,447 bytes, 415 lines download raw bytes

1/* **************************************************
2
3Name: common.js
4
5Description: Common Settings
6
7Create: 2014.02.13
8Update: 2017.04.25
9Update: 2019.03.01
10Update: 2020.11.10
11
12Copyright 2014 Hitachi, Ltd.
13
14***************************************************** */
15
16
17
18/* content===========================================
19
20[-] Use Agent
21[-] Base Setting
22[-] Skip Link
23[-] Pop-up Window
24[-] Smooth Scroll
25[-] Link Box
26[-] jQuery Easing
27
28===================================================== */
29
30
31
32/* 1: Use Agent
33=========================================================================================== */
34
35var nut = navigator.userAgent.toLowerCase();
36var uaCheck = {
37	"ie"		:nut.indexOf("msie") != -1 || nut.indexOf('trident') != -1,
38	"ie6"		:nut.indexOf("msie 6") != -1,
39	"ie7"		:nut.indexOf("msie 7") != -1,
40	"ie8"		:nut.indexOf("msie 8") != -1,
41	"ff"		:nut.indexOf("firefox") != -1,
42	"safari"	:nut.indexOf("safari") != -1,
43	"chrome"	:nut.indexOf("chrome") != -1,
44	"opera"		:nut.indexOf("opera") != -1,
45	"iphone"	:nut.indexOf("iphone") != -1,
46	"ipad"		:nut.indexOf("ipad") != -1,
47	"ipod"		:nut.indexOf("ipod") != -1,
48	"android"	:nut.indexOf("android") != -1,
49	"xp"		:nut.indexOf("nt 5.1") != -1,
50	"win"		:navigator.appVersion.indexOf ("Win") != -1,
51	"mac"		:navigator.appVersion.indexOf ("Macintosh") != -1,
52	"ios"		:nut.indexOf("iphone") != -1 || nut.indexOf("ipad") != -1 || nut.indexOf("ipod") != -1,
53	"sp"		:nut.indexOf("iphone") != -1 || nut.indexOf("ipad") != -1 || nut.indexOf("ipod") != -1 || nut.indexOf("android") != -1
54};
55
56function ua(target) {
57	return uaCheck[target];
58}
59
60
61
62/* 2: Base Setting
63=========================================================================================== */
64
65if(ua("sp")) $("html").addClass("SP");
66
67
68
69/* 3: Skip Link
70=========================================================================================== */
71
72function skiplink(target_id) {
73
74	function focusIn(event) {
75		var focus_class = 'focus';
76		this.className = focus_class;
77		window.scroll(document.documentElement.scrollTop || document.body.scrollTop, 0);
78	}
79	function focusOut(event) {
80		this.className = '';
81	}
82	function jumpTo(event) {
83		var VK_ENTER = 13;
84		if ((event.type == 'keydown') && (event.keyCode != VK_ENTER)) return;
85		this.className = '';
86		var hrefID = this.getAttribute('href').replace(/.*#/g,'');
87		window.location.hash = '#' + hrefID;
88		var timeID = setTimeout(function(){
89			clearTimeout(timeID);
90			var target = document.getElementById(hrefID);
91			target.setAttribute('href','');
92			target.focus();
93			target.removeAttribute('href');
94		}, 100);
95	}
96
97	function setListeners(e) {
98		if (document.getElementById(target_id)) {
99			var targetAnchor = document.getElementById(target_id).getElementsByTagName('a');
100			if (targetAnchor.length > 0) {
101				targetAnchor = targetAnchor[0];
102				addListener(targetAnchor, 'focus', focusIn, false);
103				addListener(targetAnchor, 'blur', focusOut, false);
104				addListener(targetAnchor, 'keydown', jumpTo, false);
105				addListener(targetAnchor, 'mousedown', jumpTo, false);
106			}
107		} else {
108			return false;
109		}
110	}
111
112	function addListener(elem, eventType, func, cap) {
113		if (elem.addEventListener) {
114			elem.addEventListener(eventType, func, cap);
115		} else if (elem.attachEvent) {
116			elem.attachEvent('on' + eventType, function() {
117				func.call(elem, window.event);
118			});
119		} else {
120			return false;
121		}
122	}
123
124	addListener(window, 'load', setListeners, false);
125
126};
127
128skiplink('top');
129
130
131
132/* 4: Pop-up Window
133=========================================================================================== */
134
135function openWindow()
136{
137		/*
138		 * for pop-up window
139		 *
140		 *  1. url
141		 *  2. window name
142		 *  3. width
143		 *  4. height
144		 *  5. resizable
145		 *  6. toolbar
146		 *  7. scrollbars
147		 *  8. location
148		 *  9. menubar
149		 * 10. status
150		 *
151		 */
152		var args = arguments;
153		var win_set = '';
154		win_set += 'width=' + ((args[2])? args[2] : screen.width-30) 
155		win_set += ',height=' + ((args[3])? args[3] : screen.height-30) 
156		win_set += ',resizable=' + ((args[4])? 1 : 0) 
157		win_set += ',toolbar=' + ((args[5])? 1 : 0) 
158		win_set += ',scrollbars=' + ((args[6])? 1 : 0) 
159		win_set += ',location=' + ((args[7])? 1 : 0) 
160		win_set += ',menubar=' + ((args[8])? 1 : 0) 
161		win_set += ',status=' + ((args[9])? 1 : 0);
162		swin = window.open(args[0],args[1],win_set);
163		swin.focus();
164}
165
166function openNormalWindow(url,wname)
167{
168		/*
169		 * Pop-up - normal
170		 */
171		swin = window.open(url,wname, "width=600, height=550, resizable=yes, toolbar=no, scrollbars=yes, location=no, menubar=yes, status=yes");
172		swin.focus();
173}
174
175function openLargeWindow(url,wname)
176{
177		/*
178		 * Pop-up - large
179		 */
180		swin = window.open(url,wname, "width=800, height=550, resizable=yes, toolbar=no, scrollbars=yes, location=no, menubar=yes, status=yes");
181		swin.focus();
182}
183
184function openBlankWindow(url,wname)
185{
186		/*
187		 * The target pseudo-class ="_blank"
188		 */
189		swin = window.open(url,wname);
190		swin.focus();
191}
192
193
194
195(function($){
196
197/* 5: Smooth Scroll
198=========================================================================================== */
199
200$(document).ready(function() {
201	
202	var topID = (ua("safari")) ? "html,body" : "html";
203	
204	$(".SmoothScroll").click(function(){
205		var link = $(this).attr("href");
206		if(link.charAt(0)=="#" && link.charAt(1)!="") {
207			var offset = $(link).offset();
208			var tid = setTimeout(function() {
209				$(topID).stop().animate({scrollTop: offset.top}, 800, "easeInOutCubic", function() {
210					location.href = link;
211				});
212			}, 10);
213			return false;
214		}
215	});
216	
217});
218
219
220
221/* 6: Link Box
222=========================================================================================== */
223
224$(document).ready(function() {
225	
226	$(".Link").mouseover(function() {
227		$(this).addClass("hover");
228	}).mouseout(function() {
229		$(this).removeClass("hover");
230	}).click(function(){
231		location.href = $(this).find("a").attr("href");
232	});
233	
234});
235
236
237
238})(jQuery);
239
240
241
242/* 8: jQuery Easing
243=========================================================================================== */
244/*
245 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
246 *
247 * Uses the built in easing capabilities added In jQuery 1.1
248 * to offer multiple easing options
249 *
250 * TERMS OF USE - jQuery Easing
251 * 
252 * Open source under the BSD License. 
253 * 
254 * Copyright c 2008 George McGinley Smith
255 * All rights reserved.
256 * 
257 * Redistribution and use in source and binary forms, with or without modification, 
258 * are permitted provided that the following conditions are met:
259 * 
260 * Redistributions of source code must retain the above copyright notice, this list of 
261 * conditions and the following disclaimer.
262 * Redistributions in binary form must reproduce the above copyright notice, this list 
263 * of conditions and the following disclaimer in the documentation and/or other materials 
264 * provided with the distribution.
265 * 
266 * Neither the name of the author nor the names of contributors may be used to endorse 
267 * or promote products derived from this software without specific prior written permission.
268 * 
269 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
270 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
271 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
272 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
273 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
274 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
275 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
276 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
277 * OF THE POSSIBILITY OF SUCH DAMAGE. 
278 *
279*/
280
281// t: current time, b: begInnIng value, c: change In value, d: duration
282jQuery.easing['jswing'] = jQuery.easing['swing'];
283
284jQuery.extend( jQuery.easing,
285{
286	def: 'easeOutQuad',
287	swing: function (x, t, b, c, d) {
288		//alert(jQuery.easing.default);
289		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
290	},
291	easeInQuad: function (x, t, b, c, d) {
292		return c*(t/=d)*t + b;
293	},
294	easeOutQuad: function (x, t, b, c, d) {
295		return -c *(t/=d)*(t-2) + b;
296	},
297	easeInOutQuad: function (x, t, b, c, d) {
298		if ((t/=d/2) < 1) return c/2*t*t + b;
299		return -c/2 * ((--t)*(t-2) - 1) + b;
300	},
301	easeInCubic: function (x, t, b, c, d) {
vendor: 4,034 bytes, lines 302-415
302		return c*(t/=d)*t*t + b;
303	},
304	easeOutCubic: function (x, t, b, c, d) {
305		return c*((t=t/d-1)*t*t + 1) + b;
306	},
307	easeInOutCubic: function (x, t, b, c, d) {
308		if ((t/=d/2) < 1) return c/2*t*t*t + b;
309		return c/2*((t-=2)*t*t + 2) + b;
310	},
311	easeInQuart: function (x, t, b, c, d) {
312		return c*(t/=d)*t*t*t + b;
313	},
314	easeOutQuart: function (x, t, b, c, d) {
315		return -c * ((t=t/d-1)*t*t*t - 1) + b;
316	},
317	easeInOutQuart: function (x, t, b, c, d) {
318		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
319		return -c/2 * ((t-=2)*t*t*t - 2) + b;
320	},
321	easeInQuint: function (x, t, b, c, d) {
322		return c*(t/=d)*t*t*t*t + b;
323	},
324	easeOutQuint: function (x, t, b, c, d) {
325		return c*((t=t/d-1)*t*t*t*t + 1) + b;
326	},
327	easeInOutQuint: function (x, t, b, c, d) {
328		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
329		return c/2*((t-=2)*t*t*t*t + 2) + b;
330	},
331	easeInSine: function (x, t, b, c, d) {
332		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
333	},
334	easeOutSine: function (x, t, b, c, d) {
335		return c * Math.sin(t/d * (Math.PI/2)) + b;
336	},
337	easeInOutSine: function (x, t, b, c, d) {
338		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
339	},
340	easeInExpo: function (x, t, b, c, d) {
341		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
342	},
343	easeOutExpo: function (x, t, b, c, d) {
344		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
345	},
346	easeInOutExpo: function (x, t, b, c, d) {
347		if (t==0) return b;
348		if (t==d) return b+c;
349		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
350		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
351	},
352	easeInCirc: function (x, t, b, c, d) {
353		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
354	},
355	easeOutCirc: function (x, t, b, c, d) {
356		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
357	},
358	easeInOutCirc: function (x, t, b, c, d) {
359		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
360		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
361	},
362	easeInElastic: function (x, t, b, c, d) {
363		var s=1.70158;var p=0;var a=c;
364		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
365		if (a < Math.abs(c)) { a=c; var s=p/4; }
366		else var s = p/(2*Math.PI) * Math.asin (c/a);
367		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
368	},
369	easeOutElastic: function (x, t, b, c, d) {
370		var s=1.70158;var p=0;var a=c;
371		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
372		if (a < Math.abs(c)) { a=c; var s=p/4; }
373		else var s = p/(2*Math.PI) * Math.asin (c/a);
374		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
375	},
376	easeInOutElastic: function (x, t, b, c, d) {
377		var s=1.70158;var p=0;var a=c;
378		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
379		if (a < Math.abs(c)) { a=c; var s=p/4; }
380		else var s = p/(2*Math.PI) * Math.asin (c/a);
381		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
382		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
383	},
384	easeInBack: function (x, t, b, c, d, s) {
385		if (s == undefined) s = 1.70158;
386		return c*(t/=d)*t*((s+1)*t - s) + b;
387	},
388	easeOutBack: function (x, t, b, c, d, s) {
389		if (s == undefined) s = 1.70158;
390		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
391	},
392	easeInOutBack: function (x, t, b, c, d, s) {
393		if (s == undefined) s = 1.70158; 
394		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
395		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
396	},
397	easeInBounce: function (x, t, b, c, d) {
398		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
399	},
400	easeOutBounce: function (x, t, b, c, d) {
401		if ((t/=d) < (1/2.75)) {
402			return c*(7.5625*t*t) + b;
403		} else if (t < (2/2.75)) {
404			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
405		} else if (t < (2.5/2.75)) {
406			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
407		} else {
408			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
409		}
410	},
411	easeInOutBounce: function (x, t, b, c, d) {
412		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
413		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
414	}
415});

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.