PageSourceSearch

https://www.uprrmuseum.org/cs/websites/up/sitenavigationfunctions.js

js uprrmuseum.org collected 2026-09-24 09:22:56 UTC 12,282 bytes, 369 lines download raw bytes

1var g_httpCgiUrl = "/cs/idcplg?IdcService=SS_GET_PAGE&";
2
3/////////////////////////////////////////////////////////////////////////////
4// Function : isTrue
5// Comments :
6/////////////////////////////////////////////////////////////////////////////
7function isTrue( boolStr )
8{
9	if( boolStr.length > 0 )
10	{
11		var boolChar = boolStr.substring(0,1).toUpperCase();
12		if( ( boolChar == '1' ) || ( boolChar == 'T' ) )
13		{
14			return true;
15		}
16	}
17
18	return false;
19}
20
21/////////////////////////////////////////////////////////////////////////////
22// Function : link
23// Comments :
24/////////////////////////////////////////////////////////////////////////////
25function link(dDocName,ssTargetNodeId,ssTargetSiteId)
26{
27	if ((dDocName.search("http://") != -1) || (dDocName.search("https://") != -1))
28	{
29		window.open(dDocName);
30	}
31	else if (dDocName.charAt(0) == '#')
32        {
33           window.location = window.location.href.split("#")[0] + dDocName;
34        }
35	else
36	{
37		var newUrl = "";
38		newUrl += g_httpCgiUrl;
39		newUrl += "ssDocName=" + dDocName;
40
41		var currentUrl = "" + window.location;
42
43		// Continue propagation of the "SSContributor" parameter
44		if( SSContributor )
45		{
46			var paramName = "SSContributor=";
47			var pos = currentUrl.indexOf( paramName );
48			if( pos != -1 )
49			{
50				var subStr = currentUrl.substring( pos+paramName.length, pos+paramName.length+1 );
51				if( isTrue( subStr ) )
52				{
53					newUrl += "&" + paramName + "true";
54				}
55			}
56		}
57
58		// Continue propagation of the "previewId" parameter
59		var previewId = "previewId=";
60		var posStart = currentUrl.indexOf( previewId );
61		if( posStart != -1 )
62		{
63			var posEnd = currentUrl.indexOf("&", posStart);
64			var value = "";
65			if (posEnd == -1)
66			{
67				value = currentUrl.substring(posStart+previewId.length, currentUrl.length);
68			}
69			else
70			{
71				value = currentUrl.substring(posStart+previewId.length, posEnd);
72			}
73			newUrl += "&" + previewId + value;
74		}
75
76		// We now always add the node that the link is on as part of the URL also.
77		if( typeof g_ssSourceNodeId != _U && g_ssSourceNodeId != null )
78			newUrl += "&ssSourceNodeId=" + g_ssSourceNodeId;
79
80		if( typeof g_ssSourceSiteId != _U && g_ssSourceSiteId != null )
81			newUrl += "&ssSourceSiteId=" + g_ssSourceSiteId;
82
83		// If we have a specific target nodeId then add that to the URL also
84		if( typeof ssTargetNodeId != _U && ssTargetNodeId != null )
85			newUrl += "&ssTargetNodeId=" + ssTargetNodeId;
86
87		if( typeof ssTargetSiteId != _U && ssTargetSiteId != null )
88			newUrl += "&ssTargetSiteId=" + ssTargetSiteId;
89
90		// We no longer support passing ssUrlPrefix on the URL - now we pass a value
91		// to indicate the type of address being used and then let the server compute it.
92		var urlType = 0; // undefined
93		if( typeof ssUrlType != _U && ssUrlType != null )
94		{
95			urlType = ssUrlType;
96		}
97		else if( typeof ssUrlPrefix != _U && ssUrlPrefix != null )
98		{
99			if( ssUrlPrefix == "/" )
100				urlType = 1;
101			else
102				urlType = 2;
103		}
104		newUrl += "&ssUrlType=" + urlType;
105
106		if( typeof ssDomainNum != _U && ssDomainNum != null )
107		{
108			newUrl += "&ssDomainNum=" + ssDomainNum;
109		}
110
111		// Navigate to the new url
112		window.location = newUrl;
113	}
114}
115
116/////////////////////////////////////////////////////////////////////////////
117// Function : nodelink
118// Comments :
119/////////////////////////////////////////////////////////////////////////////
120function nodelink(nodeId,siteId)
121{
122	var newUrl = "";
123	newUrl += g_httpCgiUrl;
124
125	if (typeof nodeId != _U && nodeId != 0)
126	{
127		newUrl += "nodeId=" + nodeId;
128	}
129
130	if( typeof siteId != _U && siteId != null )
131	{
132		newUrl += "&siteId=" + siteId;
133	}
134
135	var currentUrl = "" + window.location;
136
137	// Continue propagation of the "SSContributor" parameter
138	if( SSContributor )
139	{
140		var paramName = "SSContributor=";
141		var pos = currentUrl.indexOf( paramName );
142		if( pos != -1 )
143		{
144			var subStr = currentUrl.substring( pos+paramName.length, pos+paramName.length+1 );
145			if( isTrue( subStr ) )
146			{
147				newUrl += "&" + paramName + "true";
148			}
149		}
150	}
151
152	// Continue propagation of the "previewId" parameter
153	var previewId = "previewId=";
154	var posStart = currentUrl.indexOf( previewId );
155	if( posStart != -1 )
156	{
157		var posEnd = currentUrl.indexOf("&", posStart);
158		var value = "";
159		if (posEnd == -1)
160		{
161			value = currentUrl.substring(posStart+previewId.length, currentUrl.length);
162		}
163		else
164		{
165			value = currentUrl.substring(posStart+previewId.length, posEnd);
166		}
167		newUrl += "&" + previewId + value;
168	}
169
170	// We now always add the node that the link is on as part of the URl also.
171	if( typeof g_ssSourceNodeId != _U && g_ssSourceNodeId != null )
172		newUrl += "&ssSourceNodeId=" + g_ssSourceNodeId;
173
174	if( typeof g_ssSourceSiteId != _U && g_ssSourceSiteId != null )
175		newUrl += "&ssSourceSiteId=" + g_ssSourceSiteId;
176
177	// We no longer support passing ssUrlPrefix on the URL - now we pass a value
178	// to indicate the type of address being used and then let the server compute it.
179	var urlType = 0; // undefined
180	if( typeof ssUrlType != _U && ssUrlType != null )
181	{
182		urlType = ssUrlType;
183	}
184	else if( typeof ssUrlPrefix != _U && ssUrlPrefix != null )
185	{
186		if( ssUrlPrefix == "/" )
187			urlType = 1;
188		else
189			urlType = 2;
190	}
191	newUrl += "&ssUrlType=" + urlType;
192
193	if( typeof ssDomainNum != _U && ssDomainNum != null )
194	{
195		newUrl += "&ssDomainNum=" + ssDomainNum;
196	}
197
198	// Navigate to the new url
199	window.location = newUrl;
200}
201
202/////////////////////////////////////////////////////////////////////////////
203// Function : sitelink
204// Comments :
205/////////////////////////////////////////////////////////////////////////////
206function sitelink(siteId)
207{
208	var newUrl = "";
209	newUrl += g_httpCgiUrl;
210	newUrl += "siteId=" + siteId;
211
212	var currentUrl = "" + window.location;
213
214	// Continue propagation of the "SSContributor" parameter
215	if( SSContributor )
216	{
217		var paramName = "SSContributor=";
218		var pos = currentUrl.indexOf( paramName );
219		if( pos != -1 )
220		{
221			var subStr = currentUrl.substring( pos+paramName.length, pos+paramName.length+1 );
222			if( isTrue( subStr ) )
223			{
224				newUrl += "&" + paramName + "true";
225			}
226		}
227	}
228
229	// Continue propagation of the "previewId" parameter
230	var previewId = "previewId=";
231	var posStart = currentUrl.indexOf( previewId );
232	if( posStart != -1 )
233	{
234		var posEnd = currentUrl.indexOf("&", posStart);
235		var value = "";
236		if (posEnd == -1)
237		{
238			value = currentUrl.substring(posStart+previewId.length, currentUrl.length);
239		}
240		else
241		{
242			value = currentUrl.substring(posStart+previewId.length, posEnd);
243		}
244		newUrl += "&" + previewId + value;
245	}
246
247	// We now always add the node that the link is on as part of the URl also.
248	if( typeof g_ssSourceNodeId != _U && g_ssSourceNodeId != null )
249		newUrl += "&ssSourceNodeId=" + g_ssSourceNodeId;
250
251	if( typeof g_ssSourceSiteId != _U && g_ssSourceSiteId != null )
252		newUrl += "&ssSourceSiteId=" + g_ssSourceSiteId;
253
254	// We no longer support passing ssUrlPrefix on the URL - now we pass a value
255	// to indicate the type of address being used and then let the server compute it.
256	var urlType = 0; // undefined
257	if( typeof ssUrlType != _U && ssUrlType != null )
258	{
259		urlType = ssUrlType;
260	}
261	else if( typeof ssUrlPrefix != _U && ssUrlPrefix != null )
262	{
263		if( ssUrlPrefix == "/" )
264			urlType = 1;
265		else
266			urlType = 2;
267	}
268	newUrl += "&ssUrlType=" + urlType;
269
270	if( typeof ssDomainNum != _U && ssDomainNum != null )
271	{
272		newUrl += "&ssDomainNum=" + ssDomainNum;
273	}
274
275	// Navigate to the new url
276	window.location = newUrl;
277}
278
279/////////////////////////////////////////////////////////////////////////////
280
281function BrowserDetectionObject()
282{
283	this.agt = navigator.userAgent.toLowerCase();
284	this.appVersion = navigator.appVersion;
285	this.majorVersion = parseInt(navigator.appVersion);
286	this.minorVersion = parseFloat(navigator.appVersion) - this.majorVersion;
287
288	this.is_ie = (this.agt.indexOf("msie") != -1);
289	this.is_ns = ((this.agt.indexOf("mozilla")!=-1) &&
290	              (this.agt.indexOf("spoofer")==-1) &&
291	              (this.agt.indexOf("compatible") == -1) &&
292	              (this.agt.indexOf("opera")==-1) &&
293	              (this.agt.indexOf("webtv")==-1) &&
294                      (this.agt.indexOf("firefox")==-1));
295	this.is_ff = (this.agt.indexOf("firefox")!=-1);
296
297	if (this.is_ie)
298	{
299		this.majorVersion = parseInt(this.agt.substring(this.agt.indexOf("msie ")+5));
300		this.minorVersion = parseInt(this.agt.substring(this.agt.indexOf("msie ")+7));
301	}
302	else if (this.is_ns && (this.agt.indexOf("netscape6/") != -1))
303	{
304		this.majorVersion = parseInt(this.agt.substring(this.agt.indexOf("netscape6/")+10));
305		this.minorVersion = parseInt(this.agt.substring(this.agt.indexOf("netscape6/")+12));
306	}
307	else if (this.is_ns && (this.agt.indexOf("netscape/7") != -1))
308	{
309		this.majorVersion = parseInt(this.agt.substring(this.agt.indexOf("netscape/7")+9));
310		this.minorVersion = parseInt(this.agt.substring(this.agt.indexOf("netscape/7")+11));
311	}
312	else if (this.is_ff)
313	{
314		this.majorVersion = parseInt(this.agt.substring(this.agt.indexOf("firefox/")+8));
315                this.minorVersion = parseInt(this.agt.substring(this.agt.indexOf("firefox/")+10));
316	}
317
318	this.is_ns3   = (this.is_ns && (this.majorVersion == 3));
319	this.is_ns4   = (this.is_ns && (this.majorVersion == 4));
320	this.is_ns6   = (this.is_ns && (this.majorVersion == 6));
321	this.is_ns7   = (this.is_ns && (this.majorVersion == 7));
322	this.is_ns4up = (this.is_ns && (this.majorVersion >= 4));
323	this.is_ns6up = (this.is_ns && (this.majorVersion >= 6));
324	this.is_ns7up = (this.is_ns && (this.majorVersion >= 7));
325	this.is_ie3   = (this.is_ie && (this.majorVersion == 3));
326	this.is_ie4   = (this.is_ie && (this.majorVersion == 4));
327	this.is_ie5   = (this.is_ie && (this.majorVersion == 5));
328	this.is_ie6   = (this.is_ie && (this.majorVersion == 6));
329	this.is_ie4up = (this.is_ie && (this.majorVersion >= 4));
330	this.is_ie5up = (this.is_ie && (this.majorVersion >= 5));
331	this.is_ie6up = (this.is_ie && (this.majorVersion >= 6));
332        this.is_ff1   = (this.is_ff && (this.majorVersion == 1));
333        this.is_ff1up = (this.is_ff && (this.majorVersion >= 1));
334}
335var g_objBrowserDetection = new BrowserDetectionObject();
336
337function ShowCurrentBrowserInfo()
338{
339   document.write("agt = " + g_objBrowserDetection.agt + "<br>");
340   document.write("appVersion = " + g_objBrowserDetection.appVersion + "<br>");
341   document.write("majorVersion = " + g_objBrowserDetection.majorVersion + "<br>");
342   document.write("minorVersion = " + g_objBrowserDetection.minorVersion + "<br>");
343
344   document.write("is_ie = " + g_objBrowserDetection.is_ie + "<br>");
345   document.write("is_ns = " + g_objBrowserDetection.is_ns + "<br>");
346   document.write("is_ff = " + g_objBrowserDetection.is_ff + "<br>");
347
348   document.write("is_ns3 = " + g_objBrowserDetection.is_ns3 + "<br>");
349   document.write("is_ns4 = " + g_objBrowserDetection.is_ns4 + "<br>");
350   document.write("is_ns6 = " + g_objBrowserDetection.is_ns6 + "<br>");
351   document.write("is_ns7 = " + g_objBrowserDetection.is_ns7 + "<br>");
352   document.write("is_ns4up = " + g_objBrowserDetection.is_ns4up + "<br>");
353   document.write("is_ns6up = " + g_objBrowserDetection.is_ns6up + "<br>");
354   document.write("is_ns7up = " + g_objBrowserDetection.is_ns7up + "<br>");
355
356   document.write("is_ie3 = " + g_objBrowserDetection.is_ie3 + "<br>");
357   document.write("is_ie4 = " + g_objBrowserDetection.is_ie4 + "<br>");
358   document.write("is_ie5 = " + g_objBrowserDetection.is_ie5 + "<br>");
359   document.write("is_ie6 = " + g_objBrowserDetection.is_ie6 + "<br>");
360   document.write("is_ie4up = " + g_objBrowserDetection.is_ie4up + "<br>");
361   document.write("is_ie5up = " + g_objBrowserDetection.is_ie5up + "<br>");
362   document.write("is_ie6up = " + g_objBrowserDetection.is_ie6up + "<br>");
363
364   document.write("is_ff1 = " + g_objBrowserDetection.is_ff1 + "<br>");
365   document.write("is_ff1up = " + g_objBrowserDetection.is_ff1up + "<br>");
366}
367
368/////////////////////////////////////////////////////////////////////////////
369

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.