overlib.js
Upload User: e_liujie
Upload Date: 2016-08-01
Package Size: 4146k
Code Size: 42k
Category:

Ajax

Development Platform:

Java

  1. ////////////////////////////////////////////////////////////////////////////////////
  2. //  overLIB 3.50  --  This notice must remain untouched at all times.
  3. //  Copyright Erik Bosrup 1998-2001. All rights reserved.
  4. //
  5. //  By Erik Bosrup (erik@bosrup.com).  Last modified 2001-08-28.
  6. //  Portions by Dan Steinman (dansteinman.com). Additions by other people are
  7. //  listed on the overLIB homepage.
  8. //
  9. //  Get the latest version at http://www.bosrup.com/web/overlib/
  10. //
  11. //  This script is published under an open source license. Please read the license
  12. //  agreement online at: http://www.bosrup.com/web/overlib/license.html
  13. //  If you have questions regarding the license please contact erik@bosrup.com.
  14. //
  15. //  This script library was originally created for personal use. By request it has
  16. //  later been made public. This is free software. Do not sell this as your own
  17. //  work, or remove this copyright notice. For full details on copying or changing
  18. //  this script please read the license agreement at the link above.
  19. //
  20. //  Please give credit on sites that use overLIB and submit changes of the script
  21. //  so other people can use them as well. This script is free to use, don't abuse.
  22. ////////////////////////////////////////////////////////////////////////////////////
  23. //mini
  24. ////////////////////////////////////////////////////////////////////////////////////
  25. // CONSTANTS
  26. // Don't touch these. :)
  27. ////////////////////////////////////////////////////////////////////////////////////
  28. var INARRAY = 1;
  29. var CAPARRAY = 2;
  30. var STICKY = 3;
  31. var BACKGROUND = 4;
  32. var NOCLOSE = 5;
  33. var CAPTION = 6;
  34. var LEFT = 7;
  35. var RIGHT = 8;
  36. var CENTER = 9;
  37. var OFFSETX = 10;
  38. var OFFSETY = 11;
  39. var FGCOLOR = 12;
  40. var BGCOLOR = 13;
  41. var TEXTCOLOR = 14;
  42. var CAPCOLOR = 15;
  43. var CLOSECOLOR = 16;
  44. var WIDTH = 17;
  45. var BORDER = 18;
  46. var STATUS = 19;
  47. var AUTOSTATUS = 20;
  48. var AUTOSTATUSCAP = 21;
  49. var HEIGHT = 22;
  50. var CLOSETEXT = 23;
  51. var SNAPX = 24;
  52. var SNAPY = 25;
  53. var FIXX = 26;
  54. var FIXY = 27;
  55. var FGBACKGROUND = 28;
  56. var BGBACKGROUND = 29;
  57. var PADX = 30; // PADX2 out
  58. var PADY = 31; // PADY2 out
  59. var FULLHTML = 34;
  60. var ABOVE = 35;
  61. var BELOW = 36;
  62. var CAPICON = 37;
  63. var TEXTFONT = 38;
  64. var CAPTIONFONT = 39;
  65. var CLOSEFONT = 40;
  66. var TEXTSIZE = 41;
  67. var CAPTIONSIZE = 42;
  68. var CLOSESIZE = 43;
  69. var FRAME = 44;
  70. var TIMEOUT = 45;
  71. var FUNCTION = 46;
  72. var DELAY = 47;
  73. var HAUTO = 48;
  74. var VAUTO = 49;
  75. var CLOSECLICK = 50;
  76. var CSSOFF = 51;
  77. var CSSSTYLE = 52;
  78. var CSSCLASS = 53;
  79. var FGCLASS = 54;
  80. var BGCLASS = 55;
  81. var TEXTFONTCLASS = 56;
  82. var CAPTIONFONTCLASS = 57;
  83. var CLOSEFONTCLASS = 58;
  84. var PADUNIT = 59;
  85. var HEIGHTUNIT = 60;
  86. var WIDTHUNIT = 61;
  87. var TEXTSIZEUNIT = 62;
  88. var TEXTDECORATION = 63;
  89. var TEXTSTYLE = 64;
  90. var TEXTWEIGHT = 65;
  91. var CAPTIONSIZEUNIT = 66;
  92. var CAPTIONDECORATION = 67;
  93. var CAPTIONSTYLE = 68;
  94. var CAPTIONWEIGHT = 69;
  95. var CLOSESIZEUNIT = 70;
  96. var CLOSEDECORATION = 71;
  97. var CLOSESTYLE = 72;
  98. var CLOSEWEIGHT = 73;
  99. ////////////////////////////////////////////////////////////////////////////////////
  100. // DEFAULT CONFIGURATION
  101. // You don't have to change anything here if you don't want to. All of this can be
  102. // changed on your html page or through an overLIB call.
  103. ////////////////////////////////////////////////////////////////////////////////////
  104. // Main background color (the large area)
  105. // Usually a bright color (white, yellow etc)
  106. if (typeof ol_fgcolor == 'undefined') { var ol_fgcolor = "#CCCCFF";}
  107. // Border color and color of caption
  108. // Usually a dark color (black, brown etc)
  109. if (typeof ol_bgcolor == 'undefined') { var ol_bgcolor = "#333399";}
  110. // Text color
  111. // Usually a dark color
  112. if (typeof ol_textcolor == 'undefined') { var ol_textcolor = "#000000";}
  113. // Color of the caption text
  114. // Usually a bright color
  115. if (typeof ol_capcolor == 'undefined') { var ol_capcolor = "#FFFFFF";}
  116. // Color of "Close" when using Sticky
  117. // Usually a semi-bright color
  118. if (typeof ol_closecolor == 'undefined') { var ol_closecolor = "#9999FF";}
  119. // Font face for the main text
  120. if (typeof ol_textfont == 'undefined') { var ol_textfont = "Verdana,Arial,Helvetica";}
  121. // Font face for the caption
  122. if (typeof ol_captionfont == 'undefined') { var ol_captionfont = "Verdana,Arial,Helvetica";}
  123. // Font face for the close text
  124. if (typeof ol_closefont == 'undefined') { var ol_closefont = "Verdana,Arial,Helvetica";}
  125. // Font size for the main text
  126. // When using CSS this will be very small.
  127. if (typeof ol_textsize == 'undefined') { var ol_textsize = "1";}
  128. // Font size for the caption
  129. // When using CSS this will be very small.
  130. if (typeof ol_captionsize == 'undefined') { var ol_captionsize = "1";}
  131. // Font size for the close text
  132. // When using CSS this will be very small.
  133. if (typeof ol_closesize == 'undefined') { var ol_closesize = "1";}
  134. // Width of the popups in pixels
  135. // 100-300 pixels is typical
  136. if (typeof ol_width == 'undefined') { var ol_width = "200";}
  137. // How thick the ol_border should be in pixels
  138. // 1-3 pixels is typical
  139. if (typeof ol_border == 'undefined') { var ol_border = "1";}
  140. // How many pixels to the right/left of the cursor to show the popup
  141. // Values between 3 and 12 are best
  142. if (typeof ol_offsetx == 'undefined') { var ol_offsetx = 10;}
  143. // How many pixels to the below the cursor to show the popup
  144. // Values between 3 and 12 are best
  145. if (typeof ol_offsety == 'undefined') { var ol_offsety = 10;}
  146. // Default text for popups
  147. // Should you forget to pass something to overLIB this will be displayed.
  148. if (typeof ol_text == 'undefined') { var ol_text = "Default Text"; }
  149. // Default caption
  150. // You should leave this blank or you will have problems making non caps popups.
  151. if (typeof ol_cap == 'undefined') { var ol_cap = ""; }
  152. // Decides if sticky popups are default.
  153. // 0 for non, 1 for stickies.
  154. if (typeof ol_sticky == 'undefined') { var ol_sticky = 0; }
  155. // Default background image. Better left empty unless you always want one.
  156. if (typeof ol_background == 'undefined') { var ol_background = ""; }
  157. // Text for the closing sticky popups.
  158. // Normal is "Close".
  159. if (typeof ol_close == 'undefined') { var ol_close = "Close"; }
  160. // Default vertical alignment for popups.
  161. // It's best to leave RIGHT here. Other options are LEFT and CENTER.
  162. if (typeof ol_hpos == 'undefined') { var ol_hpos = RIGHT; }
  163. // Default status bar text when a popup is invoked.
  164. if (typeof ol_status == 'undefined') { var ol_status = ""; }
  165. // If the status bar automatically should load either text or caption.
  166. // 0=nothing, 1=text, 2=caption
  167. if (typeof ol_autostatus == 'undefined') { var ol_autostatus = 0; }
  168. // Default height for popup. Often best left alone.
  169. if (typeof ol_height == 'undefined') { var ol_height = -1; }
  170. // Horizontal grid spacing that popups will snap to.
  171. // 0 makes no grid, anything else will cause a snap to that grid spacing.
  172. if (typeof ol_snapx == 'undefined') { var ol_snapx = 0; }
  173. // Vertical grid spacing that popups will snap to.
  174. // 0 makes no grid, andthing else will cause a snap to that grid spacing.
  175. if (typeof ol_snapy == 'undefined') { var ol_snapy = 0; }
  176. // Sets the popups horizontal position to a fixed column.
  177. // Anything above -1 will cause fixed position.
  178. if (typeof ol_fixx == 'undefined') { var ol_fixx = -1; }
  179. // Sets the popups vertical position to a fixed row.
  180. // Anything above -1 will cause fixed position.
  181. if (typeof ol_fixy == 'undefined') { var ol_fixy = -1; }
  182. // Background image for the popups inside.
  183. if (typeof ol_fgbackground == 'undefined') { var ol_fgbackground = ""; }
  184. // Background image for the popups frame.
  185. if (typeof ol_bgbackground == 'undefined') { var ol_bgbackground = ""; }
  186. // How much horizontal left padding text should get by default when BACKGROUND is used.
  187. if (typeof ol_padxl == 'undefined') { var ol_padxl = 1; }
  188. // How much horizontal right padding text should get by default when BACKGROUND is used.
  189. if (typeof ol_padxr == 'undefined') { var ol_padxr = 1; }
  190. // How much vertical top padding text should get by default when BACKGROUND is used.
  191. if (typeof ol_padyt == 'undefined') { var ol_padyt = 1; }
  192. // How much vertical bottom padding text should get by default when BACKGROUND is used.
  193. if (typeof ol_padyb == 'undefined') { var ol_padyb = 1; }
  194. // If the user by default must supply all html for complete popup control.
  195. // Set to 1 to activate, 0 otherwise.
  196. if (typeof ol_fullhtml == 'undefined') { var ol_fullhtml = 0; }
  197. // Default vertical position of the popup. Default should normally be BELOW.
  198. // ABOVE only works when HEIGHT is defined.
  199. if (typeof ol_vpos == 'undefined') { var ol_vpos = BELOW; }
  200. // Default height of popup to use when placing the popup above the cursor.
  201. if (typeof ol_aboveheight == 'undefined') { var ol_aboveheight = 0; }
  202. // Default icon to place next to the popups caption.
  203. if (typeof ol_caption == 'undefined') { var ol_capicon = ""; }
  204. // Default frame. We default to current frame if there is no frame defined.
  205. if (typeof ol_frame == 'undefined') { var ol_frame = self; }
  206. // Default timeout. By default there is no timeout.
  207. if (typeof ol_timeout == 'undefined') { var ol_timeout = 0; }
  208. // Default javascript funktion. By default there is none.
  209. if (typeof ol_function == 'undefined') { var ol_function = Function(); }
  210. // Default timeout. By default there is no timeout.
  211. if (typeof ol_delay == 'undefined') { var ol_delay = 0; }
  212. // If overLIB should decide the horizontal placement.
  213. if (typeof ol_hauto == 'undefined') { var ol_hauto = 0; }
  214. // If overLIB should decide the vertical placement.
  215. if (typeof ol_vauto == 'undefined') { var ol_vauto = 0; }
  216. // If the user has to click to close stickies.
  217. if (typeof ol_closeclick == 'undefined') { var ol_closeclick = 0; }
  218. // This variable determines if you want to use CSS or inline definitions.
  219. // CSSOFF=no CSS    CSSSTYLE=use CSS inline styles    CSSCLASS=use classes
  220. if (typeof ol_css == 'undefined') { var ol_css = CSSOFF; }
  221. // Main background class (eqv of fgcolor)
  222. // This is only used if CSS is set to use classes (ol_css = CSSCLASS)
  223. if (typeof ol_fgclass == 'undefined') { var ol_fgclass = ""; }
  224. // Frame background class (eqv of bgcolor)
  225. // This is only used if CSS is set to use classes (ol_css = CSSCLASS)
  226. if (typeof ol_bgclass == 'undefined') { var ol_bgclass = ""; }
  227. // Main font class
  228. // This is only used if CSS is set to use classes (ol_css = CSSCLASS)
  229. if (typeof ol_textfontclass == 'undefined') { var ol_textfontclass = ""; }
  230. // Caption font class
  231. // This is only used if CSS is set to use classes (ol_css = CSSCLASS)
  232. if (typeof ol_captionfontclass == 'undefined') { var ol_captionfontclass = ""; }
  233. // Close font class
  234. // This is only used if CSS is set to use classes (ol_css = CSSCLASS)
  235. if (typeof ol_closefontclass == 'undefined') { var ol_closefontclass = ""; }
  236. // Unit to be used for the text padding above
  237. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  238. // Options include "px", "%", "in", "cm" and more
  239. if (typeof ol_padunit == 'undefined') { var ol_padunit = "px";}
  240. // Unit to be used for height of popup
  241. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  242. // Options include "px", "%", "in", "cm" and more
  243. if (typeof ol_heightunit == 'undefined') { var ol_heightunit = "px";}
  244. // Unit to be used for width of popup
  245. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  246. // Options include "px", "%", "in", "cm" and more
  247. if (typeof ol_widthunit == 'undefined') { var ol_widthunit = "px";}
  248. // Font size unit for the main text
  249. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  250. if (typeof ol_textsizeunit == 'undefined') { var ol_textsizeunit = "px";}
  251. // Decoration of the main text ("none", "underline", "line-through" or "blink")
  252. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  253. if (typeof ol_textdecoration == 'undefined') { var ol_textdecoration = "none";}
  254. // Font style of the main text ("normal" or "italic")
  255. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  256. if (typeof ol_textstyle == 'undefined') { var ol_textstyle = "normal";}
  257. // Font weight of the main text ("normal", "bold", "bolder", "lighter", ect.)
  258. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  259. if (typeof ol_textweight == 'undefined') { var ol_textweight = "normal";}
  260. // Font size unit for the caption
  261. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  262. if (typeof ol_captionsizeunit == 'undefined') { var ol_captionsizeunit = "px";}
  263. // Decoration of the caption ("none", "underline", "line-through" or "blink")
  264. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  265. if (typeof ol_captiondecoration == 'undefined') { var ol_captiondecoration = "none";}
  266. // Font style of the caption ("normal" or "italic")
  267. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  268. if (typeof ol_captionstyle == 'undefined') { var ol_captionstyle = "normal";}
  269. // Font weight of the caption ("normal", "bold", "bolder", "lighter", ect.)
  270. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  271. if (typeof ol_captionweight == 'undefined') { var ol_captionweight = "bold";}
  272. // Font size unit for the close text
  273. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  274. if (typeof ol_closesizeunit == 'undefined') { var ol_closesizeunit = "px";}
  275. // Decoration of the close text ("none", "underline", "line-through" or "blink")
  276. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  277. if (typeof ol_closedecoration == 'undefined') { var ol_closedecoration = "none";}
  278. // Font style of the close text ("normal" or "italic")
  279. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  280. if (typeof ol_closestyle == 'undefined') { var ol_closestyle = "normal";}
  281. // Font weight of the close text ("normal", "bold", "bolder", "lighter", ect.)
  282. // Only used if CSS inline styles are being used (ol_css = CSSSTYLE)
  283. if (typeof ol_closeweight == 'undefined') { var ol_closeweight = "normal";}
  284. ////////////////////////////////////////////////////////////////////////////////////
  285. // ARRAY CONFIGURATION
  286. // You don't have to change anything here if you don't want to. The following
  287. // arrays can be filled with text and html if you don't wish to pass it from
  288. // your html page.
  289. ////////////////////////////////////////////////////////////////////////////////////
  290. // Array with texts.
  291. if (typeof ol_texts == 'undefined') { var ol_texts = new Array("Text 0", "Text 1"); }
  292. // Array with captions.
  293. if (typeof ol_caps == 'undefined') { var ol_caps = new Array("Caption 0", "Caption 1"); }
  294. ////////////////////////////////////////////////////////////////////////////////////
  295. // END CONFIGURATION
  296. // Don't change anything below this line, all configuration is above.
  297. ////////////////////////////////////////////////////////////////////////////////////
  298. ////////////////////////////////////////////////////////////////////////////////////
  299. // INIT
  300. ////////////////////////////////////////////////////////////////////////////////////
  301. // Runtime variables init. Used for runtime only, don't change, not for config!
  302. var o3_text = "";
  303. var o3_cap = "";
  304. var o3_sticky = 0;
  305. var o3_background = "";
  306. var o3_close = "Close";
  307. var o3_hpos = RIGHT;
  308. var o3_offsetx = 2;
  309. var o3_offsety = 2;
  310. var o3_fgcolor = "";
  311. var o3_bgcolor = "";
  312. var o3_textcolor = "";
  313. var o3_capcolor = "";
  314. var o3_closecolor = "";
  315. var o3_width = 100;
  316. var o3_border = 1;
  317. var o3_status = "";
  318. var o3_autostatus = 0;
  319. var o3_height = -1;
  320. var o3_snapx = 0;
  321. var o3_snapy = 0;
  322. var o3_fixx = -1;
  323. var o3_fixy = -1;
  324. var o3_fgbackground = "";
  325. var o3_bgbackground = "";
  326. var o3_padxl = 0;
  327. var o3_padxr = 0;
  328. var o3_padyt = 0;
  329. var o3_padyb = 0;
  330. var o3_fullhtml = 0;
  331. var o3_vpos = BELOW;
  332. var o3_aboveheight = 0;
  333. var o3_capicon = "";
  334. var o3_textfont = "Verdana,Arial,Helvetica";
  335. var o3_captionfont = "Verdana,Arial,Helvetica";
  336. var o3_closefont = "Verdana,Arial,Helvetica";
  337. var o3_textsize = "1";
  338. var o3_captionsize = "1";
  339. var o3_closesize = "1";
  340. var o3_frame = self;
  341. var o3_timeout = 0;
  342. var o3_timerid = 0;
  343. var o3_allowmove = 0;
  344. var o3_function = Function();
  345. var o3_delay = 0;
  346. var o3_delayid = 0;
  347. var o3_hauto = 0;
  348. var o3_vauto = 0;
  349. var o3_closeclick = 0;
  350. var o3_css = CSSOFF;
  351. var o3_fgclass = "";
  352. var o3_bgclass = "";
  353. var o3_textfontclass = "";
  354. var o3_captionfontclass = "";
  355. var o3_closefontclass = "";
  356. var o3_padunit = "px";
  357. var o3_heightunit = "px";
  358. var o3_widthunit = "px";
  359. var o3_textsizeunit = "px";
  360. var o3_textdecoration = "";
  361. var o3_textstyle = "";
  362. var o3_textweight = "";
  363. var o3_captionsizeunit = "px";
  364. var o3_captiondecoration = "";
  365. var o3_captionstyle = "";
  366. var o3_captionweight = "";
  367. var o3_closesizeunit = "px";
  368. var o3_closedecoration = "";
  369. var o3_closestyle = "";
  370. var o3_closeweight = "";
  371. // Display state variables
  372. var o3_x = 0;
  373. var o3_y = 0;
  374. var o3_allow = 0;
  375. var o3_showingsticky = 0;
  376. var o3_removecounter = 0;
  377. // Our layer
  378. var over = null;
  379. // Decide browser version
  380. var ns4 = (document.layers)? true:false;
  381. var ns6 = (document.getElementById)? true:false;
  382. var ie4 = (document.all)? true:false;
  383. var ie5 = false;
  384. // Microsoft Stupidity Check(tm).
  385. if (ie4) {
  386. if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) {
  387. ie5 = true;
  388. }
  389. if (ns6) {
  390. ns6 = false;
  391. }
  392. }
  393. // Capture events, alt. diffuses the overlib function.
  394. if ( (ns4) || (ie4) || (ns6)) {
  395. document.onmousemove = mouseMove
  396. if (ns4) document.captureEvents(Event.MOUSEMOVE)
  397. } else {
  398. overlib = no_overlib;
  399. nd = no_overlib;
  400. ver3fix = true;
  401. }
  402. // Fake function for 3.0 users.
  403. function no_overlib() {
  404. return ver3fix;
  405. }
  406. ////////////////////////////////////////////////////////////////////////////////////
  407. // PUBLIC FUNCTIONS
  408. ////////////////////////////////////////////////////////////////////////////////////
  409. // overlib(arg0, ..., argN)
  410. // Loads parameters into global runtime variables.
  411. function overlib() {
  412. // Load defaults to runtime.
  413. o3_text = ol_text;
  414. o3_cap = ol_cap;
  415. o3_sticky = ol_sticky;
  416. o3_background = ol_background;
  417. o3_close = ol_close;
  418. o3_hpos = ol_hpos;
  419. o3_offsetx = ol_offsetx;
  420. o3_offsety = ol_offsety;
  421. o3_fgcolor = ol_fgcolor;
  422. o3_bgcolor = ol_bgcolor;
  423. o3_textcolor = ol_textcolor;
  424. o3_capcolor = ol_capcolor;
  425. o3_closecolor = ol_closecolor;
  426. o3_width = ol_width;
  427. o3_border = ol_border;
  428. o3_status = ol_status;
  429. o3_autostatus = ol_autostatus;
  430. o3_height = ol_height;
  431. o3_snapx = ol_snapx;
  432. o3_snapy = ol_snapy;
  433. o3_fixx = ol_fixx;
  434. o3_fixy = ol_fixy;
  435. o3_fgbackground = ol_fgbackground;
  436. o3_bgbackground = ol_bgbackground;
  437. o3_padxl = ol_padxl;
  438. o3_padxr = ol_padxr;
  439. o3_padyt = ol_padyt;
  440. o3_padyb = ol_padyb;
  441. o3_fullhtml = ol_fullhtml;
  442. o3_vpos = ol_vpos;
  443. o3_aboveheight = ol_aboveheight;
  444. o3_capicon = ol_capicon;
  445. o3_textfont = ol_textfont;
  446. o3_captionfont = ol_captionfont;
  447. o3_closefont = ol_closefont;
  448. o3_textsize = ol_textsize;
  449. o3_captionsize = ol_captionsize;
  450. o3_closesize = ol_closesize;
  451. o3_timeout = ol_timeout;
  452. o3_function = ol_function;
  453. o3_delay = ol_delay;
  454. o3_hauto = ol_hauto;
  455. o3_vauto = ol_vauto;
  456. o3_closeclick = ol_closeclick;
  457. o3_css = ol_css;
  458. o3_fgclass = ol_fgclass;
  459. o3_bgclass = ol_bgclass;
  460. o3_textfontclass = ol_textfontclass;
  461. o3_captionfontclass = ol_captionfontclass;
  462. o3_closefontclass = ol_closefontclass;
  463. o3_padunit = ol_padunit;
  464. o3_heightunit = ol_heightunit;
  465. o3_widthunit = ol_widthunit;
  466. o3_textsizeunit = ol_textsizeunit;
  467. o3_textdecoration = ol_textdecoration;
  468. o3_textstyle = ol_textstyle;
  469. o3_textweight = ol_textweight;
  470. o3_captionsizeunit = ol_captionsizeunit;
  471. o3_captiondecoration = ol_captiondecoration;
  472. o3_captionstyle = ol_captionstyle;
  473. o3_captionweight = ol_captionweight;
  474. o3_closesizeunit = ol_closesizeunit;
  475. o3_closedecoration = ol_closedecoration;
  476. o3_closestyle = ol_closestyle;
  477. o3_closeweight = ol_closeweight;
  478. // Special for frame support, over must be reset...
  479. if ( (ns4) || (ie4) || (ns6) ) {
  480. o3_frame = ol_frame;
  481. if (ns4) over = o3_frame.document.overDiv
  482. if (ie4) over = o3_frame.overDiv.style
  483. if (ns6) over = o3_frame.document.getElementById("overDiv");
  484. }
  485. // What the next argument is expected to be.
  486. var parsemode = -1;
  487. var ar = arguments;
  488. for (i = 0; i < ar.length; i++) {
  489. if (parsemode < 0) {
  490. // Arg is maintext, unless INARRAY
  491. if (ar[i] == INARRAY) {
  492. o3_text = ol_texts[ar[++i]];
  493. } else {
  494. o3_text = ar[i];
  495. }
  496. parsemode = 0;
  497. } else {
  498. // Note: NS4 doesn't like switch cases with vars.
  499. if (ar[i] == INARRAY) { o3_text = ol_texts[ar[++i]]; continue; }
  500. if (ar[i] == CAPARRAY) { o3_cap = ol_caps[ar[++i]]; continue; }
  501. if (ar[i] == STICKY) { o3_sticky = 1; continue; }
  502. if (ar[i] == BACKGROUND) { o3_background = ar[++i]; continue; }
  503. if (ar[i] == NOCLOSE) { o3_close = ""; continue; }
  504. if (ar[i] == CAPTION) { o3_cap = ar[++i]; continue; }
  505. if (ar[i] == CENTER || ar[i] == LEFT || ar[i] == RIGHT) { o3_hpos = ar[i]; continue; }
  506. if (ar[i] == OFFSETX) { o3_offsetx = ar[++i]; continue; }
  507. if (ar[i] == OFFSETY) { o3_offsety = ar[++i]; continue; }
  508. if (ar[i] == FGCOLOR) { o3_fgcolor = ar[++i]; continue; }
  509. if (ar[i] == BGCOLOR) { o3_bgcolor = ar[++i]; continue; }
  510. if (ar[i] == TEXTCOLOR) { o3_textcolor = ar[++i]; continue; }
  511. if (ar[i] == CAPCOLOR) { o3_capcolor = ar[++i]; continue; }
  512. if (ar[i] == CLOSECOLOR) { o3_closecolor = ar[++i]; continue; }
  513. if (ar[i] == WIDTH) { o3_width = ar[++i]; continue; }
  514. if (ar[i] == BORDER) { o3_border = ar[++i]; continue; }
  515. if (ar[i] == STATUS) { o3_status = ar[++i]; continue; }
  516. if (ar[i] == AUTOSTATUS) { o3_autostatus = 1; continue; }
  517. if (ar[i] == AUTOSTATUSCAP) { o3_autostatus = 2; continue; }
  518. if (ar[i] == HEIGHT) { o3_height = ar[++i]; o3_aboveheight = ar[i]; continue; } // Same param again.
  519. if (ar[i] == CLOSETEXT) { o3_close = ar[++i]; continue; }
  520. if (ar[i] == SNAPX) { o3_snapx = ar[++i]; continue; }
  521. if (ar[i] == SNAPY) { o3_snapy = ar[++i]; continue; }
  522. if (ar[i] == FIXX) { o3_fixx = ar[++i]; continue; }
  523. if (ar[i] == FIXY) { o3_fixy = ar[++i]; continue; }
  524. if (ar[i] == FGBACKGROUND) { o3_fgbackground = ar[++i]; continue; }
  525. if (ar[i] == BGBACKGROUND) { o3_bgbackground = ar[++i]; continue; }
  526. if (ar[i] == PADX) { o3_padxl = ar[++i]; o3_padxr = ar[++i]; continue; }
  527. if (ar[i] == PADY) { o3_padyt = ar[++i]; o3_padyb = ar[++i]; continue; }
  528. if (ar[i] == FULLHTML) { o3_fullhtml = 1; continue; }
  529. if (ar[i] == BELOW || ar[i] == ABOVE) { o3_vpos = ar[i]; continue; }
  530. if (ar[i] == CAPICON) { o3_capicon = ar[++i]; continue; }
  531. if (ar[i] == TEXTFONT) { o3_textfont = ar[++i]; continue; }
  532. if (ar[i] == CAPTIONFONT) { o3_captionfont = ar[++i]; continue; }
  533. if (ar[i] == CLOSEFONT) { o3_closefont = ar[++i]; continue; }
  534. if (ar[i] == TEXTSIZE) { o3_textsize = ar[++i]; continue; }
  535. if (ar[i] == CAPTIONSIZE) { o3_captionsize = ar[++i]; continue; }
  536. if (ar[i] == CLOSESIZE) { o3_closesize = ar[++i]; continue; }
  537. if (ar[i] == FRAME) { opt_FRAME(ar[++i]); continue; }
  538. if (ar[i] == TIMEOUT) { o3_timeout = ar[++i]; continue; }
  539. if (ar[i] == FUNCTION) { opt_FUNCTION(ar[++i]); continue; }
  540. if (ar[i] == DELAY) { o3_delay = ar[++i]; continue; }
  541. if (ar[i] == HAUTO) { o3_hauto = (o3_hauto == 0) ? 1 : 0; continue; }
  542. if (ar[i] == VAUTO) { o3_vauto = (o3_vauto == 0) ? 1 : 0; continue; }
  543. if (ar[i] == CLOSECLICK) { o3_closeclick = (o3_closeclick == 0) ? 1 : 0; continue; }
  544. if (ar[i] == CSSOFF) { o3_css = ar[i]; continue; }
  545. if (ar[i] == CSSSTYLE) { o3_css = ar[i]; continue; }
  546. if (ar[i] == CSSCLASS) { o3_css = ar[i]; continue; }
  547. if (ar[i] == FGCLASS) { o3_fgclass = ar[++i]; continue; }
  548. if (ar[i] == BGCLASS) { o3_bgclass = ar[++i]; continue; }
  549. if (ar[i] == TEXTFONTCLASS) { o3_textfontclass = ar[++i]; continue; }
  550. if (ar[i] == CAPTIONFONTCLASS) { o3_captionfontclass = ar[++i]; continue; }
  551. if (ar[i] == CLOSEFONTCLASS) { o3_closefontclass = ar[++i]; continue; }
  552. if (ar[i] == PADUNIT) { o3_padunit = ar[++i]; continue; }
  553. if (ar[i] == HEIGHTUNIT) { o3_heightunit = ar[++i]; continue; }
  554. if (ar[i] == WIDTHUNIT) { o3_widthunit = ar[++i]; continue; }
  555. if (ar[i] == TEXTSIZEUNIT) { o3_textsizeunit = ar[++i]; continue; }
  556. if (ar[i] == TEXTDECORATION) { o3_textdecoration = ar[++i]; continue; }
  557. if (ar[i] == TEXTSTYLE) { o3_textstyle = ar[++i]; continue; }
  558. if (ar[i] == TEXTWEIGHT) { o3_textweight = ar[++i]; continue; }
  559. if (ar[i] == CAPTIONSIZEUNIT) { o3_captionsizeunit = ar[++i]; continue; }
  560. if (ar[i] == CAPTIONDECORATION) { o3_captiondecoration = ar[++i]; continue; }
  561. if (ar[i] == CAPTIONSTYLE) { o3_captionstyle = ar[++i]; continue; }
  562. if (ar[i] == CAPTIONWEIGHT) { o3_captionweight = ar[++i]; continue; }
  563. if (ar[i] == CLOSESIZEUNIT) { o3_closesizeunit = ar[++i]; continue; }
  564. if (ar[i] == CLOSEDECORATION) { o3_closedecoration = ar[++i]; continue; }
  565. if (ar[i] == CLOSESTYLE) { o3_closestyle = ar[++i]; continue; }
  566. if (ar[i] == CLOSEWEIGHT) { o3_closeweight = ar[++i]; continue; }
  567. }
  568. }
  569. if (o3_delay == 0) {
  570. return overlib350();
  571. } else {
  572. o3_delayid = setTimeout("overlib350()", o3_delay);
  573. if (o3_sticky) {
  574. return false;
  575. } else {
  576. return true;
  577. }
  578. }
  579. }
  580. // Clears popups if appropriate
  581. function nd() {
  582. if ( o3_removecounter >= 1 ) { o3_showingsticky = 0 };
  583. if ( (ns4) || (ie4) || (ns6) ) {
  584. if ( o3_showingsticky == 0 ) {
  585. o3_allowmove = 0;
  586. if (over != null) hideObject(over);
  587. } else {
  588. o3_removecounter++;
  589. }
  590. }
  591. return true;
  592. }
  593. ////////////////////////////////////////////////////////////////////////////////////
  594. // OVERLIB 3.50 FUNCTION
  595. ////////////////////////////////////////////////////////////////////////////////////
  596. // This function decides what it is we want to display and how we want it done.
  597. function overlib350() {
  598. // Make layer content
  599. var layerhtml;
  600. if (o3_background != "" || o3_fullhtml) {
  601. // Use background instead of box.
  602. layerhtml = ol_content_background(o3_text, o3_background, o3_fullhtml);
  603. } else {
  604. // They want a popup box.
  605. // Prepare popup background
  606. if (o3_fgbackground != "" && o3_css == CSSOFF) {
  607. o3_fgbackground = "BACKGROUND=""+o3_fgbackground+""";
  608. }
  609. if (o3_bgbackground != "" && o3_css == CSSOFF) {
  610. o3_bgbackground = "BACKGROUND=""+o3_bgbackground+""";
  611. }
  612. // Prepare popup colors
  613. if (o3_fgcolor != "" && o3_css == CSSOFF) {
  614. o3_fgcolor = "BGCOLOR=""+o3_fgcolor+""";
  615. }
  616. if (o3_bgcolor != "" && o3_css == CSSOFF) {
  617. o3_bgcolor = "BGCOLOR=""+o3_bgcolor+""";
  618. }
  619. // Prepare popup height
  620. if (o3_height > 0 && o3_css == CSSOFF) {
  621. o3_height = "HEIGHT=" + o3_height;
  622. } else {
  623. o3_height = "";
  624. }
  625. // Decide which kinda box.
  626. if (o3_cap == "") {
  627. // Plain
  628. layerhtml = ol_content_simple(o3_text);
  629. } else {
  630. // With caption
  631. if (o3_sticky) {
  632. // Show close text
  633. layerhtml = ol_content_caption(o3_text, o3_cap, o3_close);
  634. } else {
  635. // No close text
  636. layerhtml = ol_content_caption(o3_text, o3_cap, "");
  637. }
  638. }
  639. }
  640. // We want it to stick!
  641. if (o3_sticky) {
  642. o3_showingsticky = 1;
  643. o3_removecounter = 0;
  644. }
  645. // Write layer
  646. layerWrite(layerhtml);
  647. // Prepare status bar
  648. if (o3_autostatus > 0) {
  649. o3_status = o3_text;
  650. if (o3_autostatus > 1) {
  651. o3_status = o3_cap;
  652. }
  653. }
  654. // When placing the layer the first time, even stickies may be moved.
  655. o3_allowmove = 0;
  656. // Initiate a timer for timeout
  657. if (o3_timeout > 0) {          
  658. if (o3_timerid > 0) clearTimeout(o3_timerid);
  659. o3_timerid = setTimeout("cClick()", o3_timeout);
  660. }
  661. // Show layer
  662. disp(o3_status);
  663. // Stickies should stay where they are.
  664. if (o3_sticky) {
  665. o3_allowmove = 0;
  666. return false;
  667. } else {
  668. return true;
  669. }
  670. }
  671. ////////////////////////////////////////////////////////////////////////////////////
  672. // LAYER GENERATION FUNCTIONS
  673. ////////////////////////////////////////////////////////////////////////////////////
  674. // Makes simple table without caption
  675. function ol_content_simple(text) {
  676. if (o3_css == CSSCLASS) txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 class=""+o3_bgclass+""><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 class=""+o3_fgclass+""><TR><TD VALIGN=TOP><FONT class=""+o3_textfontclass+"">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  677. if (o3_css == CSSSTYLE) txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 style="background-color: "+o3_bgcolor+"; height: "+o3_height+o3_heightunit+";"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 style="color: "+o3_fgcolor+"; background-color: "+o3_fgcolor+"; height: "+o3_height+o3_heightunit+";"><TR><TD VALIGN=TOP><FONT style="font-family: "+o3_textfont+"; color: "+o3_textcolor+"; font-size: "+o3_textsize+o3_textsizeunit+"; text-decoration: "+o3_textdecoration+"; font-weight: "+o3_textweight+"; font-style:"+o3_textstyle+"">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  678. if (o3_css == CSSOFF) txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 "+o3_bgcolor+" "+o3_height+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 "+o3_fgcolor+" "+o3_fgbackground+" "+o3_height+"><TR><TD VALIGN=TOP><FONT FACE=""+o3_textfont+"" COLOR=""+o3_textcolor+"" SIZE=""+o3_textsize+"">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  679. set_background("");
  680. return txt;
  681. }
  682. // Makes table with caption and optional close link
  683. function ol_content_caption(text, title, close) {
  684. closing = "";
  685. closeevent = "onMouseOver";
  686. if (o3_closeclick == 1) closeevent = "onClick";
  687. if (o3_capicon != "") o3_capicon = "<IMG SRC=""+o3_capicon+""> ";
  688. if (close != "") {
  689. if (o3_css == CSSCLASS) closing = "<TD ALIGN=RIGHT><A HREF="/" "+closeevent+"="return cClick();" class=""+o3_closefontclass+"">"+close+"</A></TD>";
  690. if (o3_css == CSSSTYLE) closing = "<TD ALIGN=RIGHT><A HREF="/" "+closeevent+"="return cClick();" style="color: "+o3_closecolor+"; font-family: "+o3_closefont+"; font-size: "+o3_closesize+o3_closesizeunit+"; text-decoration: "+o3_closedecoration+"; font-weight: "+o3_closeweight+"; font-style:"+o3_closestyle+";">"+close+"</A></TD>";
  691. if (o3_css == CSSOFF) closing = "<TD ALIGN=RIGHT><A HREF="/" "+closeevent+"="return cClick();"><FONT COLOR=""+o3_closecolor+"" FACE=""+o3_closefont+"" SIZE=""+o3_closesize+"">"+close+"</FONT></A></TD>";
  692. }
  693. if (o3_css == CSSCLASS) txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 class=""+o3_bgclass+""><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><FONT class=""+o3_captionfontclass+"">"+o3_capicon+title+"</FONT></TD>"+closing+"</TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 class=""+o3_fgclass+""><TR><TD VALIGN=TOP><FONT class=""+o3_textfontclass+"">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  694. if (o3_css == CSSSTYLE) txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 style="background-color: "+o3_bgcolor+"; background-image: url("+o3_bgbackground+"); height: "+o3_height+o3_heightunit+";"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><FONT style="font-family: "+o3_captionfont+"; color: "+o3_capcolor+"; font-size: "+o3_captionsize+o3_captionsizeunit+"; font-weight: "+o3_captionweight+"; font-style: "+o3_captionstyle+";">"+o3_capicon+title+"</FONT></TD>"+closing+"</TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 style="color: "+o3_fgcolor+"; background-color: "+o3_fgcolor+"; height: "+o3_height+o3_heightunit+";"><TR><TD VALIGN=TOP><FONT style="font-family: "+o3_textfont+"; color: "+o3_textcolor+"; font-size: "+o3_textsize+o3_textsizeunit+"; text-decoration: "+o3_textdecoration+"; font-weight: "+o3_textweight+"; font-style:"+o3_textstyle+"">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  695. if (o3_css == CSSOFF) txt = "<TABLE WIDTH="+o3_width+" BORDER=0 CELLPADDING="+o3_border+" CELLSPACING=0 "+o3_bgcolor+" "+o3_bgbackground+" "+o3_height+"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><B><FONT COLOR=""+o3_capcolor+"" FACE=""+o3_captionfont+"" SIZE=""+o3_captionsize+"">"+o3_capicon+title+"</FONT></B></TD>"+closing+"</TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 "+o3_fgcolor+" "+o3_fgbackground+" "+o3_height+"><TR><TD VALIGN=TOP><FONT COLOR=""+o3_textcolor+"" FACE=""+o3_textfont+"" SIZE=""+o3_textsize+"">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
  696. set_background("");
  697. return txt;
  698. }
  699. // Sets the background picture, padding and lots more. :)
  700. function ol_content_background(text, picture, hasfullhtml) {
  701. if (hasfullhtml) {
  702. txt = text;
  703. } else {
  704. if (o3_css == CSSCLASS) txt = "<TABLE WIDTH="+o3_width+o3_widthunit+" BORDER=0 CELLPADDING=0 CELLSPACING=0 HEIGHT="+o3_height+o3_heightunit+"><TR><TD COLSPAN=3 HEIGHT="+o3_padyt+o3_padunit+"></TD></TR><TR><TD WIDTH="+o3_padxl+o3_padunit+"></TD><TD VALIGN=TOP WIDTH="+(o3_width-o3_padxl-o3_padxr)+o3_padunit+"><FONT class=""+o3_textfontclass+"">"+text+"</FONT></TD><TD WIDTH="+o3_padxr+o3_padunit+"></TD></TR><TR><TD COLSPAN=3 HEIGHT="+o3_padyb+o3_padunit+"></TD></TR></TABLE>";
  705. if (o3_css == CSSSTYLE) txt = "<TABLE WIDTH="+o3_width+o3_widthunit+" BORDER=0 CELLPADDING=0 CELLSPACING=0 HEIGHT="+o3_height+o3_heightunit+"><TR><TD COLSPAN=3 HEIGHT="+o3_padyt+o3_padunit+"></TD></TR><TR><TD WIDTH="+o3_padxl+o3_padunit+"></TD><TD VALIGN=TOP WIDTH="+(o3_width-o3_padxl-o3_padxr)+o3_padunit+"><FONT style="font-family: "+o3_textfont+"; color: "+o3_textcolor+"; font-size: "+o3_textsize+o3_textsizeunit+";">"+text+"</FONT></TD><TD WIDTH="+o3_padxr+o3_padunit+"></TD></TR><TR><TD COLSPAN=3 HEIGHT="+o3_padyb+o3_padunit+"></TD></TR></TABLE>";
  706. if (o3_css == CSSOFF) 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)+"><FONT FACE=""+o3_textfont+"" COLOR=""+o3_textcolor+"" SIZE=""+o3_textsize+"">"+text+"</FONT></TD><TD WIDTH="+o3_padxr+"></TD></TR><TR><TD COLSPAN=3 HEIGHT="+o3_padyb+"></TD></TR></TABLE>";
  707. }
  708. set_background(picture);
  709. return txt;
  710. }
  711. // Loads a picture into the div.
  712. function set_background(pic) {
  713. if (pic == "") {
  714. if (ie4) over.backgroundImage = "none";
  715. if (ns6) over.style.backgroundImage = "none";
  716. } else {
  717. if (ns4) {
  718. over.background.src = pic;
  719. } else if (ie4) {
  720. over.backgroundImage = "url("+pic+")";
  721. } else if (ns6) {
  722. over.style.backgroundImage = "url("+pic+")";
  723. }
  724. }
  725. }
  726. ////////////////////////////////////////////////////////////////////////////////////
  727. // HANDLING FUNCTIONS
  728. ////////////////////////////////////////////////////////////////////////////////////
  729. // Displays the popup
  730. function disp(statustext) {
  731. if ( (ns4) || (ie4) || (ns6) ) {
  732. if (o3_allowmove == 0)  {
  733. placeLayer();
  734. showObject(over);
  735. o3_allowmove = 1;
  736. }
  737. }
  738. if (statustext != "") {
  739. self.status = statustext;
  740. }
  741. }
  742. // Decides where we want the popup.
  743. function placeLayer() {
  744. var placeX, placeY;
  745. // HORIZONTAL PLACEMENT
  746. if (o3_fixx > -1) {
  747. // Fixed position
  748. placeX = o3_fixx;
  749. } else {
  750. winoffset = (ie4) ? o3_frame.document.body.scrollLeft : o3_frame.pageXOffset;
  751. if (ie4) iwidth = o3_frame.document.body.clientWidth;
  752. if (ns4) iwidth = o3_frame.innerWidth; // was screwed in mozilla, fixed now?
  753. if (ns6) iwidth = o3_frame.outerWidth;
  754. // If HAUTO, decide what to use.
  755. if (o3_hauto == 1) {
  756. if ( (o3_x - winoffset) > ((eval(iwidth)) / 2)) {
  757. o3_hpos = LEFT;
  758. } else {
  759. o3_hpos = RIGHT;
  760. }
  761. }
  762. // From mouse
  763. if (o3_hpos == CENTER) { // Center
  764. placeX = o3_x+o3_offsetx-(o3_width/2);
  765. }
  766. if (o3_hpos == RIGHT) { // Right
  767. placeX = o3_x+o3_offsetx;
  768. if ( (eval(placeX) + eval(o3_width)) > (winoffset + iwidth) ) {
  769. placeX = iwidth + winoffset - o3_width;
  770. if (placeX < 0) placeX = 0;
  771. }
  772. }
  773. if (o3_hpos == LEFT) { // Left
  774. placeX = o3_x-o3_offsetx-o3_width;
  775. if (placeX < winoffset) placeX = winoffset;
  776. }
  777. // Snapping!
  778. if (o3_snapx > 1) {
  779. var snapping = placeX % o3_snapx;
  780. if (o3_hpos == LEFT) {
  781. placeX = placeX - (o3_snapx + snapping);
  782. } else {
  783. // CENTER and RIGHT
  784. placeX = placeX + (o3_snapx - snapping);
  785. }
  786. if (placeX < winoffset) placeX = winoffset;
  787. }
  788. }
  789. // VERTICAL PLACEMENT
  790. if (o3_fixy > -1) {
  791. // Fixed position
  792. placeY = o3_fixy;
  793. } else {
  794. scrolloffset = (ie4) ? o3_frame.document.body.scrollTop : o3_frame.pageYOffset;
  795. // If VAUTO, decide what to use.
  796. if (o3_vauto == 1) {
  797. if (ie4) iheight = o3_frame.document.body.clientHeight;
  798. if (ns4) iheight = o3_frame.innerHeight;
  799. if (ns6) iheight = o3_frame.outerHeight;
  800. iheight = (eval(iheight)) / 2;
  801. if ( (o3_y - scrolloffset) > iheight) {
  802. o3_vpos = ABOVE;
  803. } else {
  804. o3_vpos = BELOW;
  805. }
  806. }
  807. // From mouse
  808. if (o3_vpos == ABOVE) {
  809. if (o3_aboveheight == 0) {
  810. var divref = (ie4) ? o3_frame.document.all['overDiv'] : over;
  811. o3_aboveheight = (ns4) ? divref.clip.height : divref.offsetHeight;
  812. }
  813. placeY = o3_y - (o3_aboveheight + o3_offsety);
  814. if (placeY < scrolloffset) placeY = scrolloffset;
  815. } else {
  816. // BELOW
  817. placeY = o3_y + o3_offsety;
  818. }
  819. // Snapping!
  820. if (o3_snapy > 1) {
  821. var snapping = placeY % o3_snapy;
  822. if (o3_aboveheight > 0 && o3_vpos == ABOVE) {
  823. placeY = placeY - (o3_snapy + snapping);
  824. } else {
  825. placeY = placeY + (o3_snapy - snapping);
  826. }
  827. if (placeY < scrolloffset) placeY = scrolloffset;
  828. }
  829. }
  830. // Actually move the object.
  831. repositionTo(over, placeX, placeY);
  832. }
  833. // Moves the layer
  834. function mouseMove(e) {
  835. if ( (ns4) || (ns6) ) {o3_x=e.pageX; o3_y=e.pageY;}
  836. if (ie4) {o3_x=event.x; o3_y=event.y;}
  837. if (ie5) {o3_x=event.x+o3_frame.document.body.scrollLeft; o3_y=event.y+o3_frame.document.body.scrollTop;}
  838. if (o3_allowmove == 1) {
  839. placeLayer();
  840. }
  841. }
  842. // The Close onMouseOver function for stickies
  843. function cClick() {
  844. hideObject(over);
  845. o3_showingsticky = 0;
  846. return false;
  847. }
  848. // Makes sure target frame has overLIB
  849. function compatibleframe(frameid) {        
  850. if (ns4) {
  851. if (typeof frameid.document.overDiv =='undefined') return false;
  852. } else if (ie4) {
  853. if (typeof frameid.document.all["overDiv"] =='undefined') return false;
  854. } else if (ns6) {
  855. if (frameid.document.getElementById('overDiv') == null) return false;
  856. }
  857. return true;
  858. }
  859. ////////////////////////////////////////////////////////////////////////////////////
  860. // LAYER FUNCTIONS
  861. ////////////////////////////////////////////////////////////////////////////////////
  862. // Writes to a layer
  863. function layerWrite(txt) {
  864. txt += "n";
  865.         if (ns4) {
  866.                 var lyr = o3_frame.document.overDiv.document
  867.                 lyr.write(txt)
  868.                 lyr.close()
  869.         } else if (ie4) {
  870. o3_frame.document.all["overDiv"].innerHTML = txt
  871. } else if (ns6) {
  872. range = o3_frame.document.createRange();
  873. range.setStartBefore(over);
  874. domfrag = range.createContextualFragment(txt);
  875. while (over.hasChildNodes()) {
  876. over.removeChild(over.lastChild);
  877. }
  878. over.appendChild(domfrag);
  879. }
  880. }
  881. // Make an object visible
  882. function showObject(obj) {
  883.         if (ns4) obj.visibility = "show";
  884.         else if (ie4) obj.visibility = "visible";
  885. else if (ns6) obj.style.visibility = "visible";
  886. }
  887. // Hides an object
  888. function hideObject(obj) {
  889.         if (ns4) obj.visibility = "hide";
  890.         else if (ie4) obj.visibility = "hidden";
  891. else if (ns6) obj.style.visibility = "hidden";
  892.         
  893. if (o3_timerid > 0) clearTimeout(o3_timerid);
  894. if (o3_delayid > 0) clearTimeout(o3_delayid);
  895. o3_timerid = 0;
  896. o3_delayid = 0;
  897.         self.status = "";
  898. }
  899. // Move a layer
  900. function repositionTo(obj,xL,yL) {
  901. if ( (ns4) || (ie4) ) {
  902.         obj.left = xL;
  903.         obj.top = yL;
  904. } else if (ns6) {
  905. obj.style.left = xL + "px";
  906. obj.style.top = yL+ "px";
  907. }
  908. }
  909. ////////////////////////////////////////////////////////////////////////////////////
  910. // PARSER FUNCTIONS
  911. ////////////////////////////////////////////////////////////////////////////////////
  912. // Defines which frame we should point to.
  913. function opt_FRAME(frm) {
  914.         o3_frame = compatibleframe(frm) ? frm : ol_frame;
  915. if ( (ns4) || (ie4 || (ns6)) ) {
  916. if (ns4) over = o3_frame.document.overDiv;
  917. if (ie4) over = o3_frame.overDiv.style;
  918. if (ns6) over = o3_frame.document.getElementById("overDiv");
  919. }
  920. return 0;
  921. }
  922. // Calls an external function
  923. function opt_FUNCTION(callme) {
  924. o3_text = callme()
  925. return 0;
  926. }
  927. //end (For internal purposes.)
  928. ////////////////////////////////////////////////////////////////////////////////////
  929. // OVERLIB 2 COMPATABILITY FUNCTIONS
  930. // If you aren't upgrading you can remove the below section.
  931. ////////////////////////////////////////////////////////////////////////////////////
  932. // Converts old 0=left, 1=right and 2=center into constants.
  933. function vpos_convert(d) {
  934. if (d == 0) {
  935. d = LEFT;
  936. } else {
  937. if (d == 1) {
  938. d = RIGHT;
  939. } else {
  940. d = CENTER;
  941. }
  942. }
  943. return d;
  944. }
  945. // Simple popup
  946. function dts(d,text) {
  947. o3_hpos = vpos_convert(d);
  948. overlib(text, o3_hpos, CAPTION, "");
  949. }
  950. // Caption popup
  951. function dtc(d,text, title) {
  952. o3_hpos = vpos_convert(d);
  953. overlib(text, CAPTION, title, o3_hpos);
  954. }
  955. // Sticky
  956. function stc(d,text, title) {
  957. o3_hpos = vpos_convert(d);
  958. overlib(text, CAPTION, title, o3_hpos, STICKY);
  959. }
  960. // Simple popup right
  961. function drs(text) {
  962. dts(1,text);
  963. }
  964. // Caption popup right
  965. function drc(text, title) {
  966. dtc(1,text,title);
  967. }
  968. // Sticky caption right
  969. function src(text,title) {
  970. stc(1,text,title);
  971. }
  972. // Simple popup left
  973. function dls(text) {
  974. dts(0,text);
  975. }
  976. // Caption popup left
  977. function dlc(text, title) {
  978. dtc(0,text,title);
  979. }
  980. // Sticky caption left
  981. function slc(text,title) {
  982. stc(0,text,title);
  983. }
  984. // Simple popup center
  985. function dcs(text) {
  986. dts(2,text);
  987. }
  988. // Caption popup center
  989. function dcc(text, title) {
  990. dtc(2,text,title);
  991. }
  992. // Sticky caption center
  993. function scc(text,title) {
  994. stc(2,text,title);
  995. }