1 <script type="text/javascript">
3 // The following code is used to support the small popups that
4 // give the full description of an event when the user move the
6 // Thanks to Klaus Knopper (www.knoppix.com) for this script.
7 // It has been modified to work with the existing WebCalendar
8 // architecture on 02/25/2005
10 // 03/05/2005 Prevent popup from going off screen by setting
11 // maximum width, which is cnfigurable
13 // Bubblehelp infoboxes, (C) 2002 Klaus Knopper <infobox@knopper.net>
14 // You can copy/modify and distribute this code under the conditions
15 // of the GNU GENERAL PUBLIC LICENSE Version 2.
17 var ns4 // Are we using Netscape4?
18 var ie4 // Are we using Internet Explorer Version 4?
19 var ie5 // Are we using Internet Explorer Version 5 and up?
20 var kon // Are we using KDE Konqueror?
21 var x,y,winW,winH // Current help position and main window size
22 var idiv=null // Pointer to infodiv container
23 var px="px" // position suffix with "px" in some cases
24 var popupW // width of popup
25 var popupH // height of popup
26 var xoffset = 8 // popup distance from cursor x coordinate
27 var yoffset = 12 // popup distance from cursor y coordinate
28 var followMe = 1 // allow popup to follow cursor...turn off for better performance
29 var maxwidth = 300 // maximum width of popup window
31 function nsfix(){setTimeout("window.onresize = rebrowse", 2000);}
33 function rebrowse(){window.location.reload();}
36 ns4=(document.layers)?true:false, ie4=(document.all)?true:false;
37 ie5=((ie4)&&((navigator.userAgent.indexOf('MSIE 5')>0)||(navigator.userAgent.indexOf('MSIE 6')>0)))?true:false;
38 kon=(navigator.userAgent.indexOf('konqueror')>0)?true:false;
39 x=0;y=0;winW=800;winH=600;
42 document.onmousemove = mousemove;
43 if(ns4&&document.captureEvents) document.captureEvents(Event.MOUSEMOVE);
45 // Workaround for just another netscape bug: Fix browser confusion on resize
46 // obviously conqueror has a similar problem :-(
47 if(ns4||kon){ nsfix() }
52 idiv.visibility=ns4?"hide":"hidden";
56 function gettip(name){return (document.layers&&document.layers[name])?document.layers[name]:(document.all&&document.all[name]&&document.all[name].style)?document.all[name].style:document[name]?document[name]:(document.getElementById(name)?document.getElementById(name).style:0);}
58 function show(evt, name){
62 scrollX =0; scrollY=0;
63 winW=(window.innerWidth)? window.innerWidth+window.pageXOffset-16:document.body.offsetWidth-20;
64 winH=(window.innerHeight)?window.innerHeight+window.pageYOffset :document.body.offsetHeight;
65 scrollX=(typeof window.pageXOffset == "number")? window.pageXOffset:(document.documentElement && document.documentElement.scrollLeft)?document.documentElement.scrollLeft:(document.body && document.body.scrollLeft)?document.body.scrollLeft:window.scrollX;
66 scrollY=(typeof window.pageYOffset == "number")? window.pageYOffset:(document.documentElement && document.documentElement.scrollTop)?document.documentElement.scrollTop:(document.body && document.body.scrollTop)?document.body.scrollTop:window.scrollY;
67 popupW = document.getElementById(name).offsetWidth;
68 popupH = document.getElementById(name).offsetHeight;
75 e = e? e: window.event;
78 x=e.pageX?e.pageX:e.clientX?e.clientX + scrollX:0;
79 y=e.pageY?e.pageY:e.clientY?e.clientY + scrollY:0;
84 // MAke sure we don't go off screen
85 if ( popupW > maxwidth ) {
87 idiv.width = maxwidth + px;
89 idiv.left=(((x + popupW + xoffset)>winW)?x - popupW - xoffset:x + xoffset)+px;
90 if ((popupH + yoffset)>winH) {
91 idiv.top= yoffset + px;
93 idiv.top=(((y + popupH + yoffset)>winH)?winH - popupH - yoffset:y + yoffset)+px;
95 idiv.visibility=ns4?"show":"visible";
99 function mousemove(e){
102 // Initialize after loading the page
103 window.onload=infoinit;