Project

General

Profile

1
//\/////
2

    
3
//\  overLIB 4.21 - You may not remove or change this notice.
4

    
5
//\  Copyright Erik Bosrup 1998-2004. All rights reserved.
6

    
7
//\
8

    
9
//\  Contributors are listed on the homepage.
10

    
11
//\  This file might be old, always check for the latest version at:
12

    
13
//\  http://www.bosrup.com/web/overlib/
14

    
15
//\
16

    
17
//\  Please read the license agreement (available through the link above)
18

    
19
//\  before using overLIB. Direct any licensing questions to erik@bosrup.com.
20

    
21
//\
22

    
23
//\  Do not sell this as your own work or remove this copyright notice. 
24

    
25
//\  For full details on copying or changing this script please read the
26

    
27
//\  license agreement at the link above. Please give credit on sites that
28

    
29
//\  use overLIB and submit changes of the script so other people can use
30

    
31
//\  them as well.
32

    
33
//   $Revision$                $Date$
34

    
35
//\/////
36

    
37
//\mini
38

    
39

    
40

    
41
////////
42

    
43
// PRE-INIT
44

    
45
// Ignore these lines, configuration is below.
46

    
47
////////
48

    
49
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);
50

    
51
var FREPLACE = 0; var FBEFORE = 1; var FAFTER = 2; var FALTERNATE = 3; var FCHAIN=4;
52

    
53
var olHideForm=0;  // parameter for hiding SELECT and ActiveX elements in IE5.5+ 
54

    
55
var olHautoFlag = 0;  // flags for over-riding VAUTO and HAUTO if corresponding
56

    
57
var olVautoFlag = 0;  // positioning commands are used on the command line
58

    
59
var hookPts = new Array(), postParse = new Array(), cmdLine = new Array(), runTime = new Array();
60

    
61
// for plugins
62

    
63
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');
64

    
65

    
66

    
67
////////
68

    
69
// DEFAULT CONFIGURATION
70

    
71
// Settings you want everywhere are set here. All of this can also be
72

    
73
// changed on your html page or through an overLIB call.
74

    
75
////////
76

    
77
if (typeof ol_fgcolor=='undefined') var ol_fgcolor="#CCCCFF";
78

    
79
if (typeof ol_bgcolor=='undefined') var ol_bgcolor="#333399";
80

    
81
if (typeof ol_textcolor=='undefined') var ol_textcolor="#000000";
82

    
83
if (typeof ol_capcolor=='undefined') var ol_capcolor="#FFFFFF";
84

    
85
if (typeof ol_closecolor=='undefined') var ol_closecolor="#9999FF";
86

    
87
if (typeof ol_textfont=='undefined') var ol_textfont="Verdana,Arial,Helvetica";
88

    
89
if (typeof ol_captionfont=='undefined') var ol_captionfont="Verdana,Arial,Helvetica";
90

    
91
if (typeof ol_closefont=='undefined') var ol_closefont="Verdana,Arial,Helvetica";
92

    
93
if (typeof ol_textsize=='undefined') var ol_textsize="1";
94

    
95
if (typeof ol_captionsize=='undefined') var ol_captionsize="1";
96

    
97
if (typeof ol_closesize=='undefined') var ol_closesize="1";
98

    
99
if (typeof ol_width=='undefined') var ol_width="200";
100

    
101
if (typeof ol_border=='undefined') var ol_border="1";
102

    
103
if (typeof ol_cellpad=='undefined') var ol_cellpad=2;
104

    
105
if (typeof ol_offsetx=='undefined') var ol_offsetx=10;
106

    
107
if (typeof ol_offsety=='undefined') var ol_offsety=10;
108

    
109
if (typeof ol_text=='undefined') var ol_text="Default Text";
110

    
111
if (typeof ol_cap=='undefined') var ol_cap="";
112

    
113
if (typeof ol_sticky=='undefined') var ol_sticky=0;
114

    
115
if (typeof ol_background=='undefined') var ol_background="";
116

    
117
if (typeof ol_close=='undefined') var ol_close="Close";
118

    
119
if (typeof ol_hpos=='undefined') var ol_hpos=RIGHT;
120

    
121
if (typeof ol_status=='undefined') var ol_status="";
122

    
123
if (typeof ol_autostatus=='undefined') var ol_autostatus=0;
124

    
125
if (typeof ol_height=='undefined') var ol_height=-1;
126

    
127
if (typeof ol_snapx=='undefined') var ol_snapx=0;
128

    
129
if (typeof ol_snapy=='undefined') var ol_snapy=0;
130

    
131
if (typeof ol_fixx=='undefined') var ol_fixx=-1;
132

    
133
if (typeof ol_fixy=='undefined') var ol_fixy=-1;
134

    
135
if (typeof ol_relx=='undefined') var ol_relx=null;
136

    
137
if (typeof ol_rely=='undefined') var ol_rely=null;
138

    
139
if (typeof ol_fgbackground=='undefined') var ol_fgbackground="";
140

    
141
if (typeof ol_bgbackground=='undefined') var ol_bgbackground="";
142

    
143
if (typeof ol_padxl=='undefined') var ol_padxl=1;
144

    
145
if (typeof ol_padxr=='undefined') var ol_padxr=1;
146

    
147
if (typeof ol_padyt=='undefined') var ol_padyt=1;
148

    
149
if (typeof ol_padyb=='undefined') var ol_padyb=1;
150

    
151
if (typeof ol_fullhtml=='undefined') var ol_fullhtml=0;
152

    
153
if (typeof ol_vpos=='undefined') var ol_vpos=BELOW;
154

    
155
if (typeof ol_aboveheight=='undefined') var ol_aboveheight=0;
156

    
157
if (typeof ol_capicon=='undefined') var ol_capicon="";
158

    
159
if (typeof ol_frame=='undefined') var ol_frame=self;
160

    
161
if (typeof ol_timeout=='undefined') var ol_timeout=0;
162

    
163
if (typeof ol_function=='undefined') var ol_function=null;
164

    
165
if (typeof ol_delay=='undefined') var ol_delay=0;
166

    
167
if (typeof ol_hauto=='undefined') var ol_hauto=0;
168

    
169
if (typeof ol_vauto=='undefined') var ol_vauto=0;
170

    
171
if (typeof ol_closeclick=='undefined') var ol_closeclick=0;
172

    
173
if (typeof ol_wrap=='undefined') var ol_wrap=0;
174

    
175
if (typeof ol_followmouse=='undefined') var ol_followmouse=1;
176

    
177
if (typeof ol_mouseoff=='undefined') var ol_mouseoff=0;
178

    
179
if (typeof ol_closetitle=='undefined') var ol_closetitle='Close';
180

    
181
if (typeof ol_compatmode=='undefined') var ol_compatmode=0;
182

    
183
if (typeof ol_css=='undefined') var ol_css=CSSOFF;
184

    
185
if (typeof ol_fgclass=='undefined') var ol_fgclass="";
186

    
187
if (typeof ol_bgclass=='undefined') var ol_bgclass="";
188

    
189
if (typeof ol_textfontclass=='undefined') var ol_textfontclass="";
190

    
191
if (typeof ol_captionfontclass=='undefined') var ol_captionfontclass="";
192

    
193
if (typeof ol_closefontclass=='undefined') var ol_closefontclass="";
194

    
195

    
196

    
197
////////
198

    
199
// ARRAY CONFIGURATION
200

    
201
////////
202

    
203

    
204

    
205
// You can use these arrays to store popup text here instead of in the html.
206

    
207
if (typeof ol_texts=='undefined') var ol_texts = new Array("Text 0", "Text 1");
208

    
209
if (typeof ol_caps=='undefined') var ol_caps = new Array("Caption 0", "Caption 1");
210

    
211

    
212

    
213
////////
214

    
215
// END OF CONFIGURATION
216

    
217
// Don't change anything below this line, all configuration is above.
218

    
219
////////
220

    
221

    
222

    
223

    
224

    
225

    
226

    
227

    
228

    
229

    
230

    
231
////////
232

    
233
// INIT
234

    
235
////////
236

    
237
// Runtime variables init. Don't change for config!
238

    
239
var o3_text="";
240

    
241
var o3_cap="";
242

    
243
var o3_sticky=0;
244

    
245
var o3_background="";
246

    
247
var o3_close="Close";
248

    
249
var o3_hpos=RIGHT;
250

    
251
var o3_offsetx=2;
252

    
253
var o3_offsety=2;
254

    
255
var o3_fgcolor="";
256

    
257
var o3_bgcolor="";
258

    
259
var o3_textcolor="";
260

    
261
var o3_capcolor="";
262

    
263
var o3_closecolor="";
264

    
265
var o3_width=100;
266

    
267
var o3_border=1;
268

    
269
var o3_cellpad=2;
270

    
271
var o3_status="";
272

    
273
var o3_autostatus=0;
274

    
275
var o3_height=-1;
276

    
277
var o3_snapx=0;
278

    
279
var o3_snapy=0;
280

    
281
var o3_fixx=-1;
282

    
283
var o3_fixy=-1;
284

    
285
var o3_relx=null;
286

    
287
var o3_rely=null;
288

    
289
var o3_fgbackground="";
290

    
291
var o3_bgbackground="";
292

    
293
var o3_padxl=0;
294

    
295
var o3_padxr=0;
296

    
297
var o3_padyt=0;
298

    
299
var o3_padyb=0;
300

    
301
var o3_fullhtml=0;
302

    
303
var o3_vpos=BELOW;
304

    
305
var o3_aboveheight=0;
306

    
307
var o3_capicon="";
308

    
309
var o3_textfont="Verdana,Arial,Helvetica";
310

    
311
var o3_captionfont="Verdana,Arial,Helvetica";
312

    
313
var o3_closefont="Verdana,Arial,Helvetica";
314

    
315
var o3_textsize="1";
316

    
317
var o3_captionsize="1";
318

    
319
var o3_closesize="1";
320

    
321
var o3_frame=self;
322

    
323
var o3_timeout=0;
324

    
325
var o3_timerid=0;
326

    
327
var o3_allowmove=0;
328

    
329
var o3_function=null; 
330

    
331
var o3_delay=0;
332

    
333
var o3_delayid=0;
334

    
335
var o3_hauto=0;
336

    
337
var o3_vauto=0;
338

    
339
var o3_closeclick=0;
340

    
341
var o3_wrap=0;
342

    
343
var o3_followmouse=1;
344

    
345
var o3_mouseoff=0;
346

    
347
var o3_closetitle='';
348

    
349
var o3_compatmode=0;
350

    
351
var o3_css=CSSOFF;
352

    
353
var o3_fgclass="";
354

    
355
var o3_bgclass="";
356

    
357
var o3_textfontclass="";
358

    
359
var o3_captionfontclass="";
360

    
361
var o3_closefontclass="";
362

    
363

    
364

    
365
// Display state variables
366

    
367
var o3_x = 0;
368

    
369
var o3_y = 0;
370

    
371
var o3_showingsticky = 0;
372

    
373
var o3_removecounter = 0;
374

    
375

    
376

    
377
// Our layer
378

    
379
var over = null;
380

    
381
var fnRef, hoveringSwitch = false;
382

    
383
var olHideDelay;
384

    
385

    
386

    
387
// Decide browser version
388

    
389
var isMac = (navigator.userAgent.indexOf("Mac") != -1);
390

    
391
var olOp = (navigator.userAgent.toLowerCase().indexOf('opera') > -1 && document.createTextNode);  // Opera 7
392

    
393
var olNs4 = (navigator.appName=='Netscape' && parseInt(navigator.appVersion) == 4);
394

    
395
var olNs6 = (document.getElementById) ? true : false;
396

    
397
var olKq = (olNs6 && /konqueror/i.test(navigator.userAgent));
398

    
399
var olIe4 = (document.all) ? true : false;
400

    
401
var olIe5 = false; 
402

    
403
var olIe55 = false; // Added additional variable to identify IE5.5+
404

    
405
var docRoot = 'document.body';
406

    
407

    
408

    
409
// Resize fix for NS4.x to keep track of layer
410

    
411
if (olNs4) {
412

    
413
	var oW = window.innerWidth;
414

    
415
	var oH = window.innerHeight;
416

    
417
	window.onresize = function() { if (oW != window.innerWidth || oH != window.innerHeight) location.reload(); }
418

    
419
}
420

    
421

    
422

    
423
// Microsoft Stupidity Check(tm).
424

    
425
if (olIe4) {
426

    
427
	var agent = navigator.userAgent;
428

    
429
	if (/MSIE/.test(agent)) {
430

    
431
		var versNum = parseFloat(agent.match(/MSIE[ ](\d\.\d+)\.*/i)[1]);
432

    
433
		if (versNum >= 5){
434

    
435
			olIe5=true;
436

    
437
			olIe55=(versNum>=5.5&&!olOp) ? true : false;
438

    
439
			if (olNs6) olNs6=false;
440

    
441
		}
442

    
443
	}
444

    
445
	if (olNs6) olIe4 = false;
446

    
447
}
448

    
449

    
450

    
451
// Check for compatability mode.
452

    
453
if (document.compatMode && document.compatMode == 'CSS1Compat') {
454

    
455
	docRoot= ((olIe4 && !olOp) ? 'document.documentElement' : docRoot);
456

    
457
}
458

    
459

    
460

    
461
// Add window onload handlers to indicate when all modules have been loaded
462

    
463
// For Netscape 6+ and Mozilla, uses addEventListener method on the window object
464

    
465
// For IE it uses the attachEvent method of the window object and for Netscape 4.x
466

    
467
// it sets the window.onload handler to the OLonload_handler function for Bubbling
468

    
469
if(window.addEventListener) window.addEventListener("load",OLonLoad_handler,false);
470

    
471
else {
472

    
473
  if (window.attachEvent) {
474

    
475
    var pc_result = window.attachEvent("onload",OLonLoad_handler);
476

    
477
    if( pc_result == false ) alert("Failed onload attach");
478

    
479
  } else {
480

    
481
    alert( "failed attach");
482

    
483
  }
484

    
485
}
486

    
487

    
488

    
489
var capExtent;
490

    
491

    
492

    
493
////////
494

    
495
// PUBLIC FUNCTIONS
496

    
497
////////
498

    
499

    
500

    
501
// overlib(arg0,...,argN)
502

    
503
// Loads parameters into global runtime variables.
504

    
505
function overlib() {
506

    
507
	if (!olLoaded || isExclusive(overlib.arguments)) return true;
508

    
509
	if (olCheckMouseCapture) olMouseCapture();
510

    
511
	if (over) {
512

    
513
		over = (typeof over.id != 'string') ? o3_frame.document.all['overDiv'] : over;
514

    
515
		cClick();
516

    
517
	}
518

    
519

    
520

    
521
	// Load defaults to runtime.
522

    
523
  olHideDelay=0;
524

    
525
	o3_text=ol_text;
526

    
527
	o3_cap=ol_cap;
528

    
529
	o3_sticky=ol_sticky;
530

    
531
	o3_background=ol_background;
532

    
533
	o3_close=ol_close;
534

    
535
	o3_hpos=ol_hpos;
536

    
537
	o3_offsetx=ol_offsetx;
538

    
539
	o3_offsety=ol_offsety;
540

    
541
	o3_fgcolor=ol_fgcolor;
542

    
543
	o3_bgcolor=ol_bgcolor;
544

    
545
	o3_textcolor=ol_textcolor;
546

    
547
	o3_capcolor=ol_capcolor;
548

    
549
	o3_closecolor=ol_closecolor;
550

    
551
	o3_width=ol_width;
552

    
553
	o3_border=ol_border;
554

    
555
	o3_cellpad=ol_cellpad;
556

    
557
	o3_status=ol_status;
558

    
559
	o3_autostatus=ol_autostatus;
560

    
561
	o3_height=ol_height;
562

    
563
	o3_snapx=ol_snapx;
564

    
565
	o3_snapy=ol_snapy;
566

    
567
	o3_fixx=ol_fixx;
568

    
569
	o3_fixy=ol_fixy;
570

    
571
	o3_relx=ol_relx;
572

    
573
	o3_rely=ol_rely;
574

    
575
	o3_fgbackground=ol_fgbackground;
576

    
577
	o3_bgbackground=ol_bgbackground;
578

    
579
	o3_padxl=ol_padxl;
580

    
581
	o3_padxr=ol_padxr;
582

    
583
	o3_padyt=ol_padyt;
584

    
585
	o3_padyb=ol_padyb;
586

    
587
	o3_fullhtml=ol_fullhtml;
588

    
589
	o3_vpos=ol_vpos;
590

    
591
	o3_aboveheight=ol_aboveheight;
592

    
593
	o3_capicon=ol_capicon;
594

    
595
	o3_textfont=ol_textfont;
596

    
597
	o3_captionfont=ol_captionfont;
598

    
599
	o3_closefont=ol_closefont;
600

    
601
	o3_textsize=ol_textsize;
602

    
603
	o3_captionsize=ol_captionsize;
604

    
605
	o3_closesize=ol_closesize;
606

    
607
	o3_timeout=ol_timeout;
608

    
609
	o3_function=ol_function;
610

    
611
	o3_delay=ol_delay;
612

    
613
	o3_hauto=ol_hauto;
614

    
615
	o3_vauto=ol_vauto;
616

    
617
	o3_closeclick=ol_closeclick;
618

    
619
	o3_wrap=ol_wrap;	
620

    
621
	o3_followmouse=ol_followmouse;
622

    
623
	o3_mouseoff=ol_mouseoff;
624

    
625
	o3_closetitle=ol_closetitle;
626

    
627
	o3_css=ol_css;
628

    
629
	o3_compatmode=ol_compatmode;
630

    
631
	o3_fgclass=ol_fgclass;
632

    
633
	o3_bgclass=ol_bgclass;
634

    
635
	o3_textfontclass=ol_textfontclass;
636

    
637
	o3_captionfontclass=ol_captionfontclass;
638

    
639
	o3_closefontclass=ol_closefontclass;
640

    
641
	
642

    
643
	setRunTimeVariables();
644

    
645
	
646

    
647
	fnRef = '';
648

    
649
	
650

    
651
	// Special for frame support, over must be reset...
652

    
653
	o3_frame = ol_frame;
654

    
655
	
656

    
657
	if(!(over=createDivContainer())) return false;
658

    
659

    
660

    
661
	parseTokens('o3_', overlib.arguments);
662

    
663
	if (!postParseChecks()) return false;
664

    
665

    
666

    
667
	if (o3_delay == 0) {
668

    
669
		return runHook("olMain", FREPLACE);
670

    
671
 	} else {
672

    
673
		o3_delayid = setTimeout("runHook('olMain', FREPLACE)", o3_delay);
674

    
675
		return false;
676

    
677
	}
678

    
679
}
680

    
681

    
682

    
683
// Clears popups if appropriate
684

    
685
function nd(time) {
686

    
687
	if (olLoaded && !isExclusive()) {
688

    
689
		hideDelay(time);  // delay popup close if time specified
690

    
691

    
692

    
693
		if (o3_removecounter >= 1) { o3_showingsticky = 0 };
694

    
695
		
696

    
697
		if (o3_showingsticky == 0) {
698

    
699
			o3_allowmove = 0;
700

    
701
			if (over != null && o3_timerid == 0) runHook("hideObject", FREPLACE, over);
702

    
703
		} else {
704

    
705
			o3_removecounter++;
706

    
707
		}
708

    
709
	}
710

    
711
	
712

    
713
	return true;
714

    
715
}
716

    
717

    
718

    
719
// The Close onMouseOver function for stickies
720

    
721
function cClick() {
722

    
723
	if (olLoaded) {
724

    
725
		runHook("hideObject", FREPLACE, over);
726

    
727
		o3_showingsticky = 0;	
728

    
729
	}	
730

    
731
	return false;
732

    
733
}
734

    
735

    
736

    
737
// Method for setting page specific defaults.
738

    
739
function overlib_pagedefaults() {
740

    
741
	parseTokens('ol_', overlib_pagedefaults.arguments);
742

    
743
}
744

    
745

    
746

    
747

    
748

    
749
////////
750

    
751
// OVERLIB MAIN FUNCTION
752

    
753
////////
754

    
755

    
756

    
757
// This function decides what it is we want to display and how we want it done.
758

    
759
function olMain() {
760

    
761
	var layerhtml, styleType;
762

    
763
 	runHook("olMain", FBEFORE);
764

    
765
 	
766

    
767
	if (o3_background!="" || o3_fullhtml) {
768

    
769
		// Use background instead of box.
770

    
771
		layerhtml = runHook('ol_content_background', FALTERNATE, o3_css, o3_text, o3_background, o3_fullhtml);
772

    
773
	} else {
774

    
775
		// They want a popup box.
776

    
777
		styleType = (pms[o3_css-1-pmStart] == "cssoff" || pms[o3_css-1-pmStart] == "cssclass");
778

    
779

    
780

    
781
		// Prepare popup background
782

    
783
		if (o3_fgbackground != "") o3_fgbackground = "background=\""+o3_fgbackground+"\"";
784

    
785
		if (o3_bgbackground != "") o3_bgbackground = (styleType ? "background=\""+o3_bgbackground+"\"" : o3_bgbackground);
786

    
787

    
788

    
789
		// Prepare popup colors
790

    
791
		if (o3_fgcolor != "") o3_fgcolor = (styleType ? "bgcolor=\""+o3_fgcolor+"\"" : o3_fgcolor);
792

    
793
		if (o3_bgcolor != "") o3_bgcolor = (styleType ? "bgcolor=\""+o3_bgcolor+"\"" : o3_bgcolor);
794

    
795

    
796

    
797
		// Prepare popup height
798

    
799
		if (o3_height > 0) o3_height = (styleType ? "height=\""+o3_height+"\"" : o3_height);
800

    
801
		else o3_height = "";
802

    
803

    
804

    
805
		// Decide which kinda box.
806

    
807
		if (o3_cap=="") {
808

    
809
			// Plain
810

    
811
			layerhtml = runHook('ol_content_simple', FALTERNATE, o3_css, o3_text);
812

    
813
		} else {
814

    
815
			// With caption
816

    
817
			if (o3_sticky) {
818

    
819
				// Show close text
820

    
821
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, o3_close);
822

    
823
			} else {
824

    
825
				// No close text
826

    
827
				layerhtml = runHook('ol_content_caption', FALTERNATE, o3_css, o3_text, o3_cap, "");
828

    
829
			}
830

    
831
		}
832

    
833
	}	
