Subversion-Projekte lars-tiefland.ci

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
875 lars 1
//\/////
2
//\  overLIB 4.21 - You may not remove or change this notice.
3
//\  Copyright Erik Bosrup 1998-2004. All rights reserved.
4
//\
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/
8
//\
9
//\  Please read the license agreement (available through the link above)
10
//\  before using overLIB. Direct any licensing questions to erik@bosrup.com.
11
//\
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
16
//\  them as well.
17
//   $Revision: 3723 $                $Date: 2013-07-04 14:42:05 +0200 (Do, 04. Jul 2013) $
18
//\/////
19
//\mini
20
 
21
////////
22
// PRE-INIT
23
// Ignore these lines, configuration is below.
24
////////
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);
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
var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array();
31
// for plugins
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');
33
 
34
////////
35
// DEFAULT CONFIGURATION
36
// Settings you want everywhere are set here. All of this can also be
37
// changed on your html page or through an overLIB call.
38
////////
39
if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#FFFFFF";
40
if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#FF0000";
41
if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
42
if (typeof ol_capcolor=='undefined') var ol_capcolor="#FFFFFF";
43
if (typeof ol_closecolor=='undefined') var ol_closecolor="#9999FF";
44
if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
45
if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
46
if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
47
if (typeof ol_textsize=='undefined') var ol_textsize="1";
48
if (typeof ol_captionsize=='undefined') var ol_captionsize="1";
49
if (typeof ol_closesize=='undefined') var ol_closesize="1";
50
if (typeof ol_width=='undefined') var ol_width="200";
51
if (typeof ol_border=='undefined') var ol_border="1";
52
if (typeof ol_cellpad=='undefined') var ol_cellpad=2;
53
if (typeof ol_offsetx=='undefined') var ol_offsetx=10;
54
if (typeof ol_offsety=='undefined') var ol_offsety=10;
55
if (typeof ol_text=='undefined') var ol_text="Default Text";
56
if (typeof ol_cap=='undefined') var ol_cap="";
57
if (typeof ol_sticky=='undefined') var ol_sticky=0;
58
if (typeof ol_background=='undefined') var ol_background="";
59
if (typeof ol_close=='undefined') var ol_close="Close";
60
if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT;
61
if (typeof ol_status=='undefined') var ol_status="";
62
if (typeof ol_autostatus=='undefined') var ol_autostatus=0;
63
if (typeof ol_height=='undefined') var ol_height=-1;
64
if (typeof ol_snapx=='undefined') var ol_snapx=0;
65
if (typeof ol_snapy=='undefined') var ol_snapy=0;
66
if (typeof ol_fixx=='undefined') var ol_fixx=-1;
67
if (typeof ol_fixy=='undefined') var ol_fixy=-1;
68
if (typeof ol_relx=='undefined') var ol_relx=null;
69
if (typeof ol_rely=='undefined') var ol_rely=null;
70
if (typeof ol_fgbackground=='undefined') var ol_fgbackground="";
71
if (typeof ol_bgbackground=='undefined') var ol_bgbackground="";
72
if (typeof ol_padxl=='undefined') var ol_padxl=1;
73
if (typeof ol_padxr=='undefined') var ol_padxr=1;
74
if (typeof ol_padyt=='undefined') var ol_padyt=1;
75
if (typeof ol_padyb=='undefined') var ol_padyb=1;
76
if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
77
if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
78
if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
79
if (typeof ol_capicon=='undefined') var ol_capicon="";
80
if (typeof ol_frame=='undefined') var ol_frame=self;
81
if (typeof ol_timeout=='undefined') var ol_timeout=0;
82
if (typeof ol_function=='undefined') var ol_function=null;
83
if (typeof ol_delay=='undefined') var ol_delay=0;
84
if (typeof ol_hauto=='undefined') var ol_hauto=0;
85
if (typeof ol_vauto=='undefined') var ol_vauto=0;
86
if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
87
if (typeof ol_wrap=='undefined') var ol_wrap=0;
88
if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
89
if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
90
if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
91
if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
92
if (typeof ol_css=='undefined') var ol_css=CSSOFF;
93
if (typeof ol_fgclass=='undefined') var ol_fgclass="";
94
if (typeof ol_bgclass=='undefined') var ol_bgclass="";
95
if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
96
if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";
97
if (typeof ol_closefontclass=='undefined') var ol_closefontclass="";
98
 
99
////////
100
// ARRAY CONFIGURATION
101
////////
102
 
103
// You can use these arrays to store popup text here instead of in the html.
104
if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1");
105
if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1");
106
 
107
////////
108
// END OF CONFIGURATION
109
// Don't change anything below this line, all configuration is above.
110
////////
111
 
112
 
113
 
114
 
115
 
116
////////
117
// INIT
118
////////
119
// Runtime variables init. Don't change for config!
120
var o3_text="";
121
var o3_cap="";
122
var o3_sticky=0;
123
var o3_background="";
124
var o3_close="Close";
125
var o3_hpos=RIGHT;
126
var o3_offsetx=2;
127
var o3_offsety=2;
128
var o3_fgcolor="";
129
var o3_bgcolor="";
130
var o3_textcolor="";
131
var o3_capcolor="";
132
var o3_closecolor="";
133
var o3_width=100;
134
var o3_border=1;
135
var o3_cellpad=2;
136
var o3_status="";
137
var o3_autostatus=0;
138
var o3_height=-1;
139
var o3_snapx=0;
140
var o3_snapy=0;
141
var o3_fixx=-1;
142
var o3_fixy=-1;
143
var o3_relx=null;
144
var o3_rely=null;
145
var o3_fgbackground="";
146
var o3_bgbackground="";
147
var o3_padxl=0;
148
var o3_padxr=0;
149
var o3_padyt=0;
150
var o3_padyb=0;
151
var o3_fullhtml=0;
152
var o3_vpos=BELOW;
153
var o3_aboveheight=0;
154
var o3_capicon="";
155
var o3_textfont="Verdana,Arial,Helvetica";
156
var o3_captionfont="Verdana,Arial,Helvetica";
157
var o3_closefont="Verdana,Arial,Helvetica";
158
var o3_textsize="1";
159
var o3_captionsize="1";
160
var o3_closesize="1";
161
var o3_frame=self;
162
var o3_timeout=0;
163
var o3_timerid=0;
164
var o3_allowmove=0;
165
var o3_function=null;
166
var o3_delay=0;
167
var o3_delayid=0;
168
var o3_hauto=0;
169
var o3_vauto=0;
170
var o3_closeclick=0;
171
var o3_wrap=0;
172
var o3_followmouse=1;
173
var o3_mouseoff=0;
174
var o3_closetitle='';
175
var o3_compatmode=0;
176
var o3_css=CSSOFF;
177
var o3_fgclass="";
178
var o3_bgclass="";
179
var o3_textfontclass="";
180
var o3_captionfontclass="";
181
var o3_closefontclass="";
182
 
