/* EventCalendar. Copyright (C) 2005, Alex Tingle. $Revision: 65 $ * This file is licensed under the GNU GPL. See LICENSE file for details. */ /** class ec3_Popup */ function ec3_Popup() { WindowOnload( function() { var calendars=ec3.get_calendars(); if(!calendars) return; // Pre-load images. ec3.imgShadow0=new Image(8,32); ec3.imgShadow1=new Image(500,16); ec3.imgShadow2=new Image(8,32); ec3.imgShadow0.src=ec3.myfiles+'/shadow0.png'; ec3.imgShadow1.src=ec3.myfiles+'/shadow1.png'; ec3.imgShadow2.src=ec3.myfiles+'/shadow2.png'; // Generate the popup (but keep it hidden). var table,tbody,tr,td; ec3_Popup.popup=document.createElement('table'); ec3_Popup.popup.style.display='none'; ec3_Popup.popup.id='ec3_popup'; ec3_Popup.popup.className='ec3_popup'; tbody=ec3_Popup.popup.appendChild( document.createElement('tbody') ); tr=tbody.appendChild( document.createElement('tr') ); td=tr.appendChild( document.createElement('td') ); td.id='ec3_shadow0'; td.rowSpan=2; td.appendChild( document.createElement('div') ); td=tr.appendChild( document.createElement('td') ); ec3_Popup.contents=td.appendChild( document.createElement('table') ); ec3_Popup.contents.style.width=500; td=tr.appendChild( document.createElement('td') ); td.id='ec3_shadow2'; td.rowSpan=2; td.appendChild( document.createElement('div') ); tr=tbody.appendChild( document.createElement('tr') ); td=tr.appendChild( document.createElement('td') ); td.id='ec3_shadow1'; document.body.appendChild(ec3_Popup.popup); // Add event handlers to the calendars. for(var i=0; i is now set to false //===================================================================== function addEvent(obj, evType, fn){ if(obj.addEventListener){ obj.addEventListener(evType, fn, false); return true; } else if (obj.attachEvent){ var r = obj.attachEvent('on'+evType, fn); return r; } else { return false; } } //===================================================================== // From http://www.quirksmode.org/ //===================================================================== function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while(1) { curleft += obj.offsetLeft; if(!obj.offsetParent) break; obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while(1) { curtop += obj.offsetTop; if(!obj.offsetParent) break; obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } } // end namespace ec3_Popup // Export public functions from ec3_Popup namespace. ec3_Popup();