var the_timeout = 0; var delay = 50; //milliseconds function startHide( obj_id, time_out ) { obj = $(obj_id); if( obj && obj.style.display == 'block' ) { the_timeout = setTimeout("switchVisibility('"+ obj_id +"')", time_out ); } } function stopHide() { if ( the_timeout ) { clearTimeout(the_timeout); } } function loadCalendar( id, year, month, day ) { _calendar = $('calendar'); if ( _calendar ) { _calendar.innerHTML = _msg_loading ; var req = new Ajax.Request('calendar', { method: 'post', parameters: {id: id, year: year, month: month, day: day}, onComplete: function(req) { _calendar.innerHTML = req.responseText; } } ); } }