183
// Display state variables
184
var o3_x = 0;
185
var o3_y = 0;
186
var o3_showingsticky = 0;
187
var o3_removecounter = 0;
188
 
189
// Our layer
190
var over = null;
191
var fnRef, hoveringSwitch = false;
192
var olHideDelay;
193
 
194
// Decide browser version
195
var isMac = (navigator.userAgent.indexOf("Mac") != -1);
196
var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode);  // Opera 7
197
var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
198
var olNs6 = (document.getElementById) ? true : false;
199
var olKq = (olNs6 && /konqueror/i.test(navigator.userAgent));
200
var olIe4 = (document.all) ? true : false;
201
var olIe5 = false;
202
var olIe55 = false; // Added additional variable to identify IE5.5+
203
var docRoot = 'document.body';
204
 
205
// Resize fix for NS4.x to keep track of layer
206
if (olNs4) {
207
	var oW = window.innerWidth;
208
	var oH = window.innerHeight;
209
	window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); }
210
}
211
 
212
// Microsoft Stupidity Check(tm).
213
if (olIe4) {
214
	var agent = navigator.userAgent;
215
	if (/MSIE/.test(agent)) {
216
        //Fix Fuer IE 10
217
        var versNum = parseFloat(agent.match(/MSIE[ ](\d{1,2}\.\d+)\.*/i)[1]);
218
        //var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);
219
		if (versNum >= 5){
220
			olIe5=true;
221
			olIe55=(versNum>=5.5&&!olOp) ? true : false;
222
			if (olNs6) olNs6=false;
223
		}
224
	}
225
	if (olNs6) olIe4 = false;
226
}
227
 
228
// Check for compatability mode.
229
if (document.compatMode && document.compatMode == 'CSS1Compat') {
230
	docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot);
231
}
232
 
233
// Add window onload handlers to indicate when all modules have been loaded
234
// For Netscape 6+ and Mozilla, uses addEventListener method on the window object
235
// For IE it uses the attachEvent method of the window object and for Netscape 4.x
236
// it sets the window.onload handler to the OLonload_handler function for Bubbling
237
if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false);
238
else if (window.attachEvent) window.attachEvent("onload",OLonLoad_handler);
239
 
240
var capExtent;
241
 
242
////////
243
// PUBLIC FUNCTIONS
244
////////
245
 
246
// overlib(arg0,...,argN)
247
// Loads parameters into global runtime variables.
248
function overlib() {
249
	if (!olLoaded || isExclusive(overlib.arguments)) return true;
250
	if (olCheckMouseCapture) olMouseCapture();
251
	if (over) {
252
		over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over;
253
		cClick();
254
	}
255
 
256
	// Load defaults to runtime.
257
  olHideDelay=0;
258
	o3_text=ol_text;
259
	o3_cap=ol_cap;
260
	o3_sticky=ol_sticky;
261
	o3_background=ol_background;
262
	o3_close=ol_close;
263
	o3_hpos=ol_hpos;
264
	o3_offsetx=ol_offsetx;
265
	o3_offsety=ol_offsety;
266
	o3_fgcolor=ol_fgcolor;
267
	o3_bgcolor=ol_bgcolor;
268
	o3_textcolor=ol_textcolor;
269
	o3_capcolor=ol_capcolor;
270
	o3_closecolor=ol_closecolor;
271
	o3_width=ol_width;
272
	o3_border=ol_border;
273
	o3_cellpad=ol_cellpad;
274
	o3_status=ol_status;
275
	o3_autostatus=ol_autostatus;
276
	o3_height=ol_height;
277
	o3_snapx=ol_snapx;
278
	o3_snapy=ol_snapy;
279
	o3_fixx=ol_fixx;
280
	o3_fixy=ol_fixy;
281
	o3_relx=ol_relx;
282
	o3_rely=ol_rely;
283
	o3_fgbackground=ol_fgbackground;
284
	o3_bgbackground=ol_bgbackground;
285
	o3_padxl=ol_padxl;
286
	o3_padxr=ol_padxr;
287
	o3_padyt=ol_padyt;
288
	o3_padyb=ol_padyb;
289
	o3_fullhtml=ol_fullhtml;
290
	o3_vpos=ol_vpos;
291
	o3_aboveheight=ol_aboveheight;
292
	o3_capicon=ol_capicon;
293
	o3_textfont=ol_textfont;
294
	o3_captionfont=ol_captionfont;
295
	o3_closefont=ol_closefont;
296
	o3_textsize=ol_textsize;
297
	o3_captionsize=ol_captionsize;
298
	o3_closesize=ol_closesize;
299
	o3_timeout=ol_timeout;
300
	o3_function=ol_function;
301
	o3_delay=ol_delay;
302
	o3_hauto=ol_hauto;
303
	o3_vauto=ol_vauto;
304
	o3_closeclick=ol_closeclick;
305
	o3_wrap=ol_wrap;
306
	o3_followmouse=ol_followmouse;
307
	o3_mouseoff=ol_mouseoff;
308
	o3_closetitle=ol_closetitle;
309
	o3_css=ol_css;
310
	o3_compatmode=ol_compatmode;
311
	o3_fgclass=ol_fgclass;
312
	o3_bgclass=ol_bgclass;
313
	o3_textfontclass=ol_textfontclass;
314
	o3_captionfontclass=ol_captionfontclass;
315
	o3_closefontclass=ol_closefontclass;
316
 
317
	setRunTimeVariables();
318
 
319
	fnRef = '';
320
 
321
	// Special for frame support, over must be reset...
322
	o3_frame = ol_frame;
323
 
324
	if(!(over=createDivContainer())) return false;
325
 
326
	parseTokens('o3_', overlib.arguments);
327
	if (!postParseChecks()) return false;
328
 
329
	if (o3_delay == 0) {
330
		return runHook("olMain", FREPLACE);
331
 	} else {
332
		o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
333
		return false;
334
	}
335
}
336
 
