/*
 * @file
 * @author  Original:      German Escallon
 * @author  Contributors:  N/A
 * @date    Created:       2008/08/19
 * @date    Last Edit:     $Date$ by $Author$
 * Description: This file handles the events tab
 *****************************************************************************/
function DisplayEvents(){setting.log_err="";UpdateCurrentTab("events");$("main_div").innerHTML='<br /><br /><img src="/images/refresh.gif" onclick="return RefreshEvents(); "/><br /><br /><br /><b>Events:</b> <img id="eveHint" onclick="ShowHelp(&quot;hlp_eve&quot;, this);" src="/images/hints.gif"/><br /><br /><div id="events_main" style="white-space: pre" />';RefreshEvents()}function RefreshEvents(){var b="/myles?LOG=ERR";var a=function(i){if(ParseResponse(i)){var g=GetErrorArray();var e=new YAHOO.util.DataSource(g);e.responseType=YAHOO.util.DataSource.TYPE_JSARRAY;e.responseSchema={fields:["date","time","device","error"]};var f=[{key:"date",label:"<b>Date</b>",resizeable:true,sortable:true,formatter:function(k,j,l,m){k.innerHTML=m}},{key:"time",label:"<b>Time</b>",resizeable:true,sortable:true,formatter:function(k,j,l,m){k.innerHTML=m}},{key:"device",label:"<b>Device Name</b>",resizeable:true,sortable:true,formatter:function(k,j,l,m){k.innerHTML=m}},{key:"error",label:"<b>Error</b>",resizeable:true,sortable:true,formatter:function(k,j,l,m){k.innerHTML=m}}];var d={sortedBy:{key:"slot",dir:"desc"}};var h=new YAHOO.widget.DataTable("events_main",f,e,d)}else{if(_debug){console.log("Events parse error")}}};var c={success:a,failure:function(d){if(_debug){console.log("ERROR: Events could not be logged")}}};ResetLog();_yuiConnect.asyncRequest("GET",b,c,null)}function GetErrorArray(){var a=[];for(var b=0;b<_logIndex;b++){var c={date:setting.log_err_date[b],time:setting.log_err_time[b],device:setting.log_err_device[b],error:setting.log_err_msg[b]};a.push(c)}return a};