834

    
835

    
836

    
837
	// We want it to stick!
838

    
839
	if (o3_sticky) {
840

    
841
		if (o3_timerid > 0) {
842

    
843
			clearTimeout(o3_timerid);
844

    
845
			o3_timerid = 0;
846

    
847
		}
848

    
849
		o3_showingsticky = 1;
850

    
851
		o3_removecounter = 0;
852

    
853
	}
854

    
855

    
856

    
857
	// Created a separate routine to generate the popup to make it easier
858

    
859
	// to implement a plugin capability
860

    
861
	if (!runHook("createPopup", FREPLACE, layerhtml)) return false;
862

    
863

    
864

    
865
	// Prepare status bar
866

    
867
	if (o3_autostatus > 0) {
868

    
869
		o3_status = o3_text;
870

    
871
		if (o3_autostatus > 1) o3_status = o3_cap;
872

    
873
	}
874

    
875

    
876

    
877
	// When placing the layer the first time, even stickies may be moved.
878

    
879
	o3_allowmove = 0;
880

    
881

    
882

    
883
	// Initiate a timer for timeout
884

    
885
	if (o3_timeout > 0) {          
886

    
887
		if (o3_timerid > 0) clearTimeout(o3_timerid);
888

    
889
		o3_timerid = setTimeout("cClick()", o3_timeout);
890

    
891
	}