337
// Clears popups if appropriate
338
function nd(time) {
339
	if (olLoaded && !isExclusive()) {
340
		hideDelay(time);  // delay popup close if time specified
341
 
342
		if (o3_removecounter >= 1) { o3_showingsticky = 0 };
343
 
344
		if (o3_showingsticky == 0) {
345
			o3_allowmove = 0;
346
			if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over);
347
		} else {
348
			o3_removecounter++;
349
		}
350
	}
351
 
352
	return true;
353
}
354
 
355
// The Close onMouseOver function for stickies
356
function cClick() {
357
	if (olLoaded) {
358
		runHook("hideObject", FREPLACE, over);
359
		o3_showingsticky = 0;
360
	}
361
	return false;
362
}
363
 
364
// Method for setting page specific defaults.
365
function overlib_pagedefaults() {
366
	parseTokens('ol_', overlib_pagedefaults.arguments);
367
}
368
 
369
 
370
////////
371
// OVERLIB MAIN FUNCTION
372
////////
373
 
374
// This function decides what it is we want to display and how we want it done.
375
function olMain() {
376
	var layerhtml, styleType;
377
 	runHook("olMain", FBEFORE);
378
 
379
	if (o3_background!="" || o3_fullhtml) {
380
		// Use background instead of box.
381
		layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
382
	} else {
383
		// They want a popup box.
384
		styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");
385
 
386
		// Prepare popup background
387
		if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
388
		if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);
389
 
390
		// Prepare popup colors
391
		if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
392
		if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);
393
 
394
		// Prepare popup height
395
		if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
396
		else o3_height = "";
397
 
398
		// Decide which kinda box.
399
		if (o3_cap=="") {
400
			// Plain
401
			layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
402
		} else {
403
			// With caption
404
			if (o3_sticky) {
405
				// Show close text
406
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close);
407
			} else {
408
				// No close text
409
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
410
			}
411
		}
412
	}
413
 
414
	// We want it to stick!
415
	if (o3_sticky) {
416
		if (o3_timerid > 0) {
417
			clearTimeout(o3_timerid);
418
			o3_timerid = 0;
419
		}
420
		o3_showingsticky = 1;
421
		o3_removecounter = 0;
422
	}
423
 
424
	// Created a separate routine to generate the popup to make it easier
425
	// to implement a plugin capability
426
	if (!runHook("createPopup", FREPLACE, layerhtml)) return false;
427
 
428
	// Prepare status bar
429
	if (o3_autostatus > 0) {
430
		o3_status = o3_text;
431
		if (o3_autostatus > 1) o3_status = o3_cap;
432
	}
433
 
434
	// When placing the layer the first time, even stickies may be moved.
435
	o3_allowmove = 0;
436
 
437
	// Initiate a timer for timeout
438
	if (o3_timeout > 0) {
439
		if (o3_timerid > 0) clearTimeout(o3_timerid);
440
		o3_timerid = setTimeout("cClick()", o3_timeout);
441
	}
442
 
443
	// Show layer
444
	runHook("disp", FREPLACE, o3_status);
445
	runHook("olMain", FAFTER);
446
 
447
	return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
448
}
449
 
450
////////
451
// LAYER GENERATION FUNCTIONS
452
////////
453
// These functions just handle popup content with tags that should adhere to the W3C standards specification.
454
 
455
// Makes simple table without caption
456
function ol_content_simple(text) {
457
	var cpIsMultiple = /,/.test(o3_cellpad);
458
	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>';
459
 
460
	set_background("");
461
	return txt;
462
}
463
 
464
// Makes table with caption and optional close link
465
function ol_content_caption(text,title,close) {
466
	var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad);
467
	var closing, closeevent;
468
 
469
	closing = "";
470
	closeevent = "onmouseover";
471
	if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
472
	if (o3_capicon != "") {
473
	  nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"';
474
	  if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
475
	  o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
476
	}
477
 
478
	if (close != "")
479
		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>';
480
	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>';
481
 
482
	set_background("");
483
	return txt;
484
}
485
 
486
// Sets the background picture,padding and lots more. :)
487
function ol_content_background(text,picture,hasfullhtml) {
488
	if (hasfullhtml) {
489
		txt=text;
490
	} else {
491
		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>';
492
	}
493
 
494
	set_background(picture);
495
	return txt;
496
}
497
 
498
// Loads a picture into the div.
499
function set_background(pic) {
500
	if (pic == "") {
501
		if (olNs4) {
502
			over.background.src = null;
503
		} else if (over.style) {
504
			over.style.backgroundImage = "none";
505
		}
506
	} else {
507
		if (olNs4) {
508
			over.background.src = pic;
509
		} else if (over.style) {
510
			over.style.width=o3_width + 'px';
511
			over.style.backgroundImage = "url("+pic+")";
512
		}
513
	}
514
}
515
 
516
////////
517
// HANDLING FUNCTIONS
518
////////
519
var olShowId=-1;
520
 
521
// Displays the popup
522
function disp(statustext) {
523
	runHook("disp", FBEFORE);
524
 
525
	if (o3_allowmove == 0) {
526
		runHook("placeLayer", FREPLACE);
527
		(olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
528
		o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
529
	}
530
 
531
	runHook("disp", FAFTER);
532
 
533
	if (statustext != "") self.status = statustext;
534
}
535
 
536
// Creates the actual popup structure
537
function createPopup(lyrContent){
538
	runHook("createPopup", FBEFORE);
539
 
540
	if (o3_wrap) {
541
		var wd,ww,theObj = (olNs4 ? over : over.style);
542
		theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
543
		layerWrite(lyrContent);
544
		wd = (olNs4 ? over.clip.width : over.offsetWidth);
545
		if (wd > (ww=windowWidth())) {
546
			lyrContent=lyrContent.replace(/\&nbsp;/g, ' ');
547
			o3_width=ww;
548
			o3_wrap=0;
549
		}
550
	}
551
 
552
	layerWrite(lyrContent);
553
 
554
	// Have to set o3_width for placeLayer() routine if o3_wrap is turned on
555
	if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);
556
 
557
	runHook("createPopup", FAFTER, lyrContent);
558
 
559
	return true;
560
}
561
 
