var winType = ms;
var winArray = new Array;
var prevCell = "";
//showDiv('winMenuMap');
function bgHover(cell){
//document.getElementById(cell).style.backgroundImage = "url(/images/misc/rgr_ms_07520t1.gif)";
document.getElementById(cell).style.background="none";
document.getElementById(cell).style.backgroundColor = "#BDDBBD";
}
function bgOff(cell){
if (cell != prevCell) {
document.getElementById(cell).style.backgroundImage = "url(/images/misc/rgr_ms_07520t1.gif)";
}
}
function changeBg(cell) {
if(prevCell != ""){
document.getElementById(prevCell).style.backgroundImage = "url(/images/misc/rgr_ms_07520t1.gif)";
}
document.getElementById(cell).style.background="none";
document.getElementById(cell).style.backgroundColor = "#BDDBBD";
prevCell = cell;
}
function setWinType(type) {
changeBg(type);
winType = eval(type);
createTable();
}
function createTable() {
var table = "";
switch(winType){
case ms : plus = 37; break;
case ws : plus = 35; break;
case md : plus = 37; break;
case wd : plus = 31; break;
case xd : plus = 33; break;
case bs : plus = 22; break;
case gs : plus = 20; break;
case bd : plus = 10; break;
case gd : plus = 10; break;
}
table += '<table cellpadding="0" cellspacing="1" border="0" class="tblBord">';
table += '<tr>';
table += ' <td width="55" height="17" class="tblTextRedBg" align="center"><b>Year</b></td>';
table += ' <td width="166" height="17" class="tblTextRedBg" align="center"><b>Winner</b></td>';
table += ' <td width="1"><spacer type="block" width="1" height="1"></td>';
table += ' <td width="55" height="17" class="tblTextRedBg" align="center"><b>Year</b></td>';
table += ' <td width="166" height="17" class="tblTextRedBg" align="center"><b>Winner</b></td>';
table += ' <td width="1"><spacer type="block" width="1" height="1"></td>';
table += ' <td width="55" height="17" class="tblTextRedBg" align="center"><b>Year</b></td>';
table += ' <td width="166" height="17" class="tblTextRedBg" align="center"><b>Winner</b></td>';
table += '</tr>';
for (x=0; x<plus; x++){
var dataRow = "";
next = 0;
data = winType[x].split('|');
dataRow += '<tr>';
dataRow += '<td width="35" height="15" class="tblTextGrnBg" align="center"><b>' + data[0] + '</b></td>';
if (data[2]) {
dataRow += '<td width="158" height="15" class="tblBg">&nbsp;' + data[1] + ' (' + data[2] + ')</td>';
} else {
dataRow += '<td width="158" height="15" class="tblBg">&nbsp;' + data[1] + '</td>';
}
dataRow += '<td width="1"><spacer type="block" width="1" height="1"></td>';
next = x+plus;
if (next < winType.length) {
data = winType[next].split('|');
dataRow += '<td width="35" height="15" class="tblTextGrnBg" align="center"><b>' + data[0] + '</b></td>';
if (data[2]) {
dataRow += '<td width="158" height="15" class="tblBg">&nbsp;' + data[1] + ' (' + data[2] + ')</td>';
} else {
dataRow += '<td width="158" height="15" class="tblBg">&nbsp;' + data[1] + '</td>';
}
dataRow += '<td width="1"><spacer type="block" width="1" height="1"></td>';
} else {
dataRow += '<td width="35" height="15" class="tblTextGrnBg" align="center">&nbsp;</td>';
dataRow += '<td width="158" height="15" class="tblBg">&nbsp;</td>';
dataRow += '<td width="1"><spacer type="block" width="1" height="1"></td>';
}
next = next+plus;
if (next < winType.length) {
data = winType[next].split('|');
dataRow += '<td width="35" height="15" class="tblTextGrnBg" align="center"><b>' + data[0] + '</b></td>';
if (data[2]) {
dataRow += '<td width="158" height="15" class="tblBg">&nbsp;' + data[1] + ' (' + data[2] + ')</td>';
} else {
dataRow += '<td width="158" height="15" class="tblBg">&nbsp;' + data[1] + '</td>';
}
dataRow += '</tr>';
} else {
dataRow += '<td width="35" height="15" class="tblTextGrnBg" align="center">&nbsp;</td>';
dataRow += '<td width="158" height="15" class="bg5">&nbsp;</td>';
dataRow += '</tr>';
}
table += dataRow;
}
table += '</table>';
document.getElementById("winnerTable").innerHTML = table;
}