892

    
893

    
894

    
895
	// Show layer
896

    
897
	runHook("disp", FREPLACE, o3_status);
898

    
899
	runHook("olMain", FAFTER);
900

    
901

    
902

    
903
	return (olOp && event && event.type == 'mouseover' && !o3_status) ? '' : (o3_status != '');
904

    
905
}
906

    
907

    
908

    
909
////////
910

    
911
// LAYER GENERATION FUNCTIONS
912

    
913
////////
914

    
915
// These functions just handle popup content with tags that should adhere to the W3C standards specification.
916

    
917

    
918

    
919
// Makes simple table without caption
920

    
921
function ol_content_simple(text) {
922

    
923
	var cpIsMultiple = /,/.test(o3_cellpad);
924

    
925
	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>';
926

    
927

    
928

    
929
	set_background("");
930

    
931
	return txt;
932

    
933
}
934

    
935

    
936

    
937
// Makes table with caption and optional close link
938

    
939
function ol_content_caption(text,title,close) {
940

    
941
	var nameId, txt, cpIsMultiple = /,/.test(o3_cellpad);
942

    
943
	var closing, closeevent;
944

    
945

    
946

    
947
	closing = "";
948

    
949
	closeevent = "onmouseover";
950

    
951
	if (o3_closeclick == 1) closeevent = (o3_closetitle ? "title='" + o3_closetitle +"'" : "") + " onclick";
952

    
953
	if (o3_capicon != "") {
954

    
955
	  nameId = ' hspace = \"5\"'+' align = \"middle\" alt = \"\"';
956

    
957
	  if (typeof o3_dragimg != 'undefined' && o3_dragimg) nameId =' hspace=\"5\"'+' name=\"'+o3_dragimg+'\" id=\"'+o3_dragimg+'\" align=\"middle\" alt=\"Drag Enabled\" title=\"Drag Enabled\"';
958

    
959
	  o3_capicon = '<img src=\"'+o3_capicon+'\"'+nameId+' />';
960

    
961
	}
962

    
963

    
964

    
965
	if (close != "")
966

    
967
		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>';
968

    
969
	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>';
970

    
971

    
972

    
973
	set_background("");
974

    
975
	return txt;
976

    
977
}
978

    
979

    
980

    
981
// Sets the background picture,padding and lots more. :)
982

    
983
function ol_content_background(text,picture,hasfullhtml) {
984

    
985
	if (hasfullhtml) {
986

    
987
		txt=text;
988

    
989
	} else {
990

    
991
		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>';
992

    
993
	}
994

    
995

    
996

    
997
	set_background(picture);
998

    
999
	return txt;
1000

    
1001
}
1002

    
1003

    
1004

    
1005
// Loads a picture into the div.
1006

    
1007
function set_background(pic) {
1008

    
1009
	if (pic == "") {
1010

    
1011
		if (olNs4) {
1012

    
1013
			over.background.src = null; 
1014

    
1015
		} else if (over.style) {
1016

    
1017
			over.style.backgroundImage = "none";
1018

    
1019
		}
1020

    
1021
	} else {
1022

    
1023
		if (olNs4) {
1024

    
1025
			over.background.src = pic;
1026

    
1027
		} else if (over.style) {
1028

    
1029
			over.style.width=o3_width + 'px';
1030

    
1031
			over.style.backgroundImage = "url("+pic+")";
1032

    
1033
		}
1034

    
1035
	}
1036

    
1037
}
1038

    
1039

    
1040

    
1041
////////
1042

    
1043
// HANDLING FUNCTIONS
1044

    
1045
////////
1046

    
1047
var olShowId=-1;
1048

    
1049

    
1050

    
1051
// Displays the popup
1052

    
1053
function disp(statustext) {
1054

    
1055
	runHook("disp", FBEFORE);
1056

    
1057
	
1058

    
1059
	if (o3_allowmove == 0) {
1060

    
1061
		runHook("placeLayer", FREPLACE);
1062

    
1063
		(olNs6&&olShowId<0) ? olShowId=setTimeout("runHook('showObject', FREPLACE, over)", 1) : runHook("showObject", FREPLACE, over);
1064

    
1065
		o3_allowmove = (o3_sticky || o3_followmouse==0) ? 0 : 1;
1066

    
1067
	}
1068

    
1069
	
1070

    
1071
	runHook("disp", FAFTER);
1072

    
1073

    
1074

    
1075
	if (statustext != "") self.status = statustext;
1076

    
1077
}
1078

    
1079

    
1080

    
1081
// Creates the actual popup structure
1082

    
1083
function createPopup(lyrContent){
1084

    
1085
	runHook("createPopup", FBEFORE);
1086

    
1087
	
1088

    
1089
	if (o3_wrap) {
1090

    
1091
		var wd,ww,theObj = (olNs4 ? over : over.style);
1092

    
1093
		theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
1094

    
1095
		layerWrite(lyrContent);
1096

    
1097
		wd = (olNs4 ? over.clip.width : over.offsetWidth);
1098

    
1099
		if (wd > (ww=windowWidth())) {
1100

    
1101
			lyrContent=lyrContent.replace(/\&nbsp;/g, ' ');
1102

    
1103
			o3_width=ww;
1104

    
1105
			o3_wrap=0;
1106

    
1107
		} 
1108

    
1109
	}
1110

    
1111

    
1112

    
1113
	layerWrite(lyrContent);
1114

    
1115
	
1116

    
1117
	// Have to set o3_width for placeLayer() routine if o3_wrap is turned on
1118

    
1119
	if (o3_wrap) o3_width=(olNs4 ? over.clip.width : over.offsetWidth);
1120

    
1121
	
1122

    
1123
	runHook("createPopup", FAFTER, lyrContent);
1124

    
1125

    
1126

    
1127
	return true;
1128

    
1129
}
1130

    
1131

    
1132

    
1133
// Decides where we want the popup.
1134

    
1135
function placeLayer() {
1136

    
1137
	var placeX, placeY, widthFix = 0;
1138

    
1139
	
1140

    
1141
	// HORIZONTAL PLACEMENT, re-arranged to work in Safari
1142

    
1143
	if (o3_frame.innerWidth) widthFix=18; 
1144

    
1145
	iwidth = windowWidth();
1146

    
1147

    
1148

    
1149
	// Horizontal scroll offset
1150

    
1151
	winoffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollLeft') : o3_frame.pageXOffset;
1152

    
1153

    
1154

    
1155
	placeX = runHook('horizontalPlacement',FCHAIN,iwidth,winoffset,widthFix);
1156

    
1157

    
1158

    
1159
	// VERTICAL PLACEMENT, re-arranged to work in Safari
1160

    
1161
	if (o3_frame.innerHeight) {
1162

    
1163
		iheight=o3_frame.innerHeight;
1164

    
1165
	} else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientHeight=='number'")&&eval('o3_frame.'+docRoot+'.clientHeight')) { 
1166

    
1167
		iheight=eval('o3_frame.'+docRoot+'.clientHeight');
1168

    
1169
	}			
1170

    
1171

    
1172

    
1173
	// Vertical scroll offset
1174

    
1175
	scrolloffset=(olIe4) ? eval('o3_frame.'+docRoot+'.scrollTop') : o3_frame.pageYOffset;
1176

    
1177
	placeY = runHook('verticalPlacement',FCHAIN,iheight,scrolloffset);
1178

    
1179

    
1180

    
1181
	// Actually move the object.
1182

    
1183
	repositionTo(over, placeX, placeY);