562
// Decides where we want the popup.
563
function placeLayer() {
564
	var placeX, placeY, widthFix = 0;
565
 
566
	// HORIZONTAL PLACEMENT, re-arranged to work in Safari
567
	if (o3_frame.innerWidth) widthFix=18;
568
	iwidth = windowWidth();
569
 
570
	// Horizontal scroll offset
571
	winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset;
572
 
573
	placeX = runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix);
574
 
575
	// VERTICAL PLACEMENT, re-arranged to work in Safari
576
	if (o3_frame.innerHeight) {
577
		iheight=o3_frame.innerHeight;
578
	} else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')) {
579
		iheight=eval('o3_frame.'+docRoot+'.clientHeight');
580
	}
581
 
582
	// Vertical scroll offset
583
	scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset;
584
	placeY = runHook('verticalPlacement',FCHAIN,iheight,scrolloffset);
585
 
586
	// Actually move the object.
587
	repositionTo(over, placeX, placeY);
588
}
589
 
590
// Moves the layer
591
function olMouseMove(e) {
592
	var e = (e) ? e : event;
593
 
594
	if (e.pageX) {
595
		o3_x = e.pageX;
596
		o3_y = e.pageY;
597
	} else if (e.clientX) {
598
		o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft');
599
		o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop');
600
	}
601
 
602
	if (o3_allowmove == 1) runHook("placeLayer", FREPLACE);
603
 
604
	// MouseOut handler
605
	if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) {
606
		(olHideDelay ? hideDelay(olHideDelay) : cClick());
607
		hoveringSwitch = !hoveringSwitch;
608
	}
609
}
610
 
611
// Fake function for 3.0 users.
612
function no_overlib() { return ver3fix; }
613
 
614
// Capture the mouse and chain other scripts.
615
function olMouseCapture() {
616
	capExtent = document;
617
	var fN, str = '', l, k, f, wMv, sS, mseHandler = olMouseMove;
618
	var re = /function[ ]*(\w*)\(/;
619
 
620
	wMv = (!olIe4 && window.onmousemove);
621
	if (document.onmousemove || wMv) {
622
		if (wMv) capExtent = window;
623
		f = capExtent.onmousemove.toString();
624
		fN = f.match(re);
625
		if (fN == null) {
626
			str = f+'(e); ';
627
		} else if (fN[1] == 'anonymous' || fN[1] == 'olMouseMove' || (wMv && fN[1] == 'onmousemove')) {
628
			if (!olOp && wMv) {
629
				l = f.indexOf('{')+1;
630
				k = f.lastIndexOf('}');
631
				sS = f.substring(l,k);
632
				if ((l = sS.indexOf('(')) != -1) {
633
					sS = sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,'');
634
					if (eval("typeof " + sS + " == 'undefined'")) window.onmousemove = null;
635
					else str = sS + '(e);';
636
				}
637
			}
638
			if (!str) {
639
				olCheckMouseCapture = false;
640
				return;
641
			}
642
		} else {
643
			if (fN[1]) str = fN[1]+'(e); ';
644
			else {
645
				l = f.indexOf('{')+1;
646
				k = f.lastIndexOf('}');
647
				str = f.substring(l,k) + '\n';
648
			}
649
		}
650
		str += 'olMouseMove(e); ';
651
		mseHandler = new Function('e', str);
652
	}
653
 
654
	capExtent.onmousemove = mseHandler;
655
	if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE);
656
}
657
 
658
////////
659
// PARSING FUNCTIONS
660
////////
661
 
662
// Does the actual command parsing.
663
function parseTokens(pf, ar) {
664
	// What the next argument is expected to be.
665
	var v, i, mode=-1, par = (pf != 'ol_');
666
	var fnMark = (par && !ar.length ? 1 : 0);
667
 
668
	for (i = 0; i < ar.length; i++) {
669
		if (mode < 0) {
670
			// Arg is maintext,unless its a number between pmStart and pmUpper
671
			// then its a command.
672
			if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) {
673
				fnMark = (par ? 1 : 0);
674
				i--;   // backup one so that the next block can parse it
675
			} else {
676
				switch(pf) {
677
					case 'ol_':
678
						ol_text = ar[i].toString();
679
						break;
680
					default:
681
						o3_text=ar[i].toString();
682
				}
683
			}
684
			mode = 0;
685
		} else {
686
			// Note: NS4 doesn't like switch cases with vars.
687
			if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; }
688
			if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; }
689
			if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; }
690
			if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; }
691
			if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
692
			if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
693
			if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
694
			if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; }
695
			if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
696
			if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
697
			if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
698
			if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
699
			if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
700
			if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
701
			if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
702
			if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
703
			if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
704
			if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
705
			if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
706
			if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
707
			if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
708
			if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
709
			if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
710
			if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
711
			if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }
712
			if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; }
713
			if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; }
714
			if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; }
715
			if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; }
716
			if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; }
717
			if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; }
718
			if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; }
719
			if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; }
720
			if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; }
721
			if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); if (pf!='ol_') olVautoFlag=1; continue; }
722
			if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; }
723
			if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; }
724
			if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
725
			if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
726
			if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
727
			if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
728
			if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
729
			if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
730
			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; }
731
			if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
732
			if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
733
			if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
734
			if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
735
			if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
736
			if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
737
			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; }
738
			if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
739
			if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
740
			if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
741
			if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
742
			if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
743
			if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
744
			if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }
745
			if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; }
746
			i = parseCmdLine(pf, i, ar);
747
		}
748
	}
749
 
750
	if (fnMark && o3_function) o3_text = o3_function();
751
 
752
	if ((pf == 'o3_') && o3_wrap) {
753
		o3_width = 0;
754
 
755
		var tReg=/<.*\n*>/ig;
756
		if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, '&nbsp;');
757
		if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, '&nbsp;');
758
	}
