64aae53dcf8aaaa2c4ffa241fde2bbf373054bf6
2 //\ overLIB 4.14 - You may not remove or change this notice.
3 //\ Copyright Erik Bosrup 1998-2004. All rights reserved.
5 //\ Contributors are listed on the homepage.
6 //\ This file might be old, always check for the latest version at:
7 //\ http://www.bosrup.com/web
/overlib/
9 //\ Please read the license agreement (available through the link above)
10 //\ before using overLIB. Direct any licensing questions to erik@bosrup.com.
12 //\ Do not sell this as your own work or remove this copyright notice.
13 //\ For full details on copying or changing this script please read the
14 //\ license agreement at the link above. Please give credit on sites that
15 //\ use overLIB and submit changes of the script so other people can use
17 // $Revision: 1.107 $ $Date: 2004/12/26 15:34:56 $
23 // Ignore these lines, configuration is below.
25 var olLoaded
= 0;var pmStart
= 10000000; var pmUpper
= 10001000; var pmCount
= pmStart
+1; var pmt
=''; var pms
= new Array(); var olInfo
= new Info('4.14', 1);
26 var FREPLACE
= 0; var FBEFORE
= 1; var FAFTER
= 2; var FALTERNATE
= 3; var FCHAIN
=4;
27 var olHideForm
=0; // parameter for hiding SELECT and ActiveX elements in IE5.5+
28 var olHautoFlag
= 0; // flags for over-riding VAUTO and HAUTO if corresponding
29 var olVautoFlag
= 0; // positioning commands are used on the command line
30 registerCommands('donothing,inarray,caparray,sticky,background,noclose,caption,left,right,center,offsetx,offsety,fgcolor,bgcolor,textcolor,capcolor,closecolor,width,border,cellpad,status,autostatus,autostatuscap,height,closetext,snapx,snapy,fixx,fixy,relx,rely,fgbackground,bgbackground,padx,pady,fullhtml,above,below,capicon,textfont,captionfont,closefont,textsize,captionsize,closesize,timeout,function,delay,hauto,vauto,closeclick,wrap,followmouse,mouseoff,closetitle,cssoff,compatmode,cssclass,fgclass,bgclass,textfontclass,captionfontclass,closefontclass');
33 // DEFAULT CONFIGURATION
34 // Settings you want everywhere are set here. All of this can also be
35 // changed on your html page or through an overLIB call.
37 if (typeof ol_fgcolor
=='undefined') var ol_fgcolor
="#CCCCFF";
38 if (typeof ol_bgcolor
=='undefined') var ol_bgcolor
="#333399";
39 if (typeof ol_textcolor
=='undefined') var ol_textcolor
="#000000";
40 if (typeof ol_capcolor
=='undefined') var ol_capcolor
="#FFFFFF";
41 if (typeof ol_closecolor
=='undefined') var ol_closecolor
="#9999FF";
42 if (typeof ol_textfont
=='undefined') var ol_textfont
="Verdana,Arial,Helvetica";
43 if (typeof ol_captionfont
=='undefined') var ol_captionfont
="Verdana,Arial,Helvetica";
44 if (typeof ol_closefont
=='undefined') var ol_closefont
="Verdana,Arial,Helvetica";
45 if (typeof ol_textsize
=='undefined') var ol_textsize
="1";
46 if (typeof ol_captionsize
=='undefined') var ol_captionsize
="1";
47 if (typeof ol_closesize
=='undefined') var ol_closesize
="1";
48 if (typeof ol_width
=='undefined') var ol_width
="200";
49 if (typeof ol_border
=='undefined') var ol_border
="1";
50 if (typeof ol_cellpad
=='undefined') var ol_cellpad
=2;
51 if (typeof ol_offsetx
=='undefined') var ol_offsetx
=10;
52 if (typeof ol_offsety
=='undefined') var ol_offsety
=10;
53 if (typeof ol_text
=='undefined') var ol_text
="Default Text";
54 if (typeof ol_cap
=='undefined') var ol_cap
="";
55 if (typeof ol_sticky
=='undefined') var ol_sticky
=0;
56 if (typeof ol_background
=='undefined') var ol_background
="";
57 if (typeof ol_close
=='undefined') var ol_close
="Close";
58 if (typeof ol_hpos
=='undefined') var ol_hpos
=RIGHT
;
59 if (typeof ol_status
=='undefined') var ol_status
="";
60 if (typeof ol_autostatus
=='undefined') var ol_autostatus
=0;
61 if (typeof ol_height
=='undefined') var ol_height
=-1;
62 if (typeof ol_snapx
=='undefined') var ol_snapx
=0;
63 if (typeof ol_snapy
=='undefined') var ol_snapy
=0;
64 if (typeof ol_fixx
=='undefined') var ol_fixx
=-1;
65 if (typeof ol_fixy
=='undefined') var ol_fixy
=-1;
66 if (typeof ol_relx
=='undefined') var ol_relx
=null;
67 if (typeof ol_rely
=='undefined') var ol_rely
=null;
68 if (typeof ol_fgbackground
=='undefined') var ol_fgbackground
="";
69 if (typeof ol_bgbackground
=='undefined') var ol_bgbackground
="";
70 if (typeof ol_padxl
=='undefined') var ol_padxl
=1;
71 if (typeof ol_padxr
=='undefined') var ol_padxr
=1;
72 if (typeof ol_padyt
=='undefined') var ol_padyt
=1;
73 if (typeof ol_padyb
=='undefined') var ol_padyb
=1;
74 if (typeof ol_fullhtml
=='undefined') var ol_fullhtml
=0;
75 if (typeof ol_vpos
=='undefined') var ol_vpos
=BELOW
;
76 if (typeof ol_aboveheight
=='undefined') var ol_aboveheight
=0;
77 if (typeof ol_capicon
=='undefined') var ol_capicon
="";
78 if (typeof ol_frame
=='undefined') var ol_frame
=self
;
79 if (typeof ol_timeout
=='undefined') var ol_timeout
=0;
80 if (typeof ol_function
=='undefined') var ol_function
=null;
81 if (typeof ol_delay
=='undefined') var ol_delay
=0;
82 if (typeof ol_hauto
=='undefined') var ol_hauto
=0;
83 if (typeof ol_vauto
=='undefined') var ol_vauto
=0;
84 if (typeof ol_closeclick
=='undefined') var ol_closeclick
=0;
85 if (typeof ol_wrap
=='undefined') var ol_wrap
=0;
86 if (typeof ol_followmouse
=='undefined') var ol_followmouse
=1;
87 if (typeof ol_mouseoff
=='undefined') var ol_mouseoff
=0;
88 if (typeof ol_closetitle
=='undefined') var ol_closetitle
='Close';
89 if (typeof ol_compatmode
=='undefined') var ol_compatmode
=0;
90 if (typeof ol_css
=='undefined') var ol_css
=CSSOFF
;
91 if (typeof ol_fgclass
=='undefined') var ol_fgclass
="";
92 if (typeof ol_bgclass
=='undefined') var ol_bgclass
="";
93 if (typeof ol_textfontclass
=='undefined') var ol_textfontclass
="";
94 if (typeof ol_captionfontclass
=='undefined') var ol_captionfontclass
="";
95 if (typeof ol_closefontclass
=='undefined') var ol_closefontclass
="";
98 // ARRAY CONFIGURATION
101 // You can use these arrays to store popup text here instead of in the html.
102 if (typeof ol_texts
=='undefined') var ol_texts
= new Array("Text 0", "Text 1");
103 if (typeof ol_caps
=='undefined') var ol_caps
= new Array("Caption 0", "Caption 1");
106 // END OF CONFIGURATION
107 // Don't change anything below this line, all configuration is above.
117 // Runtime variables init. Don't change for config!
121 var o3_background
="";
122 var o3_close
="Close";
130 var o3_closecolor
="";
143 var o3_fgbackground
="";
144 var o3_bgbackground
="";
151 var o3_aboveheight
=0;
153 var o3_textfont
="Verdana,Arial,Helvetica";
154 var o3_captionfont
="Verdana,Arial,Helvetica";
155 var o3_closefont
="Verdana,Arial,Helvetica";
157 var o3_captionsize
="1";
158 var o3_closesize
="1";
163 var o3_function
=null;
170 var o3_followmouse
=1;
172 var o3_closetitle
='';
177 var o3_textfontclass
="";
178 var o3_captionfontclass
="";
179 var o3_closefontclass
="";
181 // Display state variables
184 var o3_showingsticky
= 0;
185 var o3_removecounter
= 0;
189 var fnRef
, hoveringSwitch
= false;
192 // Decide browser version
193 var isMac
= (navigator
.userAgent
.indexOf("Mac") != -1);
194 var olOp
= (navigator
.userAgent
.toLowerCase().indexOf('opera') > -1 && document
.createTextNode
); // Opera 7
195 var olNs4
= (navigator
.appName
=='Netscape' && parseInt(navigator
.appVersion
) == 4);
196 var olNs6
= (document
.getElementById
) ? true : false;
197 var olKq
= (olNs6
&& /konqueror/i.test(navigator
.userAgent
));
198 var olIe4
= (document
.all
) ? true : false;
200 var olIe55
= false; // Added additional variable to identify IE5.5+
201 var docRoot
= 'document.body';
203 // Resize fix for NS4.x to keep track of layer
205 var oW
= window
.innerWidth
;
206 var oH
= window
.innerHeight
;
207 window
.onresize
= function() { if (oW
!= window
.innerWidth
|| oH
!= window
.innerHeight
) location
.reload(); }
210 // Microsoft Stupidity Check(tm).
212 var agent
= navigator
.userAgent
;
213 if (/MSIE/.test(agent
)) {
214 var versNum
= parseFloat(agent
.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);
217 olIe55
=(versNum
>=5.5&&!olOp
) ? true : false;
218 if (olNs6
) olNs6
=false;
221 if (olNs6
) olIe4
= false;
224 // Check for compatability mode.
225 if (document
.compatMode
&& document
.compatMode
== 'CSS1Compat') {
226 docRoot
= ((olIe4
&& !olOp
) ? 'document.documentElement' : docRoot
);
229 // Add window onload handlers to indicate when all modules have been loaded
230 // For Netscape 6+ and Mozilla, uses addEventListener method on the window object
231 // For IE it uses the attachEvent method of the window object and for Netscape 4.x
232 // it sets the window.onload handler to the OLonload_handler function for Bubbling
233 if(window
.addEventListener
) window
.addEventListener("load",OLonLoad_handler
,false);
234 else if (window
.attachEvent
) window
.attachEvent("onload",OLonLoad_handler
);
236 // Capture events, alt. diffuses the overlib function.
237 var olCheckMouseCapture
= true;
238 if ((olNs4
|| olNs6
|| olIe4
)) {
241 overlib
= no_overlib
;
251 // overlib(arg0,...,argN)
252 // Loads parameters into global runtime variables.
254 if (!olLoaded
|| isExclusive(overlib
.arguments
)) return true;
255 if (olCheckMouseCapture
) olMouseCapture();
257 over
= (typeof over
.id
!= 'string') ? o3_frame
.document
.all
['overDiv'] : over
;
261 // Load defaults to runtime.
266 o3_background
=ol_background
;
269 o3_offsetx
=ol_offsetx
;
270 o3_offsety
=ol_offsety
;
271 o3_fgcolor
=ol_fgcolor
;
272 o3_bgcolor
=ol_bgcolor
;
273 o3_textcolor
=ol_textcolor
;
274 o3_capcolor
=ol_capcolor
;
275 o3_closecolor
=ol_closecolor
;
278 o3_cellpad
=ol_cellpad
;
280 o3_autostatus
=ol_autostatus
;
288 o3_fgbackground
=ol_fgbackground
;
289 o3_bgbackground
=ol_bgbackground
;
294 o3_fullhtml
=ol_fullhtml
;
296 o3_aboveheight
=ol_aboveheight
;
297 o3_capicon
=ol_capicon
;
298 o3_textfont
=ol_textfont
;
299 o3_captionfont
=ol_captionfont
;
300 o3_closefont
=ol_closefont
;
301 o3_textsize
=ol_textsize
;
302 o3_captionsize
=ol_captionsize
;
303 o3_closesize
=ol_closesize
;
304 o3_timeout
=ol_timeout
;
305 o3_function
=ol_function
;
309 o3_closeclick
=ol_closeclick
;
311 o3_followmouse
=ol_followmouse
;
312 o3_mouseoff
=ol_mouseoff
;
313 o3_closetitle
=ol_closetitle
;
315 o3_compatmode
=ol_compatmode
;
316 o3_fgclass
=ol_fgclass
;
317 o3_bgclass
=ol_bgclass
;
318 o3_textfontclass
=ol_textfontclass
;
319 o3_captionfontclass
=ol_captionfontclass
;
320 o3_closefontclass
=ol_closefontclass
;
322 setRunTimeVariables();
326 // Special for frame support, over must be reset...
329 if(!(over
=createDivContainer())) return false;
331 parseTokens('o3_', overlib
.arguments
);
332 if (!postParseChecks()) return false;
335 return runHook("olMain", FREPLACE
);
337 o3_delayid
= setTimeout("runHook('olMain', FREPLACE)", o3_delay
);
342 // Clears popups if appropriate
344 if (olLoaded
&& !isExclusive()) {
345 hideDelay(time
); // delay popup close if time specified
347 if (o3_removecounter
>= 1) { o3_showingsticky
= 0 };
349 if (o3_showingsticky
== 0) {
351 if (over
!= null && o3_timerid
== 0) runHook("hideObject", FREPLACE
, over
);
360 // The Close onMouseOver function for stickies
363 runHook("hideObject", FREPLACE
, over
);
364 o3_showingsticky
= 0;
369 // Method for setting page specific defaults.
370 function overlib_pagedefaults() {
371 parseTokens('ol_', overlib_pagedefaults
.arguments
);
376 // OVERLIB MAIN FUNCTION
379 // This function decides what it is we want to display and how we want it done.
381 var layerhtml
, styleType
;
382 runHook("olMain", FBEFORE
);
384 if (o3_background
!="" || o3_fullhtml
) {
385 // Use background instead of box.
386 layerhtml
= runHook('ol_content_background', FALTERNATE
, o3_css
, o3_text
, o3_background
, o3_fullhtml
);
388 // They want a popup box.
389 styleType
= (pms
[o3_css
-1-pmStart
] == "cssoff" || pms
[o3_css
-1-pmStart
] == "cssclass");
391 // Prepare popup background
392 if (o3_fgbackground
!= "") o3_fgbackground
= "background=\""+o3_fgbackground
+"\"";
393 if (o3_bgbackground
!= "") o3_bgbackground
= (styleType
? "background=\""+o3_bgbackground
+"\"" : o3_bgbackground
);
395 // Prepare popup colors
396 if (o3_fgcolor
!= "") o3_fgcolor
= (styleType
? "bgcolor=\""+o3_fgcolor
+"\"" : o3_fgcolor
);
397 if (o3_bgcolor
!= "") o3_bgcolor
= (styleType
? "bgcolor=\""+o3_bgcolor
+"\"" : o3_bgcolor
);
399 // Prepare popup height
400 if (o3_height
> 0) o3_height
= (styleType
? "height=\""+o3_height
+"\"" : o3_height
);
403 // Decide which kinda box.
406 layerhtml
= runHook('ol_content_simple', FALTERNATE
, o3_css
, o3_text
);
411 layerhtml
= runHook('ol_content_caption', FALTERNATE
, o3_css
, o3_text
, o3_cap
, o3_close
);
414 layerhtml
= runHook('ol_content_caption', FALTERNATE
, o3_css
, o3_text
, o3_cap
, "");
419 // We want it to stick!
421 if (o3_timerid
> 0) {
422 clearTimeout(o3_timerid
);
425 o3_showingsticky
= 1;
426 o3_removecounter
= 0;
429 // Created a separate routine to generate the popup to make it easier
430 // to implement a plugin capability
431 if (!runHook("createPopup", FREPLACE
, layerhtml
)) return false;
433 // Prepare status bar
434 if (o3_autostatus
> 0) {
436 if (o3_autostatus
> 1) o3_status
= o3_cap
;
439 // When placing the layer the first time, even stickies may be moved.
442 // Initiate a timer for timeout
443 if (o3_timeout
> 0) {
444 if (o3_timerid
> 0) clearTimeout(o3_timerid
);
445 o3_timerid
= setTimeout("cClick()", o3_timeout
);
449 runHook("disp", FREPLACE
, o3_status
);
450 runHook("olMain", FAFTER
);
452 return (olOp
&& event
&& event
.type
== 'mouseover' && !o3_status
) ? '' : (o3_status
!= '');
456 // LAYER GENERATION FUNCTIONS
458 // These functions just handle popup content with tags that should adhere to the W3C standards specification.
460 // Makes simple table without caption
461 function ol_content_simple(text
) {
462 txt
='<table width="'+o3_width
+ '" border="0" cellpadding="'+o3_border
+'" cellspacing="0" '+(o3_bgclass
? 'class="'+o3_bgclass
+'"' : o3_bgcolor
+' '+o3_height
)+'><tr><td><table width="100%" border="0" cellpadding="' + o3_cellpad
+ '" cellspacing="0" '+(o3_fgclass
? 'class="'+o3_fgclass
+'"' : o3_fgcolor
+' '+o3_fgbackground
+' '+o3_height
)+'><tr><td valign="TOP"'+(o3_textfontclass
? ' class="'+o3_textfontclass
+'">' : '>')+(o3_textfontclass
? '' : wrapStr(0,o3_textsize
,'text'))+text
+(o3_textfontclass
? '' : wrapStr(1,o3_textsize
))+'</td></tr></table></td></tr></table>';
468 // Makes table with caption and optional close link
469 function ol_content_caption(text
,title
,close
) {
472 closeevent
="onmouseover";
473 if (o3_closeclick
==1) closeevent
= (o3_closetitle
? "title='" + o3_closetitle
+"'" : "") + " onclick";
474 if (o3_capicon
!="") {
475 nameId
=' hspace=\"5\"'+' align=\"middle\" alt=\"\"';
476 if (typeof o3_dragimg
!='undefined'&&o3_dragimg
) nameId
=' hspace=\"5\"'+' name=\"'+o3_dragimg
+'\" id=\"'+o3_dragimg
+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
477 o3_capicon
='<img src=\"'+o3_capicon
+'\"'+nameId
+' />';
481 closing
='<td '+(!o3_compatmode
&& o3_closefontclass
? 'class="'+o3_closefontclass
: 'align="RIGHT')+'"><a href="javascript:return '+fnRef
+'cClick();"'+((o3_compatmode
&& o3_closefontclass
) ? ' class="' + o3_closefontclass
+ '" ' : ' ')+closeevent
+'="return '+fnRef
+'cClick();">'+(o3_closefontclass
? '' : wrapStr(0,o3_closesize
,'close'))+close
+(o3_closefontclass
? '' : wrapStr(1,o3_closesize
,'close'))+'</a></td>';
482 txt
='<table width="'+o3_width
+ '" border="0" cellpadding="'+o3_border
+'" cellspacing="0" '+(o3_bgclass
? 'class="'+o3_bgclass
+'"' : o3_bgcolor
+' '+o3_bgbackground
+' '+o3_height
)+'><tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td'+(o3_captionfontclass
? ' class="'+o3_captionfontclass
+'">' : '>')+(o3_captionfontclass
? '' : '<b>'+wrapStr(0,o3_captionsize
,'caption'))+o3_capicon
+title
+(o3_captionfontclass
? '' : wrapStr(1,o3_captionsize
)+'</b>')+'</td>'+closing
+'</tr></table><table width="100%" border="0" cellpadding="' + o3_cellpad
+ '" cellspacing="0" '+(o3_fgclass
? 'class="'+o3_fgclass
+'"' : o3_fgcolor
+' '+o3_fgbackground
+' '+o3_height
)+'><tr><td valign="TOP"'+(o3_textfontclass
? ' class="'+o3_textfontclass
+'">' :'>')+(o3_textfontclass
? '' : wrapStr(0,o3_textsize
,'text'))+text
+(o3_textfontclass
? '' : wrapStr(1,o3_textsize
)) + '</td></tr></table></td></tr></table>';
488 // Sets the background picture,padding and lots more. :)
489 function ol_content_background(text
,picture
,hasfullhtml
) {
493 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)+(o3_textfontclass ? '" class="'+o3_textfontclass : '')+'">'+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td><td width="'+o3_padxr
+'"></td></tr><tr><td colspan="3" height="'+o3_padyb
+'"></td></tr></table>';
496 set_background(picture
);
500 // Loads a picture into the div.
501 function set_background(pic
) {
504 over
.background
.src
= null;
505 } else if (over
.style
) {
506 over
.style
.backgroundImage
= "none";
510 over
.background
.src
= pic
;
511 } else if (over
.style
) {
512 over
.style
.width
=o3_width
+ 'px';
513 over
.style
.backgroundImage
= "url("+pic
+")";
519 // HANDLING FUNCTIONS
523 // Displays the popup
524 function disp(statustext
) {
525 runHook("disp", FBEFORE
);
527 if (o3_allowmove
== 0) {
528 runHook("placeLayer", FREPLACE
);
529 (olNs6
&&olShowId
<0) ? olShowId
=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE
, over
);
530 o3_allowmove
= (o3_sticky
|| o3_followmouse
==0) ? 0 : 1;
533 runHook("disp", FAFTER
);
535 if (statustext
!= "") self
.status
= statustext
;
538 // Creates the actual popup structure
539 function createPopup(lyrContent
){
540 runHook("createPopup", FBEFORE
);
543 var wd
,ww
,theObj
=(olNs4
? over
: over
.style
);
544 theObj
.top
=theObj
.left
=-10000 + (!olNs4
? 'px' : 0);
545 layerWrite(lyrContent
);
546 wd
= (olNs4
? over
.clip
.width
: over
.offsetWidth
);
547 if (wd
> (ww
=windowWidth())) {
548 lyrContent
=lyrContent
.replace(/\ /g, ' ');
554 layerWrite(lyrContent
);
556 // Have to set o3_width for placeLayer() routine if o3_wrap is turned on
557 if (o3_wrap
) o3_width
=(olNs4
? over
.clip
.width
: over
.offsetWidth
);
559 runHook("createPopup", FAFTER
, lyrContent
);
564 // Decides where we want the popup.
565 function placeLayer() {
566 var placeX
, placeY
, widthFix
= 0;
568 // HORIZONTAL PLACEMENT, re-arranged to work in Safari
569 if (o3_frame
.innerWidth
) widthFix
=18;
570 iwidth
= windowWidth();
572 // Horizontal scroll offset
573 winoffset
=(olIe4
) ? eval('o3_frame.'+docRoot
+'.scrollLeft') : o3_frame
.pageXOffset
;
575 placeX
= runHook('horizontalPlacement',FCHAIN
,iwidth
,winoffset
,widthFix
);
577 // VERTICAL PLACEMENT, re-arranged to work in Safari
578 if (o3_frame
.innerHeight
) {
579 iheight
=o3_frame
.innerHeight
;
580 } else if (eval('o3_frame.'+docRoot
)&&eval("typeof o3_frame."+docRoot
+".clientHeight=='number'")&&eval('o3_frame.'+docRoot
+'.clientHeight')) {
581 iheight
=eval('o3_frame.'+docRoot
+'.clientHeight');
584 // Vertical scroll offset
585 scrolloffset
=(olIe4
) ? eval('o3_frame.'+docRoot
+'.scrollTop') : o3_frame
.pageYOffset
;
586 placeY
= runHook('verticalPlacement',FCHAIN
,iheight
,scrolloffset
);
588 // Actually move the object.
589 repositionTo(over
, placeX
, placeY
);
593 function olMouseMove(e
) {
594 var e
= (e
) ? e
: event
;
599 } else if (e
.clientX
) {
600 o3_x
= eval('e.clientX+o3_frame.'+docRoot
+'.scrollLeft');
601 o3_y
= eval('e.clientY+o3_frame.'+docRoot
+'.scrollTop');
604 if (o3_allowmove
== 1) runHook("placeLayer", FREPLACE
);
607 if (hoveringSwitch
&& !olNs4
&& runHook("cursorOff", FREPLACE
)) {
608 (olHideDelay
? hideDelay(olHideDelay
) : cClick());
609 hoveringSwitch
= !hoveringSwitch
;
613 // Fake function for 3.0 users.
614 function no_overlib() { return ver3fix
; }
616 // Capture the mouse and chain other scripts.
617 function olMouseCapture() {
618 capExtent
= document
;
619 var fN
, str
, l
, k
, f
, mseHandler
= olMouseMove
;
620 var re
= /function[ ]*(\w*)\(/;
622 if (document
.onmousemove
|| (!olIe4
&& window
.onmousemove
)) {
623 if (window
.onmousemove
) capExtent
= window
;
624 f
= capExtent
.onmousemove
.toString();
629 } else if (fN
[1] == 'anonymous' || fN
[1] == 'olMouseMove') {
630 olCheckMouseCapture
= false;
633 if (fN
[1]) str
= fN
[1]+'(e); ';
636 k
=f
.lastIndexOf('}');
637 str
=f
.substring(l
,k
) + '\n';
641 str
+= 'olMouseMove(e); ';
642 mseHandler
= new Function('e', str
);
645 capExtent
.onmousemove
= mseHandler
;
646 if (olNs4
) capExtent
.captureEvents(Event
.MOUSEMOVE
);
653 // Does the actual command parsing.
654 function parseTokens(pf
, ar
) {
655 // What the next argument is expected to be.
656 var v
, mode
=-1, par
= (pf
!= 'ol_');
657 var fnMark
= (par
&& !ar
.length
? 1 : 0);
659 for (i
= 0; i
< ar
.length
; i
++) {
661 // Arg is maintext,unless its a number between pmStart and pmUpper
662 // then its a command.
663 if (typeof ar
[i
] == 'number' && ar
[i
] > pmStart
&& ar
[i
] < pmUpper
) {
664 fnMark
= (par
? 1 : 0);
665 i
--; // backup one so that the next block can parse it
669 ol_text
= ar
[i
].toString();
672 o3_text
=ar
[i
].toString();
677 // Note: NS4 doesn't like switch cases with vars.
678 if (ar
[i
] >= pmCount
|| ar
[i
]==DONOTHING
) { continue; }
679 if (ar
[i
]==INARRAY
) { fnMark
= 0; eval(pf
+'text=ol_texts['+ar
[++i
]+'].toString()'); continue; }
680 if (ar
[i
]==CAPARRAY
) { eval(pf
+'cap=ol_caps['+ar
[++i
]+'].toString()'); continue; }
681 if (ar
[i
]==STICKY
) { if (pf
!='ol_') eval(pf
+'sticky=1'); continue; }
682 if (ar
[i
]==BACKGROUND
) { eval(pf
+'background="'+ar
[++i
]+'"'); continue; }
683 if (ar
[i
]==NOCLOSE
) { if (pf
!='ol_') opt_NOCLOSE(); continue; }
684 if (ar
[i
]==CAPTION
) { eval(pf
+"cap='"+escSglQuote(ar
[++i
])+"'"); continue; }
685 if (ar
[i
]==CENTER
|| ar
[i
]==LEFT
|| ar
[i
]==RIGHT
) { eval(pf
+'hpos='+ar
[i
]); if(pf
!='ol_') olHautoFlag
=1; continue; }
686 if (ar
[i
]==OFFSETX
) { eval(pf
+'offsetx='+ar
[++i
]); continue; }
687 if (ar
[i
]==OFFSETY
) { eval(pf
+'offsety='+ar
[++i
]); continue; }
688 if (ar
[i
]==FGCOLOR
) { eval(pf
+'fgcolor="'+ar
[++i
]+'"'); continue; }
689 if (ar
[i
]==BGCOLOR
) { eval(pf
+'bgcolor="'+ar
[++i
]+'"'); continue; }
690 if (ar
[i
]==TEXTCOLOR
) { eval(pf
+'textcolor="'+ar
[++i
]+'"'); continue; }
691 if (ar
[i
]==CAPCOLOR
) { eval(pf
+'capcolor="'+ar
[++i
]+'"'); continue; }
692 if (ar
[i
]==CLOSECOLOR
) { eval(pf
+'closecolor="'+ar
[++i
]+'"'); continue; }
693 if (ar
[i
]==WIDTH
) { eval(pf
+'width='+ar
[++i
]); continue; }
694 if (ar
[i
]==BORDER
) { eval(pf
+'border='+ar
[++i
]); continue; }
695 if (ar
[i
]==CELLPAD
) { i
=opt_MULTIPLEARGS(++i
,ar
,(pf
+'cellpad')); continue; }
696 if (ar
[i
]==STATUS
) { eval(pf
+"status='"+escSglQuote(ar
[++i
])+"'"); continue; }
697 if (ar
[i
]==AUTOSTATUS
) { eval(pf
+'autostatus=('+pf
+'autostatus == 1) ? 0 : 1'); continue; }
698 if (ar
[i
]==AUTOSTATUSCAP
) { eval(pf
+'autostatus=('+pf
+'autostatus == 2) ? 0 : 2'); continue; }
699 if (ar
[i
]==HEIGHT
) { eval(pf
+'height='+pf
+'aboveheight='+ar
[++i
]); continue; } // Same param again.
700 if (ar
[i
]==CLOSETEXT
) { eval(pf
+"close='"+escSglQuote(ar
[++i
])+"'"); continue; }
701 if (ar
[i
]==SNAPX
) { eval(pf
+'snapx='+ar
[++i
]); continue; }
702 if (ar
[i
]==SNAPY
) { eval(pf
+'snapy='+ar
[++i
]); continue; }
703 if (ar
[i
]==FIXX
) { eval(pf
+'fixx='+ar
[++i
]); continue; }
704 if (ar
[i
]==FIXY
) { eval(pf
+'fixy='+ar
[++i
]); continue; }
705 if (ar
[i
]==RELX
) { eval(pf
+'relx='+ar
[++i
]); continue; }
706 if (ar
[i
]==RELY
) { eval(pf
+'rely='+ar
[++i
]); continue; }
707 if (ar
[i
]==FGBACKGROUND
) { eval(pf
+'fgbackground="'+ar
[++i
]+'"'); continue; }
708 if (ar
[i
]==BGBACKGROUND
) { eval(pf
+'bgbackground="'+ar
[++i
]+'"'); continue; }
709 if (ar
[i
]==PADX
) { eval(pf
+'padxl='+ar
[++i
]); eval(pf
+'padxr='+ar
[++i
]); continue; }
710 if (ar
[i
]==PADY
) { eval(pf
+'padyt='+ar
[++i
]); eval(pf
+'padyb='+ar
[++i
]); continue; }
711 if (ar
[i
]==FULLHTML
) { if (pf
!='ol_') eval(pf
+'fullhtml=1'); continue; }
712 if (ar
[i
]==BELOW
|| ar
[i
]==ABOVE
) { eval(pf
+'vpos='+ar
[i
]); if (pf
!='ol_') olVautoFlag
=1; continue; }
713 if (ar
[i
]==CAPICON
) { eval(pf
+'capicon="'+ar
[++i
]+'"'); continue; }
714 if (ar
[i
]==TEXTFONT
) { eval(pf
+"textfont='"+escSglQuote(ar
[++i
])+"'"); continue; }
715 if (ar
[i
]==CAPTIONFONT
) { eval(pf
+"captionfont='"+escSglQuote(ar
[++i
])+"'"); continue; }
716 if (ar
[i
]==CLOSEFONT
) { eval(pf
+"closefont='"+escSglQuote(ar
[++i
])+"'"); continue; }
717 if (ar
[i
]==TEXTSIZE
) { eval(pf
+'textsize="'+ar
[++i
]+'"'); continue; }
718 if (ar
[i
]==CAPTIONSIZE
) { eval(pf
+'captionsize="'+ar
[++i
]+'"'); continue; }
719 if (ar
[i
]==CLOSESIZE
) { eval(pf
+'closesize="'+ar
[++i
]+'"'); continue; }
720 if (ar
[i
]==TIMEOUT
) { eval(pf
+'timeout='+ar
[++i
]); continue; }
721 if (ar
[i
]==FUNCTION
) { if (pf
=='ol_') { if (typeof ar
[i
+1]!='number') { v
=ar
[++i
]; ol_function
=(typeof v
=='function' ? v
: null); }} else {fnMark
= 0; v
= null; if (typeof ar
[i
+1]!='number') v
= ar
[++i
]; opt_FUNCTION(v
); } continue; }
722 if (ar
[i
]==DELAY
) { eval(pf
+'delay='+ar
[++i
]); continue; }
723 if (ar
[i
]==HAUTO
) { eval(pf
+'hauto=('+pf
+'hauto == 0) ? 1 : 0'); continue; }
724 if (ar
[i
]==VAUTO
) { eval(pf
+'vauto=('+pf
+'vauto == 0) ? 1 : 0'); continue; }
725 if (ar
[i
]==CLOSECLICK
) { eval(pf
+'closeclick=('+pf
+'closeclick == 0) ? 1 : 0'); continue; }
726 if (ar
[i
]==WRAP
) { eval(pf
+'wrap=('+pf
+'wrap == 0) ? 1 : 0'); continue; }
727 if (ar
[i
]==FOLLOWMOUSE
) { eval(pf
+'followmouse=('+pf
+'followmouse == 1) ? 0 : 1'); continue; }
728 if (ar
[i
]==MOUSEOFF
) { eval(pf
+'mouseoff=('+pf
+'mouseoff==0) ? 1 : 0'); v
=ar
[i
+1]; if (pf
!= 'ol_' && eval(pf
+'mouseoff') && typeof v
== 'number' && (v
< pmStart
|| v
> pmUpper
)) olHideDelay
=ar
[++i
]; continue; }
729 if (ar
[i
]==CLOSETITLE
) { eval(pf
+"closetitle='"+escSglQuote(ar
[++i
])+"'"); continue; }
730 if (ar
[i
]==CSSOFF
||ar
[i
]==CSSCLASS
) { eval(pf
+'css='+ar
[i
]); continue; }
731 if (ar
[i
]==COMPATMODE
) { eval(pf
+'compatmode=('+pf
+'compatmode==0) ? 1 : 0'); continue; }
732 if (ar
[i
]==FGCLASS
) { eval(pf
+'fgclass="'+ar
[++i
]+'"'); continue; }
733 if (ar
[i
]==BGCLASS
) { eval(pf
+'bgclass="'+ar
[++i
]+'"'); continue; }
734 if (ar
[i
]==TEXTFONTCLASS
) { eval(pf
+'textfontclass="'+ar
[++i
]+'"'); continue; }
735 if (ar
[i
]==CAPTIONFONTCLASS
) { eval(pf
+'captionfontclass="'+ar
[++i
]+'"'); continue; }
736 if (ar
[i
]==CLOSEFONTCLASS
) { eval(pf
+'closefontclass="'+ar
[++i
]+'"'); continue; }
737 i
= parseCmdLine(pf
, i
, ar
);
741 if (fnMark
&& o3_function
) o3_text
= o3_function();
743 if ((pf
== 'o3_') && o3_wrap
) {
746 var tReg
=/<.*\n*>/ig;
747 if (!tReg
.test(o3_text
)) o3_text
= o3_text
.replace(/[ ]+/g, ' ');
748 if (!tReg
.test(o3_cap
))o3_cap
= o3_cap
.replace(/[ ]+/g, ' ');
750 if ((pf
== 'o3_') && o3_sticky
) {
751 if (!o3_close
&& (o3_frame
!= ol_frame
)) o3_close
= ol_close
;
752 if (o3_mouseoff
&& (o3_frame
== ol_frame
)) opt_NOCLOSE(' ');
762 function layerWrite(txt
) {
765 var lyr
= o3_frame
.document
.layers
['overDiv'].document
768 } else if (typeof over
.innerHTML
!= 'undefined') {
769 if (olIe5
&& isMac
) over
.innerHTML
= '';
770 over
.innerHTML
= txt
;
772 range
= o3_frame
.document
.createRange();
773 range
.setStartAfter(over
);
774 domfrag
= range
.createContextualFragment(txt
);
776 while (over
.hasChildNodes()) {
777 over
.removeChild(over
.lastChild
);
780 over
.appendChild(domfrag
);
784 // Make an object visible
785 function showObject(obj
) {
786 runHook("showObject", FBEFORE
);
788 var theObj
=(olNs4
? obj
: obj
.style
);
789 theObj
.visibility
= 'visible';
791 runHook("showObject", FAFTER
);
795 function hideObject(obj
) {
796 runHook("hideObject", FBEFORE
);
798 var theObj
=(olNs4
? obj
: obj
.style
);
799 if (olNs6
&& olShowId
>0) { clearTimeout(olShowId
); olShowId
=0; }
800 theObj
.visibility
= 'hidden';
801 theObj
.top
=theObj
.left
=-10000 + (!olNs4
? 'px' : 0);
803 if (o3_timerid
> 0) clearTimeout(o3_timerid
);
804 if (o3_delayid
> 0) clearTimeout(o3_delayid
);
810 if (obj
.onmouseout
|| obj
.onmouseover
) {
811 if (olNs4
) obj
.releaseEvents(Event
.MOUSEOUT
|| Event
.MOUSEOVER
);
812 obj
.onmouseout
= obj
.onmouseover
= null;
815 runHook("hideObject", FAFTER
);
819 function repositionTo(obj
, xL
, yL
) {
820 var theObj
=(olNs4
? obj
: obj
.style
);
821 theObj
.left
= xL
+ (!olNs4
? 'px' : 0);
822 theObj
.top
= yL
+ (!olNs4
? 'px' : 0);
825 // Check position of cursor relative to overDiv DIVision; mouseOut function
826 function cursorOff() {
827 var left
= parseInt(over
.style
.left
);
828 var top
= parseInt(over
.style
.top
);
829 var right
= left
+ (over
.offsetWidth
>= parseInt(o3_width
) ? over
.offsetWidth
: parseInt(o3_width
));
830 var bottom
= top
+ (over
.offsetHeight
>= o3_aboveheight
? over
.offsetHeight
: o3_aboveheight
);
832 if (o3_x
< left
|| o3_x
> right
|| o3_y
< top
|| o3_y
> bottom
) return true;
842 // Calls callme or the default function.
843 function opt_FUNCTION(callme
) {
844 o3_text
= (callme
? (typeof callme
=='string' ? (/.+\(.*\)/.test(callme
) ? eval(callme
) : callme
) : callme()) : (o3_function
? o3_function() : 'No Function'));
850 function opt_NOCLOSE(unused
) {
851 if (!unused
) o3_close
= "";
854 over
.captureEvents(Event
.MOUSEOUT
|| Event
.MOUSEOVER
);
855 over
.onmouseover
= function () { if (o3_timerid
> 0) { clearTimeout(o3_timerid
); o3_timerid
= 0; } }
856 over
.onmouseout
= function (e
) { if (olHideDelay
) hideDelay(olHideDelay
); else cClick(e
); }
858 over
.onmouseover
= function () {hoveringSwitch
= true; if (o3_timerid
> 0) { clearTimeout(o3_timerid
); o3_timerid
=0; } }
864 // Function to scan command line arguments for multiples
865 function opt_MULTIPLEARGS(i
, args
, parameter
) {
866 var k
=i
, re
, pV
, str
='';
868 for(k
=i
; k
<args
.length
; k
++) {
869 if(typeof args
[k
] == 'number' && args
[k
]>pmStart
) break;
870 str
+= args
[k
] + ',';
872 if (str
) str
= str
.substring(0,--str
.length
);
874 k
--; // reduce by one so the for loop this is in works correctly
875 pV
=(olNs4
&& /cellpad/i.test(parameter
)) ? str
.split(',')[0] : str
;
876 eval(parameter
+ '="' + pV
+ '"');
881 // Remove in texts when done.
882 function nbspCleanup() {
884 o3_text
= o3_text
.replace(/\ /g, ' ');
885 o3_cap
= o3_cap
.replace(/\ /g, ' ');
889 // Escape embedded single quotes in text strings
890 function escSglQuote(str
) {
891 return str
.toString().replace(/'/g,"\\'");
894 // Onload handler for window onload event
895 function OLonLoad_handler(e
) {
896 var re
= /\w+\(.*\)[;\s]+/g, olre
= /overlib\(|nd\(|cClick\(/, fn
, l
, i
;
898 if(!olLoaded
) olLoaded
=1;
900 // Remove it for Gecko based browsers
901 if(window
.removeEventListener
&& e
.eventPhase
== 3) window
.removeEventListener("load",OLonLoad_handler
,false);
902 else if(window
.detachEvent
) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()
903 window
.detachEvent("onload",OLonLoad_handler
);
904 var fN
= document
.body
.getAttribute('onload');
906 fN
=fN
.toString().match(re
);
907 if (fN
&& fN
.length
) {
908 for (i
=0; i
<fN
.length
; i
++) {
909 if (/anonymous/.test(fN
[i
])) continue;
910 while((l
=fN
[i
].search(/\)[;\s]+/)) != -1) {
911 fn
=fN
[i
].substring(0,l
+1);
912 fN
[i
] = fN
[i
].substring(l
+2);
913 if (olre
.test(fn
)) eval(fn
);
921 // Wraps strings in Layer Generation Functions with the correct tags
922 // endWrap true(if end tag) or false if start tag
923 // fontSizeStr - font size string such as '1' or '10px'
924 // whichString is being wrapped -- 'text', 'caption', or 'close'
925 function wrapStr(endWrap
,fontSizeStr
,whichString
) {
926 var fontStr
, fontColor
, isClose
=((whichString
=='close') ? 1 : 0), hasDims
=/[%\-a-z]+$/.test(fontSizeStr
);
927 fontSizeStr
= (olNs4
) ? (!hasDims
? fontSizeStr
: '1') : fontSizeStr
;
928 if (endWrap
) return (hasDims
&&!olNs4
) ? (isClose
? '</span>' : '</div>') : '</font>';
930 fontStr
='o3_'+whichString
+'font';
931 fontColor
='o3_'+((whichString
=='caption')? 'cap' : whichString
)+'color';
932 return (hasDims
&&!olNs4
) ? (isClose
? '<span style="font-family: '+quoteMultiNameFonts(eval(fontStr
))+'; color: '+eval(fontColor
)+'; font-size: '+fontSizeStr
+';">' : '<div style="font-family: '+quoteMultiNameFonts(eval(fontStr
))+'; color: '+eval(fontColor
)+'; font-size: '+fontSizeStr
+';">') : '<font face="'+eval(fontStr
)+'" color="'+eval(fontColor
)+'" size="'+(parseInt(fontSizeStr
)>7 ? '7' : fontSizeStr
)+'">';
936 // Quotes Multi word font names; needed for CSS Standards adherence in font-family
937 function quoteMultiNameFonts(theFont
) {
938 var v
, pM
=theFont
.split(',');
939 for (var i
=0; i
<pM
.length
; i
++) {
941 v
=v
.replace(/^\s+/,'').replace(/\s+$/,'');
942 if(/\s/.test(v
) && !/['"]/.test(v
)) {
950 // dummy function which will be overridden
951 function isExclusive(args
) {
955 // function will delay close by time milliseconds
956 function hideDelay(time
) {
957 if (time
&&!o3_delay
) {
958 if (o3_timerid
> 0) clearTimeout(o3_timerid
);
960 o3_timerid
=setTimeout("cClick()",(o3_timeout
=time
));
964 // Was originally in the placeLayer() routine; separated out for future ease
965 function horizontalPlacement(browserWidth
, horizontalScrollAmount
, widthFix
) {
966 var placeX
, iwidth
=browserWidth
, winoffset
=horizontalScrollAmount
;
967 var parsedWidth
= parseInt(o3_width
);
969 if (o3_fixx
> -1 || o3_relx
!= null) {
971 placeX
=(o3_relx
!= null ? ( o3_relx
< 0 ? winoffset
+o3_relx
+ iwidth
- parsedWidth
- widthFix
: winoffset
+o3_relx
) : o3_fixx
);
973 // If HAUTO, decide what to use.
975 if ((o3_x
- winoffset
) > (iwidth
/ 2)) {
983 if (o3_hpos
== CENTER
) { // Center
984 placeX
= o3_x
+o3_offsetx
-(parsedWidth
/2);
986 if (placeX
< winoffset
) placeX
= winoffset
;
989 if (o3_hpos
== RIGHT
) { // Right
990 placeX
= o3_x
+o3_offsetx
;
992 if ((placeX
+parsedWidth
) > (winoffset
+iwidth
- widthFix
)) {
993 placeX
= iwidth
+winoffset
- parsedWidth
- widthFix
;
994 if (placeX
< 0) placeX
= 0;
997 if (o3_hpos
== LEFT
) { // Left
998 placeX
= o3_x
-o3_offsetx
-parsedWidth
;
999 if (placeX
< winoffset
) placeX
= winoffset
;
1004 var snapping
= placeX
% o3_snapx
;
1006 if (o3_hpos
== LEFT
) {
1007 placeX
= placeX
- (o3_snapx
+snapping
);
1010 placeX
= placeX
+(o3_snapx
- snapping
);
1013 if (placeX
< winoffset
) placeX
= winoffset
;
1020 // was originally in the placeLayer() routine; separated out for future ease
1021 function verticalPlacement(browserHeight
,verticalScrollAmount
) {
1022 var placeY
, iheight
=browserHeight
, scrolloffset
=verticalScrollAmount
;
1023 var parsedHeight
=(o3_aboveheight
? parseInt(o3_aboveheight
) : (olNs4
? over
.clip
.height
: over
.offsetHeight
));
1025 if (o3_fixy
> -1 || o3_rely
!= null) {
1027 placeY
=(o3_rely
!= null ? (o3_rely
< 0 ? scrolloffset
+o3_rely
+iheight
- parsedHeight
: scrolloffset
+o3_rely
) : o3_fixy
);
1029 // If VAUTO, decide what to use.
1030 if (o3_vauto
== 1) {
1031 if ((o3_y
- scrolloffset
) > (iheight
/ 2) && o3_vpos
== BELOW
&& (o3_y
+ parsedHeight
+ o3_offsety
- (scrolloffset
+ iheight
) > 0)) {
1033 } else if (o3_vpos
== ABOVE
&& (o3_y
- (parsedHeight
+ o3_offsety
) - scrolloffset
< 0)) {
1039 if (o3_vpos
== ABOVE
) {
1040 if (o3_aboveheight
== 0) o3_aboveheight
= parsedHeight
;
1042 placeY
= o3_y
- (o3_aboveheight
+o3_offsety
);
1043 if (placeY
< scrolloffset
) placeY
= scrolloffset
;
1046 placeY
= o3_y
+o3_offsety
;
1051 var snapping
= placeY
% o3_snapy
;
1053 if (o3_aboveheight
> 0 && o3_vpos
== ABOVE
) {
1054 placeY
= placeY
- (o3_snapy
+snapping
);
1056 placeY
= placeY
+(o3_snapy
- snapping
);
1059 if (placeY
< scrolloffset
) placeY
= scrolloffset
;
1066 // checks positioning flags
1067 function checkPositionFlags() {
1068 if (olHautoFlag
) olHautoFlag
= o3_hauto
=0;
1069 if (olVautoFlag
) olVautoFlag
= o3_vauto
=0;
1073 // get Browser window width
1074 function windowWidth() {
1076 if (o3_frame
.innerWidth
) w
=o3_frame
.innerWidth
;
1077 else if (eval('o3_frame.'+docRoot
)&&eval("typeof o3_frame."+docRoot
+".clientWidth=='number'")&&eval('o3_frame.'+docRoot
+'.clientWidth'))
1078 w
=eval('o3_frame.'+docRoot
+'.clientWidth');
1082 // create the div container for popup content if it doesn't exist
1083 function createDivContainer(id
,frm
,zValue
) {
1084 id
= (id
|| 'overDiv'), frm
= (frm
|| o3_frame
), zValue
= (zValue
|| 1000);
1085 var objRef
, divContainer
= layerReference(id
);
1087 if (divContainer
== null) {
1089 divContainer
= frm
.document
.layers
[id
] = new Layer(window
.innerWidth
, frm
);
1090 objRef
= divContainer
;
1092 var body
= (olIe4
? frm
.document
.all
.tags('BODY')[0] : frm
.document
.getElementsByTagName("BODY")[0]);
1093 if (olIe4
&&!document
.getElementById
) {
1094 body
.insertAdjacentHTML("beforeEnd",'<div id="'+id
+'"></div>');
1095 divContainer
=layerReference(id
);
1097 divContainer
= frm
.document
.createElement("DIV");
1098 divContainer
.id
= id
;
1099 body
.appendChild(divContainer
);
1101 objRef
= divContainer
.style
;
1105 position
= 'absolute';
1106 visibility
= 'hidden';
1111 return divContainer
;
1114 // get reference to a layer with ID=id
1115 function layerReference(id
) {
1116 return (olNs4
? o3_frame
.document
.layers
[id
] : (document
.all
? o3_frame
.document
.all
[id
] : o3_frame
.document
.getElementById(id
)));
1119 // PLUGIN ACTIVATION FUNCTIONS
1122 // Runs plugin functions to set runtime variables.
1123 function setRunTimeVariables(){
1124 if (typeof runTime
!= 'undefined' && runTime
.length
) {
1125 for (var k
= 0; k
< runTime
.length
; k
++) {
1131 // Runs plugin functions to parse commands.
1132 function parseCmdLine(pf
, i
, args
) {
1133 if (typeof cmdLine
!= 'undefined' && cmdLine
.length
) {
1134 for (var k
= 0; k
< cmdLine
.length
; k
++) {
1135 var j
= cmdLine
[k
](pf
, i
, args
);
1146 // Runs plugin functions to do things after parse.
1147 function postParseChecks(){
1148 if (typeof postParse
!= 'undefined' && postParse
.length
) {
1149 for (var k
= 0; k
< postParse
.length
; k
++) {
1150 if (postParse
[k
]()) continue;
1151 return false; // end now since have an error
1159 // PLUGIN REGISTRATION FUNCTIONS
1162 // Registers commands and creates constants.
1163 function registerCommands(cmdStr
) {
1164 if (typeof cmdStr
!='string') return;
1166 var pM
= cmdStr
.split(',');
1167 pms
= pms
.concat(pM
);
1169 for (var i
= 0; i
< pM
.length
; i
++) {
1170 eval(pM
[i
].toUpperCase()+'='+pmCount
++);
1174 // Registers no-parameter commands
1175 function registerNoParameterCommands(cmdStr
) {
1176 if (!cmdStr
&& typeof cmdStr
!='string') return;
1177 pmt
=(!pmt
) ? cmdStr
: pmt
+ ',' + cmdStr
;
1180 // Register a function to hook at a certain point.
1181 function registerHook(fnHookTo
, fnRef
, hookType
, optPm
) {
1182 var hookPt
, last
= typeof optPm
;
1184 if (fnHookTo
== 'plgIn'||fnHookTo
== 'postParse') return;
1185 if (typeof hookPts
== 'undefined') hookPts
= new Array();
1186 if (typeof hookPts
[fnHookTo
] == 'undefined') hookPts
[fnHookTo
] = new FunctionReference();
1188 hookPt
= hookPts
[fnHookTo
];
1190 if (hookType
!= null) {
1191 if (hookType
== FREPLACE
) {
1192 hookPt
.ovload
= fnRef
; // replace normal overlib routine
1193 if (fnHookTo
.indexOf('ol_content_') > -1) hookPt
.alt
[pms
[CSSOFF
-1-pmStart
]]=fnRef
;
1195 } else if (hookType
== FBEFORE
|| hookType
== FAFTER
) {
1196 var hookPt
=(hookType
== 1 ? hookPt
.before
: hookPt
.after
);
1198 if (typeof fnRef
== 'object') {
1199 hookPt
= hookPt
.concat(fnRef
);
1201 hookPt
[hookPt
.length
++] = fnRef
;
1204 if (optPm
) hookPt
= reOrder(hookPt
, fnRef
, optPm
);
1206 } else if (hookType
== FALTERNATE
) {
1207 if (last
=='number') hookPt
.alt
[pms
[optPm
-1-pmStart
]] = fnRef
;
1208 } else if (hookType
== FCHAIN
) {
1209 hookPt
= hookPt
.chain
;
1210 if (typeof fnRef
=='object') hookPt
=hookPt
.concat(fnRef
); // add other functions
1211 else hookPt
[hookPt
.length
++]=fnRef
;
1218 // Register a function that will set runtime variables.
1219 function registerRunTimeFunction(fn
) {
1220 if (isFunction(fn
)) {
1221 if (typeof runTime
== 'undefined') runTime
= new Array();
1222 if (typeof fn
== 'object') {
1223 runTime
= runTime
.concat(fn
);
1225 runTime
[runTime
.length
++] = fn
;
1230 // Register a function that will handle command parsing.
1231 function registerCmdLineFunction(fn
){
1232 if (isFunction(fn
)) {
1233 if (typeof cmdLine
== 'undefined') cmdLine
= new Array();
1234 if (typeof fn
== 'object') {
1235 cmdLine
= cmdLine
.concat(fn
);
1237 cmdLine
[cmdLine
.length
++] = fn
;
1242 // Register a function that does things after command parsing.
1243 function registerPostParseFunction(fn
){
1244 if (isFunction(fn
)) {
1245 if (typeof postParse
== 'undefined') postParse
= new Array();
1246 if (typeof fn
== 'object') {
1247 postParse
= postParse
.concat(fn
);
1249 postParse
[postParse
.length
++] = fn
;
1255 // PLUGIN REGISTRATION FUNCTIONS
1258 // Runs any hooks registered.
1259 function runHook(fnHookTo
, hookType
) {
1260 var l
= hookPts
[fnHookTo
], k
, rtnVal
, optPm
, arS
, ar
= runHook
.arguments
;
1262 if (hookType
== FREPLACE
) {
1263 arS
= argToString(ar
, 2);
1265 if (typeof l
== 'undefined' || !(l
= l
.ovload
)) return eval(fnHookTo
+'('+arS
+')');
1266 else return eval('l('+arS
+')');
1268 } else if (hookType
== FBEFORE
|| hookType
== FAFTER
) {
1269 if (typeof l
== 'undefined') return;
1270 l
=(hookType
== 1 ? l
.before
: l
.after
);
1272 if (!l
.length
) return;
1274 arS
= argToString(ar
, 2);
1275 for (var k
= 0; k
< l
.length
; k
++) eval('l[k]('+arS
+')');
1277 } else if (hookType
== FALTERNATE
) {
1279 arS
= argToString(ar
, 3);
1281 if (typeof l
== 'undefined' || (l
= l
.alt
[pms
[optPm
-1-pmStart
]]) == 'undefined') {
1282 return eval(fnHookTo
+'('+arS
+')');
1284 return eval('l('+arS
+')');
1286 } else if (hookType
== FCHAIN
) {
1287 arS
=argToString(ar
,2);
1290 for (k
=l
.length
; k
> 0; k
--) if((rtnVal
=eval('l[k-1]('+arS
+')'))!=void(0)) return rtnVal
;
1295 // UTILITY FUNCTIONS
1298 // Checks if something is a function.
1299 function isFunction(fnRef
) {
1302 if (typeof fnRef
== 'object') {
1303 for (var i
= 0; i
< fnRef
.length
; i
++) {
1304 if (typeof fnRef
[i
]=='function') continue;
1308 } else if (typeof fnRef
!= 'function') {
1315 // Converts an array into an argument string for use in eval.
1316 function argToString(array
, strtInd
, argName
) {
1317 var jS
= strtInd
, aS
= '', ar
= array
;
1318 argName
=(argName
? argName
: 'ar');
1320 if (ar
.length
> jS
) {
1321 for (var k
= jS
; k
< ar
.length
; k
++) aS
+= argName
+'['+k
+'], ';
1322 aS
= aS
.substring(0, aS
.length
-2);
1328 // Places a hook in the correct position in a hook point.
1329 function reOrder(hookPt
, fnRef
, order
) {
1330 if (!order
|| typeof order
== 'undefined' || typeof order
== 'number') return;
1332 var newPt
= new Array(), match
;
1334 if (typeof order
=='function') {
1335 if (typeof fnRef
=='object') {
1336 newPt
= newPt
.concat(fnRef
);
1338 newPt
[newPt
.length
++]=fnRef
;
1341 for (var i
= 0; i
< hookPt
.length
; i
++) {
1343 if (typeof fnRef
== 'function' && hookPt
[i
] == fnRef
) {
1346 for(var j
= 0; j
< fnRef
.length
; j
++) if (hookPt
[i
] == fnRef
[j
]) {
1351 if (!match
) newPt
[newPt
.length
++] = hookPt
[i
];
1354 newPt
[newPt
.length
++] = order
;
1356 } else if (typeof order
== 'object') {
1357 if (typeof fnRef
== 'object') {
1358 newPt
= newPt
.concat(fnRef
);
1360 newPt
[newPt
.length
++] = fnRef
;
1363 for (var j
= 0; j
< hookPt
.length
; j
++) {
1365 if (typeof fnRef
== 'function' && hookPt
[j
] == fnRef
) {
1368 for (var i
= 0; i
< fnRef
.length
; i
++) if (hookPt
[j
] == fnRef
[i
]) {
1373 if (!match
) newPt
[newPt
.length
++]=hookPt
[j
];
1376 for (i
= 0; i
< newPt
.length
; i
++) hookPt
[i
] = newPt
[i
];
1379 for (var j
= 0; j
< hookPt
.length
; j
++) {
1381 for (var i
= 0; i
< order
.length
; i
++) {
1382 if (hookPt
[j
] == order
[i
]) {
1387 if (!match
) newPt
[newPt
.length
++] = hookPt
[j
];
1389 newPt
= newPt
.concat(order
);
1392 for(i
= 0; i
< newPt
.length
; i
++) hookPt
[i
] = newPt
[i
];
1398 // OBJECT CONSTRUCTORS
1401 // Object for handling hooks.
1402 function FunctionReference() {
1404 this.before
= new Array();
1405 this.after
= new Array();
1406 this.alt
= new Array();
1407 this.chain
= new Array();
1410 // Object for simple access to the overLIB version used.
1411 // Examples: simpleversion:351 major:3 minor:5 revision:1
1412 function Info(version
, prerelease
) {
1413 this.version
= version
;
1414 this.prerelease
= prerelease
;
1416 this.simpleversion
= Math
.round(this.version
*100);
1417 this.major
= parseInt(this.simpleversion
/ 100);
1418 this.minor
= parseInt(this.simpleversion
/ 10) - this.major
* 10;
1419 this.revision
= parseInt(this.simpleversion
) - this.major
* 100 - this.minor
* 10;
1423 // checks for Core Version required
1424 function meets(reqdVersion
) {
1425 return (!reqdVersion
) ? false : this.simpleversion
>= Math
.round(100*parseFloat(reqdVersion
));
1430 // STANDARD REGISTRATIONS
1432 registerHook("ol_content_simple", ol_content_simple
, FALTERNATE
, CSSOFF
);
1433 registerHook("ol_content_caption", ol_content_caption
, FALTERNATE
, CSSOFF
);
1434 registerHook("ol_content_background", ol_content_background
, FALTERNATE
, CSSOFF
);
1435 registerHook("ol_content_simple", ol_content_simple
, FALTERNATE
, CSSCLASS
);
1436 registerHook("ol_content_caption", ol_content_caption
, FALTERNATE
, CSSCLASS
);
1437 registerHook("ol_content_background", ol_content_background
, FALTERNATE
, CSSCLASS
);
1438 registerPostParseFunction(checkPositionFlags
);
1439 registerHook("hideObject", nbspCleanup
, FAFTER
);
1440 registerHook("horizontalPlacement", horizontalPlacement
, FCHAIN
);
1441 registerHook("verticalPlacement", verticalPlacement
, FCHAIN
);
1442 if (olNs4
||(olIe5
&&isMac
)||olKq
) olLoaded
=1;
1443 registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');