var l3,aY=[[2009],[2008],[2007],[2006],[2005]],nY=-1;
document.all.tags("html")(0).onkeypress=checkKey;
window.onbeforeprint=window.onafterprint=checkPrint;

function checkKey(){
  var k,o,i,a=[0,0,0,0];
  k=event.keyCode;
  if (k==115){
    o=document.styleSheets(0).rules;
    for (i=0; i<o.length; i++) if (/^\.r3$/i.test(o(i).selectorText)) break;
    if (i<o.length) o(i).style.backgroundImage=(l3=!l3) ? "" : "url(bulb.gif)";
  }
  else if (k==105){
    o=document.all.tags("table")(0).rows;
    i=-1;
    nY=++nY%aY.length;
    while (++i<o.length && o(i).cells(1).innerText!=aY[nY]);
    while (++i<o.length && o(i).cells(1).innerText!=Number(aY[nY])-1){
      a[0]++;
      if (o(i).cells(0).className.search(/^(r|o)(\d+)$/i)!=-1){
        if (RegExp.$1.toLowerCase()=="o") o(i).cells(0).className="r"+RegExp.$2;
        a[RegExp.$2]++;
      }
    }
    status=aY[nY]+" - "+a[0]+" / "+a[1]+" / "+(a[2]+a[3])+" / "+a[3];
  }
}
function checkPrint(){
  var o,o1,i,s;
  if (event.type=="afterprint"){
    document.body.children(1).style.display="none";
    document.body.children(0).style.display="block";
    return;
  }
  if (document.body.children.length<2){
    o=document.body.insertBefore(document.createElement("div"));
    o=o.insertBefore(document.createElement("ol"));
    i=-1;
    o1=document.all.tags("table")(0).rows;
    while (++i<o1.length && o1(i).cells(1).innerText!=aY[0]);
    while (++i<o1.length){
      if ((s=o1(i).cells(1).innerText)==Number(aY[nY])-1) break;
      if (o1(i).cells(0).className.toLowerCase()=="r2") o.insertBefore(document.createElement("li")).innerText=s;
    }
  }
  document.body.children(0).style.display="none";
  document.body.children(1).style.display="block";
}