759
	if ((pf == 'o3_') && o3_sticky) {
760
		if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close;
761
		if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' ');
762
	}
763
}
764
 
765
 
766
////////
767
// LAYER FUNCTIONS
768
////////
769
 
770
// Writes to a layer
771
function layerWrite(txt) {
772
	txt += "\n";
773
	if (olNs4) {
774
		var lyr = o3_frame.document.layers['overDiv'].document
775
		lyr.write(txt)
776
		lyr.close()
777
	} else if (typeof over.innerHTML != 'undefined') {
778
		if (olIe5 && isMac) over.innerHTML = '';
779
		over.innerHTML = txt;
780
	} else {
781
		range = o3_frame.document.createRange();
782
		range.setStartAfter(over);
783
		domfrag = range.createContextualFragment(txt);
784
 
785
		while (over.hasChildNodes()) {
786
			over.removeChild(over.lastChild);
787
		}
788
 
789
		over.appendChild(domfrag);
790
	}
791
}
792
 
793
// Make an object visible
794
function showObject(obj) {
795
	runHook("showObject", FBEFORE);
796
 
797
	var theObj=(olNs4 ? obj : obj.style);
798
	theObj.visibility = 'visible';
799
 
800
	runHook("showObject", FAFTER);
801
}
802
 
803
// Hides an object
804
function hideObject(obj) {
805
	runHook("hideObject", FBEFORE);
806
 
807
	var theObj=(olNs4 ? obj : obj.style);
808
	if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
809
	theObj.visibility = 'hidden';
810
	theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
811
 
812
	if (o3_timerid > 0) clearTimeout(o3_timerid);
813
	if (o3_delayid > 0) clearTimeout(o3_delayid);
814
 
815
	o3_timerid = 0;
816
	o3_delayid = 0;
817
	self.status = "";
818
 
819
	if (obj.onmouseout||obj.onmouseover) {
820
		if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
821
		obj.onmouseout = obj.onmouseover = null;
822
	}
823
 
824
	runHook("hideObject", FAFTER);
825
}
826
 
827
// Move a layer
828
function repositionTo(obj, xL, yL) {
829
	var theObj=(olNs4 ? obj : obj.style);
830
	theObj.left = xL + (!olNs4 ? 'px' : 0);
831
	theObj.top = yL + (!olNs4 ? 'px' : 0);
832
}
833
 
834
// Check position of cursor relative to overDiv DIVision; mouseOut function
835
function cursorOff() {
836
	var left = parseInt(over.style.left);
837
	var top = parseInt(over.style.top);
838
	var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
839
	var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);
840
 
841
	if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;
842
 
843
	return false;
844
}
845
 
846
 
847
////////
848
// COMMAND FUNCTIONS
849
////////
850
 
851
// Calls callme or the default function.
852
function opt_FUNCTION(callme) {
853
	o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function'));
854
 
855
	return 0;
856
}
857
 
858
// Handle hovering
859
function opt_NOCLOSE(unused) {
860
	if (!unused) o3_close = "";
861
 
862
	if (olNs4) {
863
		over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
864
		over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
865
		over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); }
866
	} else {
867
		over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
868
	}
869
 
870
	return 0;
871
}
872
 
873
// Function to scan command line arguments for multiples
874
function opt_MULTIPLEARGS(i, args, parameter) {
875
  var k=i, re, pV, str='';
876
 
877
  for(k=i; k<args.length; k++) {
878
		if(typeof args[k] == 'number' && args[k]>pmStart) break;
879
		str += args[k] + ',';
880
	}
881
	if (str) str = str.substring(0,--str.length);
882
 
883
	k--;  // reduce by one so the for loop this is in works correctly
884
	pV=(olNs4 && /cellpad/i.test(parameter)) ? str.split(',')[0] : str;
885
	eval(parameter + '="' + pV + '"');
886
 
887
	return k;
888
}
889
 
890
// Remove &nbsp; in texts when done.
891
function nbspCleanup() {
892
	if (o3_wrap) {
893
		o3_text = o3_text.replace(/\&nbsp;/g, ' ');
894
		o3_cap = o3_cap.replace(/\&nbsp;/g, ' ');
895
	}
896
}
897
 
898
// Escape embedded single quotes in text strings
899
function escSglQuote(str) {
900
  return str.toString().replace(/'/g,"\\'");
901
}
902
 
903
// Onload handler for window onload event
904
function OLonLoad_handler(e) {
905
	var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i;
906
 
907
	if(!olLoaded) olLoaded=1;
908
 
909
  // Remove it for Gecko based browsers
910
	if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false);
911
	else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()
912
		window.detachEvent("onload",OLonLoad_handler);
913
		var fN = document.body.getAttribute('onload');
914
		if (fN) {
915
			fN=fN.toString().match(re);
916
			if (fN && fN.length) {
917
				for (i=0; i<fN.length; i++) {
918
					if (/anonymous/.test(fN[i])) continue;
919
					while((l=fN[i].search(/\)[;\s]+/)) != -1) {
920
						fn=fN[i].substring(0,l+1);
921
						fN[i] = fN[i].substring(l+2);
922
						if (olre.test(fn)) eval(fn);
923
					}
924
				}
925
			}
926
		}
927
	}
928
}
929
 
930
// Wraps strings in Layer Generation Functions with the correct tags
931
//    endWrap true(if end tag) or false if start tag
932
//    fontSizeStr - font size string such as '1' or '10px'
933
//    whichString is being wrapped -- 'text', 'caption', or 'close'
934
function wrapStr(endWrap,fontSizeStr,whichString) {
935
	var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
936
	fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
937
	if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
938
	else {
939
		fontStr='o3_'+whichString+'font';
940
		fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
941
		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)+'">';
942
	}
943
}
944
 
