PageSourceSearch

http://staffordbp.com/~navs/QuickSiteMain.js

js staffordbp.com collected 2026-10-08 21:36:24 UTC 17,914 bytes, 464 lines download raw bytes

1var nav_QuickSiteMain = new Object();
2
3nav_QuickSiteMain.accentColor="Black";
4nav_QuickSiteMain.accentStyle="Square";
5nav_QuickSiteMain.accentType="none";
6nav_QuickSiteMain.background="";
7nav_QuickSiteMain.basicButton="Gray";
8nav_QuickSiteMain.basicTab="White";
9nav_QuickSiteMain.bold="false";
10nav_QuickSiteMain.border="";
11nav_QuickSiteMain.brightButton="Chicky";
12nav_QuickSiteMain.buttonCategory="basic";
13nav_QuickSiteMain.darkButton="Basic_Black";
14nav_QuickSiteMain.dirty="false";
15nav_QuickSiteMain.funButton="Arts_and_Crafts";
16nav_QuickSiteMain.graphicMouseover="false";
17nav_QuickSiteMain.graphicSelected="false";
18nav_QuickSiteMain.hasLinks="true";
19nav_QuickSiteMain.height="23";
20nav_QuickSiteMain.holidayButton="Christmas_Ornaments";
21nav_QuickSiteMain.horizontalSpacing="40";
22nav_QuickSiteMain.horizontalWrap="6";
23nav_QuickSiteMain.imageHeight="31";
24nav_QuickSiteMain.imageWidth="114";
25nav_QuickSiteMain.importedImage="";
26nav_QuickSiteMain.importedImageMouseOver="";
27nav_QuickSiteMain.importedImageSelected="";
28nav_QuickSiteMain.italic="false";
29nav_QuickSiteMain.justification="left";
30nav_QuickSiteMain.lineColor="#000000";
31nav_QuickSiteMain.lineWidth="2";
32nav_QuickSiteMain.localPreview="false";
33nav_QuickSiteMain.modernButton="Basic_Black";
34nav_QuickSiteMain.mouseoverBgcolor="";
35nav_QuickSiteMain.mouseoverBold="false";
36nav_QuickSiteMain.mouseoverEffect="true";
37nav_QuickSiteMain.mouseoverItalic="false";
38nav_QuickSiteMain.mouseoverTextcolor="#0196ff";
39nav_QuickSiteMain.mouseoverUnderline="false";
40nav_QuickSiteMain.navID="nav_QuickSiteMain";
41nav_QuickSiteMain.numLinks="5";
42nav_QuickSiteMain.orientation="horizontal";
43nav_QuickSiteMain.selectedBgcolor="";
44nav_QuickSiteMain.selectedBold="false";
45nav_QuickSiteMain.selectedEffect="true";
46nav_QuickSiteMain.selectedItalic="false";
47nav_QuickSiteMain.selectedTextcolor="#0196ff";
48nav_QuickSiteMain.selectedUnderline="false";
49nav_QuickSiteMain.shinyButton="Shiny_Aqua";
50nav_QuickSiteMain.simpleButton="Autumn_Leaves";
51nav_QuickSiteMain.sophisticatedButton="Antique";
52nav_QuickSiteMain.squareTab="Camel";
53nav_QuickSiteMain.style="text";
54nav_QuickSiteMain.tabCategory="basic";
55nav_QuickSiteMain.textColor="#464646";
56nav_QuickSiteMain.textFont="Helvetica";
57nav_QuickSiteMain.textSize="16";
58nav_QuickSiteMain.texturedButton="Brick";
59nav_QuickSiteMain.type="Navigation";
60nav_QuickSiteMain.underline="false";
61nav_QuickSiteMain.version="5";
62nav_QuickSiteMain.verticalSpacing="10";
63nav_QuickSiteMain.width="596";
64
65nav_QuickSiteMain.navName = "QuickSiteMain";
66nav_QuickSiteMain.imagePath = "null";
67nav_QuickSiteMain.selectedImagePath = "/~media/elements/LayoutClipart/";
68nav_QuickSiteMain.mouseOverImagePath = "/~media/elements/LayoutClipart/";
69nav_QuickSiteMain.imageWidth = "16";
70nav_QuickSiteMain.imageHeight = "16";
71nav_QuickSiteMain.fontClass = "size16 Helvetica16";
72nav_QuickSiteMain.fontFace = "Helvetica, Arial, sans-serif";
73
74
75var baseHref = '';
76// this will only work if getElementsByTagName works
77if (document.getElementsByTagName)
78{
79    // this will only work if we can find a base tag
80    var base = document.getElementsByTagName('base');
81    // Verify that the base object exists
82    if (base && base.length > 0)
83    {
84        // if you don't specify a base href, href comes back as undefined
85        if (base[0].href != undefined)
86        {
87            // get the base href
88            baseHref = base[0].href;
89            // add a trailing slash if base href doesn't already have one
90            if (baseHref != '' && baseHref.charAt(baseHref.length - 1) != '/')
91            {
92                baseHref += '/';
93            }
94        }
95    }
96}
97
98
99nav_QuickSiteMain.links=new Array(5);
100var nav_QuickSiteMain_Link1 = new Object();
101nav_QuickSiteMain_Link1.type = "existing";
102nav_QuickSiteMain_Link1.displayName = "Home";
103nav_QuickSiteMain_Link1.linkWindow = "_self";
104nav_QuickSiteMain_Link1.linkValue = "index.html";
105nav_QuickSiteMain_Link1.linkIndex = "1";
106nav_QuickSiteMain.links[0] = nav_QuickSiteMain_Link1;
107var nav_QuickSiteMain_Link2 = new Object();
108nav_QuickSiteMain_Link2.type = "existing";
109nav_QuickSiteMain_Link2.displayName = "Products";
110nav_QuickSiteMain_Link2.linkWindow = "_self";
111nav_QuickSiteMain_Link2.linkValue = "productslist.html";
112nav_QuickSiteMain_Link2.linkIndex = "2";
113nav_QuickSiteMain.links[1] = nav_QuickSiteMain_Link2;
114var nav_QuickSiteMain_Link3 = new Object();
115nav_QuickSiteMain_Link3.type = "existing";
116nav_QuickSiteMain_Link3.displayName = "Services";
117nav_QuickSiteMain_Link3.linkWindow = "_self";
118nav_QuickSiteMain_Link3.linkValue = "services.html";
119nav_QuickSiteMain_Link3.linkIndex = "3";
120nav_QuickSiteMain.links[2] = nav_QuickSiteMain_Link3;
121var nav_QuickSiteMain_Link4 = new Object();
122nav_QuickSiteMain_Link4.type = "existing";
123nav_QuickSiteMain_Link4.displayName = "Manufacturers";
124nav_QuickSiteMain_Link4.linkWindow = "_self";
125nav_QuickSiteMain_Link4.linkValue = "gallery.html";
126nav_QuickSiteMain_Link4.linkIndex = "4";
127nav_QuickSiteMain.links[3] = nav_QuickSiteMain_Link4;
128var nav_QuickSiteMain_Link5 = new Object();
129nav_QuickSiteMain_Link5.type = "existing";
130nav_QuickSiteMain_Link5.displayName = "Contact Us";
131nav_QuickSiteMain_Link5.linkWindow = "_self";
132nav_QuickSiteMain_Link5.linkValue = "contact.html";
133nav_QuickSiteMain_Link5.linkIndex = "5";
134nav_QuickSiteMain.links[4] = nav_QuickSiteMain_Link5;
135function backgroundMouseOn(tdElement, newColor)
136{
137	if(tdElement != null) {
138		tdElement.oldBGColor = tdElement.style.backgroundColor;
139		tdElement.style.backgroundColor = newColor;
140	}
141}
142function backgroundMouseOff(tdElement)
143{
144	if(tdElement != null) {
145		tdElement.style.backgroundColor = tdElement.oldBGColor;
146	}
147} 
148
149function doMouseChange(Navigation,tdElement,linkIndex,bisMouseOver) {
150	if (Navigation.mouseoverEffect != 'true') {
151		return;
152	}	
153	var link = Navigation.links[linkIndex-1];
154	var bIsCurrentPage = isCurrentPage(link);
155	var bShowMouseoverBg = !(bIsCurrentPage
156			&& 'true' == Navigation.selectedEffect && Navigation.selectedBgcolor);
157	var fontElement = getLinkFontElement(tdElement);
158	if(fontElement != null) {
159		doFontChange(Navigation,fontElement,bIsCurrentPage,bisMouseOver);
160	}
161	
162	if (Navigation.mouseoverBgcolor && bShowMouseoverBg) {
163		if(bisMouseOver) {
164			backgroundMouseOn(tdElement,Navigation.mouseoverBgcolor);
165		} else {
166			backgroundMouseOff(tdElement);
167		}
168	}
169}
170function addStyle(Navigation, Link, tdElement,vNavTrElement) {
171	if (tdElement == null) {
172		return;
173	}
174	var strFontColor = Navigation.textColor;
175	if ('true' == Navigation.selectedEffect) {
176		if (Navigation.selectedTextcolor) {
177			strFontColor = Navigation.selectedTextcolor;
178		}
179		if (Navigation.selectedBgcolor) {
180			if (Navigation.orientation == 'horizontal') {
181				tdElement.style.backgroundColor = Navigation.selectedBgcolor;
182			} else {
183				if (vNavTrElement != null) {
184					vNavTrElement.style.backgroundColor = Navigation.selectedBgcolor;
185				}
186			}
187		}
188	}
189	var fontElement = getLinkFontElement(tdElement);
190	if (fontElement != null) {
191		fontElement.style.color = strFontColor;
192	}
193	tdElement.style.color = strFontColor;
194	if ('true' == Navigation.selectedEffect) {
195		if ('true' == Navigation.selectedBold) {
196			tdElement.style.fontWeight = "bold";
197		}
198		if ('true' == Navigation.selectedItalic) {
199			tdElement.style.fontStyle = "italic";
200		}
201		if ('true' == Navigation.selectedUnderline) {
202			tdElement.style.textDecoration = "underline";
203		}
204	}
205}
206
207// Combined escape html and javascript
208function escapeHtmlInlineScript(s, escapeSingleQuotes, escapeDoubleQuotes){
209	return htmlEncode(escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes));
210}
211
212function htmlEncode(s){
213	if (typeof(s) != "string") return "";
214	
215	var result = "";
216	for (var i = 0; i < s.length; i++) {
217		var ch = s.charAt(i);
218		switch (ch) {
219		case '<':
220			result += "&lt;";
221			break;
222		case '>':
223			result += "&gt;";
224			break;
225		case '&':
226			result += "&amp;";
227			break;
228		case '"':
229			result += "&quot;";
230			break;
231		case "'":
232			result += "&#39;";
233			break;
234		default:
235			result += ch;
236		}
237	}
238	return result;
239}
240
241/* escapes slashes and quotes. the default is to escape quotes,
242 * but this can be turned off.
243 * this function is used for javascript and also for escaping urls
244 * within background-image css.	 
245 */
246function escapeScript(s, escapeSingleQuotes, escapeDoubleQuotes){
247	if (typeof(s) != "string") return "";
248	
249	var result = "";
250	for (var i = 0; i < s.length; i++) {
251		var ch = s.charAt(i);
252		switch (ch) {
253		case '\'':
254			if (escapeSingleQuotes == null || escapeSingleQuotes)
255				result += "\\\'";
256			break;
257		case '\"':
258			if (escapeDoubleQuotes == null || escapeDoubleQuotes)
259				result += "\\\"";
260			break;
261		case '\\':
262			result += "\\\\";
263			break;
264		default:
265			result += ch;
266		}
267	}
268	return result;
269}
270
271//
272// This .js file includes utility functions used by both graphical and text navs
273// in their rendering.  User pages including a nav element will import this file, along
274// with TextNavigation.js and GraphicNavigation.js.  The functions within will
275// be called by the [navname].js file generated at publish time.
276
277function fixLinkValue(Link)
278{
279	if(Link.type!='existing')
280	{
281		return Link.linkValue;
282	}
283	else
284	{
285		return baseHref + strRelativePathToRoot + Link.linkValue;
286	}
287}
288
289function isCurrentPage(Link)
290{
291	if(Link.type!='existing')
292	{
293		return false;
294	}
295	var strLinkValue = Link.linkValue.toLowerCase();
296	return (strRelativePagePath == strLinkValue);
297}
298
299function toggleOnMouseChange(fontElement,newColor, bold, underline, italic)
300{
301	if(fontElement == null) {
302		return;
303	}
304	if(newColor)
305	{
306		fontElement.style.color=newColor;
307	}
308	fontElement.style.fontWeight = (bold=='true' ? 'bold' : 'normal');
309	fontElement.style.textDecoration = (underline=='true' ? 'underline' : 'none');
310	fontElement.style.fontStyle = (italic=='true' ? 'italic' : 'normal');
311
312}
313
314function doFontChange(Navigation,fontElement,bIsCurrentPage,bisMouseOver) {
315	if(fontElement == null) {
316		return;
317	}
318	var textColor;
319	var baseTextColor = Navigation.textColor;
320	var bold;
321	var baseBold = Navigation.bold;
322	var underline;
323	var baseUnderline = Navigation.underline;
324	var italic;
325	var baseItalic = Navigation.italic;
326	if (bIsCurrentPage && 'true' == Navigation.selectedEffect) {
327		textColor = Navigation.selectedTextcolor ? Navigation.selectedTextcolor
328				: (Navigation.mouseoverTextColor ? Navigation.mouseoverTextcolor
329						: Navigation.textColor);
330		baseTextColor = Navigation.selectedTextcolor ? Navigation.selectedTextcolor
331				: Navigation.textColor;
332		baseBold = bold = Navigation.selectedBold;
333		baseUnderline = underline = Navigation.selectedUnderline;
334		baseItalic = italic = Navigation.selectedItalic;
335	} else {
336		textColor = Navigation.mouseoverTextcolor ? Navigation.mouseoverTextcolor
337				: Navigation.textColor;
338		bold = Navigation.mouseoverBold;
339		underline = Navigation.mouseoverUnderline;
340		italic = Navigation.mouseoverItalic;
341	}
342	
343	if(bisMouseOver) {
344		toggleOnMouseChange(fontElement,textColor,bold,underline,italic);
345	} else {
346		toggleOnMouseChange(fontElement,baseTextColor,baseBold,baseUnderline,baseItalic);
347	}
348	
349
350}
351
352function addMouseAndStyleSupportQuickSiteMain(Navigation,navTbId) {
353	var startNode;
354
355	if(typeof(nav_element_id) != 'undefined' && document.getElementById(nav_element_id) != null) {
356		startNode = document.getElementById(nav_element_id);
357			
358	} else if(navTbId != null) {
359		startNode = document.getElementById(navTbId);
360			
361	}
362	
363	if(startNode != null) {
364	  searchForCurrentPageTd(Navigation,startNode);
365	}
366	
367
368}
369
370function searchForCurrentPageTd(Navigation,startNode) {
371	
372	if(startNode.childNodes != null) {
373		for(var i=0;i<startNode.childNodes.length;i++){
374			if(addStyleForCurrentPageTd(Navigation,startNode.childNodes[i])){
375			   return;	
376			} else {
377			   searchForCurrentPageTd(Navigation,startNode.childNodes[i]);
378			}
379		}
380	}
381
382}
383
384function addStyleForCurrentPageTd(Navigation,currentNode) {
385	if(Navigation.orientation == 'horizontal') {
386		if(currentNode.tagName == 'TD' && currentNode.id != '' && currentNode.id.indexOf(Navigation.navName+navTDLinkPart) != -1){
387			var currentTDIdPrefix = Navigation.navName+navTDLinkPart;
388			var linkId = currentNode.id.substring(currentTDIdPrefix.length,currentNode.id.length);
389			if(isCurrentPage(Navigation.links[linkId-1]) == true) {
390				addStyle(Navigation, Navigation.links[linkId-1],currentNode);
391				return true;
392			}
393		}
394	} else {
395		if(currentNode.tagName == 'TR' && currentNode.id != '' && currentNode.id.indexOf(navTRLinkPrefix) != -1){	
396			var currentTRIdPrefix = navTRLinkPrefix+Navigation.navName;
397			var linkId = currentNode.id.substring(currentTRIdPrefix.length,currentNode.id.length);
398			if(isCurrentPage(Navigation.links[linkId-1]) == true && currentNode.childNodes != null) {
399				var currentPageTd;
400				for(var i=0;currentNode.childNodes.length;i++) {
401					if(typeof(currentNode.childNodes[i].tagName) != 'undefined' && currentNode.childNodes[i].tagName == 'TD' && currentNode.childNodes[i].id.indexOf(Navigation.navName+navTDLinkPart) != -1) {
402						currentPageTd = currentNode.childNodes[i];
403						addStyle(Navigation, Navigation.links[linkId - 1],currentPageTd,currentNode);
404						return true;
405					}
406				}
407			}
408		}
409	}
410	return false;
411}
412
413function getChildElementFromTree(startNode,nodesToTraverse) {
414	var currentChildNode = startNode;
415	
416	for(var n= 0;n<nodesToTraverse.length;n++) {
417		currentChildNode = getMatchingChildByTag(currentChildNode.childNodes,nodesToTraverse[n]);
418	}
419	
420	return currentChildNode;
421}
422
423
424function getMatchingChildByTag(childNodes,tagName) {
425	var child;
426	for(var i=0;childNodes.length;i++) {
427		if(childNodes[i].tagName == tagName) {
428			child = childNodes[i];
429			break;
430		}
431	}
432	return child;
433}
434function getLinkFontElement(tdElement){
435	var fontElement;
436	var aElement = getChildElementFromTree(tdElement,['A']);
437	for(var i=0;i < aElement.childNodes.length;i++) {
438		if(aElement.childNodes[i].tagName == 'DIV') {
439		 	fontElement = getChildElementFromTree(aElement.childNodes[i],['FONT']);
440		 	break;
441		} else if(aElement.childNodes[i].tagName == 'FONT'){
442		 	fontElement = 	aElement.childNodes[i];
443		 	break;
444		}
445	
446	}
447	return fontElement;
448}
449
450
451
452	if(typeof(navTRLinkPrefix) == 'undefined') {
453		navTRLinkPrefix = 'vNavTR_Link_';
454	}
455	if(typeof(navTDLinkPart) == 'undefined') {
456		navTDLinkPart = '_Link';
457	}
458	if(document.getElementById('nav_version') == null) {
459	if (typeof(navTBSuffix) == 'undefined') {
460	navTBSuffix = 0;
461	} else {navTBSuffix++;}
462		document.write('<TABLE ID="ntb'+navTBSuffix+'"  CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\" ><TR ALIGN=\"CENTER\" VALIGN=\"MIDDLE\"><TD><TABLE CELLSPACING=\"0\" CELLPADDING=\"0\" BORDER=\"0\"><TR><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"QuickSiteMain_Link1\" style=\"cursor: pointer;cursor: hand;color:#464646;font-size: 1px; line-height: 1px;\" onmouseover=\"doMouseChange(nav_QuickSiteMain,this,\'1\',true);\" onmouseout=\"doMouseChange(nav_QuickSiteMain,this,\'1\',false);\"><A HREF=\"\/index.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"Home\"><FONT ID=\"QuickSiteMain_f1\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size16 Helvetica16\" STYLE=\"color:#464646\">Home<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"QuickSiteMain_Link2\" style=\"cursor: pointer;cursor: hand;color:#464646;font-size: 1px; line-height: 1px;\" onmouseover=\"doMouseChange(nav_QuickSiteMain,this,\'2\',true);\" onmouseout=\"doMouseChange(nav_QuickSiteMain,this,\'2\',false);\"><A HREF=\"\/productslist.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"Products\"><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"QuickSiteMain_f2\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size16 Helvetica16\" STYLE=\"color:#464646\">Products<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"QuickSiteMain_Link3\" style=\"cursor: pointer;cursor: hand;color:#464646;font-size: 1px; line-height: 1px;\" onmouseover=\"doMouseChange(nav_QuickSiteMain,this,\'3\',true);\" onmouseout=\"doMouseChange(nav_QuickSiteMain,this,\'3\',false);\"><A HREF=\"\/services.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"Services\"><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"QuickSiteMain_f3\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size16 Helvetica16\" STYLE=\"color:#464646\">Services<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"QuickSiteMain_Link4\" style=\"cursor: pointer;cursor: hand;color:#464646;font-size: 1px; line-height: 1px;\" onmouseover=\"doMouseChange(nav_QuickSiteMain,this,\'4\',true);\" onmouseout=\"doMouseChange(nav_QuickSiteMain,this,\'4\',false);\"><A HREF=\"\/gallery.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"Manufacturers\"><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"QuickSiteMain_f4\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size16 Helvetica16\" STYLE=\"color:#464646\">Manufacturers<\/FONT><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><\/A><\/TD><TD ALIGN=\"center\" VALIGN=\"MIDDLE\" NOWRAP=\"NOWRAP\" id=\"QuickSiteMain_Link5\" style=\"cursor: pointer;cursor: hand;color:#464646;font-size: 1px; line-height: 1px;\" onmouseover=\"doMouseChange(nav_QuickSiteMain,this,\'5\',true);\" onmouseout=\"doMouseChange(nav_QuickSiteMain,this,\'5\',false);\"><A HREF=\"\/contact.html\" TARGET=\"_self\" STYLE=\"text-decoration:none;\" NAME=\"Contact Us\"><IMG SRC=\"\/tp.gif\" WIDTH=\"20.0\" HEIGHT=\"1\" BORDER=\"0\"><FONT ID=\"QuickSiteMain_f5\" FACE=\"Helvetica, Arial, sans-serif\" CLASS=\"size16 Helvetica16\" STYLE=\"color:#464646\">Contact&nbsp;Us<\/FONT><\/A><\/TD><\/TR><\/TABLE><\/TD><\/TR><\/TABLE><script type="text/javascript">addMouseAndStyleSupportQuickSiteMain(nav_QuickSiteMain,"ntb'+navTBSuffix+'");'+'</scri'+'pt>');
463	}
464

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.