PageSourceSearch

https://www.idaten.ne.jp/portal/common-dominant/js/common2.js

js idaten.ne.jp collected 2026-10-02 06:58:28 UTC 17,267 bytes, 573 lines download raw bytes

1/**
2 * common2.js
3 *
4 *  version --- 1.0
5 *  updated --- 2016/08/22
6 */
7
8
9/* !stack ------------------------------------------------------------------- */
10jQuery(document).ready(function($) {
11	pageScroll();
12	rollover();
13	popWindow();
14	localNav();
15	addCss();
16});
17
18
19/* !isUA -------------------------------------------------------------------- */
20var isUA = (function(){
21	var ua = navigator.userAgent.toLowerCase();
22	indexOfKey = function(key){ return (ua.indexOf(key) != -1)? true: false;}
23	var o = {};
24	o.ie      = function(){ return indexOfKey("msie"); }
25	o.fx      = function(){ return indexOfKey("firefox"); }
26	o.chrome  = function(){ return indexOfKey("chrome"); }
27	o.opera   = function(){ return indexOfKey("opera"); }
28	o.android = function(){ return indexOfKey("android"); }
29	o.ipad    = function(){ return indexOfKey("ipad"); }
30	o.ipod    = function(){ return indexOfKey("ipod"); }
31	o.iphone  = function(){ return indexOfKey("iphone"); }
32	return o;
33})();
34/* !fxPrint ----------------------------------------------------------------- */
35(function(){
36	setCSS = function(){
37		elem = document.createElement('link');
38		elem.setAttribute('rel','stylesheet');
39		elem.setAttribute('type','text/css');
40		elem.setAttribute('media','print');
41		elem.setAttribute('href','/portal/common/css/fx_print.css');
42		document.getElementsByTagName('head')[0].appendChild(elem);
43	}
44	if( isUA.fx() ) window.addEventListener("load",setCSS,false);
45})();
46/* 2016.08.22 DIS.KIWASA DELETE START ----------------------------------------*/
47/* !init Smart Devices ------------------------------------------------------
48(function (){
49	var parentNode = document.getElementsByTagName('head')[0];
50	var viewport = {
51		withzoom:'width=devise-width, initial-scale=1.0',
52		android : 'width=480, user-scalable=yes, initial-scale=0.3125 maximum-scale=3',
53		ipad    : 'width=1024',
54		iphone  : 'width=device-width'
55	}
56	meta = document.createElement('meta');
57	meta.setAttribute('name','viewport');
58
59	if( isUA.android() ){
60		meta.setAttribute('content',viewport.android);
61		parentNode.appendChild(meta);
62	}else if( isUA.ipad() ){
63		meta.setAttribute('content',viewport.ipad);
64		parentNode.appendChild(meta);
65	}else if( isUA.ipod() || isUA.iphone() ){
66		meta.setAttribute('content',viewport.iphone);
67		parentNode.appendChild(meta);
68		window.addEventListener('load', function(){ setTimeout(scrollTo, 100, 0, 1);}, false);
69	}else{
70	}
71})();
72/* 2016.08.22 DIS.KIWASA DELETE END ------------------------------------------*/
73/* !rollover ---------------------------------------------------------------- */
74var rollover = function(){
75	var suffix = { normal : '_no.', over   : '_on.'};
76	$('a.over, img.over, input.over').each(function(){
77		var a = null;
78		var img = null;
79
80		var elem = $(this).get(0);
81		if( elem.nodeName.toLowerCase() == 'a' ){
82			a = $(this);
83			img = $('img',this);
84		}else if( elem.nodeName.toLowerCase() == 'img' || elem.nodeName.toLowerCase() == 'input' ){
85			img = $(this);
86		}
87
88		var src_no = img.attr('src');
89		var src_on = src_no.replace(suffix.normal, suffix.over);
90
91		if( elem.nodeName.toLowerCase() == 'a' ){
92			a.bind("mouseover focus",function(){ img.attr('src',src_on); })
93			 .bind("mouseout blur",  function(){ img.attr('src',src_no); });
94		}else if( elem.nodeName.toLowerCase() == 'img' ){
95			img.bind("mouseover",function(){ img.attr('src',src_on); })
96			   .bind("mouseout", function(){ img.attr('src',src_no); });
97		}else if( elem.nodeName.toLowerCase() == 'input' ){
98			img.bind("mouseover focus",function(){ img.attr('src',src_on); })
99			   .bind("mouseout blur",  function(){ img.attr('src',src_no); });
100		}
101
102		var cacheimg = document.createElement('img');
103		cacheimg.src = src_on;
104
105		img.css('cursor', 'pointer');
106	});
107};
108/* !pageScroll -------------------------------------------------------------- */
109var pageScroll = function(){
110	jQuery.easing.easeInOutCubic = function (x, t, b, c, d) {
111		if ((t/=d/2) < 1) return c/2*t*t*t + b;
112		return c/2*((t-=2)*t*t + 2) + b;
113	};
114	$('a.scroll, .scroll a, .pageTop a, .ftPageTop a').each(function(){
115		$(this).bind("click keypress",function(e){
116			e.preventDefault();
117			var target  = $(this).attr('href');
118			if ( $(target).offset() == null) {
119				return false;
120			}
121			var targetY = $(target).offset().top;
122			var parent  = ( isUA.opera() )? (document.compatMode == 'BackCompat') ? 'body': 'html' : 'html,body';
123			$(parent).animate(
124				{scrollTop: targetY },
125				400,
126				'easeInOutCubic',
127				function(){
128					location.hash = target;
129				}
130			);
131			return false;
132		});
133	});
134}
135/* !localNav ---------------------------------------------------------------- */
136var localNav = function(){
137	var navClass = document.body.className.toLowerCase(),
138		parent = $("#lNavi"),
139		prefix = 'lNav',
140		current = 'current',
141		regex = {
142			a  : /l/,
143			dp : [
144				/l[\d]+_[\d]+_[\d]+_[\d]+/,
145				/l[\d]+_[\d]+_[\d]+/,
146				/l[\d]+_[\d]+/,
147				/l[\d]+/
148			]
149		},
150		route = [],
151		i,
152		l,
153		temp,
154		node;
155
156	$("ul ul", parent).hide();
157
158	if( navClass.indexOf("ldef") >= -1 ){
159		for(i = 0, l = regex.dp.length; i < l; i++){
160			temp = regex.dp[i].exec( navClass );
161			if( temp ){
162				route[i] = temp[0].replace(regex.a, prefix);
163			}
164		}
165		///console.log(route);
166		if( route[0] ){
167			// depth 4
168			node = $("a."+route[0], parent);
169			node.addClass(current);
170			node.next().show();
171			node.parent().parent().show()
172				.parent().parent().show()
173				.parent().parent().show();
174			node.parent().parent().prev().addClass('parent');
175			node.parent().parent()
176				.parent().parent().prev().addClass('parent');
177			node.parent().parent()
178				.parent().parent()
179				.parent().parent().prev().addClass('parent');
180
181		}else if( route[1] ){
182			// depth 3
183			node = $("a."+route[1], parent);
184			node.addClass(current);
185			node.next().show();
186			node.parent().parent().show()
187				.parent().parent().show();
188			node.parent().parent().prev().addClass('parent');
189			node.parent().parent()
190				.parent().parent().prev().addClass('parent');
191
192
193		}else if( route[2] ){
194			// depth 2
195			node = $("a."+route[2], parent);
196			node.addClass(current);
197			node.next().show();
198			node.parent().parent().show();
199			node.parent().parent().prev().addClass('parent');
200
201		}else if( route[3] ){
202			// depth 1
203			node = $("a."+route[3], parent);
204			node.addClass(current);
205			node.next().show();
206
207		}else{
208		}
209	}
210}
211/* !popWindow --------------------------------------------------------------- */
212var popWindow = function (){
213	var param = null;
214	// param[0] = width
215	// param[1] = height
216	// param[2] = window.name
217	$('a[class^="js_popup"], area[class^="js_popup"]').each(function(i){
218		$(this).click(function(){
219			var w = null;
220			param = $(this).attr('class').match(/[0-9]+/g);
221			// get window.name
222			param[2] = window.name ? window.name+'_' : '';
223			w = window.open(this.href, param[2]+'popup'+i,'width='+param[0]+',height='+param[1]+',scrollbars=no');
224			w.focus();
225			return false;
226		});
227	});
228}
229/* !defFunc ----------------------------------------------------------------- */
230var defFunc = (function(){
231	Print = function(){ window.print(); return false;}
232	Close = function(){ window.close(); return false;}
233})();
234/* !Addition Fitst & Last --------------------------------------------------- */
235var addCss = (function(){
236	//$('.section:first-child:not(:last-child)').addClass('first');
237	//$('.section:last-child').addClass('last');
238	//$('.sectionSub:last-child').addClass('last');
239	$('li:first-child:not(:last-child)').addClass('first');
240	$('li:last-child').addClass('last');
241	$('tr:first-child:not(:last-child)').addClass('first');
242	$('tr:last-child').addClass('last');
243});
244/* !gnavi --------------------------------------------------- */
245$(function(){
246	$('#gNavi li:not(#gNav08) p').append('<span class="line"></span>');
247	$('#wrapper.g01 #gNavi li#gNav01, #wrapper.g02 #gNavi li#gNav02, #wrapper.g03 #gNavi li#gNav03, #wrapper.g04 #gNavi li#gNav04, #wrapper.g05 #gNavi li#gNav05, #wrapper.g06 #gN
247avi li#gNav06, #wrapper.g07 #gNavi li#gNav07, #wrapper.g08 #gNavi li#gNav08').addClass('current');
248	$('#wrapper.g01 #gNavi li#gNav01, #wrapper.g02 #gNavi li#gNav02, #wrapper.g03 #gNavi li#gNav03, #wrapper.g04 #gNavi li#gNav04, #wrapper.g05 #gNavi li#gNav05, #wrapper.g06 #gNavi li#gNav06, #wrapper.g07 #gNavi li#gNav07, #wrapper.g08 #gNavi li#gNav08').prev().find('span').addClass('cur_prev');
249	$('#wrapper.g01 #gNavi li#gNav01, #wrapper.g02 #gNavi li#gNav02, #wrapper.g03 #gNavi li#gNav03, #wrapper.g04 #gNavi li#gNav04, #wrapper.g05 #gNavi li#gNav05, #wrapper.g06 #gNavi li#gNav06, #wrapper.g07 #gNavi li#gNav07').next().addClass('cur_next');
250	$('#gNavi li').hover(function(){
251		$(this).addClass('hover');
252		$(this).prev().find('span').addClass('prev');
253	},function(){
254		$(this).removeClass('hover');
255		$(this).prev().find('span').removeClass('prev');
256	});
257	$('#gNavi li.cur_next').hover(function(){
258		$(this).prev().find('span').addClass('next_hover');
259	},function(){
260		$(this).prev().find('span').removeClass('next_hover');
261	});
262	$("#gNavi li p").click(function(){
263		window.location=$(this).find("a").attr("href");
264		return false;
265	});
266
267});
268
269
270/* !placeholder --------------------------------------------------- */
271$(function(){
272	$(window).load(function(){
273		$('#headerSearch input[type=text], #headerSearch03 input[type=text], .sideLoginSec02 input[type=text]').each(function(){
274			var thisTitle = $(this).attr('title');
275			if(!(thisTitle === '')){
276				$(this).wrapAll('<span style="text-align:left;display:inline-block;position:relative;"></span>');
277				$(this).parent('span').append('<span class="placeholder">' + thisTitle + '</span>');
278				$('.placeholder').css({
279					top:'7px',
280					left:'5px',
281					fontSize:'100%',
282					lineHeight:'120%',
283					textAlign:'left',
284					color:'#666',
285					overflow:'hidden',
286					position:'absolute',
287					zIndex:'99'
288				}).click(function(){
289					$(this).prev().focus();
290				});
291
292				$(this).focus(function(){
293					$(this).next('span').css({display:'none'});
294				});
295
296				$(this).blur(function(){
297					var thisVal = $(this).val();
298					if(thisVal === ''){
299						$(this).next('span').css({display:'inline-block'});
300					} else {
301						$(this).next('span').css({display:'none'});
302					}
303				});
304
305				var thisVal = $(this).val();
306				if(thisVal === ''){
307					$(this).next('span').css({display:'inline-block'});
308				} else {
309					$(this).next('span').css({display:'none'});
310				}
311			}
312		});
313	});
314});
315$(function(){
316	var urlPath = location.pathname;
317	var isChangeMessage = false;
318	if (urlPath.indexOf('/portal/pub/prod/EOCCXX001_list.html') > -1) {
319		isChangeMessage = true;
320	}
321	var thisTitleSentaku = '選択してください';
322	var displayPleaseSentaku = function(){
323		$('.ui-state-default').each(function(){
324            var p = $(this).parent('span').prev('select');
325            var display = p.css('display');
326			if (p.length == 0 || p.css('display') != 'none') {
327				return ;
328			}
329
330            $(this).css('border', '1px solid #AAA');
331            $(this).css('background', '#FFF');
332            if ($(this)[0].tagName.toLowerCase() != 'input') { return; }
333
334            if (isChangeMessage && $(this).closest('div').hasClass('divBundle01R')) {
335            	$(this).parent('span').append('<span class="placeholderSentaku">お気に入りリストを選択</span>');
336            } else {
337            	$(this).parent('span').append('<span class="placeholderSentaku">' + thisTitleSentaku + '</span>');
338            }
339			$('.placeholderSentaku').css({
340				top:'7px',
341				left:'5px',
342				fontSize:'100%',
343				lineHeight:'120%',
344				textAlign:'left',
345				color:'#666',
346				overflow:'hidden',
347				position:'absolute',
348				zIndex:'99'
349			}).click(function(){
350				$(this).prev().focus();
351			});
352
353			$(this).focus(function(){
354				$(this).next('a').next('span .placeholderSentaku').css({display:'none'});
355			});
356
357			$(this).blur(function(){
358                var targetInput = $(this);
359				var thisVal = targetInput.val();
360				if(thisVal === ''){
361				    targetInput.next('a').next('span .placeholderSentaku').css({display:'inline-block'});
362				} else {
363				    targetInput.next('a').next('span .placeholderSentaku').css({display:'none'});
364				}
365			});
366
367			var thisVal = $(this).val();
368			if(thisVal === ''){
369				$(this).next('a').next('span .placeholderSentaku').css({display:'inline-block'});
370			} else {
371				$(this).next('a').next('span .placeholderSentaku').css({display:'none'});
372			}
373		});
374	};
375	setTimeout(displayPleaseSentaku, 500);
376});
377
378/* !auto bar --------------------------------------------------- */
379$(function(){
380	$('.divLogin03L span').each(function(){
381		var barWidth = parseInt($(this).html());
382		var HarfBarWidth = barWidth/2;
383		$(this).prev('img').width(HarfBarWidth+'%');
384		var txtWidth1 = $(this).prev('img').width();
385		var txtWidth2 = txtWidth1-4;
386		$(this).width(txtWidth2+'px');
387	});
388});
389/* !box open --------------------------------------------------- */
390$(function(){
391	var b_more_close="元に戻す";
392	$('.btn_more01').each(function(){
393		var tHight = parseInt($(this).prev().height());
394		var lHight = parseInt($(this).prev().children('p').css('font-size'));
395		lHight = lHight + lHight/2;
396		var fSize = lHight*3;
397		$(this).prev().css('height',fSize);
398		if (!isFinite(lHight)) {
399			$(this).remove();
400		} else if (tHight <= fSize + 2) {
401			$(this).remove();
402		} else {
403		var inText = $(this).children('span').children('a');
404		var b_more_open = inText.text();
405		$(this).click(
406			function(){
407				var inText = $(this).children('span').children('a');
408				if(inText.text()==b_more_open) {
409					$(this).prev().stop().animate({ height: tHight}, 500);
410					inText.text(b_more_close);
411				} else {
412					$(this).prev().stop().animate({ height: fSize}, 500);
413					inText.text(b_more_open);
414				}
415			}
416		);
417		$(this).toggle(
418			function(){
419				$(this).prev().stop().animate({ height: tHight}, 500);
420				$(this).addClass('open');
421			},function(){
422				$(this).prev().stop().animate({ height: fSize}, 500);
423				$(this).removeClass('open');
424			}
425		);
426		}
427
428	});
429
430});
431/* !table_even --------------------------------------------------- */
432//table_even
433$(function(){
434  $("div.table_even table").each(function(){
435    jQuery(this).find("tbody tr:nth-child(even)").addClass("even");
436  });
437});
438//table_even02
439$(function(){
440  $("div.table_even02 table").each(function(){
441    jQuery(this).find("tr:nth-child(4n-1),tr:nth-child(4n)").addClass("even");
442  });
443});
444//table_even03
445$(function(){
446  $("div.table_even03 table").each(function(){
447    jQuery(this).find("tr:nth-child(6n-2),tr:nth-child(6n-1),tr:nth-child(6n)").addClass("even");
448  });
449});
450//table_even04
451$(function(){
452  $("div.table_even04 table").each(function(){
453    jQuery(this).find("tr:nth-child(8n-3),tr:nth-child(8n-2),tr:nth-child(8n-1),tr:nth-child(8n)").addClass("even");
454  });
455});
456//table_even_specList
457$(function(){
458  $("div.table_even_specList table").each(function(){
459    jQuery(this).find("tbody tr:nth-child(odd)").addClass("even");
460  });
461});
462
463/* !Block Hover ------------------------------------------------------------ */
464var stopTimer;
465var stopTimerXY;
466var prePosiX;
467var mPosiX;
468$(function(){
469	$('.balloonTip01, .side_tip01').hover(function() {
470		$(this).addClass('hover');
471	},function() {
472		$(this).removeClass('hover');
473	});
474
475	$("body").mouseover(function () {
476		$('.div_tip01').hide();
477	});
478
479	$('.sideLoginSec001In').mouseover(function (b) {
480		cancelEvent(b)
481	});
482
483	$('.sideLoginSec001In').mousemove(function (b) {
484		mPosiX = b.clientX
485	});
486
487	$('.sideSec04_01').mouseover(function (b) {
488		cancelEvent(b)
489	});
490
491	$('.sideSec04_01').mousemove(function (b) {
492		mPosiX = b.clientX
493	});
494
495	$('.sideCatarogSec02In').mouseover(function (b) {
496		cancelEvent(b)
497	});
498
499	$('.sideCatarogSec02In').mousemove(function (b) {
500		mPosiX = b.clientX
501	});
502
503	$('.side_tip01').mouseover(function() {
504		var b = $(this);
505		var tm = 0;
506		var xZure = 8;
507
508		if (!$.support.opacity) {
509			xZure = 12
510		}
511
512		var cld = b.find('.div_tip01');
513		cancelEvent(b);
514		clearTimeout(stopTimerXY);
515		clearTimeout(stopTimer);
516		if (prePosiX != 0 && (mPosiX - prePosiX) > xZure) {
517			tm = 500
518		}
519		stopTimerXY = setTimeout(function(){
520			stopTimer = setTimeout(function() {
521				$('.div_tip01').hide();
522				cld.show();
523			}, 34);
524		}, tm);
525		prePosiX = mPosiX
526	}).mouseout(function () {
527		var b = $(this);
528		cancelEvent(b);
529		clearTimeout(stopTimerXY);
530		clearTimeout(stopTimer);
531	});
532});
533
534function cancelEvent(a) {
535	a = a ? a : window.event;
536	if (a.stopPropagation) {
537		a.stopPropagation()
538	}
539	if (a.preventDefault) {
540		a.preventDefault()
541	}
542	a.cancelBubble = true;
543	a.cancel = true;
544	a.returnValue = false;
545	return false
546}
547
548/* !AllCheck and Clear ------------------------------------------------------------ */
549$(function(){
550	$('.allcheck').click(function(){
551		var className = $(this).attr('chkgroup');
552		$('.' + className + ' :checkbox').attr('checked', true);
553	});
554	$('.allclear').click(function(){
555		var className = $(this).attr('chkgroup');
556		// start DIS-NET4 非互換改修パターン:jQuery(9)
557		$('.' + className + ' :checkbox').prop('checked', false);
558		// end DIS-NET4 非互換改修パターン:jQuery(9)
559	});
560});
561
562function htmlDecode(value) {
563	if (value != null) {
564		return $('<div/>').html(value).text();
565	}
566	return value;
567}
568
569/* !sicata dummy ------------------------------------------------------------ */
570function sicataA(rowIndex) {}
571function sicataB(checkName) {}
572function sicataC() {}
573function sicataD() {}

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.