function battle(won) {
  if (navigator.cookieEnabled || typeof(navigator.cookieEnabled) != "undefined") {
    document.cookie = "won=" + won;
  }
  else {
    alert('oops!');
  }
  
  document.location.href = document.location.href;
  
}
