function show(e) {
  var element = (e.target||ev.srcElement);
  element.style.backgroundColor = "white";
}

function hide(e){
  var element = (e.target||ev.srcElement);
  element.style.backgroundColor = "red";
}
function addAll() {
  var i, item;
  var checks = document.getElementsByTagName("span"); 
  for (i=0; i<checks.length; i++) {
    item = checks[i];			
    if (item.getAttribute("class") == "check") {
      item.addEventListener("click", show, false);
    }
  }
}
window.onload = addAll;
