PageSourceSearch

https://isaac-gaikokugo-school.jp/js/common.js

js isaac-gaikokugo-school.jp collected 2026-10-08 10:32:04 UTC 5,443 bytes, 210 lines download raw bytes

1function smartRollover() {
2	if(document.getElementsByTagName) {
3		var images = document.getElementsByTagName("img");
4
5		for(var i=0; i < images.length; i++) {
6			if(images[i].getAttribute("src").match("Off"))
7			{
8				images[i].onmouseover = function() {
9					this.setAttribute("src", this.getAttribute("src").replace("Off", "On"));
10				}
11				images[i].onmouseout = function() {
12					this.setAttribute("src", this.getAttribute("src").replace("On", "Off"));
13				}
14			}
15		}
16	}
17}
18
19if(window.addEventListener) {
20	window.addEventListener("load", smartRollover, false);
21}
22else if(window.attachEvent) {
23	window.attachEvent("onload", smartRollover);
24}
25
26// --------------------------------------------------------------------------------------------------------------------
27
28function _reportError(request)
29{
30    alert("通信中にエラーが発生しました。\r\nインターネットに正常に接続されているか、確認して下さい。");
31}
32
33
34
35// フローウィンドウ
36var g_flowWnd = null;
37
38function flowWndOpen(in_title, targeturl, in_width, in_height)
39{
40    if (g_flowWnd) { // 重複して開いている
41        return;
42    }
43
44    g_flowWnd = new Window({className: "dialog", width: in_width, height: in_height, zIndex: 100, url: targeturl, title: in_title, showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff});
45    g_flowWnd.setCloseCallback(flowWndClose);
46
47    // g_flowWnd.show();
48    g_flowWnd.showCenter();
49
50    g_flowWnd.setCloseCallback(flowWndClose);
51}
52function flowWndClose()
53{
54    g_flowWnd = null;
55    return true;
56}
57
58
59
60// ブラウザの幅・高さ取得
61function getBrowserWidth() {
62    if (window.innerWidth) {
63        return window.innerWidth;
64    }
65    else if (document.documentElement && document.documentElement.clientWidth != 0) {
66        return document.documentElement.clientWidth;
67    }
68    else if (document.body) {
69        return document.body.clientWidth;
70    }
71    return 0;
72}
73
74function getBrowserHeight() {
75    if (window.innerHeight) {
76        return window.innerHeight;
77    }
78    else if (document.documentElement && document.documentElement.clientHeight != 0) {
79        var ret = document.documentElement.clientHeight;
80        /*
81        var userAgent = navigator.userAgent.toLowerCase();
82         if (userAgent.indexOf("msie") != -1) {
83             ret -= 20;
84         }
85         */
86        return ret;
87    }
88    else if (document.body) {
89        return document.body.clientHeight;
90    }
91    return 0;
92}
93
94
95// マウスの X,Y 位置取得
96function getMouseXpos(event)
97{
98    var ret = '';
99    if (document.all) {
100
101        var scrollVal = document.body.scrollLeft;
102        if (! scrollVal) {
103            scrollVal = document.documentElement.scrollLeft;
104        }
105        if (! scrollVal) {
106            scrollVal = 0;
107        }
108
109        try {
110            ret = event.pageX;
111        } catch (e) {
112            ret = scrollVal + window.event.clientX;
113        }
114
115        if (! ret) {
116            try {
117                ret = scrollVal + window.event.clientX;
118            } catch(e) {
119                ret = 824;
120            }
121        }
122    }
123    else if (document.layers || document.getElementById) {
124        ret = event.pageX;
125    }
126
127    return ret;
128}
129
130function getMouseYpos(event)
131{
132    var ret = '';
133
134    if (document.all) {
135
136        var scrollVal = document.body.scrollTop;
137        if (! scrollVal) {
138            scrollVal = document.documentElement.scrollTop;
139        }
140        if (! scrollVal) {
141            scrollVal = 0;
142        }
143
144        try {
145            ret = event.pageY;
146        } catch (e) {
147            ret = scrollVal + window.event.clientY;
148        }
149
150        if (! ret) {
151            try {
152                ret = scrollVal + window.event.clientY;
153            } catch(e) {
154                ret = 204;
155            }
156        }
157    }
158    else if (document.layers || document.getElementById) {
159        ret = event.pageY;
160    }
161
162    return ret;
163}
164
165
166
167
168////////Scroll ================================================
169
170var objPageScrollTimer;                 // タイマーオブジェクト
171var intPageScrollTimerInterval = 5;     // 移動時間間隔(ms)
172var intPageScrollRate = 5;
172              // 移動する距離割合(現在位置から目的地までの○○%分移動させる)
173var intPageScrollGoalTop;               // 目的のY座標
174
175//ページ内の指定したID属性のタグまでスクロールする
176function pageScroll(objID)
177{
178// タイマー初期化
179if (objPageScrollTimer) clearInterval(objPageScrollTimer);
180
181if(document.getElementById(objID)){
182// 目的の要素までのY座標を取得
183var objBounds = document.getElementById(objID).getBoundingClientRect();
184intPageScrollGoalTop = objBounds.top;
185// タイマーセット
186objPageScrollTimer = setInterval("pageScrolling()", intPageScrollTimerInterval);
187}
188
189return false;
190}
191
192function pageScrolling()
193{
194// 現在のY座標を取得
195var intNowY = document.documentElement.scrollTop || document.body.scrollTop;
196
197// 移動距離を計算
198scrollLength = Math.ceil((intPageScrollGoalTop - intNowY) * (intPageScrollRate/100));
199
200// スクロールの移動
201scrollBy(0, scrollLength);
202
203// 移動後のY座標を取得
204var intNewY = document.documentElement.scrollTop || document.body.scrollTop;
205
206// 目的の座標を越えるか移動後の座標変化がない場合はタイマー停止
207if (intPageScrollGoalTop <= intNowY || intNewY == intNowY){
208objPageScrollTimer = clearInterval(objPageScrollTimer);
209}
210}

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.