// randomize background color with click
function makeHexa(thiscol) {
  var colhex_left = Math.floor(thiscol/16)
  var colhex_right= thiscol-(colhex_left*16)
  if (colhex_left == 10) {colhex_left="A"}
  else if (colhex_left == 11) {colhex_left="B"}
  else if (colhex_left == 12) {colhex_left="C"}
  else if (colhex_left == 13) {colhex_left="D"}
  else if (colhex_left == 14) {colhex_left="E"}
  else if (colhex_left == 15) {colhex_left="F"}
  if (colhex_right == 10) {colhex_right="A"}
  else if (colhex_right == 11) {colhex_right="B"}
  else if (colhex_right == 12) {colhex_right="C"}
  else if (colhex_right == 13) {colhex_right="D"}
  else if (colhex_right == 14) {colhex_right="E"}
  else if (colhex_right == 15) {colhex_right="F"}
  return ""+colhex_left+colhex_right
}
function click() {
  redcolor=makeHexa(Math.floor(255*Math.random()))
  greencolor=makeHexa(Math.floor(255*Math.random()))
  bluecolor=makeHexa(Math.floor(255*Math.random()))
  if (isIE) {
     document.styleSheets[0].rules[0].style.backgroundColor=""+redcolor+greencolor+bluecolor
  } else if (isNS6) {
     document.styleSheets[0].cssRules[0].style.backgroundColor=""+redcolor+greencolor+bluecolor
  } else if (isNS4) {
     document.bgColor=""+redcolor+greencolor+bluecolor
  }
}
document.onclick=click;
