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