//FT_331_renderEngine.js_v3.3

function Container(param){this.member=param;}
function renderPage(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){var allRecords=xmlhttp.responseText.split('\x0A');var output;var record;var recPointer;var doubleSpace='';Container("")
updateMenuBar()
document.getElementById("results").className="current"
for(var idx=0;idx<allRecords.length;idx++){record=allRecords[idx].split('\t');if(idx==0){output=drawInfoTable(record)+'<p>Posted Results are '+record[12]+'official. Click on your name for more details about your runs.</p>\x0A';recPointer=record[10];var timeFormat=record[15];}else if(idx==1){output+='<div style="text-align:left;">\x0A'+'<table class="resultsTable" border="0" cellspacing="1" cellpadding="2">\x0A'+'<td class="listHeader" align=center width="50">'+record[0]+'</td>\x0A'+'<td class="listHeader" align=center width="30">'+record[1]+'</td>\x0A'+'<td class="listHeader" align=center width="250">'+record[2]+'</td>\x0A'+'<td class="listHeader" align=center width="250">'+record[3]+'</td>\x0A'
var xx=recPointer-1;for(itr=0;itr<=xx;itr++){output+='<td class="listHeader" align=center width="65">'+record[4+itr]+'</td>\x0A';output+='<td class="listHeader" align=center width="50">'+record[16+itr]+'</td>\x0A';}
output+='<td class="listHeader" align=center width="50">'+record[28]+'</td>\x0A'+'<td class="listHeader" align=center width="50">'+record[29]+'</td>\x0A'+'<td class="listHeader" align=center width="50">'+record[30]+'</td>\x0A'+'<td class="listHeader" align=center width="50">'+record[31]+'</td>\x0A'+'</tr>';}else if(idx<(allRecords.length-1)){output+='<tr>\x0A';if(doubleSpace.length>0){if(doubleSpace!=record[0]){output+='<td width="50" bgcolor="#FFFFFF">&#160;</td>\x0A</tr>\x0A'}}
doubleSpace=record[0]
output+='<td align=left width="50">'+record[0]+'</td>\x0A'+'<td align=left width="30">'+record[1]+'</td>\x0A'+'<td style="text-decoration:underline" onmouseover="(makeCursor(this))"; onMouseDown="ShowPersonal(&#39;'+record[1]+'&#39;)" align="left" width="250">'+
record[2]+'</td>\x0A'+'<td align=left width="250">'+record[3]+'</td>\x0A'
for(iter=0;iter<=xx;iter++){output+='<td align=right width="65">'+rectime(record[4+iter],timeFormat)+'</td>\x0A';output+='<td align=center width="50">'+record[16+iter]+'</td>\x0A';}
output+='<td align=right width="50">'+rectime(record[28],timeFormat)+'</td>\x0A'+'<td align=right width="50">'+roundStringResult(record[29])+'</td>\x0A'+'<td align=right width="50">'+rectime(record[30],timeFormat)+'</td>\x0A'+'<td align=right width="50">'+record[31]+'</td>\x0A'+'</tr>\x0A';}}
document.getElementById('resultsPage').innerHTML=output;}else
output=drawErrorBox("LIVE Results data unavailable");document.getElementById('resultsPage').innerHTML=output;}}
function renderTopDrivers(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){var allRecords=xmlhttp.responseText.split('\x0A');var output;var record;var rCarID;Container("")
updateMenuBar()
document.getElementById("topdrivers").className="current"
for(var idx=0;idx<allRecords.length;idx++){record=allRecords[idx].split('\t');if(idx==0){output=drawInfoTable(record)+'<p>Posted Top Drivers Results are '+record[12]+'official. Click on your name for more details about your runs.</p>\x0A';var timeFormat=record[15];Container("");}else if(idx==1){output+='<div style="text-align:left;">\x0A'+'<table class="listTable" border="0" cellspacing="1" cellpadding="2">\x0A'+'<td class="listHeader" align=center width="140">'+record[0]+'</td>\x0A'+'<td class="listHeader" align=center width="65">'+record[1]+'</td>\x0A'+'<td class="listHeader" align=center width="50">'+record[2]+'</td>\x0A'+'<td class="listHeader" align=center width="165">'+record[3]+'</td>\x0A'+'<td class="listHeader" align=center width="30">'+record[4]+'</td>\x0A'+'</tr>';}else if(idx<(allRecords.length-1)){rCarID=trim(record[4]);output+='<tr>\x0A'+'<td align=left width="140">'+record[0]+'</td>\x0A'+'<td align=left width="65">'+rectime(record[1],timeFormat)+'</td>\x0A'+'<td align=left width="50">'+record[2]+'</td>\x0A'+'<td style="text-decoration:underline" onmouseover="(makeCursor(this))"; onMouseDown="ShowPersonal(&#39;'+rCarID+'&#39;)" align="left" width="165">'+
record[3]+'</td>\x0A'+'<td align=left width="30">'+record[4]+'</td>\x0A'+'</tr>\x0A';}}
document.getElementById('resultsPage').innerHTML=output;}else
output=drawErrorBox("Top Drivers data not available.");document.getElementById('resultsPage').innerHTML=output;}}
function renderPaxResults(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){var allRecords=xmlhttp.responseText.split('\x0A');var output;var record;Container("")
updateMenuBar()
document.getElementById("pax").className="current"
for(var idx=0;idx<allRecords.length;idx++){record=allRecords[idx].split('\t');if(idx==0){output=drawInfoTable(record)+'<p>Posted PAX Results are '+record[12]+'official. Click on your name for more details about your runs.</p>\x0A';var timeFormat=record[15];Container("");}else if(idx==1){output+='<div style="text-align:left;">\x0A'+'<table class="listTable" border="0" cellspacing="1" cellpadding="2">\x0A'+'<td class="listHeader" align=center width="30">Position</td>\x0A'+'<td class="listHeader" align=center width="30">'+record[0]+'</td>\x0A'+'<td class="listHeader" align=center width="55">'+record[1]+'</td>\x0A'+'<td class="listHeader" align=center width="155">'+record[2]+'</td>\x0A'+'<td class="listHeader" align=center width="155">'+record[3]+'</td>\x0A'+'<td class="listHeader" align=center width="50">'+record[4]+'</td>\x0A'+'<td class="listHeader" align=center width="80">'+record[5]+'</td>\x0A'+'</tr>';}else if(idx<(allRecords.length-1)){output+='<tr>\x0A'+'<td align=left width="30">'+String(idx-1)+'</td>\x0A'+'<td align=left width="30">'+record[0]+'</td>\x0A'+'<td align=left width="55">'+record[1]+'</td>\x0A'+'<td style="text-decoration:underline" onmouseover="(makeCursor(this))"; onMouseDown="ShowPersonal(&#39;'+record[1]+'&#39;)" align="left" width="155">'+
record[2]+'</td>\x0A'+'<td align=left width="155">'+record[3]+'</td>\x0A'+'<td align=right width="50">'+roundStringResult(record[4])+'</td>\x0A'+'<td align=right width="80">'+rectime(record[5],timeFormat)+'</td>\x0A'+'</tr>\x0A';}}
document.getElementById('resultsPage').innerHTML=output;}else
output=drawErrorBox("Best PAX Results data unavailable.");document.getElementById('resultsPage').innerHTML=output;}}
function renderBestRuns(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){var allRecords=xmlhttp.responseText.split('\x0A');var output;var record;Container("")
updateMenuBar()
document.getElementById("bestruns").className="current"
for(var idx=0;idx<allRecords.length;idx++){record=allRecords[idx].split('\t');if(idx==0){output=drawInfoTable(record)+'<p>Posted Best Runs are '+record[12]+'official. Click on your name for more details about your runs.</p>\x0A';var timeFormat=record[15];Container("");}else if(idx==1){output+='<div style="text-align:left;">\x0A'+'<table class="listTable" border="0" cellspacing="1" cellpadding="2">\x0A'+'<td class="listHeader" align=center width="30">Position</td>\x0A'+'<td class="listHeader" align=center width="30">'+record[0]+'</td>\x0A'+'<td class="listHeader" align=center width="55">'+record[1]+'</td>\x0A'+'<td class="listHeader" align=center width="155">'+record[2]+'</td>\x0A'+'<td class="listHeader" align=center width="155">'+record[3]+'</td>\x0A'+'<td class="listHeader" align=center width="50">'+record[4]+'</td>\x0A'+'</tr>';}else if(idx<(allRecords.length-1)){output+='<tr>\x0A'+'<td align=left width="30">'+String(idx-1)+'</td>\x0A'+'<td align=left width="30">'+record[0]+'</td>\x0A'+'<td align=left width="55">'+record[1]+'</td>\x0A'+'<td style="text-decoration:underline" onmouseover="(makeCursor(this))"; onMouseDown="ShowPersonal(&#39;'+record[1]+'&#39;)" align="left" width="155">'+
record[2]+'</td>\x0A'+'<td align=left width="155">'+record[3]+'</td>\x0A'+'<td align=right width="50">'+rectime(record[4],timeFormat)+'</td>\x0A'+'</tr>\x0A';}}
document.getElementById('resultsPage').innerHTML=output;}else
output=drawErrorBox("Best PAX Results data unavailable.");document.getElementById('resultsPage').innerHTML=output;}}
function renderAboutText(){self.clearInterval(globalTimerRef)
if(xmlhttp.readyState==4){if(xmlhttp.status==200){Container("")
updateMenuBar()
document.getElementById("about").className="current"
var allRecords=xmlhttp.responseText;document.getElementById('resultsPage').innerHTML=allRecords;}}}