1184

    
1185
}
1186

    
1187

    
1188

    
1189
// Moves the layer
1190

    
1191
function olMouseMove(e) {
1192

    
1193
	var e = (e) ? e : event;
1194

    
1195

    
1196

    
1197
	if (e.pageX) {
1198

    
1199
		o3_x = e.pageX;
1200

    
1201
		o3_y = e.pageY;
1202

    
1203
	} else if (e.clientX) {
1204

    
1205
		o3_x = eval('e.clientX+o3_frame.'+docRoot+'.scrollLeft');
1206

    
1207
		o3_y = eval('e.clientY+o3_frame.'+docRoot+'.scrollTop');
1208

    
1209
	}
1210

    
1211
	
1212

    
1213
	if (o3_allowmove == 1) runHook("placeLayer", FREPLACE);
1214

    
1215

    
1216

    
1217
	// MouseOut handler
1218

    
1219
	if (hoveringSwitch && !olNs4 && runHook("cursorOff", FREPLACE)) {
1220

    
1221
		(olHideDelay ? hideDelay(olHideDelay) : cClick());
1222

    
1223
		hoveringSwitch = !hoveringSwitch;
1224

    
1225
	}
1226

    
1227
}
1228

    
1229

    
1230

    
1231
// Fake function for 3.0 users.
1232

    
1233
function no_overlib() { return ver3fix; }
1234

    
1235

    
1236

    
1237
// Capture the mouse and chain other scripts.
1238

    
1239
function olMouseCapture() {
1240

    
1241
	capExtent = document;
1242

    
1243
	var fN, str = '', l, k, f, wMv, sS, mseHandler = olMouseMove;
1244

    
1245
	var re = /function[ ]*(\w*)\(/;
1246

    
1247
	
1248

    
1249
	wMv = (!olIe4 && window.onmousemove);
1250

    
1251
	if (document.onmousemove || wMv) {
1252

    
1253
		if (wMv) capExtent = window;
1254

    
1255
		f = capExtent.onmousemove.toString();
1256

    
1257
		fN = f.match(re);
1258

    
1259
		if (fN == null) {
1260

    
1261
			str = f+'(e); ';
1262

    
1263
		} else if (fN[1] == 'anonymous' || fN[1] == 'olMouseMove' || (wMv && fN[1] == 'onmousemove')) {
1264

    
1265
			if (!olOp && wMv) {
1266

    
1267
				l = f.indexOf('{')+1;
1268

    
1269
				k = f.lastIndexOf('}');
1270

    
1271
				sS = f.substring(l,k);
1272

    
1273
				if ((l = sS.indexOf('(')) != -1) {
1274

    
1275
					sS = sS.substring(0,l).replace(/^\s+/,'').replace(/\s+$/,'');
1276

    
1277
					if (eval("typeof " + sS + " == 'undefined'")) window.onmousemove = null;
1278

    
1279
					else str = sS + '(e);';
1280

    
1281
				}
1282

    
1283
			}
1284

    
1285
			if (!str) {
1286

    
1287
				olCheckMouseCapture = false;
1288

    
1289
				return;
1290

    
1291
			}
1292

    
1293
		} else {
1294

    
1295
			if (fN[1]) str = fN[1]+'(e); ';
1296

    
1297
			else {
1298

    
1299
				l = f.indexOf('{')+1;
1300

    
1301
				k = f.lastIndexOf('}');
1302

    
1303
				str = f.substring(l,k) + '\n';
1304

    
1305
			}
1306

    
1307
		}
1308

    
1309
		str += 'olMouseMove(e); ';
1310

    
1311
		mseHandler = new Function('e', str);
1312

    
1313
	}
1314

    
1315

    
1316

    
1317
	capExtent.onmousemove = mseHandler;
1318

    
1319
	if (olNs4) capExtent.captureEvents(Event.MOUSEMOVE);
1320

    
1321
}
1322

    
1323

    
1324

    
1325
////////
1326

    
1327
// PARSING FUNCTIONS
1328

    
1329
////////
1330

    
1331

    
1332

    
1333
// Does the actual command parsing.
1334

    
1335
function parseTokens(pf, ar) {
1336

    
1337
	// What the next argument is expected to be.
1338

    
1339
	var v, i, mode=-1, par = (pf != 'ol_');	
1340

    
1341
	var fnMark = (par && !ar.length ? 1 : 0);
1342

    
1343

    
1344

    
1345
	for (i = 0; i < ar.length; i++) {
1346

    
1347
		if (mode < 0) {
1348

    
1349
			// Arg is maintext,unless its a number between pmStart and pmUpper
1350

    
1351
			// then its a command.
1352

    
1353
			if (typeof ar[i] == 'number' && ar[i] > pmStart && ar[i] < pmUpper) {
1354

    
1355
				fnMark = (par ? 1 : 0);
1356

    
1357
				i--;   // backup one so that the next block can parse it
1358

    
1359
			} else {
1360

    
1361
				switch(pf) {
1362

    
1363
					case 'ol_':
1364

    
1365
						ol_text = ar[i].toString();
1366

    
1367
						break;
1368

    
1369
					default:
1370

    
1371
						o3_text=ar[i].toString();  
1372

    
1373
				}
1374

    
1375
			}
1376

    
1377
			mode = 0;
1378

    
1379
		} else {
1380

    
1381
			// Note: NS4 doesn't like switch cases with vars.
1382

    
1383
			if (ar[i] >= pmCount || ar[i]==DONOTHING) { continue; }
1384

    
1385
			if (ar[i]==INARRAY) { fnMark = 0; eval(pf+'text=ol_texts['+ar[++i]+'].toString()'); continue; }
1386

    
1387
			if (ar[i]==CAPARRAY) { eval(pf+'cap=ol_caps['+ar[++i]+'].toString()'); continue; }
1388

    
1389
			if (ar[i]==STICKY) { if (pf!='ol_') eval(pf+'sticky=1'); continue; }
1390

    
1391
			if (ar[i]==BACKGROUND) { eval(pf+'background="'+ar[++i]+'"'); continue; }
1392

    
1393
			if (ar[i]==NOCLOSE) { if (pf!='ol_') opt_NOCLOSE(); continue; }
1394

    
1395
			if (ar[i]==CAPTION) { eval(pf+"cap='"+escSglQuote(ar[++i])+"'"); continue; }
1396

    
1397
			if (ar[i]==CENTER || ar[i]==LEFT || ar[i]==RIGHT) { eval(pf+'hpos='+ar[i]); if(pf!='ol_') olHautoFlag=1; continue; }
1398

    
1399
			if (ar[i]==OFFSETX) { eval(pf+'offsetx='+ar[++i]); continue; }
1400

    
1401
			if (ar[i]==OFFSETY) { eval(pf+'offsety='+ar[++i]); continue; }
1402

    
1403
			if (ar[i]==FGCOLOR) { eval(pf+'fgcolor="'+ar[++i]+'"'); continue; }
1404

    
1405
			if (ar[i]==BGCOLOR) { eval(pf+'bgcolor="'+ar[++i]+'"'); continue; }
1406

    
1407
			if (ar[i]==TEXTCOLOR) { eval(pf+'textcolor="'+ar[++i]+'"'); continue; }
1408

    
1409
			if (ar[i]==CAPCOLOR) { eval(pf+'capcolor="'+ar[++i]+'"'); continue; }
1410

    
1411
			if (ar[i]==CLOSECOLOR) { eval(pf+'closecolor="'+ar[++i]+'"'); continue; }
1412

    
1413
			if (ar[i]==WIDTH) { eval(pf+'width='+ar[++i]); continue; }
1414

    
1415
			if (ar[i]==BORDER) { eval(pf+'border='+ar[++i]); continue; }
1416

    
1417
			if (ar[i]==CELLPAD) { i=opt_MULTIPLEARGS(++i,ar,(pf+'cellpad')); continue; }
1418

    
1419
			if (ar[i]==STATUS) { eval(pf+"status='"+escSglQuote(ar[++i])+"'"); continue; }
1420

    
1421
			if (ar[i]==AUTOSTATUS) { eval(pf +'autostatus=('+pf+'autostatus == 1) ? 0 : 1'); continue; }
1422

    
1423
			if (ar[i]==AUTOSTATUSCAP) { eval(pf +'autostatus=('+pf+'autostatus == 2) ? 0 : 2'); continue; }
1424

    
1425
			if (ar[i]==HEIGHT) { eval(pf+'height='+pf+'aboveheight='+ar[++i]); continue; } // Same param again.
1426

    
1427
			if (ar[i]==CLOSETEXT) { eval(pf+"close='"+escSglQuote(ar[++i])+"'"); continue; }
1428

    
1429
			if (ar[i]==SNAPX) { eval(pf+'snapx='+ar[++i]); continue; }
1430

    
1431
			if (ar[i]==SNAPY) { eval(pf+'snapy='+ar[++i]); continue; }
1432

    
1433
			if (ar[i]==FIXX) { eval(pf+'fixx='+ar[++i]); continue; }
1434

    
1435
			if (ar[i]==FIXY) { eval(pf+'fixy='+ar[++i]); continue; }
1436

    
1437
			if (ar[i]==RELX) { eval(pf+'relx='+ar[++i]); continue; }
1438

    
1439
			if (ar[i]==RELY) { eval(pf+'rely='+ar[++i]); continue; }
1440

    
1441
			if (ar[i]==FGBACKGROUND) { eval(pf+'fgbackground="'+ar[++i]+'"'); continue; }
1442

    
1443
			if (ar[i]==BGBACKGROUND) { eval(pf+'bgbackground="'+ar[++i]+'"'); continue; }
1444

    
1445
			if (ar[i]==PADX) { eval(pf+'padxl='+ar[++i]); eval(pf+'padxr='+ar[++i]); continue; }
1446

    
1447
			if (ar[i]==PADY) { eval(pf+'padyt='+ar[++i]); eval(pf+'padyb='+ar[++i]); continue; }
1448

    
1449
			if (ar[i]==FULLHTML) { if (pf!='ol_') eval(pf+'fullhtml=1'); continue; }
1450

    
1451
			if (ar[i]==BELOW || ar[i]==ABOVE) { eval(pf+'vpos='+ar[i]); if (pf!='ol_') olVautoFlag=1; continue; }
1452

    
1453
			if (ar[i]==CAPICON) { eval(pf+'capicon="'+ar[++i]+'"'); continue; }
1454

    
1455
			if (ar[i]==TEXTFONT) { eval(pf+"textfont='"+escSglQuote(ar[++i])+"'"); continue; }
1456

    
1457
			if (ar[i]==CAPTIONFONT) { eval(pf+"captionfont='"+escSglQuote(ar[++i])+"'"); continue; }
1458

    
1459
			if (ar[i]==CLOSEFONT) { eval(pf+"closefont='"+escSglQuote(ar[++i])+"'"); continue; }
1460

    
1461
			if (ar[i]==TEXTSIZE) { eval(pf+'textsize="'+ar[++i]+'"'); continue; }
1462

    
1463
			if (ar[i]==CAPTIONSIZE) { eval(pf+'captionsize="'+ar[++i]+'"'); continue; }
1464

    
1465
			if (ar[i]==CLOSESIZE) { eval(pf+'closesize="'+ar[++i]+'"'); continue; }
1466

    
1467
			if (ar[i]==TIMEOUT) { eval(pf+'timeout='+ar[++i]); continue; }
1468

    
1469
			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; }
1470

    
1471
			if (ar[i]==DELAY) { eval(pf+'delay='+ar[++i]); continue; }
1472

    
1473
			if (ar[i]==HAUTO) { eval(pf+'hauto=('+pf+'hauto == 0) ? 1 : 0'); continue; }
1474

    
1475
			if (ar[i]==VAUTO) { eval(pf+'vauto=('+pf+'vauto == 0) ? 1 : 0'); continue; }
1476

    
1477
			if (ar[i]==CLOSECLICK) { eval(pf +'closeclick=('+pf+'closeclick == 0) ? 1 : 0'); continue; }
1478

    
1479
			if (ar[i]==WRAP) { eval(pf +'wrap=('+pf+'wrap == 0) ? 1 : 0'); continue; }
1480

    
1481
			if (ar[i]==FOLLOWMOUSE) { eval(pf +'followmouse=('+pf+'followmouse == 1) ? 0 : 1'); continue; }
1482

    
1483
			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; }
1484

    
1485
			if (ar[i]==CLOSETITLE) { eval(pf+"closetitle='"+escSglQuote(ar[++i])+"'"); continue; }
1486

    
1487
			if (ar[i]==CSSOFF||ar[i]==CSSCLASS) { eval(pf+'css='+ar[i]); continue; }
1488

    
1489
			if (ar[i]==COMPATMODE) { eval(pf+'compatmode=('+pf+'compatmode==0) ? 1 : 0'); continue; }
1490

    
1491
			if (ar[i]==FGCLASS) { eval(pf+'fgclass="'+ar[++i]+'"'); continue; }
1492

    
1493
			if (ar[i]==BGCLASS) { eval(pf+'bgclass="'+ar[++i]+'"'); continue; }
1494

    
1495
			if (ar[i]==TEXTFONTCLASS) { eval(pf+'textfontclass="'+ar[++i]+'"'); continue; }
1496

    
1497
			if (ar[i]==CAPTIONFONTCLASS) { eval(pf+'captionfontclass="'+ar[++i]+'"'); continue; }
1498

    
1499
			if (ar[i]==CLOSEFONTCLASS) { eval(pf+'closefontclass="'+ar[++i]+'"'); continue; }
1500

    
1501
			i = parseCmdLine(pf, i, ar);
1502

    
1503
		}
1504

    
1505
	}
