PageSourceSearch

https://tsc-6666.com/style/js/medica.js?20261005155110

js tsc-6666.com collected 2026-10-05 06:51:26 UTC 11,267 bytes, 370 lines download raw bytes

1// ウィンク効果
2$(function(){
3	$(".wink a img").hover(function(){
4		$(this).css("opacity", "0.4");
5		$(this).css("filter", "alpha(opacity=40)");
6		$(this).fadeTo("slow", 1.0);
7	});
8});
9
10
11/*
12 * yuga.js 0.7.1 - 優雅なWeb制作のためのJS
13 *
14 * Copyright (c) 2009 Kyosuke Nakamura (kyosuke.jp)
15 * Licensed under the MIT License:
16 * http://www.opensource.org/licenses/mit-license.php
17 *
18 * Since:     2006-10-30
19 * Modified:  2009-01-27
20 *
21 * jQuery 1.3.1
22 * ThickBox 3.1
23 */
24
25/*
26 * [使用方法] XHTMLのhead要素内で次のように読み込みます。
27 
28<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />
29<script type="text/javascript" src="js/jquery.js"></script>
30<script type="text/javascript" src="js/thickbox.js"></script>
31<script type="text/javascript" src="js/yuga.js" charset="utf-8"></script>
32
33 */
34
35(function($) {
36
37	$(function() {
38		$.yuga.selflink();
39		$.yuga.rollover();
40		$.yuga.externalLink();
41		$.yuga.thickbox();
42		$.yuga.scroll();
43		$.yuga.tab();
44		$.yuga.stripe();
45		$.yuga.css3class();
46	});
47
48	//---------------------------------------------------------------------
49
50	$.yuga = {
51		// URIを解析したオブジェクトを返すfunction
52		Uri: function(path){
53			var self = this;
54			this.originalPath = path;
55			//絶対パスを取得
56			this.absolutePath = (function(){
57				var e = document.createElement('span');
58				e.innerHTML = '<a href="' + path + '" />';
59				return e.firstChild.href;
60			})();
61			//絶対パスを分解
62			var fields = {'schema' : 2, 'username' : 5, 'password' : 6, 'host' : 7, 'path' : 9, 'query' : 10, 'fragment' : 11};
63			var r = /^((\w+):)?(\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/.exec(this.absolutePath);
64			for (var field in fields) {
65				this[field] = r[fields[field]];
66			}
67			this.querys = {};
68			if(this.query){
69				$.each(self.query.split('&'), function(){
70					var a = this.split('=');
71					if (a.length == 2) self.querys[a[0]] = a[1];
72				});
73			}
74		},
75		//現在のページと親ディレクトリへのリンク
76		selflink: function (options) {
77			var c = $.extend({
78				selfLinkAreaSelector:'body',
79				selfLinkClass:'current',
80				parentsLinkClass:'parentsLink',
81				postfix: '_cr',
82				changeImgSelf:true,
83				changeImgParents:true
84			}, options);
85			$(c.selfLinkAreaSelector+((c.selfLinkAreaSelector)?' ':'')+'a[href]').each(function(){
86				var href = new $.yuga.Uri(this.getAttribute('href'));
87				var setImgFlg = false;
88				if ((href.absolutePath == location.href) && !href.fragment) {
89					//同じ文書にリンク
90					$(this).addClass(c.selfLinkClass);
91					setImgFlg = c.changeImgSelf;
92				} else if (0 <= location.href.search(href.absolutePath)) {
93					//親ディレクトリリンク
94					$(this).addClass(c.parentsLinkClass);
95					setImgFlg = c.changeImgParents;
96				}
97				if (setImgFlg){
98					//img要素が含まれていたら現在用画像(_cr)に設定
99					$(this).find('img').each(function(){
100						this.originalSrc = $(this).attr('src');
101						this.current_Src = this.originalSrc.replace(new RegExp('('+c.postfix+')?(\.gif|\.jpg|\.png)$'), c.postfix+"$2");
102						$(this).attr('src',this.current_Src);
103					});
104				}
105			});
106		},
107		//ロールオーバー
108		rollover: function(options) {
109			var c = $.extend({
110				hoverSelector: '.btn, .allbtn img',
111				groupSelector: '.btngroup',
112				postfix: '_on'
113			}, options);
114			//ロールオーバーするノードの初期化
115			var rolloverImgs = $(c.hoverSelector).filter(isNotCurrent);
116			rolloverImgs.each(function(){
117				this.originalSrc = $(this).attr('src');
118				this.rolloverSrc = this.originalSrc.replace(new RegExp('('+c.postfix+')?(\.gif|\.jpg|\.png)$'), c.postfix+"$2");
119				this.rolloverImg = new Image;
120				this.rolloverImg.src = this.rolloverSrc;
121			});
122			//グループ内のimg要素を指定するセレクタ生成
123			var groupingImgs = $(c.groupSelector).find('img').filter(isRolloverImg);
124
125			//通常ロールオーバー
126			rolloverImgs.not(groupingImgs).hover(function(){
127				$(this).attr('src',this.rolloverSrc);
128			},function(){
129				$(this).attr('src',this.originalSrc);
130			});
131			//グループ化されたロールオーバー
132			$(c.groupSelector).hover(function(){
133				$(this).find('img').filter(isRolloverImg).each(function(){
134					$(this).attr('src',this.rolloverSrc);
135				});
136			},function(){
137				$(this).find('img').filter(isRolloverImg).each(function(){
138					$(this).attr('src',this.originalSrc);
139				});
140			});
141			//フィルタ用function
142			function isNotCurrent(i){
143				return Boolean(!this.current_Src);
144			}
145			function isRolloverImg(i){
146				return Boolean(this.rolloverSrc);
147			}
148
149		},
150		//外部リンクは別ウインドウを設定
151		externalLink: function(options) {
152			var c = $.extend({
153				windowOpen:true,
154				externalClass: 'externalLink',
155				addIconSrc: ''
156			}, options);
157			var uri = new $.yuga.Uri(location.href);
158			var e = $('a[href^="http://"]').not('a[href^="' + uri.schema + '://' + uri.host + '/' + '"]');
159			if (c.windowOpen) {
160				e.click(function(){
161					window.open(this.href, '_blank');
162					return false;
163				});
164			}
165			if (c.addIconSrc) e.not(':has(img)').after($('<img src="'+c.addIconSrc+'" class="externalIcon" />'));
166			e.addClass(c.externalClass);
167		},
168		//画像へ直リンクするとthickboxで表示(thickbox.js利用)
169		thickbox: function() {
170			try {
171				tb_init('a[href$=".jpg"]:not(.thickbox, a[href*="?"]), a[href$=".gif"][href!="?"]:not(.thickbox, a[href*="?"]), a[href$=".png"][href!="?"]:not(.thickbox, a[href*="?"])');
172			} catch(e) {
173			}	
174		},
175		//ページ内リンクはするするスクロール
176		scroll: function(options) {
177			//ドキュメントのスクロールを制御するオブジェクト
178			var scroller = (function() {
179				var c = $.extend({
180					easing:100,
181					step:30,
182					fps:60,
183					fragment:''
184				}, options);
185				c.ms = Math.floor(1000/c.fps);
186				var timerId;
187				var param = {
188					stepCount:0,
189					startY:0,
190					endY:0,
191					lastY:0
192				};
193				//スクロール中に実行されるfunction
194				function move() {
195					if (param.stepCount == c.step) {
196						//スクロール終了時
197						setFragment(param.hrefdata.absolutePath);
198						window.scrollTo(getCurrentX(), param.endY);
199					} else if (param.lastY == getCurrentY()) {
200						//通常スクロール時
201						param.stepCount++;
202						window.scrollTo(getCurrentX(), getEasingY());
203						param.lastY = getEasingY();
204						timerId = setTimeout(move, c.ms); 
205					} else {
206						//キャンセル発生
207						if (getCurrentY()+getViewportHeight() == getDocumentHeight()) {
208							//画面下のためスクロール終了
209							setFragment(param.hrefdata.absolutePath);
210						}
211					}
212				}
213				function setFragment(path){
214					location.href = path
215				}
216				function getCurrentY() {
217					return document.body.scrollTop  || document.documentElement.scrollTop;
218				}
219				function getCurrentX() {
220					return document.body.scrollLeft  || document.documentElement.scrollLeft;
221				}
222				function getDocumentHeight(){
223					return document.documentElement.scrollHeight || document.body.scrollHeight;
224				}
225				function getViewportHeight(){
226					return (!$.browser.safari && !$.browser.opera) ? document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight : window.innerHeight;
227				}
228				function getEasingY() {
229					return Math.floor(getEasing(param.startY, param.endY, param.stepCount, c.step, c.easing));
230				}
231				function getEasing(start, end, stepCount, step, easing) {
232					var s = stepCount / step;
233					return (end - start) * (s + easing / (100 * Math.PI) * Math.sin(Math.PI * s)) + start;
234				}
235				return {
236					set: function(options) {
237						this.stop();
238						if (options.startY == undefined) options.startY = getCurrentY();
239						param = $.extend(param, options);
240						param.lastY = param.startY;
241						timerId = setTimeout(move, c.ms); 
242					},
243					stop: function(){
244						clearTimeout(timerId);
245						param.stepCount = 0;
246					}
247				};
248			})();
249			$('a[href^=#], area[href^=#]').not('a[href=#], area[href=#]').each(function(){
250				this.hrefdata = new $.yuga.Uri(this.getAttribute('href'));
251			}).click(function(){
252				var target = $('#'+this.hrefdata.fragment);
253				if (target.length == 0) target = $('a[name='+this.hrefdata.fragment+']');
254				if (target.length) {
255					scroller.set({
256						endY: target.offset().top,
257						hrefdata: this.hrefdata
258					});
259					return false;
260				}
261			});
262		},
263		//タブ機能
264		tab: function(options) {
265			var c = $.extend({
266				tabNavSelector:'.tabNav',
267				activeTabClass:'active'
268			}, options);
269			$(c.tabNavSelector).each(function(){
270				var tabNavList = $(this).find('a[href^=#], area[href^=#]');
271				var tabBodyList;
272				tabNavList.each(function(){
273					this.hrefdata = new $.yuga.Uri(this.getAttribute('href'));
274					var selecter = '#'+this.hrefdata.fragment;
275					if (tabBodyList) {
276						tabBodyList = tabBodyList.add(selecter);
277					} else {
278						tabBodyList = $(selecter);
279					}
280					$(this).unbind('click');
281					$(this).click(function(){
282						tabNavList.removeClass(c.activeTabClass);
283						$(this).addClass(c.activeTabClass);
284						tabBodyList.hide();
285						$(selecter).show();
286						return false;
287					});
288				});
289				tabBodyList.hide()
290				tabNavList.filter(':first').trigger('click');
291			});
292		},
293		//奇数、偶数を自動追加
294		stripe: function(options) {
295			var c = $.extend({
296				oddClass:'odd',
297				evenClass:'even'
298			}, options);
299			$('ul, ol').each(function(){
300				//JSでは0から数えるのでevenとaddを逆に指定
301				$(this).children('li:odd').addClass(c.evenClass);
302				$(this).children('li:even').addClass(c.oddClass);
303			});
304			$('table, tbody').each(function(){
305				$(this).children('tr:odd').addClass(c.evenClass);
306				$(this).children('tr:even').addClass(c.oddClass);
307			});
308		},
309		//css3のクラスを追加
310		css3class: function() {
311			//:first-child, :last-childをクラスとして追加
312			$('body :first-child').addClass('firstChild');
313			$('body :last-child').addClass('lastChild');
314			//css3の:emptyをクラスとして追加
315			$('body :empty').addClass('empty');
316		}
317	};
318})(jQuery);
319
320
321
322//FontSizeChanger
323$(function(){
324	var currentstyle = readCookie('fontStyle');
325	if (currentstyle){
326		switchFont(currentstyle);
327	};
328   		$("a.sizeL").click(function(){
329			switchFont("fontL");
330   			return false;
331		});
332   		$("a.sizeM").click(function(){
333			switchFont("fontM");
334   			return false;
335		});
336   		$("a.sizeS").click(function(){
337			switchFont("fontS");
338			return false;
339		});
340});
341
342function switchFont(className){
343		$("body").removeAttr("class").addClass(className);
344		createCookie('fontStyle', className, 365);
345};
346
347// cookie script http://www.quirksmode.org/js/cookies.html
348function createCookie(name,value,days){
349	if (days){
350	var date = new Date();
351	date.setTime(date.getTime()+(days*24*60*60*1000));
352	var expires = "; expires="+date.toGMTString();
353	}
354	else var expires = "";
355	document.cookie = name+"="+value+expires+"; path=/";
356}
357
358function readCookie(name){
359	var nameEQ = name + "=";
360	var ca = document.cookie.split(';');
361	for(var i=0;i < ca.length;i++)
362		{
363		var c = ca[i];
364		while (c.charAt(0)==' ') c = c.substring(1,c.length);
365		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
366		}
367   return null;
368}
369
370

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.