PageSourceSearch

https://lawrencephelps.com/web/overlib.js

js lawrencephelps.com collected 2026-10-02 13:01:48 UTC 35,011 bytes, 1,325 lines download raw bytes

1//\//////////////////////////////////////////////////////////////////////////////////
2//\  overLIB 3.33  --  This notice must remain untouched at all times.
3//\  Copyright Erik Bosrup 1998-2001. All rights reserved.
4//\
5//\  By Erik Bosrup ([email protected]).  Last modified 2001-01-26.
6//\  Portions by Dan Steinman (dansteinman.com). Additions by other people are
7//\  listed on the overLIB homepage.
8//\
9//\  Get the latest version at http://www.bosrup.com/web/overlib/
10//\
11//\  This script is published under an open source license. Please read the license
12//\  agreement online at: http://www.bosrup.com/web/overlib/license.html
13//\  If you have questions regarding the license please contact [email protected].
14//\
15//\  This script library was originally created for personal use. By request it has
16//\  later been made public. This is free software. Do not sell this as your own
17//\  work, or remove this copyright notice. For full details on copying or changing
18//\  this script please read the license agreement at the link above.
19//\
20//\  Please give credit on sites that use overLIB and submit changes of the script
21//\  so other people can use them as well. This script is free to use, don't abuse.
22//\//////////////////////////////////////////////////////////////////////////////////
23//\mini
24
25
26////////////////////////////////////////////////////////////////////////////////////
27// CONSTANTS
28// Don't touch these. :)
29////////////////////////////////////////////////////////////////////////////////////
30var INARRAY		=	1;
31var CAPARRAY		=	2;
32var STICKY		=	3;
33var BACKGROUND		=	4;
34var NOCLOSE		=	5;
35var CAPTION		=	6;
36var LEFT		=	7;
37var RIGHT		=	8;
38var CENTER		=	9;
39var OFFSETX		=	10;
40var OFFSETY		=	11;
41var FGCOLOR		=	12;
42var BGCOLOR		=	13;
43var TEXTCOLOR		=	14;
44var CAPCOLOR		=	15;
45var CLOSECOLOR		=	16;
46var WIDTH		=	17;
47var BORDER		=	18;
48var STATUS		=	19;
49var AUTOSTATUS		=	20;
50var AUTOSTATUSCAP	=	21;
51var HEIGHT		=	22;
52var CLOSETEXT		=	23;
53var SNAPX		=	24;
54var SNAPY		=	25;
55var FIXX		=	26;
56var FIXY		=	27;
57var FGBACKGROUND	=	28;
58var BGBACKGROUND	=	29;
59var PADX		=	30;
60var PADY		=	31;
61var PADX2		=	32;
62var PADY2		=	33;
63var FULLHTML		=	34;
64var ABOVE		=	35;
65var BELOW		=	36;
66var CAPICON		=	37;
67var TEXTFONT		=	38;
68var CAPTIONFONT		=	39;
69var CLOSEFONT		=	40;
70var TEXTSIZE		=	41;
71var CAPTIONSIZE		=	42;
72var CLOSESIZE		=	43;
73var FRAME		=	44;
74var TIMEOUT		=	45;
75var FUNCTION		=	46;
76var DELAY		=	47;
77var HAUTO		=	48;
78var VAUTO		=	49;
79
80
81
82////////////////////////////////////////////////////////////////////////////////////
83// DEFAULT CONFIGURATION
84// You don't have to change anything here if you don't want to. All of this can be
85// changed on your html page or through an overLIB call.
86////////////////////////////////////////////////////////////////////////////////////
87
88// Main background color (the large area)
89// Usually a bright color (white, yellow etc)
90if (typeof ol_fgcolor == 'undefined') { var ol_fgcolor = "#ccccff";}
91	
92// Border color and color of caption
93// Usually a dark color (black, brown etc)
94if (typeof ol_bgcolor == 'undefined') { var ol_bgcolor = "#000000";}
95	
96// Text color
97// Usually a dark color
98if (typeof ol_textcolor == 'undefined') { var ol_textcolor = "#000000";}
99	
100// Color of the caption text
101// Usually a bright color
102if (typeof ol_capcolor == 'undefined') { var ol_capcolor = "#FFFFFF";}
103	
104// Color of "Close" when using Sticky
105// Usually a semi-bright color
106if (typeof ol_closecolor == 'undefined') { var ol_closecolor = "#9999FF";}
107
108// Font face for the main text
109if (typeof ol_textfont == 'undefined') { var ol_textfont = "Verdana,Arial,Helvetica";}
110
111// Font face for the caption
112if (typeof ol_captionfont == 'undefined') { var ol_captionfont = "Verdana,Arial,Helvetica";}
113
114// Font face for the close text
115if (typeof ol_closefont == 'undefined') { var ol_closefont = "Verdana,Arial,Helvetica";}
116
117// Font size for the main text
118if (typeof ol_textsize == 'undefined') { var ol_textsize = "1";}
119
120// Font size for the caption
121if (typeof ol_captionsize == 'undefined') { var ol_captionsize = "1";}
122
123// Font size for the close text
124if (typeof ol_closesize == 'undefined') { var ol_closesize = "1";}
125
126// Width of the popups in pixels
127// 100-300 pixels is typical
128if (typeof ol_width == 'undefined') { var ol_width = "200";}
129
130// How thick the ol_border should be in pixels
131// 1-3 pixels is typical
132if (typeof ol_border == 'undefined') { var ol_border = "1";}
133
134// How many pixels to the right/left of the cursor to show the popup
135// Values between 3 and 12 are best
136if (typeof ol_offsetx == 'undefined') { var ol_offsetx = 10;}
137	
138// How many pixels to the below the cursor to show the popup
139// Values between 3 and 12 are best
140if (typeof ol_offsety == 'undefined') { var ol_offsety = 10;}
141
142// Default text for popups
143// Should you forget to pass something to overLIB this will be displayed.
144if (typeof ol_text == 'undefined') { var ol_text = "Default Text"; }
145
146// Default caption
147// You should leave this blank or you will have problems making non caps popups.
148if (typeof ol_cap == 'undefined') { var ol_cap = ""; }
149
150// Decides if sticky popups are default.
151// 0 for non, 1 for stickies.
152if (typeof ol_sticky == 'undefined') { var ol_sticky = 0; }
153
154// Default background image. Better left empty unless you always want one.
155if (typeof ol_background == 'undefined') { var ol_background = ""; }
156
157// Text for the closing sticky popups.
158// Normal is "Close".
159if (typeof ol_close == 'undefined') { var ol_close = "Close"; }
160
161// Default vertical alignment for popups.
162// It's best to leave RIGHT here. Other options are LEFT and CENTER.
163if (typeof ol_hpos == 'undefined') { var ol_hpos = RIGHT; }
164
165// Default status bar text when a popup is invoked.
166if (typeof ol_status == 'undefined') { var ol_status = ""; }
167
168// If the status bar automatically should load either text or caption.
169// 0=nothing, 1=text, 2=caption
170if (typeof ol_autostatus == 'undefined') { var ol_autostatus = 0; }
171
172// Default height for popup. Often best left alone.
173if (typeof ol_height == 'undefined') { var ol_height = -1; }
174
175// Horizontal grid spacing that popups will snap to.
176// 0 makes no grid, anything else will cause a snap to that grid spacing.
177if (typeof ol_snapx == 'undefined') { var ol_snapx = 0; }
178
179// Vertical grid spacing that popups will snap to.
180// 0 makes no grid, andthing else will cause a snap to that grid spacing.
181if (typeof ol_snapy == 'undefined') { var ol_snapy = 0; }
182
183// Sets the popups horizontal position to a fixed column.
184// Anything above -1 will cause fixed position.
185if (typeof ol_fixx == 'undefined') { var ol_fixx = -1; }
186
187// Sets the popups vertical position to a fixed row.
188// Anything above -1 will cause fixed position.
189if (typeof ol_fixy == 'undefined') { var ol_fixy = -1; }
190
191// Background image for the popups inside.
192if (typeof ol_fgbackground == 'undefined') { var ol_fgbackground = ""; }
193
194// Background image for the popups frame.
195if (typeof ol_bgbackground == 'undefined') { var ol_bgbackground = ""; }
196
197// How much horizontal left padding text should get by default when BACKGROUND is used.
198if (typeof ol_padxl == 'undefined') { var ol_padxl = 1; }
199
200// How much horizontal right padding text should get by default when BACKGROUND is used.
201if (typeof ol_padxr == 'undefined') { var ol_padxr = 1; }
202
203// How much vertical top padding text should get by default when BACKGROUND is used.
204if (typeof ol_padyt == 'undefined') { var ol_padyt = 1; }
205
206// How much vertical bottom padding text should get by default when BACKGROUND is used.
207if (typeof ol_padyb == 'undefined') { var ol_padyb = 1; }
208
209// If the user by default must supply all html for complete popup control.
210// Set to 1 to activate, 0 otherwise.
211if (typeof ol_fullhtml == 'undefined') { var ol_fullhtml = 0; }
212
213// Default vertical position of the popup. Default should normally be BELOW.
214// ABOVE only works when HEIGHT is defined.
215if (typeof ol_vpos == 'undefined') { var ol_vpos = BELOW; }
216
217// Default height of popup to use when placing the popup above the cursor.
218if (typeof ol_aboveheight == 'undefined') { var ol_aboveheight = 0; }
219
220// Default icon to place next to the popups caption.
221if (typeof ol_caption == 'undefined') { var ol_capicon = ""; }
222
223// Default frame. We default to current frame if there is no frame defined.
224if (typeof ol_frame == 'undefined') { var ol_frame = self; }
225
226// Default timeout. By default there is no timeout.
227if (typeof ol_timeout == 'undefined') { var ol_timeout = 0; }
228
229// Default javascript funktion. By default there is none.
230if (typeof ol_function == 'undefined') { var ol_function = Function(); }
231
232// Default timeout. By default there is no timeout.
233if (typeof ol_delay == 'undefined') { var ol_delay = 0; }
234
235// If overLIB should decide the horizontal placement.
236if (typeof ol_hauto == 'undefined') { var ol_hauto = 0; }
237
238// If overLIB should decide the vertical placement.
239if (typeof ol_vauto == 'undefined') { var ol_vauto = 0; }
240
241
242
243////////////////////////////////////////////////////////////////////////////////////
244// ARRAY CONFIGURATION
245// You don't have to change anything here if you don't want to. The following
246// arrays can be filled with text and html if you don't wish to pass it from
247// your html page.
248////////////////////////////////////////////////////////////////////////////////////
249
250// Array with texts.
251var ol_texts = new Array("Array Text 0", "Array Text 1");
252
253// Array with captions.
254var ol_caps = new Array("Array Caption 0", "Array Caption 1");
255
256
257
258
259
260
261////////////////////////////////////////////////////////////////////////////////////
262// END CONFIGURATION
263////////////////////////////////////////////////////////////////////////////////////
264
265
266
267////////////////////////////////////////////////////////////////////////////////////
268// INIT
269////////////////////////////////////////////////////////////////////////////////////
270
271
272// Runtime variables init. Used for runtime only, don't change, not for config!
273var o3_text = "";
274var o3_cap = "";
275var o3_sticky = 0;
276var o3_background = "";
277var o3_close = "Close";
278var o3_hpos = RIGHT;
279var o3_offsetx = 2;
280var o3_offsety = 2;
281var o3_fgcolor = "";
282var o3_bgcolor = "";
283var o3_textcolor = "";
284var o3_capcolor = "";
285var o3_closecolor = "";
286var o3_width = 100;
287var o3_border = 1;
288var o3_status = "";
289var o3_autostatus = 0;
290var o3_height = -1;
291var o3_snapx = 0;
292var o3_snapy = 0;
293var o3_fixx = -1;
294var o3_fixy = -1;
295var o3_fgbackground = "";
296var o3_bgbackground = "";
297var o3_padxl = 0;
298var o3_padxr = 0;
299var o3_padyt = 0;
300var o3_padyb = 0;
301var o3_fullhtml = 0;
302var o3_vpos = BELOW;
303var o3_aboveheight = 0;
304var o3_capicon = "";
305var o3_textfont = "Verdana,Arial,Helvetica";
306var o3_captionfont = "Verdana,Arial,Helvetica";
307var o3_closefont = "Verdana,Arial,Helvetica";
308var o3_textsize = "1";
309var o3_captionsize = "1";
310var o3_closesize = "1";
311var o3_frame = self;
312var o3_timeout = 0;
313var o3_timerid = 0;
314var o3_allowmove = 0;
315var o3_function = Function();
316var o3_delay = 0;
317var o3_delayid = 0;
318var o3_hauto = 0;
319var o3_vauto = 0;
320
321
322// Display state variables
323var o3_x = 0;
324var o3_y = 0;
325var o3_allow = 0;
326var o3_showingsticky = 0;
327var o3_removecounter = 0;
328
329// Our layer
330var over = null;
331
332
333// Decide browser version
334var ns4 = (document.layers)? true:false;
335var ns6 = (document.getElementById)? true:false;
336var ie4 = (document.all)? true:false;
337var ie5 = false;
338
339// Microsoft Stupidity Check(tm).
340if (ie4) {
341	if (navigator.userAgent.indexOf('MSIE 5')>0) {
342		ie5 = true;
343	}
344	if (ns6) {
345		ns6 = false;
346	}
347}
348
349
350// Capture events, alt. diffuses the overlib function.
351if ( (ns4) || (ie4) || (ns6)) {
352	document.onmousemove = mouseMove
353	if (ns4) document.captureEvents(Event.MOUSEMOVE)
354} else {
355	overlib = no_overlib;
356	nd = no_overlib;
357	ver3fix = true;
358}
359
360
361// Fake function for 3.0 users.
362function no_overlib() {
363	return ver3fix;
364}
365
366
367
368////////////////////////////////////////////////////////////////////////////////////
369// PUBLIC FUNCTIONS
370////////////////////////////////////////////////////////////////////////////////////
371
372
373// overlib(arg0, ..., argN)
374// Loads parameters into global runtime variables.
375function overlib() {
376	
377	// Load defaults to runtime.
378	o3_text = ol_text;
379	o3_cap = ol_cap;
380	o3_sticky = ol_sticky;
381	o3_background = ol_background;
382	o3_close = ol_close;
383	o3_hpos = ol_hpos;
384	o3_offsetx = ol_offsetx;
385	o3_offsety = ol_offsety;
386	o3_fgcolor = ol_fgcolor;
387	o3_bgcolor = ol_bgcolor;
388	o3_textcolor = ol_textcolor;
389	o3_capcolor = ol_capcolor;
390	o3_closecolor = ol_closecolor;
391	o3_width = ol_width;
392	o3_border = ol_border;
393	o3_status = ol_status;
394	o3_autostatus = ol_autostatus;
395	o3_height = ol_height;
396	o3_snapx = ol_snapx;
397	o3_snapy = ol_snapy;
398	o3_fixx = ol_fixx;
399	o3_fixy = ol_fixy;
400	o3_fgbackground = ol_fgbackground;
401	o3_bgbackground = ol_bgbackground;
402	o3_padxl = ol_padxl;
403	o3_padxr = ol_padxr;
404	o3_padyt = ol_padyt;
405	o3_padyb = ol_padyb;
406	o3_fullhtml = ol_fullhtml;
407	o3_vpos = ol_vpos;
408	o3_aboveheight = ol_aboveheight;
409	o3_capicon = ol_capicon;
410	o3_textfont = ol_textfont;
411	o3_captionfont = ol_captionfont;
412	o3_closefont = ol_closefont;
413	o3_textsize = ol_textsize;
414	o3_captionsize = ol_captionsize;
415	o3_closesize = ol_closesize;
416	o3_timeout = ol_timeout;
417	o3_function = ol_function;
418	o3_delay = ol_delay;
419	o3_hauto = ol_hauto;
420	o3_vauto = ol_vauto;
421
422	// Special for frame support, over must be reset...
423	if ( (ns4) || (ie4) || (ns6) ) {
424		o3_frame = ol_frame;
425		if (ns4) over = o3_frame.document.overDiv
426		if (ie4) over = o3_frame.overDiv.style
427		if (ns6) over = o3_frame.document.getElementById("overDiv");
428	}
429	
430	
431	// What the next argument is expected to be.
432	var parsemode = -1;
433	
434	var ar = arguments;
435
436	for (i = 0; i < ar.length; i++) {
437		
438		if (parsemode == 0) {
439			// Arg is command
440			if (ar[i] == INARRAY) { parsemode = INARRAY; }
441			if (ar[i] == CAPARRAY) { parsemode = CAPARRAY; }
442			if (ar[i] == STICKY) { parsemode = opt_STICKY(ar[i]); }
443			if (ar[i] == BACKGROUND) { parsemode = BACKGROUND; }
444			if (ar[i] == NOCLOSE) { parsemode = opt_NOCLOSE(ar[i]); }
445			if (ar[i] == CAPTION) { parsemode = CAPTION; }
446			if (ar[i] == LEFT) { parsemode = opt_HPOS(ar[i]); }
447			if (ar[i] == RIGHT) { parsemode = opt_HPOS(ar[i]); }
448			if (ar[i] == CENTER) { parsemode = opt_HPOS(ar[i]); }
449			if (ar[i] == OFFSETX) { parsemode = OFFSETX; }
450			if (ar[i] == OFFSETY) { parsemode = OFFSETY; }
451			if (ar[i] == FGCOLOR) { parsemode = FGCOLOR; }
452			if (ar[i] == BGCOLOR) { parsemode = BGCOLOR; }
453			if (ar[i] == TEXTCOLOR) { parsemode = TEXTCOLOR; }
454			if (ar[i] == CAPCOLOR) { parsemode = CAPCOLOR; }
455			if (ar[i] == CLOSECOLOR) { parsemode = CLOSECOLOR; }
456			if (ar[i] == WIDTH) { parsemode = WIDTH; }
457			if (ar[i] == BORDER) { parsemode = BORDER; }
458			if (ar[i] == STATUS) { parsemode = STATUS; }
459			if (ar[i] == AUTOSTATUS) { parsemode = opt_AUTOSTATUS(ar[i]); }
460			if (ar[i] == AUTOSTATUSCAP) { parsemode = opt_AUTOSTATUSCAP(ar[i]); }
461			if (ar[i] == HEIGHT) { parsemode = HEIGHT; }
462			if (ar[i] == CLOSETEXT) { parsemode = CLOSETEXT; }
463			if (ar[i] == SNAPX) { parsemode = SNAPX; }
464			if (ar[i] == SNAPY) { parsemode = SNAPY; }
465			if (ar[i] == FIXX) { parsemode = FIXX; }
466			if (ar[i] == FIXY) { parsemode = FIXY; }
467			if (ar[i] == FGBACKGROUND) { parsemode = FGBACKGROUND; }
468			if (ar[i] == BGBACKGROUND) { parsemode = BGBACKGROUND; }
469			if (ar[i] == PADX) { parsemode = PADX; }
470			if (ar[i] == PADY) { parsemode = PADY; }
471			if (ar[i] == FULLHTML) { parsemode = opt_FULLHTML(ar[i]); }
472			if (ar[i] == ABOVE) { parsemode = opt_VPOS(ar[i]); }
473			if (ar[i] == BELOW) { parsemode = opt_VPOS(ar[i]); }
474			if (ar[i] == CAPICON) { parsemode = CAPICON; }
475			if (ar[i] == TEXTFONT) { parsemode = TEXTFONT; }
476			if (ar[i] == CAPTIONFONT) { parsemode = CAPTIONFONT; }
477			if (ar[i] == CLOSEFONT) { parsemode = CLOSEFONT; }
478			if (ar[i] == TEXTSIZE) { parsemode = TEXTSIZE; }
479			if (ar[i] == CAPTIONSIZE) { parsemode = CAPTIONSIZE; }
480			if (ar[i] == CLOSESIZE) { parsemode = CLOSESIZE; }
481			if (ar[i] == FRAME) { parsemode = FRAME; }
482			if (ar[i] == TIMEOUT) { parsemode = TIMEOUT; }
483			if (ar[i] == FUNCTION) { parsemode = FUNCTION; }
484			if (ar[i] == DELAY) { parsemode = DELAY; }
485			if (ar[i] == HAUTO) { parsemode = opt_HAUTO(ar[i]); }
486			if (ar[i] == VAUTO) { parsemode = opt_VAUTO(ar[i]); }
487
488
489		} else {
490			if (parsemode < 0) {
491				// Arg is maintext, unless INARRAY
492				if (ar[i] == INARRAY) {
493					parsemode = INARRAY;
494				} else {
495					o3_text = ar[i];
496					parsemode = 0;
497				}
498			} else {
499				// Arg is option for command
500				if (parsemode == INARRAY) { parsemode = opt_INARRAY(ar[i]); }
501				if (parsemode == CAPARRAY) { parsemode = opt_CAPARRAY(ar[i]); }
502				if (parsemode == BACKGROUND) { parsemode = opt_BACKGROUND(ar[i]); }
503				if (parsemode == CAPTION) { parsemode = opt_CAPTION(ar[i]); }
504				if (parsemode == OFFSETX) { parsemode = opt_OFFSETX(ar[i]); }
505				if (parsemode == OFFSETY) { parsemode = opt_OFFSETY(ar[i]); }
506				if (parsemode == FGCOLOR) { parsemode = opt_FGCOLOR(ar[i]); }
507				if (parsemode == BGCOLOR) { parsemode = opt_BGCOLOR(ar[i]); }
508				if (parsemode == TEXTCOLOR) { parsemode = opt_TEXTCOLOR(ar[i]); }
509				if (parsemode == CAPCOLOR) { parsemode = opt_CAPCOLOR(ar[i]); }
510				if (parsemode == CLOSECOLOR) { parsemode = opt_CLOSECOLOR(ar[i]); }
511				if (parsemode == WIDTH) { parsemode = opt_WIDTH(ar[i]); }
512				if (parsemode == BORDER) { parsemode = opt_BORDER(ar[i]); }
513				if (parsemode == STATUS) { parsemode = opt_STATUS(ar[i]); }
514				if (parsemode == HEIGHT) { parsemode = opt_HEIGHT(ar[i]); }
515				if (parsemode == CLOSETEXT) { parsemode = opt_CLOSETEXT(ar[i]); }
516				if (parsemode == SNAPX) { parsemode = opt_SNAPX(ar[i]); }
517				if (parsemode == SNAPY) { parsemode = opt_SNAPY(ar[i]); }
518				if (parsemode == FIXX) { parsemode = opt_FIXX(ar[i]); }
519				if (parsemode == FIXY) { parsemode = opt_FIXY(ar[i]); }
520				if (parsemode == FGBACKGROUND) { parsemode = opt_FGBACKGROUND(ar[i]); }
521				if (parsemode == BGBACKGROUND) { parsemode = opt_BGBACKGROUND(ar[i]); }
522				if (parsemode == PADX2) { parsemode = opt_PADX2(ar[i]); } // must be before PADX
523				if (parsemode == PADY2) { parsemode = opt_PADY2(ar[i]); } // must be before PADY
524				if (parsemode == PADX) { parsemode = opt_PADX(ar[i]); }
525				if (parsemode == PADY) { parsemode = opt_PADY(ar[i]); }
526				if (parsemode == CAPICON) { parsemode = opt_CAPICON(ar[i]); }
527				if (parsemode == TEXTFONT) { parsemode = opt_TEXTFONT(ar[i]); }
528				if (parsemode == CAPTIONFONT) { parsemode = opt_CAPTIONFONT(ar[i]); }
529				if (parsemode == CLOSEFONT) { parsemode = opt_CLOSEFONT(ar[i]); }
530				if (parsemode == TEXTSIZE) { parsemode = opt_TEXTSIZE(ar[i]); }
531				if (parsemode == CAPTIONSIZE) { parsemode = opt_CAPTIONSIZE(ar[i]); }
532				if (parsemode == CLOSESIZE) { parsemode = opt_CLOSESIZE(ar[i]); }
533				if (parsemode == FRAME) { parsemode = opt_FRAME(ar[i]); }
534				if (parsemode == TIMEOUT) { parsemode = opt_TIMEOUT(ar[i]); }
535                                if (parsemode == FUNCTION) { parsemode = opt_FUNCTION(ar[i]); }
536				if (parsemode == DELAY) { parsemode = opt_DELAY(ar[i]); }
537
538			}
539		}
540	}
541
542	if (o3_delay == 0) {
543		return overlib333();
544	} else {
545		o3_delayid = setTimeout("overlib333()", o3_delay);
546
547		if (o3_sticky) {
548			return false;
549		} else {
550			return true;
551		}
552	}
553}
554
555
556
557// Clears popups if appropriate
558function nd() {
559	if ( o3_removecounter >= 1 ) { o3_showingsticky = 0 };
560	if ( (ns4) || (ie4) || (ns6) ) {
561		if ( o3_showingsticky == 0 ) {
562			o3_allowmove = 0;
563			if (over != null) hideObject(over);
564		} else {
565			o3_removecounter++;
566		}
567	}
568	
569	return true;
570}
571
572
573
574
575
576
577
578////////////////////////////////////////////////////////////////////////////////////
579// OVERLIB 3.33 FUNCTION
580////////////////////////////////////////////////////////////////////////////////////
581
582
583// This function decides what it is we want to display and how we want it done.
584function overlib333() {
585
586	// Make layer content
587	var layerhtml;
588
589	if (o3_background != "" || o3_fullhtml) {
590		// Use background instead of box.
591		layerhtml = ol_content_background(o3_text, o3_background, o3_fullhtml);
592	} else {
593		// They want a popup box.
594
595		// Prepare popup background
596		if (o3_fgbackground != "") {
597			o3_fgbackground = "BACKGROUND=\""+o3_fgbackground+"\"";
598		}
599		if (o3_bgbackground != "") {
600			o3_bgbackground = "BACKGROUND=\""+o3_bgbackground+"\"";
601		}
602
603		// Prepare popup colors
604		if (o3_fgcolor != "") {
605			o3_fgcolor = "BGCOLOR=\""+o3_fgcolor+"\"";
606		}
607		if (o3_bgcolor != "") {
608			o3_bgcolor = "BGCOLOR=\""+o3_bgcolor+"\"";
609		}
610
611		// Prepare popup height
612		if (o3_height > 0) {
613			o3_height = "HEIGHT=" + o3_height;
614		} else {
615			o3_height = "";
616		}
617
618		// Decide which kinda box.
619		if (o3_cap == "") {
620			// Plain
621			layerhtml = ol_content_simple(o3_text);
622		} else {
623			// With caption
624			if (o3_sticky) {
625				// Show close text
626				layerhtml = ol_content_caption(o3_text, o3_cap, o3_close);
627			} else {
628				// No close text
629				layerhtml = ol_content_caption(o3_text, o3_cap, "");
630			}
631		}
632	}
633	
634	// We want it to stick!
635	if (o3_sticky) {
636		o3_showingsticky = 1;
637		o3_removecounter = 0;
638	}
639	
640	// Write layer
641	layerWrite(layerhtml);
642	
643	// Prepare status bar
644	if (o3_autostatus > 0) {
645		o3_status = o3_text;
646		if (o3_autostatus > 1) {
647			o3_status = o3_cap;
648		}
649	}
650
651	// When placing the layer the first time, even stickies may be moved.
652	o3_allowmove = 0;
653
654	// Initiate a timer for timeout
655	if (o3_timeout > 0) {          
656		if (o3_timerid > 0) clearTimeout(o3_timerid);
657		o3_timerid = setTimeout("cClick()", o3_timeout);
658	}
659
660	// Show layer
661	disp(o3_status);
662
663	// Stickies should stay where they are.	
664	if (o3_sticky) {
665		o3_allowmove = 0;
666		return false;
667	} else {
668		return true;
669	}
670}
671
672
673
674////////////////////////////////////////////////////////////////////////////////////
675// LAYER GENERATION FUNCTIONS
676////////////////////////////////////////////////////////////////////////////////////
677
678// Makes simple table without caption
679function ol_content_simple(text) {
680	txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 "+o3_bgcolor+" "+o3_height+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 "+o3_fgcolor+" "+o3_fgbackground+" "+o3_height+"><TR><TD VALIGN=TOP>"+text+"</TD></TR></TABLE></TD></TR></TABLE>";
681	set_background("");
682	return txt;
683}
684
685// Makes table with caption and optional close link
686function ol_content_caption(text, title, close) {
687	closing = "";
688	if (close != "") {
689		closing = "<TD ALIGN=RIGHT>"+close+"</TD>";
690	}
691	if (o3_capicon != "") {
692		o3_capicon = " ";
693	}
694	txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 "+o3_bgcolor+" "+o3_bgbackground+" "+o3_height+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD>"+o3_capicon+title+"</TD>"+closing+"</TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 "+o3_fgcolor+" "+o3_fgbackground+" "+o3_height+"><TR><TD VALIGN=TOP>"+text+"</TD></TR></TABLE></TD></TR></TABLE>";
695	set_background("");
696	return txt;
697}
698
699// Sets the background picture, padding and lost more. :)
700function ol_content_background(text, picture, hasfullhtml) {
701	if (hasfullhtml) {
702		txt = text;
703	} else {
704		txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING=0 CELLSPACING=0 HEIGHT="+o3_height+"><TR><TD COLSPAN=3 HEIGHT="+o3_padyt+"></TD></TR><TR><TD WIDTH="+o3_padxl+"></TD><TD VALIGN=TOP WIDTH="+(o3_width-o3_padxl-o3_padxr)+">"+text+"</TD><TD WIDTH="+o3_padxr+"></TD></TR><TR><TD COLSPAN=3 HEIGHT="+o3_padyb+"></TD></TR></TABLE>";
705	}
706	set_background(picture);
707	return txt;
708}
709
710// Loads a picture into the div.
711function set_background(pic) {
712	if (pic == "") {
713		if (ie4) over.backgroundImage = "none";
714		if (ns6) over.style.backgroundImage = "none";
715	} else {
716		if (ns4) {
717			over.background.src = pic;
718		} else if (ie4) {
719			over.backgroundImage = "url("+pic+")";
720		} else if (ns6) {
721			over.style.backgroundImage = "url("+pic+")";
722		}
723	}
724}
725
726
727
728////////////////////////////////////////////////////////////////////////////////////
729// HANDLING FUNCTIONS
730////////////////////////////////////////////////////////////////////////////////////
731
732
733// Displays the popup
734function disp(statustext) {
735	if ( (ns4) || (ie4) || (ns6) ) {
736		if (o3_allowmove == 0) 	{
737			placeLayer();
738			showObject(over);
739			o3_allowmove = 1;
740		}
741	}
742
743	if (statustext != "") {
744		self.status = statustext;
745	}
746}
747
748// Decides where we want the popup.
749function placeLayer() {
750	var placeX, placeY;
751	
752	// HORIZONTAL PLACEMENT
753	if (o3_fixx > -1) {
754		// Fixed position
755		placeX = o3_fixx;
756	} else {
757		winoffset = (ie4) ? o3_frame.document.body.scrollLeft : o3_frame.pageXOffset;
758		if (ie4) iwidth = o3_frame.document.body.clientWidth;
759		if (ns4) iwidth = o3_frame.innerWidth; // was screwed in mozilla, fixed now?
760		if (ns6) iwidth = o3_frame.outerWidth;
761		
762		// If HAUTO, decide what to use.
763		if (o3_hauto == 1) {
764			if ( (o3_x - winoffset) > ((eval(iwidth)) / 2)) {
765				o3_hpos = LEFT;
766			} else {
767				o3_hpos = RIGHT;
768			}
769		}
770		
771		// From mouse
772		if (o3_hpos == CENTER) { // Center
773			placeX = o3_x+o3_offsetx-(o3_width/2);
774		}
775		if (o3_hpos == RIGHT) { // Right
776			placeX = o3_x+o3_offsetx;
777			if ( (eval(placeX) + eval(o3_width)) > (winoffset + iwidth) ) {
778				placeX = iwidth + winoffset - o3_width;
779				if (placeX < 0) placeX = 0;
780			}
781		}
782		if (o3_hpos == LEFT) { // Left
783			placeX = o3_x-o3_offsetx-o3_width;
784			if (placeX < winoffset) placeX = winoffset;
785		}
786	
787		// Snapping!
788		if (o3_snapx > 1) {
789			var snapping = placeX % o3_snapx;
790			if (o3_hpos == LEFT) {
791				placeX = placeX - (o3_snapx + snapping);
792			} else {
793				// CENTER and RIGHT
794				placeX = placeX + (o3_snapx - snapping);
795			}
796			if (placeX < 0) placeX = 0;
797		}
798	}
799
800	
801	
802	// VERTICAL PLACEMENT
803	if (o3_fixy > -1) {
804		// Fixed position
805		placeY = o3_fixy;
806	} else {
807		// If VAUTO, decide what to use.
808		if (o3_vauto == 1) {
809			if (ie4) iheight = o3_frame.document.body.clientHeight;
810			if (ns4) iheight = o3_frame.innerHeight;
811			if (ns6) iheight = o3_frame.outerHeight;
812
813			iheight = (eval(iheight)) / 2;
814			if (o3_y > iheight) {
815				o3_vpos = ABOVE;
816			} else {
817				o3_vpos = BELOW;
818			}
819		}
820
821		// From mouse
822		if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
823			placeY = o3_y - (o3_aboveheight + o3_offsety);
824		} else {
825			// BELOW
826			placeY = o3_y + o3_offsety;
827		}
828
829		// Snapping!
830		if (o3_snapy > 1) {
831			var snapping = placeY % o3_snapy;
832			
833			if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
834				placeY = placeY - (o3_snapy + snapping);
835			} else {
836				placeY = placeY + (o3_snapy - snapping);
837			}
838			
839			if (placeY < 0) placeY = 0;
840		}
841	}
842
843
844	// Actually move the object.	
845	repositionTo(over, placeX, placeY);
846}
847
848
849// Moves the layer
850function mouseMove(e) {
851	if ( (ns4) || (ns6) ) {o3_x=e.pageX; o3_y=e.pageY;}
852	if (ie4) {o3_x=event.x; o3_y=event.y;}
853	if (ie5) {o3_x=event.x+o3_frame.document.body.scrollLeft; o3_y=event.y+o3_frame.document.body.scrollTop;}
854	
855	if (o3_allowmove == 1) {
856		placeLayer();
857	}
858}
859
860// The Close onMouseOver function for stickies
861function cClick() {
862	hideObject(over);
863	o3_showingsticky = 0;
864}
865
866
867// Makes sure target frame has overLIB
868function compatibleframe(frameid) {        
869	if (ns4) {
870		if (typeof frameid.document.overDiv =='undefined') return false;
871	} else if (ie4) {
872		if (typeof frameid.document.all["overDiv"] =='undefined') return false;
873	} else if (ns6) {
874		if (frameid.document.getElementById('overDiv') == null) return false;
875	}
876
877	return true;
878}
879
880
881
882////////////////////////////////////////////////////////////////////////////////////
883// LAYER FUNCTIONS
884////////////////////////////////////////////////////////////////////////////////////
885
886
887// Writes to a layer
888function layerWrite(txt) {
889	txt += "\n";
890	
891        if (ns4) {
892                var lyr = o3_frame.document.overDiv.document
893
894                lyr.write(txt)
895                lyr.close()
896        } else if (ie4) {
897		o3_frame.document.all["overDiv"].innerHTML = txt
898	} else if (ns6) {
899		range = o3_frame.document.createRange();
900		range.setStartBefore(over);
901		domfrag = range.createContextualFragment(txt);
902		while (over.hasChildNodes()) {
903			over.removeChild(over.lastChild);
904		}
905		over.appendChild(domfrag);
906	}
907}
908
909// Make an object visible
910function showObject(obj) {
911        if (ns4) obj.visibility = "show";
912        else if (ie4) obj.visibility = "visible";
913	else if (ns6) obj.style.visibility = "visible";
914}
915
916// Hides an object
917function hideObject(obj) {
918        if (ns4) obj.visibility = "hide";
919        else if (ie4) obj.visibility = "hidden";
920	else if (ns6) obj.style.visibility = "hidden";
921        
922	if (o3_timerid > 0) clearTimeout(o3_timerid);
923	if (o3_delayid > 0) clearTimeout(o3_delayid);
924	o3_timerid = 0;
925	o3_delayid = 0;
926        self.status = "";
927}
928
929// Move a layer
930function repositionTo(obj,xL,yL) {
931	if ( (ns4) || (ie4) ) {
932	        obj.left = xL;
933	        obj.top = yL;
934	} else if (ns6) {
935		obj.style.left = xL + "px";
936		obj.style.top = yL+ "px";
937	}
938}
939
940
941
942
943
944////////////////////////////////////////////////////////////////////////////////////
945// PARSER FUNCTIONS
946////////////////////////////////////////////////////////////////////////////////////
947
948
949// Sets text from array.
950function opt_INARRAY(id) {
951	o3_text = ol_texts[id];
952	return 0;
953}
954
955// Sets caption from array.
956function opt_CAPARRAY(id) {
957	o3_cap = ol_caps[id];	
958	return 0;
959}
960
961// Sets stickiness.
962function opt_STICKY(unused) {
963	o3_sticky = 1;
964	return 0;
965}
966
967// Sets background picture.
968function opt_BACKGROUND(file) {
969	o3_background = file;
970	return 0;
971}
972
973// Sets use of close text.
974function opt_NOCLOSE(unused) {
975	o3_close = "";
976	return 0;
977}
978
979// Sets caption.
980function opt_CAPTION(text) {
981	o3_cap = text;
982	return 0;
983}
984
985// Sets hpos, for LEFT, RIGHT and CENTER.
986function opt_HPOS(pos) {
987	o3_hpos = pos;
988	return 0;
989}
990
991// Sets the x offset
992function opt_OFFSETX(offset) {
993	o3_offsetx = offset;
994	return 0;
995}
996
997// Sets the y offset
998function opt_OFFSETY(offset) {
999	o3_offsety = offset;
1000	return 0;
1001}
1002
1003
1004// Sets the fg color
1005function opt_FGCOLOR(clr) {
1006	o3_fgcolor = clr;
1007	return 0;
1008}
1009
1010// Sets the bg color
1011function opt_BGCOLOR(clr) {
1012	o3_bgcolor = clr;
1013	return 0;
1014}
1015
1016// Sets the text color
1017function opt_TEXTCOLOR(clr) {
1018	o3_textcolor = clr;
1019	return 0;
1020}
1021
1022// Sets the caption color
1023function opt_CAPCOLOR(clr) {
1024	o3_capcolor = clr;
1025	return 0;
1026}
1027
1028// Sets the close color
1029function opt_CLOSECOLOR(clr) {
1030	o3_closecolor = clr;
1031	return 0;
1032}
1033
1034// Sets the popup width
1035function opt_WIDTH(pixels) {
1036	o3_width = pixels;
1037	return 0;
1038}
1039
1040// Sets the popup border width
1041function opt_BORDER(pixels) {
1042	o3_border = pixels;
1043	return 0;
1044}
1045
1046// Sets the status bar text
1047function opt_STATUS(text) {
1048	o3_status = text;
1049	return 0;
1050}
1051
1052// Sets that status bar text to the text
1053function opt_AUTOSTATUS(val) {
1054	o3_autostatus = 1;
1055	return 0;
1056}
1057
1058// Sets that status bar text to the caption
1059function opt_AUTOSTATUSCAP(val) {
1060	o3_autostatus = 2;
1061	return 0;
1062}
1063
1064// Sets the popup height
1065function opt_HEIGHT(pixels) {
1066	o3_height = pixels;
1067	o3_aboveheight = pixels;
1068	return 0;
1069}
1070
1071// Sets the close text.
1072function opt_CLOSETEXT(text) {
1073	o3_close = text;
1074	return 0;
1075}
1076
1077// Sets horizontal snapping
1078function opt_SNAPX(pixels) {
1079	o3_snapx = pixels;
1080	return 0;
1081}
1082
1083// Sets vertical snapping
1084function opt_SNAPY(pixels) {
1085	o3_snapy = pixels;
1086	return 0;
1087}
1088
1089// Sets horizontal position
1090function opt_FIXX(pos) {
1091	o3_fixx = pos;
1092	return 0;
1093}
1094
1095// Sets vertical position
1096function opt_FIXY(pos) {
1097	o3_fixy = pos;
1098	return 0;
1099}
1100
1101// Sets the fg background
1102function opt_FGBACKGROUND(picture) {
1103	o3_fgbackground = picture;
1104	return 0;
1105}
1106
1107// Sets the bg background
1108function opt_BGBACKGROUND(picture) {
1109	o3_bgbackground = picture;
1110	return 0;
1111}
1112
1113// Sets the left x padding for background
1114function opt_PADX(pixels) {
1115	o3_padxl = pixels;
1116	return PADX2;
1117}
1118
1119// Sets the top y padding for background
1120function opt_PADY(pixels) {
1121	o3_padyt = pixels;
1122	return PADY2;
1123}
1124
1125// Sets the right x padding for background
1126function opt_PADX2(pixels) {
1127	o3_padxr = pixels;
1128	return 0;
1129}
1130
1131// Sets the bottom y padding for background
1132function opt_PADY2(pixels) {
1133	o3_padyb = pixels;
1134	return 0;
1135}
1136
1137// Sets that user provides full html.
1138function opt_FULLHTML(unused) {
1139	o3_fullhtml = 1;
1140	return 0;
1141}
1142
1143// Sets vpos, for ABOVE and BELOW
1144function opt_VPOS(pos) {
1145	o3_vpos = pos;
1146	return 0;
1147}
1148
1149// Sets the caption icon.
1150function opt_CAPICON(icon) {
1151	o3_capicon = icon;
1152	return 0;
1153}
1154
1155// Sets the text font
1156function opt_TEXTFONT(fontname) {
1157	o3_textfont = fontname;
1158	return 0;
1159}
1160
1161// Sets the caption font
1162function opt_CAPTIONFONT(fontname) {
1163	o3_captionfont = fontname;
1164	return 0;
1165}
1166
1167// Sets the close font
1168function opt_CLOSEFONT(fontname) {
1169	o3_closefont = fontname;
1170	return 0;
1171}
1172
1173// Sets the text font size
1174function opt_TEXTSIZE(fontsize) {
1175	o3_textsize = fontsize;
1176	return 0;
1177}
1178
1179// Sets the caption font size
1180function opt_CAPTIONSIZE(fontsize) {
1181	o3_captionsize = fontsize;
1182	return 0;
1183}
1184
1185// Sets the close font size
1186function opt_CLOSESIZE(fontsize) {
1187	o3_closesize = fontsize;
1188	return 0;
1189}
1190
1191// Defines which frame we should point to.
1192function opt_FRAME(frm) {
1193        o3_frame = compatibleframe(frm) ? frm : ol_frame;
1194
1195	if ( (ns4) || (ie4 || (ns6)) ) {
1196		if (ns4) over = o3_frame.document.overDiv;
1197		if (ie4) over = o3_frame.overDiv.style;
1198		if (ns6) over = o3_frame.document.getElementById("overDiv");
1199	}
1200
1201	return 0;
1202}
1203
1204// Sets the popup timeout (note: 1 sec = 1000)
1205function opt_TIMEOUT(maxtime) {
1206	o3_timeout = maxtime;
1207	return 0;
1208}
1209
1210// Calls an external function
1211function opt_FUNCTION(callme) {
1212	o3_text = callme()
1213	return 0;
1214}
1215
1216// Sets the popup delay (note: 1 sec = 1000)
1217function opt_DELAY(waittime) {
1218	o3_delay = waittime;
1219	return 0;
1220}
1221
1222// Sets the auto horizontal option
1223function opt_HAUTO(onoff) {
1224	if (o3_hauto == 0) {
1225		o3_hauto = 1;
1226	} else {
1227		o3_hauto = 0;
1228	}
1229	return 0;
1230}
1231
1232// Sets the auto vertical option
1233function opt_VAUTO(onoff) {
1234	if (o3_vauto == 0) {
1235		o3_vauto = 1;
1236	} else {
1237		o3_vauto = 0;
1238	}
1239	return 0;
1240}
1241
1242
1243//end (For internal purposes.)
1244////////////////////////////////////////////////////////////////////////////////////
1245// OVERLIB 2 COMPATABILITY FUNCTIONS
1246// If you aren't upgrading you can remove the below section.
1247////////////////////////////////////////////////////////////////////////////////////
1248
1249// Converts old 0=left, 1=right and 2=center into constants.
1250function vpos_convert(d) {
1251	if (d == 0) {
1252		d = LEFT;
1253	} else {
1254		if (d == 1) {
1255			d = RIGHT;
1256		} else {
1257			d = CENTER;
1258		}
1259	}
1260	
1261	return d;
1262}
1263
1264// Simple popup
1265function dts(d,text) {
1266	o3_hpos = vpos_convert(d);
1267	overlib(text, o3_hpos, CAPTION, "");
1268}
1269
1270// Caption popup
1271function dtc(d,text, title) {
1272	o3_hpos = vpos_convert(d);
1273	overlib(text, CAPTION, title, o3_hpos);
1274}
1275
1276// Sticky
1277function stc(d,text, title) {
1278	o3_hpos = vpos_convert(d);
1279	overlib(text, CAPTION, title, o3_hpos, STICKY);
1280}
1281
1282// Simple popup right
1283function drs(text) {
1284	dts(1,text);
1285}
1286
1287// Caption popup right
1288function drc(text, title) {
1289	dtc(1,text,title);
1290}
1291
1292// Sticky caption right
1293function src(text,title) {
1294	stc(1,text,title);
1295}
1296
1297// Simple popup left
1298function dls(text) {
1299	dts(0,text);
1300}
1301
1302// Caption popup left
1303function dlc(text, title) {
1304	dtc(0,text,title);
1305}
1306
1307// Sticky caption left
1308function slc(text,title) {
1309	stc(0,text,title);
1310}
1311
1312// Simple popup center
1313function dcs(text) {
1314	dts(2,text);
1315}
1316
1317// Caption popup center
1318function dcc(text, title) {
1319	dtc(2,text,title);
1320}
1321
1322// Sticky caption center
1323function scc(text,title) {
1324	stc(2,text,title);
1325}

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.