1506

    
1507

    
1508

    
1509
	if (fnMark && o3_function) o3_text = o3_function();
1510

    
1511
	
1512

    
1513
	if ((pf == 'o3_') && o3_wrap) {
1514

    
1515
		o3_width = 0;
1516

    
1517
		
1518

    
1519
		var tReg=/<.*\n*>/ig;
1520

    
1521
		if (!tReg.test(o3_text)) o3_text = o3_text.replace(/[ ]+/g, '&nbsp;');
1522

    
1523
		if (!tReg.test(o3_cap))o3_cap = o3_cap.replace(/[ ]+/g, '&nbsp;');
1524

    
1525
	}
1526

    
1527
	if ((pf == 'o3_') && o3_sticky) {
1528

    
1529
		if (!o3_close && (o3_frame != ol_frame)) o3_close = ol_close;
1530

    
1531
		if (o3_mouseoff && (o3_frame == ol_frame)) opt_NOCLOSE(' ');
1532

    
1533
	}
1534

    
1535
}
1536

    
1537

    
1538

    
1539

    
1540

    
1541
////////
1542

    
1543
// LAYER FUNCTIONS
1544

    
1545
////////
1546

    
1547

    
1548

    
1549
// Writes to a layer
1550

    
1551
function layerWrite(txt) {
1552

    
1553
	txt += "\n";
1554

    
1555
	if (olNs4) {
1556

    
1557
		var lyr = o3_frame.document.layers['overDiv'].document
1558

    
1559
		lyr.write(txt)
1560

    
1561
		lyr.close()
1562

    
1563
	} else if (typeof over.innerHTML != 'undefined') {
1564

    
1565
		if (olIe5 && isMac) over.innerHTML = '';
1566

    
1567
		over.innerHTML = txt;
1568

    
1569
	} else {
1570

    
1571
		range = o3_frame.document.createRange();
1572

    
1573
		range.setStartAfter(over);
1574

    
1575
		domfrag = range.createContextualFragment(txt);
1576

    
1577
		
1578

    
1579
		while (over.hasChildNodes()) {
1580

    
1581
			over.removeChild(over.lastChild);
1582

    
1583
		}
1584

    
1585
		
1586

    
1587
		over.appendChild(domfrag);
1588

    
1589
	}
1590

    
1591
}
1592

    
1593

    
1594

    
1595
// Make an object visible
1596

    
1597
function showObject(obj) {
1598

    
1599
	runHook("showObject", FBEFORE);
1600

    
1601

    
1602

    
1603
	var theObj=(olNs4 ? obj : obj.style);
1604

    
1605
	theObj.visibility = 'visible';
1606

    
1607

    
1608

    
1609
	runHook("showObject", FAFTER);
1610

    
1611
}
1612

    
1613

    
1614

    
1615
// Hides an object
1616

    
1617
function hideObject(obj) {
1618

    
1619
	runHook("hideObject", FBEFORE);
1620

    
1621

    
1622

    
1623
	var theObj=(olNs4 ? obj : obj.style);
1624

    
1625
	if (olNs6 && olShowId>0) { clearTimeout(olShowId); olShowId=0; }
1626

    
1627
	theObj.visibility = 'hidden';
1628

    
1629
	theObj.top = theObj.left = ((olIe4&&!olOp) ? 0 : -10000) + (!olNs4 ? 'px' : 0);
1630

    
1631

    
1632

    
1633
	if (o3_timerid > 0) clearTimeout(o3_timerid);
1634

    
1635
	if (o3_delayid > 0) clearTimeout(o3_delayid);
1636

    
1637

    
1638

    
1639
	o3_timerid = 0;
1640

    
1641
	o3_delayid = 0;
1642

    
1643
	self.status = "";
1644

    
1645

    
1646

    
1647
	if (obj.onmouseout||obj.onmouseover) {
1648

    
1649
		if (olNs4) obj.releaseEvents(Event.MOUSEOUT || Event.MOUSEOVER);
1650

    
1651
		obj.onmouseout = obj.onmouseover = null;
1652

    
1653
	}
1654

    
1655

    
1656

    
1657
	runHook("hideObject", FAFTER);
1658

    
1659
}
1660

    
1661

    
1662

    
1663
// Move a layer
1664

    
1665
function repositionTo(obj, xL, yL) {
1666

    
1667
	var theObj=(olNs4 ? obj : obj.style);
1668

    
1669
	theObj.left = xL + (!olNs4 ? 'px' : 0);
1670

    
1671
	theObj.top = yL + (!olNs4 ? 'px' : 0);
1672

    
1673
}
1674

    
1675

    
1676

    
1677
// Check position of cursor relative to overDiv DIVision; mouseOut function
1678

    
1679
function cursorOff() {
1680

    
1681
	var left = parseInt(over.style.left);
1682

    
1683
	var top = parseInt(over.style.top);
1684

    
1685
	var right = left + (over.offsetWidth >= parseInt(o3_width) ? over.offsetWidth : parseInt(o3_width));
1686

    
1687
	var bottom = top + (over.offsetHeight >= o3_aboveheight ? over.offsetHeight : o3_aboveheight);
1688

    
1689

    
1690

    
1691
	if (o3_x < left || o3_x > right || o3_y < top || o3_y > bottom) return true;
1692

    
1693

    
1694

    
1695
	return false;
1696

    
1697
}
1698

    
1699

    
1700

    
1701

    
1702

    
1703
////////
1704

    
1705
// COMMAND FUNCTIONS
1706

    
1707
////////
1708

    
1709

    
1710

    
1711
// Calls callme or the default function.
1712

    
1713
function opt_FUNCTION(callme) {
1714

    
1715
	o3_text = (callme ? (typeof callme=='string' ? (/.+\(.*\)/.test(callme) ? eval(callme) : callme) : callme()) : (o3_function ? o3_function() : 'No Function'));
1716

    
1717

    
1718

    
1719
	return 0;
1720

    
1721
}
1722

    
1723

    
1724

    
1725
// Handle hovering
1726

    
1727
function opt_NOCLOSE(unused) {
1728

    
1729
	if (!unused) o3_close = "";
1730

    
1731

    
1732

    
1733
	if (olNs4) {
1734

    
1735
		over.captureEvents(Event.MOUSEOUT || Event.MOUSEOVER);
1736

    
1737
		over.onmouseover = function () { if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid = 0; } }
1738

    
1739
		over.onmouseout = function (e) { if (olHideDelay) hideDelay(olHideDelay); else cClick(e); }
1740

    
1741
	} else {
1742

    
1743
		over.onmouseover = function () {hoveringSwitch = true; if (o3_timerid > 0) { clearTimeout(o3_timerid); o3_timerid =0; } }
1744

    
1745
	}
1746

    
1747

    
1748

    
1749
	return 0;
