function byId(id) {
  return document.getElementById(id);
}

function badCSS() {
  return navigator.userAgent.indexOf("Safari") != -1;
}

function selectBtn(num) {
  
  // hide/reset all the others
  defaultPos = badCSS() ? "0px" : "";
  for(i=1; i<1000; i++) {
    if (byId("btn"+i)) {
      byId("btn"+i).style.backgroundPosition = defaultPos;
    }
    else break;
  }
  
  // show/select the one we want
  if (byId("btn"+num)) {
    byId("btn"+num).style.backgroundPosition = "top center";
  }
  
}