
            
            function updateClock () {
                
                


                
                var currentHours = $('hours').innerHTML;
                var currentMinutes = $('minutes').innerHTML;
                var currentSeconds = $('seconds').innerHTML;
                
                currentSeconds++;
                
                if (currentSeconds > 59) {
                    currentSeconds = (currentSeconds - 60);
                    
                    currentMinutes++;
                    
                    
                    if (currentMinutes > 59) {
                        currentMinutes = (currentMinutes - 60);
                        
                        currentHours++;
                        
                        
                        if (currentHours > 23) {
                            currentHours = (currentHours - 24);
                        }
                        
                        currentHours = (currentHours < 10 ? "0" : "") + currentHours;
                    }
                    
                    currentMinutes = (currentMinutes < 10 ? "0" : "") + currentMinutes;
                }

                currentSeconds = ( currentSeconds < 10 ? "0" : "") + currentSeconds;

                $('hours').innerHTML = currentHours;
                $('minutes').innerHTML = currentMinutes;
                $('seconds').innerHTML = currentSeconds;
            }
            
            var Tooltip;
            
            window.addEvent('domready', function() {
                updateClock();
            	setInterval('updateClock()', 1000);
                
                Tooltip = new TooltipClass('#calendarInner a', {
                
                    
                    content: function(e) {
                        
                        // Data is in an Attribute
                        if (e.getProperty('data-attribute')) {
                            return e.getProperty('data-attribute');
                        }
                        // Data is in an Element
                        if (e.getProperty('data-element')) {
                            if($(e.getProperty('data-element'))) {
                                return $(e.getProperty('data-element')).get('html');
                            }
                            if(Tooltip.GetCache(e.getProperty('data-element'))) {
                                return Tooltip.GetCache(e.getProperty('data-element'));
                            }
                            return 'Could not retrieve data.';
                        }
                        // Data needs to be loaded
                        if (e.getProperty('data-link')) {
                            if(Tooltip.GetCache(e.getProperty('data-link'))) {
                                return Tooltip.GetCache(e.getProperty('data-link'));
                            }
                            
                            var request = new Request.JSON({
                                url: e.getProperty('data-link'),
                                link: 'chain',
                                onSuccess: function(jsonObj) {
                                    
                                    Tooltip.SetCache(e.getProperty('data-link'), jsonObj.data);
                                    
                                    $(e.getProperty('data-link')).set('html', jsonObj.data);
                                    
                                    Tooltip.Reposition(e);

                                }
                            }).send();
                            return 'loading...';
                        }
                    },
                    
                    position: 'top',
                    center: false,
                    html: true
                    
                });
                
            });
            
            // -->
          
