<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN">
<html>
<head>
<link rel="stylesheet" type="text/css" href="main.css" />
<script>
var weeknumber = 24;
// load the specified url -synchronously- and return the response
function ajax(url) {
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera,
// Safari
req = new XMLHttpRequest();
} else { // code for IE6, IE5
req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.open("GET", url, false);
req.send(null);
return req.responseText;
}
var myarray =[];
function parse() {
raw = ajax('../csvdata/'+ 'week' + weeknumber +'/freq_events.csv?' + new Date().getTime())
var raw = raw.split ('\r');
var j,l = raw.length -1;
for (j=0; j <l; j++) {
var data = raw[j];
var nummer = data.split(',');
myarray[j]= nummer;
// creates a table row
var row = document.createElement("tr");
// colums
for (var i = 0; i < 7; i++) {
// Create a <td> element and a text node, make the text
// node the contents of the <td>, and put the <td> at
// the end of the table row
var cell = document.createElement("td");
var time = parseFloat (nummer[3]) * 1000;
var myDate = new Date(time);//1276590251000
nummer[3] = (myDate.toUTCString());
var cellText = document.createTextNode(nummer[i]);
cell.appendChild(cellText);
row.appendChild(cell);
}
// add the row to the end of the table body
document.getElementById('eventtable').appendChild(row);
var rows = document.getElementById('eventtable').getElementsByTagName ("tr");
if (j % 2 == 0){
rows[j].className = "even";
}else{
rows[j].className = "odd";
}
}
// sets the border attribute of tbl to 2;
document.getElementById('eventtable').setAttribute("border", "1");
}
</script>
</head>
<body onload= "parse()" >
<div class="alarmlist">
<div class="eventheader2">
<table>
<tr>
<th style= "width: 60px">Event nr</th>
<th style= "width: 10px">Phase</th>
<th style= "width: 130px">Description</th>
<th style= "width: 130px">Starttime</th>
<th style= "width: 60px">Value</th>
<th style= "width: 130px">Stoptime</th>
<th style= "width: 60px">Value</th>
</tr>
</table>
</div>
<div class="eventtable2">
<table id="eventtable">
<tr>
<th style= "width: 60px"></th>
<th style= "width: 10px"></th>
<th style= "width: 130px"></th>
<th style= "width: 130px"></th>
<th style= "width: 60px"></th>
<th style= "width: 130px"></th>
<th style= "width: 60px"></th>
</tr>
</table>
</div>
</div>
</body>
</html>