945
// Quotes Multi word font names; needed for CSS Standards adherence in font-family
946
function quoteMultiNameFonts(theFont) {
947
	var v, pM=theFont.split(',');
948
	for (var i=0; i<pM.length; i++) {
949
		v=pM[i];
950
		v=v.replace(/^\s+/,'').replace(/\s+$/,'');
951
		if(/\s/.test(v) && !/['"]/.test(v)) {
952
			v="\'"+v+"\'";
953
			pM[i]=v;
954
		}
955
	}
956
	return pM.join();
957
}
958
 
959
// dummy function which will be overridden
960
function isExclusive(args) {
961
	return false;
962
}
963
 
964
// Sets cellpadding style string value
965
function setCellPadStr(parameter) {
966
	var Str='', j=0, ary = new Array(), top, bottom, left, right;
967
 
968
	Str+='padding: ';
969
	ary=parameter.replace(/\s+/g,'').split(',');
970
 
971
	switch(ary.length) {
972
		case 2:
973
			top=bottom=ary[j];
974
			left=right=ary[++j];
975
			break;
976
		case 3:
977
			top=ary[j];
978
			left=right=ary[++j];
979
			bottom=ary[++j];
980
			break;
981
		case 4:
982
			top=ary[j];
983
			right=ary[++j];
984
			bottom=ary[++j];
985
			left=ary[++j];
986
			break;
987
	}
988
 
989
	Str+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');
990
 
991
	return Str;
992
}
993
 
994
// function will delay close by time milliseconds
995
function hideDelay(time) {
996
	if (time&&!o3_delay) {
997
		if (o3_timerid > 0) clearTimeout(o3_timerid);
998
 
999
		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
1000
	}
1001
}
1002
 
1003
// Was originally in the placeLayer() routine; separated out for future ease
1004
function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {
1005
	var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount;
1006
	var parsedWidth = parseInt(o3_width);
1007
 
1008
	if (o3_fixx > -1 || o3_relx != null) {
1009
		// Fixed position
1010
		placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx);
1011
	} else {
1012
		// If HAUTO, decide what to use.
1013
		if (o3_hauto == 1) {
1014
			if ((o3_x - winoffset) > (iwidth / 2)) {
1015
				o3_hpos = LEFT;
1016
			} else {
1017
				o3_hpos = RIGHT;
1018
			}
1019
		}
1020
 
1021
		// From mouse
1022
		if (o3_hpos == CENTER) { // Center
1023
			placeX = o3_x+o3_offsetx-(parsedWidth/2);
1024
 
1025
			if (placeX < winoffset) placeX = winoffset;
1026
		}
1027
 
1028
		if (o3_hpos == RIGHT) { // Right
1029
			placeX = o3_x+o3_offsetx;
1030
 
1031
			if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) {
1032
				placeX = iwidth+winoffset - parsedWidth - widthFix;
1033
				if (placeX < 0) placeX = 0;
1034
			}
1035
		}
1036
		if (o3_hpos == LEFT) { // Left
1037
			placeX = o3_x-o3_offsetx-parsedWidth;
1038
			if (placeX < winoffset) placeX = winoffset;
1039
		}
1040
 
1041
		// Snapping!
1042
		if (o3_snapx > 1) {
1043
			var snapping = placeX % o3_snapx;
1044
 
1045
			if (o3_hpos == LEFT) {
1046
				placeX = placeX - (o3_snapx+snapping);
1047
			} else {
1048
				// CENTER and RIGHT
1049
				placeX = placeX+(o3_snapx - snapping);
1050
			}
1051
 
1052
			if (placeX < winoffset) placeX = winoffset;
1053
		}
1054
	}
1055
 
1056
	return placeX;
1057
}
1058
 
1059
// was originally in the placeLayer() routine; separated out for future ease
1060
function verticalPlacement(browserHeight,verticalScrollAmount) {
1061
	var placeY, iheight=browserHeight, scrolloffset=verticalScrollAmount;
1062
	var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight));
1063
 
1064
	if (o3_fixy > -1 || o3_rely != null) {
1065
		// Fixed position
1066
		placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy);
1067
	} else {
1068
		// If VAUTO, decide what to use.
1069
		if (o3_vauto == 1) {
1070
			if ((o3_y - scrolloffset) > (iheight / 2) && o3_vpos == BELOW && (o3_y + parsedHeight + o3_offsety - (scrolloffset + iheight) > 0)) {
1071
				o3_vpos = ABOVE;
1072
			} else if (o3_vpos == ABOVE && (o3_y - (parsedHeight + o3_offsety) - scrolloffset < 0)) {
1073
				o3_vpos = BELOW;
1074
			}
1075
		}
1076
 
1077
		// From mouse
1078
		if (o3_vpos == ABOVE) {
1079
			if (o3_aboveheight == 0) o3_aboveheight = parsedHeight;
1080
 
1081
			placeY = o3_y - (o3_aboveheight+o3_offsety);
1082
			if (placeY < scrolloffset) placeY = scrolloffset;
1083
		} else {
1084
			// BELOW
1085
			placeY = o3_y+o3_offsety;
1086
		}
1087
 
1088
		// Snapping!
1089
		if (o3_snapy > 1) {
1090
			var snapping = placeY % o3_snapy;
1091
 
1092
			if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
1093
				placeY = placeY - (o3_snapy+snapping);
1094
			} else {
1095
				placeY = placeY+(o3_snapy - snapping);
1096
			}
1097
 
1098
			if (placeY < scrolloffset) placeY = scrolloffset;
1099
		}
1100
	}
1101
 
1102
	return placeY;
1103
}
1104
 
1105
// checks positioning flags
1106
function checkPositionFlags() {
1107
	if (olHautoFlag) olHautoFlag = o3_hauto=0;
1108
	if (olVautoFlag) olVautoFlag = o3_vauto=0;
1109
	return true;
1110
}
1111
 
1112
// get Browser window width
1113
function windowWidth() {
1114
	var w;
1115
	if (o3_frame.innerWidth) w=o3_frame.innerWidth;
1116
	else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval('o3_frame.'+docRoot+'.clientWidth'))
1117
		w=eval('o3_frame.'+docRoot+'.clientWidth');
1118
	return w;
1119
}
1120
 
1121
// create the div container for popup content if it doesn't exist
1122
function createDivContainer(id,frm,zValue) {
1123
	id = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 1000);
1124
	var objRef, divContainer = layerReference(id);
1125
 
1126
	if (divContainer == null) {
1127
		if (olNs4) {
1128
			divContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm);
1129
			objRef = divContainer;
1130
		} else {
1131
			var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]);
