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