1750

    
1751
}
1752

    
1753

    
1754

    
1755
// Function to scan command line arguments for multiples
1756

    
1757
function opt_MULTIPLEARGS(i, args, parameter) {
1758

    
1759
  var k=i, re, pV, str='';
1760

    
1761

    
1762

    
1763
  for(k=i; k<args.length; k++) {
1764

    
1765
		if(typeof args[k] == 'number' && args[k]>pmStart) break;
1766

    
1767
		str += args[k] + ',';
1768

    
1769
	}
1770

    
1771
	if (str) str = str.substring(0,--str.length);
1772

    
1773

    
1774

    
1775
	k--;  // reduce by one so the for loop this is in works correctly
1776

    
1777
	pV=(olNs4 && /cellpad/i.test(parameter)) ? str.split(',')[0] : str;
1778

    
1779
	eval(parameter + '="' + pV + '"');
1780

    
1781

    
1782

    
1783
	return k;
1784

    
1785
}
1786

    
1787

    
1788

    
1789
// Remove &nbsp; in texts when done.
1790

    
1791
function nbspCleanup() {
1792

    
1793
	if (o3_wrap) {
1794

    
1795
		o3_text = o3_text.replace(/\&nbsp;/g, ' ');
1796

    
1797
		o3_cap = o3_cap.replace(/\&nbsp;/g, ' ');
1798

    
1799
	}
1800

    
1801
}
1802

    
1803

    
1804

    
1805
// Escape embedded single quotes in text strings
1806

    
1807
function escSglQuote(str) {
1808

    
1809
  return str.toString().replace(/'/g,"\\'");
1810

    
1811
}
1812

    
1813

    
1814

    
1815
// Onload handler for window onload event
1816

    
1817
function OLonLoad_handler(e) {
1818

    
1819
	var re = /\w+\(.*\)[;\s]+/g, olre = /overlib\(|nd\(|cClick\(/, fn, l, i;
1820

    
1821

    
1822

    
1823
	if(!olLoaded) olLoaded=1;
1824

    
1825

    
1826

    
1827
  // Remove it for Gecko based browsers
1828

    
1829
	if(window.removeEventListener && e.eventPhase == 3) window.removeEventListener("load",OLonLoad_handler,false);
1830

    
1831
	else if(window.detachEvent) { // and for IE and Opera 4.x but execute calls to overlib, nd, or cClick()
1832

    
1833
		window.detachEvent("onload",OLonLoad_handler);
1834

    
1835
		var fN = document.body.getAttribute('onload');
1836

    
1837
		if (fN) {
1838

    
1839
			fN=fN.toString().match(re);
1840

    
1841
			if (fN && fN.length) {
1842

    
1843
				for (i=0; i<fN.length; i++) {
1844

    
1845
					if (/anonymous/.test(fN[i])) continue;
1846

    
1847
					while((l=fN[i].search(/\)[;\s]+/)) != -1) {
1848

    
1849
						fn=fN[i].substring(0,l+1);
1850

    
1851
						fN[i] = fN[i].substring(l+2);
1852

    
1853
						if (olre.test(fn)) eval(fn);
1854

    
1855
					}
1856

    
1857
				}
1858

    
1859
			}
1860

    
1861
		}
1862

    
1863
	}
1864

    
1865
}
1866

    
1867

    
1868

    
1869
// Wraps strings in Layer Generation Functions with the correct tags
1870

    
1871
//    endWrap true(if end tag) or false if start tag
1872

    
1873
//    fontSizeStr - font size string such as '1' or '10px'
1874

    
1875
//    whichString is being wrapped -- 'text', 'caption', or 'close'
1876

    
1877
function wrapStr(endWrap,fontSizeStr,whichString) {
1878

    
1879
	var fontStr, fontColor, isClose=((whichString=='close') ? 1 : 0), hasDims=/[%\-a-z]+$/.test(fontSizeStr);
1880

    
1881
	fontSizeStr = (olNs4) ? (!hasDims ? fontSizeStr : '1') : fontSizeStr;
1882

    
1883
	if (endWrap) return (hasDims&&!olNs4) ? (isClose ? '</span>' : '</div>') : '</font>';
1884

    
1885
	else {
1886

    
1887
		fontStr='o3_'+whichString+'font';
1888

    
1889
		fontColor='o3_'+((whichString=='caption')? 'cap' : whichString)+'color';
1890

    
1891
		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)+'">';
1892

    
1893
	}
1894

    
1895
}
1896

    
1897

    
1898

    
1899
// Quotes Multi word font names; needed for CSS Standards adherence in font-family
1900

    
1901
function quoteMultiNameFonts(theFont) {
1902

    
1903
	var v, pM=theFont.split(',');
1904

    
1905
	for (var i=0; i<pM.length; i++) {
1906

    
1907
		v=pM[i];
1908

    
1909
		v=v.replace(/^\s+/,'').replace(/\s+$/,'');
1910

    
1911
		if(/\s/.test(v) && !/['"]/.test(v)) {
1912

    
1913
			v="\'"+v+"\'";
1914

    
1915
			pM[i]=v;
1916

    
1917
		}
1918

    
1919
	}
1920

    
1921
	return pM.join();
1922

    
1923
}
1924

    
1925

    
1926

    
1927
// dummy function which will be overridden 
1928

    
1929
function isExclusive(args) {
1930

    
1931
	return false;
1932

    
1933
}
1934

    
1935

    
1936

    
1937
// Sets cellpadding style string value
1938

    
1939
function setCellPadStr(parameter) {
1940

    
1941
	var Str='', j=0, ary = new Array(), top, bottom, left, right;
1942

    
1943

    
1944

    
1945
	Str+='padding: ';
1946

    
1947
	ary=parameter.replace(/\s+/g,'').split(',');
1948

    
1949

    
1950

    
1951
	switch(ary.length) {
1952

    
1953
		case 2:
1954

    
1955
			top=bottom=ary[j];
1956

    
1957
			left=right=ary[++j];
1958

    
1959
			break;
1960

    
1961
		case 3:
1962

    
1963
			top=ary[j];
1964

    
1965
			left=right=ary[++j];
1966

    
1967
			bottom=ary[++j];
1968

    
1969
			break;
1970

    
1971
		case 4:
1972

    
1973
			top=ary[j];
1974

    
1975
			right=ary[++j];
1976

    
1977
			bottom=ary[++j];
1978

    
1979
			left=ary[++j];
1980

    
1981
			break;
1982

    
1983
	}
1984

    
1985

    
1986

    
1987
	Str+= ((ary.length==1) ? ary[0] + 'px;' : top + 'px ' + right + 'px ' + bottom + 'px ' + left + 'px;');
1988

    
1989

    
1990

    
1991
	return Str;
1992

    
1993
}
1994

    
1995

    
1996

    
1997
// function will delay close by time milliseconds
1998

    
1999
function hideDelay(time) {
2000

    
2001
	if (time&&!o3_delay) {
2002

    
2003
		if (o3_timerid > 0) clearTimeout(o3_timerid);
2004

    
2005

    
2006

    
2007
		o3_timerid=setTimeout("cClick()",(o3_timeout=time));
2008

    
2009
	}
2010

    
2011
}
2012

    
2013

    
2014

    
2015
// Was originally in the placeLayer() routine; separated out for future ease
2016

    
2017
function horizontalPlacement(browserWidth, horizontalScrollAmount, widthFix) {
2018

    
2019
	var placeX, iwidth=browserWidth, winoffset=horizontalScrollAmount;
2020

    
2021
	var parsedWidth = parseInt(o3_width);
2022

    
2023

    
2024

    
2025
	if (o3_fixx > -1 || o3_relx != null) {
2026

    
2027
		// Fixed position
2028

    
2029
		placeX=(o3_relx != null ? ( o3_relx < 0 ? winoffset +o3_relx+ iwidth - parsedWidth - widthFix : winoffset+o3_relx) : o3_fixx);
2030

    
2031
	} else {  
2032

    
2033
		// If HAUTO, decide what to use.
2034

    
2035
		if (o3_hauto == 1) {
2036

    
2037
			if ((o3_x - winoffset) > (iwidth / 2)) {
2038

    
2039
				o3_hpos = LEFT;
2040

    
2041
			} else {
2042

    
2043
				o3_hpos = RIGHT;
2044

    
2045
			}
2046

    
2047
		}  		
2048

    
2049

    
2050

    
2051
		// From mouse
2052

    
2053
		if (o3_hpos == CENTER) { // Center
2054

    
2055
			placeX = o3_x+o3_offsetx-(parsedWidth/2);
2056

    
2057

    
2058

    
2059
			if (placeX < winoffset) placeX = winoffset;
2060

    
2061
		}
2062

    
2063

    
2064

    
2065
		if (o3_hpos == RIGHT) { // Right
2066

    
2067
			placeX = o3_x+o3_offsetx;
2068

    
2069

    
2070

    
2071
			if ((placeX+parsedWidth) > (winoffset+iwidth - widthFix)) {
2072

    
2073
				placeX = iwidth+winoffset - parsedWidth - widthFix;
2074

    
2075
				if (placeX < 0) placeX = 0;
2076

    
2077
			}
2078

    
2079
		}
2080

    
2081
		if (o3_hpos == LEFT) { // Left
2082

    
2083
			placeX = o3_x-o3_offsetx-parsedWidth;
2084

    
2085
			if (placeX < winoffset) placeX = winoffset;
2086

    
2087
		}  	
2088

    
2089

    
2090

    
2091
		// Snapping!
2092

    
2093
		if (o3_snapx > 1) {
2094

    
2095
			var snapping = placeX % o3_snapx;
2096

    
2097

    
2098

    
2099
			if (o3_hpos == LEFT) {
2100

    
2101
				placeX = placeX - (o3_snapx+snapping);
2102

    
2103
			} else {
2104

    
2105
				// CENTER and RIGHT
2106

    
2107
				placeX = placeX+(o3_snapx - snapping);
2108

    
2109
			}
2110

    
2111

    
2112

    
2113
			if (placeX < winoffset) placeX = winoffset;
2114

    
2115
		}
2116

    
2117
	}	
2118

    
2119

    
2120

    
2121
	return placeX;
2122

    
2123
}
2124

    
2125

    
2126

    
2127
// was originally in the placeLayer() routine; separated out for future ease
2128

    
2129
function verticalPlacement(browserHeight,verticalScrollAmount) {
2130

    
2131
	var placeY, iheight=browserHeight, scrolloffset=verticalScrollAmount;
2132

    
2133
	var parsedHeight=(o3_aboveheight ? parseInt(o3_aboveheight) : (olNs4 ? over.clip.height : over.offsetHeight));
2134

    
2135

    
2136

    
2137
	if (o3_fixy > -1 || o3_rely != null) {
2138

    
2139
		// Fixed position
2140

    
2141
		placeY=(o3_rely != null ? (o3_rely < 0 ? scrolloffset+o3_rely+iheight - parsedHeight : scrolloffset+o3_rely) : o3_fixy);
2142

    
2143
	} else {
2144

    
2145
		// If VAUTO, decide what to use.
2146

    
2147
		if (o3_vauto == 1) {
2148

    
2149
			if ((o3_y - scrolloffset) > (iheight / 2) && o3_vpos == BELOW && (o3_y + parsedHeight + o3_offsety - (scrolloffset + iheight) > 0)) {
2150

    
2151
				o3_vpos = ABOVE;
2152

    
2153
			} else if (o3_vpos == ABOVE && (o3_y - (parsedHeight + o3_offsety) - scrolloffset < 0)) {
2154

    
2155
				o3_vpos = BELOW;
2156

    
2157
			}
2158

    
2159
		}
2160

    
2161

    
2162

    
2163
		// From mouse
2164

    
2165
		if (o3_vpos == ABOVE) {
2166

    
2167
			if (o3_aboveheight == 0) o3_aboveheight = parsedHeight; 
2168

    
2169

    
2170

    
2171
			placeY = o3_y - (o3_aboveheight+o3_offsety);
2172

    
2173
			if (placeY < scrolloffset) placeY = scrolloffset;
2174

    
2175
		} else {
2176

    
2177
			// BELOW
2178

    
2179
			placeY = o3_y+o3_offsety;
2180

    
2181
		} 
2182

    
2183

    
2184

    
2185
		// Snapping!
2186

    
2187
		if (o3_snapy > 1) {
2188

    
2189
			var snapping = placeY % o3_snapy;  			
2190

    
2191

    
2192

    
2193
			if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
2194

    
2195
				placeY = placeY - (o3_snapy+snapping);
2196

    
2197
			} else {
2198

    
2199
				placeY = placeY+(o3_snapy - snapping);
2200

    
2201
			} 			
2202

    
2203

    
2204

    
2205
			if (placeY < scrolloffset) placeY = scrolloffset;
2206

    
2207
		}
2208

    
2209
	}
2210

    
2211

    
2212

    
2213
	return placeY;
2214

    
2215
}
2216

    
2217

    
2218

    
2219
// checks positioning flags
2220

    
2221
function checkPositionFlags() {
2222

    
2223
	if (olHautoFlag) olHautoFlag = o3_hauto=0;
2224

    
2225
	if (olVautoFlag) olVautoFlag = o3_vauto=0;
2226

    
2227
	return true;
2228

    
2229
}
2230

    
2231

    
2232

    
2233
// get Browser window width
2234

    
2235
function windowWidth() {
2236

    
2237
	var w;
2238

    
2239
	if (o3_frame.innerWidth) w=o3_frame.innerWidth;
2240

    
2241
	else if (eval('o3_frame.'+docRoot)&&eval("typeof o3_frame."+docRoot+".clientWidth=='number'")&&eval('o3_frame.'+docRoot+'.clientWidth')) 
2242

    
2243
		w=eval('o3_frame.'+docRoot+'.clientWidth');
2244

    
2245
	return w;			
2246

    
2247
}
2248

    
2249

    
2250

    
2251
// create the div container for popup content if it doesn't exist
2252

    
2253
function createDivContainer(id,frm,zValue) {
2254

    
2255
	id = (id || 'overDiv'), frm = (frm || o3_frame), zValue = (zValue || 1000);
2256

    
2257
	var objRef, divContainer = layerReference(id);
2258

    
2259

    
2260

    
2261
	if (divContainer == null) {
2262

    
2263
		if (olNs4) {
2264

    
2265
			divContainer = frm.document.layers[id] = new Layer(window.innerWidth, frm);
2266

    
2267
			objRef = divContainer;
2268

    
2269
		} else {
2270

    
2271
			var body = (olIe4 ? frm.document.all.tags('BODY')[0] : frm.document.getElementsByTagName("BODY")[0]);
2272

    
2273
			if (olIe4&&!document.getElementById) {
2274

    
2275
				body.insertAdjacentHTML("beforeEnd",'<div id="'+id+'"></div>');
2276

    
2277
				divContainer=layerReference(id);
2278

    
2279
			} else {
2280

    
2281
				divContainer = frm.document.createElement("DIV");
2282

    
2283
				divContainer.id = id;
2284

    
2285
				body.appendChild(divContainer);
2286

    
2287
			}
2288

    
2289
			objRef = divContainer.style;
2290

    
2291
		}
2292

    
2293

    
2294

    
2295
		objRef.position = 'absolute';
2296

    
2297
		objRef.visibility = 'hidden';
2298

    
2299
		objRef.zIndex = zValue;
2300

    
2301
		if (olIe4&&!olOp) objRef.left = objRef.top = '0px';
2302

    
2303
		else objRef.left = objRef.top =  -10000 + (!olNs4 ? 'px' : 0);
2304

    
2305
	}
2306

    
2307

    
2308

    
2309
	return divContainer;
2310

    
2311
}
2312

    
2313

    
2314

    
2315
// get reference to a layer with ID=id
2316

    
2317
function layerReference(id) {
2318

    
2319
	return (olNs4 ? o3_frame.document.layers[id] : (document.all ? o3_frame.document.all[id] : o3_frame.document.getElementById(id)));
2320

    
2321
}
2322

    
2323
////////
2324

    
2325
//  UTILITY FUNCTIONS
2326

    
2327
////////
2328

    
2329

    
2330

    
2331
// Checks if something is a function.
2332

    
2333
function isFunction(fnRef) {
2334

    
2335
	var rtn = true;
2336

    
2337

    
2338

    
2339
	if (typeof fnRef == 'object') {
2340

    
2341
		for (var i = 0; i < fnRef.length; i++) {
2342

    
2343
			if (typeof fnRef[i]=='function') continue;
2344

    
2345
			rtn = false;
2346

    
2347
			break;
2348

    
2349
		}
2350

    
2351
	} else if (typeof fnRef != 'function') {
2352

    
2353
		rtn = false;
2354

    
2355
	}
2356

    
2357
	
2358

    
2359
	return rtn;
2360

    
2361
}
2362

    
2363

    
2364

    
2365
// Converts an array into an argument string for use in eval.
2366

    
2367
function argToString(array, strtInd, argName) {
2368

    
2369
	var jS = strtInd, aS = '', ar = array;
2370

    
2371
	argName=(argName ? argName : 'ar');
2372

    
2373
	
2374

    
2375
	if (ar.length > jS) {
2376

    
2377
		for (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';
2378

    
2379
		aS = aS.substring(0, aS.length-2);
2380

    
2381
	}
2382

    
2383
	
2384

    
2385
	return aS;
2386

    
2387
}
2388

    
2389

    
2390

    
2391
// Places a hook in the correct position in a hook point.
2392

    
2393
function reOrder(hookPt, fnRef, order) {
2394

    
2395
	var newPt = new Array(), match, i, j;
2396

    
2397

    
2398

    
2399
	if (!order || typeof order == 'undefined' || typeof order == 'number') return hookPt;
2400

    
2401
	
2402

    
2403
	if (typeof order=='function') {
2404

    
2405
		if (typeof fnRef=='object') {
2406

    
2407
			newPt = newPt.concat(fnRef);
2408

    
2409
		} else {
2410

    
2411
			newPt[newPt.length++]=fnRef;
2412

    
2413
		}
2414

    
2415
		
2416

    
2417
		for (i = 0; i < hookPt.length; i++) {
2418

    
2419
			match = false;
2420

    
2421
			if (typeof fnRef == 'function' && hookPt[i] == fnRef) {
2422

    
2423
				continue;
2424

    
2425
			} else {
2426

    
2427
				for(j = 0; j < fnRef.length; j++) if (hookPt[i] == fnRef[j]) {
2428

    
2429
					match = true;
2430

    
2431
					break;
2432

    
2433
				}
2434

    
2435
			}
2436

    
2437
			if (!match) newPt[newPt.length++] = hookPt[i];
2438

    
2439
		}
2440

    
2441

    
2442

    
2443
		newPt[newPt.length++] = order;
2444

    
2445

    
2446

    
2447
	} else if (typeof order == 'object') {
2448

    
2449
		if (typeof fnRef == 'object') {
2450

    
2451
			newPt = newPt.concat(fnRef);
2452

    
2453
		} else {
2454

    
2455
			newPt[newPt.length++] = fnRef;
2456

    
2457
		}
2458

    
2459
		
2460

    
2461
		for (j = 0; j < hookPt.length; j++) {
2462

    
2463
			match = false;
2464

    
2465
			if (typeof fnRef == 'function' && hookPt[j] == fnRef) {
2466

    
2467
				continue;
2468

    
2469
			} else {
2470

    
2471
				for (i = 0; i < fnRef.length; i++) if (hookPt[j] == fnRef[i]) {
2472

    
2473
					match = true;
2474

    
2475
					break;
2476

    
2477
				}
2478

    
2479
			}
2480

    
2481
			if (!match) newPt[newPt.length++]=hookPt[j];
2482

    
2483
		}
2484

    
2485

    
2486

    
2487
		for (i = 0; i < newPt.length; i++) hookPt[i] = newPt[i];
2488

    
2489
		newPt.length = 0;
2490

    
2491
		
2492

    
2493
		for (j = 0; j < hookPt.length; j++) {
2494

    
2495
			match = false;
2496

    
2497
			for (i = 0; i < order.length; i++) {
2498

    
2499
				if (hookPt[j] == order[i]) {
2500

    
2501
					match = true;
2502

    
2503
					break;
2504

    
2505
				}
2506

    
2507
			}
2508

    
2509
			if (!match) newPt[newPt.length++] = hookPt[j];
2510

    
2511
		}
2512

    
2513
		newPt = newPt.concat(order);
2514

    
2515
	}
2516

    
2517

    
2518

    
2519
	hookPt = newPt;
2520

    
2521

    
2522

    
2523
	return hookPt;
2524

    
2525
}
2526

    
2527

    
2528

    
2529
////////
2530

    
2531
//  PLUGIN ACTIVATION FUNCTIONS
2532

    
2533
////////
2534

    
2535

    
2536

    
2537
// Runs plugin functions to set runtime variables.
2538

    
2539
function setRunTimeVariables(){
2540

    
2541
	if (typeof runTime != 'undefined' && runTime.length) {
2542

    
2543
		for (var k = 0; k < runTime.length; k++) {
2544

    
2545
			runTime[k]();
2546

    
2547
		}
2548

    
2549
	}
2550

    
2551
}
2552

    
2553

    
2554

    
2555
// Runs plugin functions to parse commands.
2556

    
2557
function parseCmdLine(pf, i, args) {
2558

    
2559
	if (typeof cmdLine != 'undefined' && cmdLine.length) { 
2560

    
2561
		for (var k = 0; k < cmdLine.length; k++) { 
2562

    
2563
			var j = cmdLine[k](pf, i, args);
2564

    
2565
			if (j >- 1) {
2566

    
2567
				i = j;
2568

    
2569
				break;
2570

    
2571
			}
2572

    
2573
		}
2574

    
2575
	}
2576

    
2577

    
2578

    
2579
	return i;
2580

    
2581
}
2582

    
2583

    
2584

    
2585
// Runs plugin functions to do things after parse.
2586

    
2587
function postParseChecks(pf,args){
2588

    
2589
	if (typeof postParse != 'undefined' && postParse.length) {
2590

    
2591
		for (var k = 0; k < postParse.length; k++) {
2592

    
2593
			if (postParse[k](pf,args)) continue;
2594

    
2595
			return false;  // end now since have an error
2596

    
2597
		}
2598

    
2599
	}
2600

    
2601
	return true;
2602

    
2603
}
2604

    
2605

    
2606

    
2607

    
2608

    
2609
////////
2610

    
2611
//  PLUGIN REGISTRATION FUNCTIONS
2612

    
2613
////////
2614

    
2615

    
2616

    
2617
// Registers commands and creates constants.
2618

    
2619
function registerCommands(cmdStr) {
2620

    
2621
	if (typeof cmdStr!='string') return;
2622

    
2623

    
2624

    
2625
	var pM = cmdStr.split(',');
2626

    
2627
	pms = pms.concat(pM);
2628

    
2629

    
2630

    
2631
	for (var i = 0; i< pM.length; i++) {
2632

    
2633
		eval(pM[i].toUpperCase()+'='+pmCount++);
2634

    
2635
	}
2636

    
2637
}
2638

    
2639

    
2640

    
2641
// Registers no-parameter commands
2642

    
2643
function registerNoParameterCommands(cmdStr) {
2644

    
2645
	if (!cmdStr && typeof cmdStr != 'string') return;
2646

    
2647
	pmt=(!pmt) ? cmdStr : pmt + ',' + cmdStr;
2648

    
2649
}
2650

    
2651

    
2652

    
2653
// Register a function to hook at a certain point.
2654

    
2655
function registerHook(fnHookTo, fnRef, hookType, optPm) {
2656

    
2657
	var hookPt, last = typeof optPm;
2658

    
2659
	
2660

    
2661
	if (fnHookTo == 'plgIn'||fnHookTo == 'postParse') return;
2662

    
2663
	if (typeof hookPts[fnHookTo] == 'undefined') hookPts[fnHookTo] = new FunctionReference();
2664

    
2665

    
2666

    
2667
	hookPt = hookPts[fnHookTo];
2668

    
2669

    
2670

    
2671
	if (hookType != null) {
2672

    
2673
		if (hookType == FREPLACE) {
2674

    
2675
			hookPt.ovload = fnRef;  // replace normal overlib routine
2676

    
2677
			if (fnHookTo.indexOf('ol_content_') > -1) hookPt.alt[pms[CSSOFF-1-pmStart]]=fnRef; 
2678

    
2679

    
2680

    
2681
		} else if (hookType == FBEFORE || hookType == FAFTER) {
2682

    
2683
			var hookPt=(hookType == 1 ? hookPt.before : hookPt.after);
2684

    
2685

    
2686

    
2687
			if (typeof fnRef == 'object') {
2688

    
2689
				hookPt = hookPt.concat(fnRef);
2690

    
2691
			} else {
2692

    
2693
				hookPt[hookPt.length++] = fnRef;
2694

    
2695
			}
2696

    
2697

    
2698

    
2699
			if (optPm) hookPt = reOrder(hookPt, fnRef, optPm);
2700

    
2701

    
2702

    
2703
		} else if (hookType == FALTERNATE) {
2704

    
2705
			if (last=='number') hookPt.alt[pms[optPm-1-pmStart]] = fnRef;
2706

    
2707
		} else if (hookType == FCHAIN) {
2708

    
2709
			hookPt = hookPt.chain; 
2710

    
2711
			if (typeof fnRef=='object') hookPt=hookPt.concat(fnRef); // add other functions 
2712

    
2713
			else hookPt[hookPt.length++]=fnRef;
2714

    
2715
		}
2716

    
2717

    
2718

    
2719
		return;
2720

    
2721
	}
2722

    
2723
}
2724

    
2725

    
2726

    
2727
// Register a function that will set runtime variables.
2728

    
2729
function registerRunTimeFunction(fn) {
2730

    
2731
	if (isFunction(fn)) {
2732

    
2733
		if (typeof fn == 'object') {
2734

    
2735
			runTime = runTime.concat(fn);
2736

    
2737
		} else {
2738

    
2739
			runTime[runTime.length++] = fn;
2740

    
2741
		}
2742

    
2743
	}
2744

    
2745
}
2746

    
2747

    
2748

    
2749
// Register a function that will handle command parsing.
2750

    
2751
function registerCmdLineFunction(fn){
2752

    
2753
	if (isFunction(fn)) {
2754

    
2755
		if (typeof fn == 'object') {
2756

    
2757
			cmdLine = cmdLine.concat(fn);
2758

    
2759
		} else {
2760

    
2761
			cmdLine[cmdLine.length++] = fn;
2762

    
2763
		}
2764

    
2765
	}
2766

    
2767
}
2768

    
2769

    
2770

    
2771
// Register a function that does things after command parsing. 
2772

    
2773
function registerPostParseFunction(fn){
2774

    
2775
	if (isFunction(fn)) {
2776

    
2777
		if (typeof fn == 'object') {
2778

    
2779
			postParse = postParse.concat(fn);
2780

    
2781
		} else {
2782

    
2783
			postParse[postParse.length++] = fn;
2784

    
2785
		}
2786

    
2787
	}
2788

    
2789
}
2790

    
2791

    
2792

    
2793
////////
2794

    
2795
//  PLUGIN REGISTRATION FUNCTIONS
2796

    
2797
////////
2798

    
2799

    
2800

    
2801
// Runs any hooks registered.
2802

    
2803
function runHook(fnHookTo, hookType) {
2804

    
2805
	var l = hookPts[fnHookTo], k, rtnVal = null, optPm, arS, ar = runHook.arguments;
2806

    
2807

    
2808

    
2809
	if (hookType == FREPLACE) {
2810

    
2811
		arS = argToString(ar, 2);
2812

    
2813

    
2814

    
2815
		if (typeof l == 'undefined' || !(l = l.ovload)) rtnVal = eval(fnHookTo+'('+arS+')');
2816

    
2817
		else rtnVal = eval('l('+arS+')');
2818

    
2819

    
2820

    
2821
	} else if (hookType == FBEFORE || hookType == FAFTER) {
2822

    
2823
		if (typeof l != 'undefined') {
2824

    
2825
			l=(hookType == 1 ? l.before : l.after);
2826

    
2827
	
2828

    
2829
			if (l.length) {
2830

    
2831
				arS = argToString(ar, 2);
2832

    
2833
				for (var k = 0; k < l.length; k++) eval('l[k]('+arS+')');
2834

    
2835
			}
2836

    
2837
		}
2838

    
2839
	} else if (hookType == FALTERNATE) {
2840

    
2841
		optPm = ar[2];
2842

    
2843
		arS = argToString(ar, 3);
2844

    
2845

    
2846

    
2847
		if (typeof l == 'undefined' || (l = l.alt[pms[optPm-1-pmStart]]) == 'undefined') {
2848

    
2849
			rtnVal = eval(fnHookTo+'('+arS+')');
2850

    
2851
		} else {
2852

    
2853
			rtnVal = eval('l('+arS+')');
2854

    
2855
		}
2856

    
2857
	} else if (hookType == FCHAIN) {
2858

    
2859
		arS=argToString(ar,2);
2860

    
2861
		l=l.chain;
2862

    
2863

    
2864

    
2865
		for (k=l.length; k > 0; k--) if((rtnVal=eval('l[k-1]('+arS+')'))!=void(0)) break;
2866

    
2867
	}
2868

    
2869

    
2870

    
2871
	return rtnVal;
2872

    
2873
}
2874

    
2875

    
2876

    
2877
////////
2878

    
2879
// OBJECT CONSTRUCTORS
2880

    
2881
////////
2882

    
2883

    
2884

    
2885
// Object for handling hooks.
2886

    
2887
function FunctionReference() {
2888

    
2889
	this.ovload = null;
2890

    
2891
	this.before = new Array();
2892

    
2893
	this.after = new Array();
2894

    
2895
	this.alt = new Array();
2896

    
2897
	this.chain = new Array();
2898

    
2899
}
2900

    
2901

    
2902

    
2903
// Object for simple access to the overLIB version used.
2904

    
2905
// Examples: simpleversion:351 major:3 minor:5 revision:1
2906

    
2907
function Info(version, prerelease) {
2908

    
2909
	this.version = version;
2910

    
2911
	this.prerelease = prerelease;
2912

    
2913

    
2914

    
2915
	this.simpleversion = Math.round(this.version*100);
2916

    
2917
	this.major = parseInt(this.simpleversion / 100);
2918

    
2919
	this.minor = parseInt(this.simpleversion / 10) - this.major * 10;
2920

    
2921
	this.revision = parseInt(this.simpleversion) - this.major * 100 - this.minor * 10;
2922

    
2923
	this.meets = meets;
2924

    
2925
}
2926

    
2927

    
2928

    
2929
// checks for Core Version required
2930

    
2931
function meets(reqdVersion) {
2932

    
2933
	return (!reqdVersion) ? false : this.simpleversion >= Math.round(100*parseFloat(reqdVersion));
2934

    
2935
}
2936

    
2937

    
2938

    
2939

    
2940

    
2941
////////
2942

    
2943
// STANDARD REGISTRATIONS
2944

    
2945
////////
2946

    
2947
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSOFF);
2948

    
2949
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSOFF);
2950

    
2951
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSOFF);
2952

    
2953
registerHook("ol_content_simple", ol_content_simple, FALTERNATE, CSSCLASS);
2954

    
2955
registerHook("ol_content_caption", ol_content_caption, FALTERNATE, CSSCLASS);
2956

    
2957
registerHook("ol_content_background", ol_content_background, FALTERNATE, CSSCLASS);
2958

    
2959
registerPostParseFunction(checkPositionFlags);
2960

    
2961
registerHook("hideObject", nbspCleanup, FAFTER);
2962

    
2963
registerHook("horizontalPlacement", horizontalPlacement, FCHAIN);
2964

    
2965
registerHook("verticalPlacement", verticalPlacement, FCHAIN);
2966

    
2967
if (olNs4||(olIe5&&isMac)||olKq) olLoaded=1;
2968

    
2969
registerNoParameterCommands('sticky,autostatus,autostatuscap,fullhtml,hauto,vauto,closeclick,wrap,followmouse,mouseoff,compatmode');
2970

    
2971
///////
2972

    
2973
// ESTABLISH MOUSECAPTURING
2974

    
2975
///////
2976

    
2977

    
2978

    
2979
// Capture events, alt. diffuses the overlib function.
2980

    
2981
var olCheckMouseCapture=true;
2982

    
2983
if ((olNs4 || olNs6 || olIe4)) {
2984

    
2985
	olMouseCapture();
2986

    
2987
} else {
2988

    
2989
	overlib = no_overlib;
2990

    
2991
	nd = no_overlib;
2992

    
2993
	ver3fix = true;
2994

    
2995
}
2996

    
(1-1/11)