1132
			if (olIe4&&!document.getElementById) {
1133
				body.insertAdjacentHTML("beforeEnd",'<div id="'+id+'"></div>');
1134
				divContainer=layerReference(id);
1135
			} else {
1136
				divContainer = frm.document.createElement("DIV");
1137
				divContainer.id = id;
1138
				body.appendChild(divContainer);
1139
			}
1140
			objRef = divContainer.style;
1141
		}
1142
 
1143
		objRef.position = 'absolute';
1144
		objRef.visibility = 'hidden';
1145
		objRef.zIndex = zValue;
1146
		if (olIe4&&!olOp) objRef.left = objRef.top = '0px';
1147
		else objRef.left = objRef.top =  -10000 + (!olNs4 ? 'px' : 0);
1148
	}
1149
 
1150
	return divContainer;
1151
}
1152
 
1153
// get reference to a layer with ID=id
1154
function layerReference(id) {
1155
	return (olNs4 ? o3_frame.document.layers[id] : (document.all ? o3_frame.document.all[id] : o3_frame.document.getElementById(id)));
1156
}
1157
////////
1158
//  UTILITY FUNCTIONS
1159
////////
1160
 
1161
// Checks if something is a function.
1162
function isFunction(fnRef) {
1163
	var rtn = true;
1164
 
1165
	if (typeof fnRef == 'object') {
1166
		for (var i = 0; i < fnRef.length; i++) {
1167
			if (typeof fnRef[i]=='function') continue;
1168
			rtn = false;
1169
			break;
1170
		}
1171
	} else if (typeof fnRef != 'function') {
1172
		rtn = false;
1173
	}
1174
 
1175
	return rtn;
1176
}
1177
 
1178
// Converts an array into an argument string for use in eval.
1179
function argToString(array, strtInd, argName) {
1180
	var jS = strtInd, aS = '', ar = array;
1181
	argName=(argName ? argName : 'ar');
1182
 
1183
	if (ar.length > jS) {
1184
		for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';
1185
		aS = aS.substring(0, aS.length-2);
1186
	}
1187
 
1188
	return aS;
1189
}
1190
 
1191
// Places a hook in the correct position in a hook point.
1192
function reOrder(hookPt, fnRef, order) {
1193
	var newPt = new Array(), match, i, j;
1194
 
1195
	if (!order || typeof order == 'undefined' || typeof order == 'number') return hookPt;
1196
 
1197
	if (typeof order=='function') {
1198
		if (typeof fnRef=='object') {
1199
			newPt = newPt.concat(fnRef);
1200
		} else {
1201
			newPt[newPt.length++]=fnRef;
1202
		}
1203
 
1204
		for (i = 0; i < hookPt.length; i++) {
1205
			match = false;
1206
			if (typeof fnRef == 'function' && hookPt[i] == fnRef) {
1207
				continue;
1208
			} else {
1209
				for(j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) {
1210
					match = true;
1211
					break;
1212
				}
1213
			}
1214
			if (!match) newPt[newPt.length++] = hookPt[i];
1215
		}
1216
 
1217
		newPt[newPt.length++] = order;
1218
 
1219
	} else if (typeof order == 'object') {
1220
		if (typeof fnRef == 'object') {
1221
			newPt = newPt.concat(fnRef);
1222
		} else {
1223
			newPt[newPt.length++] = fnRef;
1224
		}
1225
 
1226
		for (j = 0; j < hookPt.length; j++) {
1227
			match = false;
1228
			if (typeof fnRef == 'function' && hookPt[j] == fnRef) {
1229
				continue;
1230
			} else {
1231
				for (i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) {
1232
					match = true;
1233
					break;
1234
				}
1235
			}
1236
			if (!match) newPt[newPt.length++]=hookPt[j];
1237
		}
1238
 
1239
		for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i];
1240
		newPt.length = 0;
1241
 
1242
		for (j = 0; j < hookPt.length; j++) {
1243
			match = false;
1244
			for (i = 0; i < order.length; i++) {
1245
				if (hookPt[j] == order[i]) {
1246
					match = true;
1247
					break;
1248
				}
1249
			}
1250
			if (!match) newPt[newPt.length++] = hookPt[j];
1251
		}
1252
		newPt = newPt.concat(order);
1253
	}
1254
 
1255
	hookPt = newPt;
1256
 
1257
	return hookPt;
1258
}
1259
 
1260
////////
1261
//  PLUGIN ACTIVATION FUNCTIONS
1262
////////
1263
 
1264
// Runs plugin functions to set runtime variables.
1265
function setRunTimeVariables(){
1266
	if (typeof runTime != 'undefined' && runTime.length) {
1267
		for (var k = 0; k < runTime.length; k++) {
1268
			runTime[k]();
1269
		}
1270
	}
1271
}
1272
 
1273
// Runs plugin functions to parse commands.
1274
function parseCmdLine(pf, i, args) {
1275
	if (typeof cmdLine != 'undefined' && cmdLine.length) {
1276
		for (var k = 0; k < cmdLine.length; k++) {
1277
			var j = cmdLine[k](pf, i, args);
1278
			if (j >- 1) {
1279
				i = j;
1280
				break;
1281
			}
1282
		}
1283
	}
1284
 
1285
	return i;
1286
}
1287
 
1288
// Runs plugin functions to do things after parse.
1289
function postParseChecks(pf,args){
1290
	if (typeof postParse != 'undefined' && postParse.length) {
1291
		for (var k = 0; k < postParse.length; k++) {
1292
			if (postParse[k](pf,args)) continue;
1293
			return false;  // end now since have an error
1294
		}
1295
	}
1296
	return true;
1297
}
1298
 
1299
 
1300
////////
1301
//  PLUGIN REGISTRATION FUNCTIONS
1302
////////
1303
 
1304
// Registers commands and creates constants.
1305
function registerCommands(cmdStr) {
1306
	if (typeof cmdStr!='string') return;
1307
 
1308
	var pM = cmdStr.split(',');
1309
	pms = pms.concat(pM);
1310
 
1311
	for (var i = 0; i< pM.length; i++) {
1312
		eval(pM[i].toUpperCase()+'='+pmCount++);
1313
	}
1314
}
1315
 
1316
// Registers no-parameter commands
1317
function registerNoParameterCommands(cmdStr) {
1318
	if (!cmdStr && typeof cmdStr != 'string') return;
1319
	pmt=(!pmt) ? cmdStr : pmt + ',' + cmdStr;
1320
}
1321
 
