/** * Holds references to the events and incidents. */ function Script() { Script.events = null; Script.incidents = null; } /** * Scrolls to the last event executed based on time. */ function jumpToLastExecutedEvent() { var lastEventArray = Script.events.getLastExecutedEvent(readCookie("time")); // IF a current event exists THEN if (lastEventArray != null) { // Move window focus to first event of the current ones var last = lastEventArray.length - 1; lastEventArray[last].focus(); } else { alert("No events have been executed yet."); } } /** * Finds the Event that was last executed by based on time and highlights it. * Removes highlighting from old events. * @return */ function highlightLatestEvent() { var currentEventArray = Script.events.getLastExecutedEvent(readCookie("time")); // IF the old event is has not been set THEN if (typeof highlightLatestEvent.oldEventArray == 'undefined') { highlightLatestEvent.oldEventArray = []; /* set up array of old events */ var currentEvent = new Object(); highlightLatestEvent.oldEventArray.push(currentEvent); highlightLatestEvent.oldEventArray[0].id = Event.invalidID; } // IF a current event exists THEN if (currentEventArray !== null) { var found = false; /* check if a current event is found in the old event array */ /* traverse the array of current event to check if there is event already in the old event array */ // IF there is a new current event THEN for (j=0; j