2 //\ overLIB 4.21 - You may not remove or change this notice.
\r
3 //\ Copyright Erik Bosrup 1998-2004. All rights reserved.
\r
5 //\ Contributors are listed on the homepage.
\r
6 //\ This file might be old, always check for the latest version at:
\r
7 //\ http://www.bosrup.com/web/overlib/
\r
9 //\ Please read the license agreement (available through the link above)
\r
10 //\ before using overLIB. Direct any licensing questions to erik@bosrup.com.
\r
12 //\ Do not sell this as your own work or remove this copyright notice.
\r
13 //\ For full details on copying or changing this script please read the
\r
14 //\ license agreement at the link above. Please give credit on sites that
\r
15 //\ use overLIB and submit changes of the script so other people can use
\r
17 // $Revision: 1.1 $ $Date: 2006/05/29 16:38:21 $
\r
23 // Ignore these lines, configuration is below.
\r
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.21', 1);
\r
26 var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4;
\r
27 var olHideForm=0; // parameter for hiding SELECT and ActiveX elements in IE5.5+
\r
28 var olHautoFlag = 0; // flags for over-riding VAUTO and HAUTO if corresponding
\r
29 var olVautoFlag = 0; // positioning commands are used on the command line
\r
30 var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array();
\r
32 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');
\r
35 // DEFAULT CONFIGURATION
\r
36 // Settings you want everywhere are set here. All of this can also be
\r
37 // changed on your html page or through an overLIB call.
\r
39 if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#99BBDD";
\r
40 if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#7799BB";
\r
41 if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
\r
42 if (typeof ol_capcolor=='undefined') var ol_capcolor="#000033";
\r
43 if (typeof ol_closecolor=='undefined') var ol_closecolor="#000000";
\r
44 if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
\r
45 if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
\r
46 if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
\r
47 if (typeof ol_textsize=='undefined') var ol_textsize="1";
\r
48 if (typeof ol_captionsize=='undefined') var ol_captionsize="1";
\r
49 if (typeof ol_closesize=='undefined') var ol_closesize="1";
\r
50 if (typeof ol_width=='undefined') var ol_width="200";
\r
51 if (typeof ol_border=='undefined') var ol_border="1";
\r
52 if (typeof ol_cellpad=='undefined') var ol_cellpad=2;
\r
53 if (typeof ol_offsetx=='undefined') var ol_offsetx=10;
\r
54 if (typeof ol_offsety=='undefined') var ol_offsety=10;
\r
55 if (typeof ol_text=='undefined') var ol_text="Default Text";
\r
56 if (typeof ol_cap=='undefined') var ol_cap="";
\r
57 if (typeof ol_sticky=='undefined') var ol_sticky=0;
\r
58 if (typeof ol_background=='undefined') var ol_background="";
\r
59 if (typeof ol_close=='undefined') var ol_close="Close";
\r
60 if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT;
\r
61 if (typeof ol_status=='undefined') var ol_status="";
\r
62 if (typeof ol_autostatus=='undefined') var ol_autostatus=0;
\r
63 if (typeof ol_height=='undefined') var ol_height=-1;
\r
64 if (typeof ol_snapx=='undefined') var ol_snapx=0;
\r
65 if (typeof ol_snapy=='undefined') var ol_snapy=0;
\r
66 if (typeof ol_fixx=='undefined') var ol_fixx=-1;
\r
67 if (typeof ol_fixy=='undefined') var ol_fixy=-1;
\r
68 if (typeof ol_relx=='undefined') var ol_relx=null;
\r
69 if (typeof ol_rely=='undefined') var ol_rely=null;
\r
70 if (typeof ol_fgbackground=='undefined') var ol_fgbackground="";
\r
71 if (typeof ol_bgbackground=='undefined') var ol_bgbackground="";
\r
72 if (typeof ol_padxl=='undefined') var ol_padxl=1;
\r
73 if (typeof ol_padxr=='undefined') var ol_padxr=1;
\r
74 if (typeof ol_padyt=='undefined') var ol_padyt=1;
\r
75 if (typeof ol_padyb=='undefined') var ol_padyb=1;
\r
76 if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
\r
77 if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
\r
78 if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
\r
79 if (typeof ol_capicon=='undefined') var ol_capicon="";
\r
80 if (typeof ol_frame=='undefined') var ol_frame=self;
\r
81 if (typeof ol_timeout=='undefined') var ol_timeout=0;
\r
82 if (typeof ol_function=='undefined') var ol_function=null;
\r
83 if (typeof ol_delay=='undefined') var ol_delay=0;
\r
84 if (typeof ol_hauto=='undefined') var ol_hauto=0;
\r
85 if (typeof ol_vauto=='undefined') var ol_vauto=0;
\r
86 if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
\r
87 if (typeof ol_wrap=='undefined') var ol_wrap=0;
\r
88 if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
\r
89 if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
\r
90 if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
\r
91 if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
\r
92 if (typeof ol_css=='undefined') var ol_css=CSSOFF;
\r
93 if (typeof ol_fgclass=='undefined') var ol_fgclass="";
\r
94 if (typeof ol_bgclass=='undefined') var ol_bgclass="";
\r
95 if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
\r
96 if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";
\r
97 if (typeof ol_closefontclass=='undefined') var ol_closefontclass="";
\r
100 // ARRAY CONFIGURATION
\r
103 // You can use these arrays to store popup text here instead of in the html.
\r
104 if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1");
\r
105 if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1");
\r
108 // END OF CONFIGURATION
\r
109 // Don't change anything below this line, all configuration is above.
\r
119 // Runtime variables init. Don't change for config!
\r
123 var o3_background="";
\r
124 var o3_close="Close";
\r
130 var o3_textcolor="";
\r
131 var o3_capcolor="";
\r
132 var o3_closecolor="";
\r
137 var o3_autostatus=0;
\r
145 var o3_fgbackground="";
\r
146 var o3_bgbackground="";
\r
153 var o3_aboveheight=0;
\r
155 var o3_textfont="Verdana,Arial,Helvetica";
\r
156 var o3_captionfont="Verdana,Arial,Helvetica";
\r
157 var o3_closefont="Verdana,Arial,Helvetica";
\r
158 var o3_textsize="1";
\r
159 var o3_captionsize="1";
\r
160 var o3_closesize="1";
\r
164 var o3_allowmove=0;
\r
165 var o3_function=null;
\r
170 var o3_closeclick=0;
\r
172 var o3_followmouse=1;
\r
174 var o3_closetitle='';
\r
175 var o3_compatmode=0;
\r
179 var o3_textfontclass="";
\r
180 var o3_captionfontclass="";
\r
181 var o3_closefontclass="";
\r
183 // Display state variables
\r
186 var o3_showingsticky = 0;
\r
187 var o3_removecounter = 0;
\r
191 var fnRef, hoveringSwitch = false;
\r
194 // Decide browser version
\r
195 var isMac = (navigator.userAgent.indexOf("Mac") != -1);
\r
196 var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode); // Opera 7
\r
197 var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
\r
198 var olNs6 = (document.getElementById) ? true : false;
\r
199 var olKq = (olNs6 && /konqueror/i.test(navigator.userAgent));
\r
200 var olIe4 = (document.all) ? true : false;
\r
202 var olIe55 = false; // Added additional variable to identify IE5.5+
\r
203 var docRoot = 'document.body';
\r
205 // Resize fix for NS4.x to keep track of layer
\r
207 var oW = window.innerWidth;
\r
208 var oH = window.innerHeight;
\r
209 window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); }
\r
212 // Microsoft Stupidity Check(tm).
\r
214 var agent = navigator.userAgent;
\r
215 if (/MSIE/.test(agent)) {
\r
216 var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);
\r
219 olIe55=(versNum>=5.5&&!olOp) ? true : false;
\r
220 if (olNs6) olNs6=false;
\r
223 if (olNs6) olIe4 = false;
\r
226 // Check for compatability mode.
\r
227 if (document.compatMode && document.compatMode == 'CSS1Compat') {
\r
228 docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot);
\r
231 // Add window onload handlers to indicate when all modules have been loaded
\r
232 // For Netscape 6+ and Mozilla, uses addEventListener method on the window object
\r
233 // For IE it uses the attachEvent method of the window object and for Netscape 4.x
\r
234 // it sets the window.onload handler to the OLonload_handler function for Bubbling
\r
235 if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false);
\r
236 else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler);
\r
241 // PUBLIC FUNCTIONS
\r
244 // overlib(arg0,...,argN)
\r
245 // Loads parameters into global runtime variables.
\r
246 function overlib() {
\r
247 if (!olLoaded || isExclusive(overlib.arguments)) return true;
\r
248 if (olCheckMouseCapture) olMouseCapture();
\r
250 over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over;
\r
254 // Load defaults to runtime.
\r
258 o3_sticky=ol_sticky;
\r
259 o3_background=ol_background;
\r
262 o3_offsetx=ol_offsetx;
\r
263 o3_offsety=ol_offsety;
\r
264 o3_fgcolor=ol_fgcolor;
\r
265 o3_bgcolor=ol_bgcolor;
\r
266 o3_textcolor=ol_textcolor;
\r
267 o3_capcolor=ol_capcolor;
\r
268 o3_closecolor=ol_closecolor;
\r
270 o3_border=ol_border;
\r
271 o3_cellpad=ol_cellpad;
\r
272 o3_status=ol_status;
\r
273 o3_autostatus=ol_autostatus;
\r
274 o3_height=ol_height;
\r
281 o3_fgbackground=ol_fgbackground;
\r
282 o3_bgbackground=ol_bgbackground;
\r
287 o3_fullhtml=ol_fullhtml;
\r
289 o3_aboveheight=ol_aboveheight;
\r
290 o3_capicon=ol_capicon;
\r
291 o3_textfont=ol_textfont;
\r
292 o3_captionfont=ol_captionfont;
\r
293 o3_closefont=ol_closefont;
\r
294 o3_textsize=ol_textsize;
\r
295 o3_captionsize=ol_captionsize;
\r
296 o3_closesize=ol_closesize;
\r
297 o3_timeout=ol_timeout;
\r
298 o3_function=ol_function;
\r
302 o3_closeclick=ol_closeclick;
\r
304 o3_followmouse=ol_followmouse;
\r
305 o3_mouseoff=ol_mouseoff;
\r
306 o3_closetitle=ol_closetitle;
\r
308 o3_compatmode=ol_compatmode;
\r
309 o3_fgclass=ol_fgclass;
\r
310 o3_bgclass=ol_bgclass;
\r
311 o3_textfontclass=ol_textfontclass;
\r
312 o3_captionfontclass=ol_captionfontclass;
\r
313 o3_closefontclass=ol_closefontclass;
\r
315 setRunTimeVariables();
\r
319 // Special for frame support, over must be reset...
\r
320 o3_frame = ol_frame;
\r
322 if(!(over=createDivContainer())) return false;
\r
324 parseTokens('o3_', overlib.arguments);
\r
325 if (!postParseChecks()) return false;
\r
327 if (o3_delay == 0) {
\r
328 return runHook("olMain", FREPLACE);
\r
330 o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
\r
335 // Clears popups if appropriate
\r
336 function nd(time) {
\r
337 if (olLoaded && !isExclusive()) {
\r
338 hideDelay(time); // delay popup close if time specified
\r
340 if (o3_removecounter >= 1) { o3_showingsticky = 0 };
\r
342 if (o3_showingsticky == 0) {
\r
344 if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over);
\r
346 o3_removecounter++;
\r
353 // The Close onMouseOver function for stickies
\r
354 function cClick() {
\r
356 runHook("hideObject", FREPLACE, over);
\r
357 o3_showingsticky = 0;
\r
362 // Method for setting page specific defaults.
\r
363 function overlib_pagedefaults() {
\r
364 parseTokens('ol_', overlib_pagedefaults.arguments);
\r
369 // OVERLIB MAIN FUNCTION
\r
372 // This function decides what it is we want to display and how we want it done.
\r
373 function olMain() {
\r
374 var layerhtml, styleType;
\r
375 runHook("olMain", FBEFORE);
\r
377 if (o3_background!="" || o3_fullhtml) {
\r
378 // Use background instead of box.
\r
379 layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
\r
381 // They want a popup box.
\r
382 styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");
\r
384 // Prepare popup background
\r
385 if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
\r
386 if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);
\r
388 // Prepare popup colors
\r
389 if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
\r
390 if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);
\r
392 // Prepare popup height
\r
393 if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
\r
394 else o3_height = "";
\r
396 // Decide which kinda box.
\r
399 layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
\r
404 layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close);
\r
407 layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
\r
412 // We want it to stick!
\r
414 if (o3_timerid > 0) {
\r
415 clearTimeout(o3_timerid);
\r
418 o3_showingsticky = 1;
\r
419 o3_removecounter = 0;
\r
422 // Created a separate routine to generate the popup to make it easier
\r
423 // to implement a plugin capability
\r
424 if (!runHook("createPopup", FREPLACE, layerhtml)) return false;
\r
426 // Prepare status bar
\r
427 if (o3_autostatus > 0) {
\r
428 o3_status = o3_text;
\r
429 if (o3_autostatus > 1) o3_status = o3_cap;
\r
432 // When placing the layer the first time, even stickies may be moved.
\r
435 // Initiate a timer for timeout
\r
436 if (o3_timeout > 0) {
\r
437 if (o3_timerid > 0) clearTimeout(o3_timerid);
\r
438 o3_timerid = setTimeout("cClick()", o3_timeout);
\r
442 runHook("disp", FREPLACE, o3_status);
\r
443 runHook("olMain", FAFTER);
\r
445 return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
\r
449 // LAYER GENERATION FUNCTIONS
\r
451 // These functions just handle popup content with tags that should adhere to the W3C standards specification.
\r
453 // Makes simple table without caption
\r
454 function ol_content_simple(text) {
\r
455 var cpIsMultiple = /,/.test(o3_cellpad);
\r
456 var 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" '+((olNs4||!cpIsMultiple) ? '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+'">' : ((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize))+'</td></tr></table></td></tr></table>';
\r
458 set_background("");
\r
462 // Makes table with caption and optional close link
\r
463 function ol_content_caption(text,title,close) {
\r
464 var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad);
\r
465 var closing, closeevent;
\r
468 closeevent = "onmouseover";
\r
469 if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
\r
470 if (o3_capicon != "") {
\r
471 nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"';
\r
472 if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
\r
473 o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
\r
477 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>';
\r
478 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="2" 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" '+((olNs4||!cpIsMultiple) ? '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+'">' :((!olNs4&&cpIsMultiple) ? ' style="'+setCellPadStr(o3_cellpad)+'">' : '>'))+(o3_textfontclass ? '' : wrapStr(0,o3_textsize,'text'))+text+(o3_textfontclass ? '' : wrapStr(1,o3_textsize)) + '</td></tr></table></td></tr></table>';
\r
480 set_background("");
\r
484 // Sets the background picture,padding and lots more. :)
\r
485 function ol_content_background(text,picture,hasfullhtml) {
\r
489 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>';
\r
492 set_background(picture);
\r
496 // Loads a picture into the div.
\r
497 function set_background(pic) {
\r
500 over.background.src = null;
\r
501 } else if (over.style) {
\r
502 over.style.backgroundImage = "none";
\r
506 over.background.src = pic;
\r
507 } else if (over.style) {
\r
508 over.style.width=o3_width + 'px';
\r
509 over.style.backgroundImage = "url("+pic+")";
\r
515 // HANDLING FUNCTIONS
\r
519 // Displays the popup
\r
520 function disp(statustext) {
\r
521 runHook("disp", FBEFORE);
\r
523 if (o3_allowmove == 0) {
\r
524 runHook("placeLayer", FREPLACE);
\r
525 (olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
\r
526 o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
\r
529 runHook("disp", FAFTER);
\r
531 if (statustext != "") self.status = statustext;
\r
534 // Creates the actual popup structure
\r
535 function createPopup(lyrContent){
\r
536 runHook("createPopup", FBEFORE);
\r
539 var wd,ww,theObj = (olNs4 ? over : over.style);
\r
540 theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
\r
541 layerWrite(lyrContent);
\r
542 wd = (olNs4 ? over.clip.width : over.offsetWidth);
\r
543 if (wd > (ww=windowWidth())) {
\r
544 lyrContent=lyrContent.replace(/\ /g, ' ');
\r
550 layerWrite(lyrContent);
\r
552 // Have to set o3_width for placeLayer() routine if o3_wrap is turned on
\r
553 if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);
\r
555 runHook("createPopup", FAFTER, lyrContent);
\r
560 // Decides where we want the popup.
\r
561 function placeLayer() {
\r
562 var placeX, placeY, widthFix = 0;
\r
564 // HORIZONTAL PLACEMENT, re-arranged to work in Safari
\r
565 if (o3_frame.innerWidth) widthFix=18;
\r
566 iwidth = windowWidth();
\r
568 // Horizontal scroll offset
\r
569 winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset;
\r
571 placeX = runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix);
\r
573 // VERTICAL PLACEMENT, re-arranged to work in Safari
\r
574 if (o3_frame.innerHeight) {
\r
575 iheight=o3_frame.innerHeight;
\r
576 } else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')) {
\r
577 iheight=eval('o3_frame.'+docRoot+'.clientHeight');
\r
580 // Vertical scroll offset
\r
581 scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset;
\r
582 placeY = runHook('verticalPlacement',FCHAIN,iheight,scrolloffset);
\r
584 // Actually move the object.
\r
585 repositionTo(over, placeX, placeY);
\r
589 function olMouseMove(e) {
\r
590 var e = (e) ? e : event;
\r
595 } else if (e.clientX) {
\r
596 o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft');
\r
597 o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop');
\r
600 if (o3_allowmove == 1) runHook("placeLayer", FREPLACE);
\r
602 // MouseOut handler
\r
603 if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) {
\r
604 (olHideDelay ? hideDelay(olHideDelay) : cClick());
\r
605 hoveringSwitch = !hoveringSwitch;
\r
609 // Fake function for 3.0 users.
\r
610 function no_overlib() { return ver3fix; }
\r
612 // Capture the mouse and chain other scripts.
\r
613 function olMouseCapture() {
\r
614 capExtent = document;
\r
615 var fN, str = '', l, k, f, wMv, sS, mseHandler = olMouseMove;
\r
616 var re = /function[ ]*(\w*)\(/;
\r
618 wMv = (!olIe4 && window.onmousemove);
\r
619 if (document.onmousemove || wMv) {
\r
620 if (wMv) capExtent = window;
\r
621 f = capExtent.onmousemove.toString();
\r
625 } else if (fN[1] == 'anonymous' || fN[1] == 'olMouseMove' || (wMv && fN[1] == 'onmousemove')) {
\r
626 if (!olOp && wMv) {
\r
627 l = f.indexOf('{')+1;
\r
628 k = f.lastIndexOf('}');
\r
629 sS = f.substring(l,k);
\r
630 if ((l = sS.indexOf('(')) != -1) {
\r
631 sS = sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,'');
\r
632 if (eval("typeof " + sS + " == 'undefined'")) window.onmousemove = null;
\r
633 else str = sS + '(e);';
\r
637 olCheckMouseCapture = false;
\r
641 if (fN[1]) str = fN[1]+'(e); ';
\r
643 l = f.indexOf('{')+1;
\r
644 k = f.lastIndexOf('}');
\r
645 str = f.substring(l,k) + '\n';
\r
648 str += 'olMouseMove(e); ';
\r
649 mseHandler = new Function('e', str);
\r
652 capExtent.onmousemove = mseHandler;
\r
653 if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE);
\r
657 // PARSING FUNCTIONS
\r
660 // Does the actual command parsing.
\r
661 function parseTokens(pf, ar) {
\r
662 // What the next argument is expected to be.
\r
663 var v, i, mode=-1, par = (pf != 'ol_');
\r
664 var fnMark = (par && !ar.length ? 1 : 0);
\r
666 for (i = 0; i < ar.length; i++) {
\r
668 // Arg is maintext,unless its a number between pmStart and pmUpper
\r
669 // then its a command.
\r
670 if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) {
\r
671 fnMark = (par ? 1 : 0);
\r
672 i--; // backup one so that the next block can parse it
\r
676 ol_text = ar[i].toString();
\r
679 o3_text=ar[i].toString();
\r
684 // Note: NS4 doesn't like switch cases with vars.
\r
685 if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; }
\r
686 if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; }
\r
687 if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; }
\r
688 if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; }
\r
689 if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
\r
690 if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
\r
691 if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
\r
692 if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; }
\r
693 if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
\r
694 if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
\r
695 if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
\r
696 if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
\r
697 if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
\r
698 if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
\r
699 if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
\r
700 if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
\r
701 if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
\r
702 if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
\r
703 if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
\r
704 if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
\r
705 if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
\r
706 if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
\r
707 if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
\r
708 if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
\r
709 if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }
\r
710 if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; }
\r
711 if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; }
\r
712 if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; }
\r
713 if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; }
\r
714 if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; }
\r
715 if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; }
\r
716 if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; }
\r
717 if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; }
\r
718 if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; }
\r
719 if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); if (pf!='ol_') olVautoFlag=1; continue; }
\r
720 if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; }
\r
721 if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; }
\r
722 if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
\r
723 if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
\r
724 if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
\r
725 if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
\r
726 if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
\r
727 if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
\r
728 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; }
\r
729 if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
\r
730 if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
\r
731 if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
\r
732 if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
\r
733 if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
\r
734 if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
\r
735 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; }
\r
736 if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
\r
737 if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
\r
738 if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
\r
739 if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
\r
740 if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
\r
741 if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
\r
742 if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }
\r
743 if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; }
\r
744 i = parseCmdLine(pf, i, ar);
\r
748 if (fnMark && o3_function) o3_text = o3_function();
\r
750 if ((pf == 'o3_') && o3_wrap) {
\r
753 var tReg=/<.*\n*>/ig;
\r
754 if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, ' ');
\r
755 if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, ' ');
\r
757 if ((pf == 'o3_') && o3_sticky) {
\r
758 if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close;
\r
759 if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' ');
\r
768 // Writes to a layer
\r
769 function layerWrite(txt) {
\r
772 var lyr = o3_frame.document.layers['overDiv'].document
\r
775 } else if (typeof over.innerHTML != 'undefined') {
\r
776 if (olIe5 && isMac) over.innerHTML = '';
\r
777 over.innerHTML = txt;
\r
779 range = o3_frame.document.createRange();
\r
780 range.setStartAfter(over);
\r
781 domfrag = range.createContextualFragment(txt);
\r
783 while (over.hasChildNodes()) {
\r
784 over.removeChild(over.lastChild);
\r
787 over.appendChild(domfrag);
\r
791 // Make an object visible
\r
792 function showObject(obj) {
\r
793 runHook("showObject", FBEFORE);
\r
795 var theObj=(olNs4 ? obj : obj.style);
\r
796 theObj.visibility = 'visible';
\r
798 runHook("showObject", FAFTER);
\r
802 function hideObject(obj) {
\r
803 runHook("hideObject", FBEFORE);
\r
805 var theObj=(olNs4 ? obj : obj.style);
\r
806 if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
\r
807 theObj.visibility = 'hidden';
\r
808 theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
\r
810 if (o3_timerid > 0) clearTimeout(o3_timerid);
\r
811 if (o3_delayid > 0) clearTimeout(o3_delayid);
\r
817 if (obj.onmouseout||obj.onmouseover) {
\r
818 if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
\r
819 obj.onmouseout = obj.onmouseover = null;
\r
822 runHook("hideObject", FAFTER);
\r
826 function repositionTo(obj, xL, yL) {
\r
827 var theObj=(olNs4 ? obj : obj.style);
\r
828 theObj.left = xL + (!olNs4 ? 'px' : 0);
\r
829 theObj.top = yL + (!olNs4 ? 'px' : 0);
\r
832 // Check position of cursor relative to overDiv DIVision; mouseOut function
\r
833 function cursorOff() {
\r
834 var left = parseInt(over.style.left);
\r
835 var top = parseInt(over.style.top);
\r
836 var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
\r
837 var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);
\r
839 if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;
\r
846 // COMMAND FUNCTIONS
\r
849 // Calls callme or the default function.
\r
850 function opt_FUNCTION(callme) {
\r
851 o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function'));
\r
857 function opt_NOCLOSE(unused) {
\r
858 if (!unused) o3_close = "";
\r
861 over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
\r
862 over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
\r
863 over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); }
\r
865 over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
\r
871 // Function to scan command line arguments for multiples
\r
872 function opt_MULTIPLEARGS(i, args, parameter) {
\r
873 var k=i, re, pV, str='';
\r
875 for(k=i; k<args.length; k++) {
\r
876 if(typeof args[k] == 'number' && args[k]>pmStart) break;
\r
877 str += args[k] + ',';
\r
879 if (str) str = str.substring(0,--str.length);
\r
881 k--; // reduce by one so the for loop this is in works correctly
\r
882 pV=(olNs4 && /cellpad/i.test(parameter)) ? str.split(',')[0] : str;
\r
883 eval(parameter + '="' + pV + '"');
\r
888 // Remove in texts when done.
\r
889 function nbspCleanup() {
\r
891 o3_text = o3_text.replace(/\ /g, ' ');
\r
892 o3_cap = o3_cap.replace(/\ /g, ' ');
\r
896 // Escape embedded single quotes in text strings
\r
897 function escSglQuote(str) {
\r
898 return str.toString().replace(/'/g,"\\'");
\r
901 // Onload handler for window onload event
\r
902 function OLonLoad_handler(e) {
\r
903 var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i;
\r
905 if(!olLoaded) olLoaded=1;
\r
907 // Remove it for Gecko based browsers
\r
908 if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false);
\r
909 else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()
\r
910 window.detachEvent("onload",OLonLoad_handler);
\r
911 var fN = document.body.getAttribute('onload');
\r
913 fN=fN.toString().match(re);
\r
914 if (fN && fN.length) {
\r
915 for (i=0; i<fN.length; i++) {
\r
916 if (/anonymous/.test(fN[i])) continue;
\r
917 while((l=fN[i].search(/\)[;\s]+/)) != -1) {
\r
918 fn=fN[i].substring(0,l+1);
\r
919 fN[i] = fN[i].substring(l+2);
\r
920 if (olre.test(fn)) eval(fn);
\r
928 // Wraps strings in Layer Generation Functions with the correct tags
\r
929 // endWrap true(if end tag) or false if start tag
\r
930 // fontSizeStr - font size string such as '1' or '10px'
\r
931 // whichString is being wrapped -- 'text', 'caption', or 'close'
\r
932 function wrapStr(endWrap,fontSizeStr,whichString) {
\r
933 var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
\r
934 fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
\r
935 if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
\r
937 fontStr='o3_'+whichString+'font';
\r
938 fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
\r
939 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)+'">';
\r
943 // Quotes Multi word font names; needed for CSS Standards adherence in font-family
\r
944 function quoteMultiNameFonts(theFont) {
\r
945 var v, pM=theFont.split(',');
\r
946 for (var i=0; i<pM.length; i++) {
\r
948 v=v.replace(/^\s+/,'').replace(/\s+$/,'');
\r
949 if(/\s/.test(v) && !/['"]/.test(v)) {
\r
957 // dummy function which will be overridden
\r
958 function isExclusive(args) {
\r
962 // Sets cellpadding style string value
\r
963 function setCellPadStr(parameter) {
\r
964 var Str='', j=0, ary = new Array(), top, bottom, left, right;
\r
967 ary=parameter.replace(/\s+/g,'').split(',');
\r
969 switch(ary.length) {
\r
972 left=right=ary[++j];
\r
976 left=right=ary[++j];
\r
987 Str+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');
\r
992 // function will delay close by time milliseconds
\r
993 function hideDelay(time) {
\r
994 if (time&&!o3_delay) {
\r
995 if (o3_timerid > 0) clearTimeout(o3_timerid);
\r
997 o3_timerid=setTimeout("cClick()",(o3_timeout=time));
\r
1001 // Was originally in the placeLayer() routine; separated out for future ease
\r
1002 function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {
\r
1003 var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount;
\r
1004 var parsedWidth = parseInt(o3_width);
\r
1006 if (o3_fixx > -1 || o3_relx != null) {
\r
1008 placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx);
\r
1010 // If HAUTO, decide what to use.
\r
1011 if (o3_hauto == 1) {
\r
1012 if ((o3_x - winoffset) > (iwidth / 2)) {
\r
1020 if (o3_hpos == CENTER) { // Center
\r
1021 placeX = o3_x+o3_offsetx-(parsedWidth/2);
\r
1023 if (placeX < winoffset) placeX = winoffset;
\r
1026 if (o3_hpos == RIGHT) { // Right
\r
1027 placeX = o3_x+o3_offsetx;
\r
1029 if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) {
\r
1030 placeX = iwidth+winoffset - parsedWidth - widthFix;
\r
1031 if (placeX < 0) placeX = 0;
\r
1034 if (o3_hpos == LEFT) { // Left
\r
1035 placeX = o3_x-o3_offsetx-parsedWidth;
\r
1036 if (placeX < winoffset) placeX = winoffset;
\r
1040 if (o3_snapx > 1) {
\r
1041 var snapping = placeX % o3_snapx;
\r
1043 if (o3_hpos == LEFT) {
\r
1044 placeX = placeX - (o3_snapx+snapping);
\r
1046 // CENTER and RIGHT
\r
1047 placeX = placeX+(o3_snapx - snapping);
\r
1050 if (placeX < winoffset) placeX = winoffset;
\r
1057 // was originally in the placeLayer() routine; separated out for future ease
\r
1058 function verticalPlacement(browserHeight,verticalScrollAmount) {
\r
1059 var placeY, iheight=browserHeight, scrolloffset=verticalScrollAmount;
\r
1060 var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight));
\r
1062 if (o3_fixy > -1 || o3_rely != null) {
\r
1064 placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy);
\r
1066 // If VAUTO, decide what to use.
\r
1067 if (o3_vauto == 1) {
\r
1068 if ((o3_y - scrolloffset) > (iheight / 2) && o3_vpos == BELOW && (o3_y + parsedHeight + o3_offsety - (scrolloffset + iheight) > 0)) {
\r
1070 } else if (o3_vpos == ABOVE && (o3_y - (parsedHeight + o3_offsety) - scrolloffset < 0)) {
\r
1076 if (o3_vpos == ABOVE) {
\r
1077 if (o3_aboveheight == 0) o3_aboveheight = parsedHeight;
\r
1079 placeY = o3_y - (o3_aboveheight+o3_offsety);
\r
1080 if (placeY < scrolloffset) placeY = scrolloffset;
\r
1083 placeY = o3_y+o3_offsety;
\r
1087 if (o3_snapy > 1) {
\r
1088 var snapping = placeY % o3_snapy;
\r
1090 if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
\r
1091 placeY = placeY - (o3_snapy+snapping);
\r
1093 placeY = placeY+(o3_snapy - snapping);
\r
1096 if (placeY < scrolloffset) placeY = scrolloffset;
\r
1103 // checks positioning flags
\r
1104 function checkPositionFlags() {
\r
1105 if (olHautoFlag) olHautoFlag = o3_hauto=0;
\r
1106 if (olVautoFlag) olVautoFlag = o3_vauto=0;
\r
1110 // get Browser window width
\r
1111 function windowWidth() {
\r
1113 if (o3_frame.innerWidth) w=o3_frame.innerWidth;
\r
1114 else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval('o3_frame.'+docRoot+'.clientWidth'))
\r
1115 w=eval('o3_frame.'+docRoot+'.clientWidth');
\r
1119 // create the div container for popup content if it doesn't exist
\r
1120 function createDivContainer(id,frm,zValue) {
\r
1121 id = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 1000);
\r
1122 var objRef, divContainer = layerReference(id);
\r
1124 if (divContainer == null) {
\r
1126 divContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm);
\r
1127 objRef = divContainer;
\r
1129 var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]);
\r
1130 if (olIe4&&!document.getElementById) {
\r
1131 body.insertAdjacentHTML("beforeEnd",'<div id="'+id+'"></div>');
\r
1132 divContainer=layerReference(id);
\r
1134 divContainer = frm.document.createElement("DIV");
\r
1135 divContainer.id = id;
\r
1136 body.appendChild(divContainer);
\r
1138 objRef = divContainer.style;
\r
1141 objRef.position = 'absolute';
\r
1142 objRef.visibility = 'hidden';
\r
1143 objRef.zIndex = zValue;
\r
1144 if (olIe4&&!olOp) objRef.left = objRef.top = '0px';
\r
1145 else objRef.left = objRef.top = -10000 + (!olNs4 ? 'px' : 0);
\r
1148 return divContainer;
\r
1151 // get reference to a layer with ID=id
\r
1152 function layerReference(id) {
\r
1153 return (olNs4 ? o3_frame.document.layers[id] : (document.all ? o3_frame.document.all[id] : o3_frame.document.getElementById(id)));
\r
1156 // UTILITY FUNCTIONS
\r
1159 // Checks if something is a function.
\r
1160 function isFunction(fnRef) {
\r
1163 if (typeof fnRef == 'object') {
\r
1164 for (var i = 0; i < fnRef.length; i++) {
\r
1165 if (typeof fnRef[i]=='function') continue;
\r
1169 } else if (typeof fnRef != 'function') {
\r
1176 // Converts an array into an argument string for use in eval.
\r
1177 function argToString(array, strtInd, argName) {
\r
1178 var jS = strtInd, aS = '', ar = array;
\r
1179 argName=(argName ? argName : 'ar');
\r
1181 if (ar.length > jS) {
\r
1182 for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';
\r
1183 aS = aS.substring(0, aS.length-2);
\r
1189 // Places a hook in the correct position in a hook point.
\r
1190 function reOrder(hookPt, fnRef, order) {
\r
1191 var newPt = new Array(), match, i, j;
\r
1193 if (!order || typeof order == 'undefined' || typeof order == 'number') return hookPt;
\r
1195 if (typeof order=='function') {
\r
1196 if (typeof fnRef=='object') {
\r
1197 newPt = newPt.concat(fnRef);
\r
1199 newPt[newPt.length++]=fnRef;
\r
1202 for (i = 0; i < hookPt.length; i++) {
\r
1204 if (typeof fnRef == 'function' && hookPt[i] == fnRef) {
\r
1207 for(j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) {
\r
1212 if (!match) newPt[newPt.length++] = hookPt[i];
\r
1215 newPt[newPt.length++] = order;
\r
1217 } else if (typeof order == 'object') {
\r
1218 if (typeof fnRef == 'object') {
\r
1219 newPt = newPt.concat(fnRef);
\r
1221 newPt[newPt.length++] = fnRef;
\r
1224 for (j = 0; j < hookPt.length; j++) {
\r
1226 if (typeof fnRef == 'function' && hookPt[j] == fnRef) {
\r
1229 for (i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) {
\r
1234 if (!match) newPt[newPt.length++]=hookPt[j];
\r
1237 for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i];
\r
1240 for (j = 0; j < hookPt.length; j++) {
\r
1242 for (i = 0; i < order.length; i++) {
\r
1243 if (hookPt[j] == order[i]) {
\r
1248 if (!match) newPt[newPt.length++] = hookPt[j];
\r
1250 newPt = newPt.concat(order);
\r
1259 // PLUGIN ACTIVATION FUNCTIONS
\r
1262 // Runs plugin functions to set runtime variables.
\r
1263 function setRunTimeVariables(){
\r
1264 if (typeof runTime != 'undefined' && runTime.length) {
\r
1265 for (var k = 0; k < runTime.length; k++) {
\r
1271 // Runs plugin functions to parse commands.
\r
1272 function parseCmdLine(pf, i, args) {
\r
1273 if (typeof cmdLine != 'undefined' && cmdLine.length) {
\r
1274 for (var k = 0; k < cmdLine.length; k++) {
\r
1275 var j = cmdLine[k](pf, i, args);
\r
1286 // Runs plugin functions to do things after parse.
\r
1287 function postParseChecks(pf,args){
\r
1288 if (typeof postParse != 'undefined' && postParse.length) {
\r
1289 for (var k = 0; k < postParse.length; k++) {
\r
1290 if (postParse[k](pf,args)) continue;
\r
1291 return false; // end now since have an error
\r
1299 // PLUGIN REGISTRATION FUNCTIONS
\r
1302 // Registers commands and creates constants.
\r
1303 function registerCommands(cmdStr) {
\r
1304 if (typeof cmdStr!='string') return;
\r
1306 var pM = cmdStr.split(',');
\r
1307 pms = pms.concat(pM);
\r
1309 for (var i = 0; i< pM.length; i++) {
\r
1310 eval(pM[i].toUpperCase()+'='+pmCount++);
\r
1314 // Registers no-parameter commands
\r
1315 function registerNoParameterCommands(cmdStr) {
\r
1316 if (!cmdStr && typeof cmdStr != 'string') return;
\r
1317 pmt=(!pmt) ? cmdStr : pmt + ',' + cmdStr;
\r
1320 // Register a function to hook at a certain point.
\r
1321 function registerHook(fnHookTo, fnRef, hookType, optPm) {
\r
1322 var hookPt, last = typeof optPm;
\r
1324 if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return;
\r
1325 if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference();
\r
1327 hookPt = hookPts[fnHookTo];
\r
1329 if (hookType != null) {
\r
1330 if (hookType == FREPLACE) {
\r
1331 hookPt.ovload = fnRef; // replace normal overlib routine
\r
1332 if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef;
\r
1334 } else if (hookType == FBEFORE || hookType == FAFTER) {
\r
1335 var hookPt=(hookType == 1 ? hookPt.before : hookPt.after);
\r
1337 if (typeof fnRef == 'object') {
\r
1338 hookPt = hookPt.concat(fnRef);
\r
1340 hookPt[hookPt.length++] = fnRef;
\r
1343 if (optPm) hookPt = reOrder(hookPt, fnRef, optPm);
\r
1345 } else if (hookType == FALTERNATE) {
\r
1346 if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef;
\r
1347 } else if (hookType == FCHAIN) {
\r
1348 hookPt = hookPt.chain;
\r
1349 if (typeof fnRef=='object') hookPt=hookPt.concat(fnRef); // add other functions
\r
1350 else hookPt[hookPt.length++]=fnRef;
\r
1357 // Register a function that will set runtime variables.
\r
1358 function registerRunTimeFunction(fn) {
\r
1359 if (isFunction(fn)) {
\r
1360 if (typeof fn == 'object') {
\r
1361 runTime = runTime.concat(fn);
\r
1363 runTime[runTime.length++] = fn;
\r
1368 // Register a function that will handle command parsing.
\r
1369 function registerCmdLineFunction(fn){
\r
1370 if (isFunction(fn)) {
\r
1371 if (typeof fn == 'object') {
\r
1372 cmdLine = cmdLine.concat(fn);
\r
1374 cmdLine[cmdLine.length++] = fn;
\r
1379 // Register a function that does things after command parsing.
\r
1380 function registerPostParseFunction(fn){
\r
1381 if (isFunction(fn)) {
\r
1382 if (typeof fn == 'object') {
\r
1383 postParse = postParse.concat(fn);
\r
1385 postParse[postParse.length++] = fn;
\r
1391 // PLUGIN REGISTRATION FUNCTIONS
\r
1394 // Runs any hooks registered.
\r
1395 function runHook(fnHookTo, hookType) {
\r
1396 var l = hookPts[fnHookTo], k, rtnVal = null, optPm, arS, ar = runHook.arguments;
\r
1398 if (hookType == FREPLACE) {
\r
1399 arS = argToString(ar, 2);
\r
1401 if (typeof l == 'undefined' || !(l = l.ovload)) rtnVal = eval(fnHookTo+'('+arS+')');
\r
1402 else rtnVal = eval('l('+arS+')');
\r
1404 } else if (hookType == FBEFORE || hookType == FAFTER) {
\r
1405 if (typeof l != 'undefined') {
\r
1406 l=(hookType == 1 ? l.before : l.after);
\r
1409 arS = argToString(ar, 2);
\r
1410 for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')');
\r
1413 } else if (hookType == FALTERNATE) {
\r
1415 arS = argToString(ar, 3);
\r
1417 if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') {
\r
1418 rtnVal = eval(fnHookTo+'('+arS+')');
\r
1420 rtnVal = eval('l('+arS+')');
\r
1422 } else if (hookType == FCHAIN) {
\r
1423 arS=argToString(ar,2);
\r
1426 for (k=l.length; k > 0; k--) if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0)) break;
\r
1433 // OBJECT CONSTRUCTORS
\r
1436 // Object for handling hooks.
\r
1437 function FunctionReference() {
\r
1438 this.ovload = null;
\r
1439 this.before = new Array();
\r
1440 this.after = new Array();
\r
1441 this.alt = new Array();
\r
1442 this.chain = new Array();
\r
1445 // Object for simple access to the overLIB version used.
\r
1446 // Examples: simpleversion:351 major:3 minor:5 revision:1
\r
1447 function Info(version, prerelease) {
\r
1448 this.version = version;
\r
1449 this.prerelease = prerelease;
\r
1451 this.simpleversion = Math.round(this.version*100);
\r
1452 this.major = parseInt(this.simpleversion / 100);
\r
1453 this.minor = parseInt(this.simpleversion / 10) - this.major * 10;
\r
1454 this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10;
\r
1455 this.meets = meets;
\r
1458 // checks for Core Version required
\r
1459 function meets(reqdVersion) {
\r
1460 return (!reqdVersion) ? false : this.simpleversion >= Math.round(100*parseFloat(reqdVersion));
\r
1465 // STANDARD REGISTRATIONS
\r
1467 registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF);
\r
1468 registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
\r
1469 registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
\r
1470 registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
\r
1471 registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
\r
1472 registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
\r
1473 registerPostParseFunction(checkPositionFlags);
\r
1474 registerHook("hideObject", nbspCleanup, FAFTER);
\r
1475 registerHook("horizontalPlacement", horizontalPlacement, FCHAIN);
\r
1476 registerHook("verticalPlacement", verticalPlacement, FCHAIN);
\r
1477 if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1;
\r
1478 registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');
\r
1480 // ESTABLISH MOUSECAPTURING
\r
1483 // Capture events, alt. diffuses the overlib function.
\r
1484 var olCheckMouseCapture=true;
\r
1485 if ((olNs4 || olNs6 || olIe4)) {
\r
1488 overlib = no_overlib;
\r