1322
// Register a function to hook at a certain point.
1323
function registerHook(fnHookTo, fnRef, hookType, optPm) {
1324
	var hookPt, last = typeof optPm;
1325
 
1326
	if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return;
1327
	if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference();
1328
 
1329
	hookPt = hookPts[fnHookTo];
1330
 
1331
	if (hookType != null) {
1332
		if (hookType == FREPLACE) {
1333
			hookPt.ovload = fnRef;  // replace normal overlib routine
1334
			if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef;
1335
 
1336
		} else if (hookType == FBEFORE || hookType == FAFTER) {
1337
			var hookPt=(hookType == 1 ? hookPt.before : hookPt.after);
1338
 
1339
			if (typeof fnRef == 'object') {
1340
				hookPt = hookPt.concat(fnRef);
1341
			} else {
1342
				hookPt[hookPt.length++] = fnRef;
1343
			}
1344
 
1345
			if (optPm) hookPt = reOrder(hookPt, fnRef, optPm);
1346
 
1347
		} else if (hookType == FALTERNATE) {
1348
			if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef;
1349
		} else if (hookType == FCHAIN) {
1350
			hookPt = hookPt.chain;
1351
			if (typeof fnRef=='object') hookPt=hookPt.concat(fnRef); // add other functions
1352
			else hookPt[hookPt.length++]=fnRef;
1353
		}
1354
 
1355
		return;
1356
	}
1357
}
1358
 
1359
// Register a function that will set runtime variables.
1360
function registerRunTimeFunction(fn) {
1361
	if (isFunction(fn)) {
1362
		if (typeof fn == 'object') {
1363
			runTime = runTime.concat(fn);
1364
		} else {
1365
			runTime[runTime.length++] = fn;
1366
		}
1367
	}
1368
}
1369
 
1370
// Register a function that will handle command parsing.
1371
function registerCmdLineFunction(fn){
1372
	if (isFunction(fn)) {
1373
		if (typeof fn == 'object') {
1374
			cmdLine = cmdLine.concat(fn);
1375
		} else {
1376
			cmdLine[cmdLine.length++] = fn;
1377
		}
1378
	}
1379
}
1380
 
1381
// Register a function that does things after command parsing.
1382
function registerPostParseFunction(fn){
1383
	if (isFunction(fn)) {
1384
		if (typeof fn == 'object') {
1385
			postParse = postParse.concat(fn);
1386
		} else {
1387
			postParse[postParse.length++] = fn;
1388
		}
1389
	}
1390
}
1391
 
1392
////////
1393
//  PLUGIN REGISTRATION FUNCTIONS
1394
////////
1395
 
1396
// Runs any hooks registered.
1397
function runHook(fnHookTo, hookType) {
1398
	var l = hookPts[fnHookTo], k, rtnVal = null, optPm, arS, ar = runHook.arguments;
1399
 
1400
	if (hookType == FREPLACE) {
1401
		arS = argToString(ar, 2);
1402
 
1403
		if (typeof l == 'undefined' || !(l = l.ovload)) rtnVal = eval(fnHookTo+'('+arS+')');
1404
		else rtnVal = eval('l('+arS+')');
1405
 
1406
	} else if (hookType == FBEFORE || hookType == FAFTER) {
1407
		if (typeof l != 'undefined') {
1408
			l=(hookType == 1 ? l.before : l.after);
1409
 
1410
			if (l.length) {
1411
				arS = argToString(ar, 2);
1412
				for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')');
1413
			}
1414
		}
1415
	} else if (hookType == FALTERNATE) {
1416
		optPm = ar[2];
1417
		arS = argToString(ar, 3);
1418
 
1419
		if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') {
1420
			rtnVal = eval(fnHookTo+'('+arS+')');
1421
		} else {
1422
			rtnVal = eval('l('+arS+')');
1423
		}
1424
	} else if (hookType == FCHAIN) {
1425
		arS=argToString(ar,2);
1426
		l=l.chain;
1427
 
1428
		for (k=l.length; k > 0; k--) if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0)) break;
1429
	}
1430
 
1431
	return rtnVal;
1432
}
1433
 
1434
////////
1435
// OBJECT CONSTRUCTORS
1436
////////
1437
 
1438
// Object for handling hooks.
1439
function FunctionReference() {
1440
	this.ovload = null;
1441
	this.before = new Array();
1442
	this.after = new Array();
1443
	this.alt = new Array();
1444
	this.chain = new Array();
1445
}
1446
 
1447
// Object for simple access to the overLIB version used.
1448
// Examples: simpleversion:351 major:3 minor:5 revision:1
1449
function Info(version, prerelease) {
1450
	this.version = version;
1451
	this.prerelease = prerelease;
1452
 
1453
	this.simpleversion = Math.round(this.version*100);
1454
	this.major = parseInt(this.simpleversion / 100);
1455
	this.minor = parseInt(this.simpleversion / 10) - this.major * 10;
1456
	this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10;
1457
	this.meets = meets;
1458
}
1459
 
1460
// checks for Core Version required
1461
function meets(reqdVersion) {
1462
	return (!reqdVersion) ? false : this.simpleversion >= Math.round(100*parseFloat(reqdVersion));
1463
}
1464
 
1465
 
1466
////////
1467
// STANDARD REGISTRATIONS
1468
////////
1469
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF);
1470
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
1471
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
1472
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
1473
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
1474
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
1475
registerPostParseFunction(checkPositionFlags);
1476
registerHook("hideObject", nbspCleanup, FAFTER);
1477
registerHook("horizontalPlacement", horizontalPlacement, FCHAIN);
1478
registerHook("verticalPlacement", verticalPlacement, FCHAIN);
1479
if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1;
1480
registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');
1481
///////
1482
// ESTABLISH MOUSECAPTURING
1483
///////
1484
 
1485
// Capture events, alt. diffuses the overlib function.
1486
var olCheckMouseCapture=true;
1487
if ((olNs4 || olNs6 || olIe4)) {
1488
	olMouseCapture();
1489
} else {
1490
	overlib = no_overlib;
1491
	nd = no_overlib;
1492
	ver3fix = true;
1493
}