var activebutton = 0;

function changeMouseToHand(){
 if(navigator.appName == "Microsoft Internet Explorer"){
  document.body.style.cursor = "hand";
 }
}

function changeMouseBack(){
 if(navigator.appName == "Microsoft Internet Explorer"){
  document.body.style.cursor = "default";
 }
}

function restoreRed(num){
 changeMouseToHand();
 document.getElementById("btn-" + num).style.backgroundColor = "rgb(64,0,32)";
}

function restoreBlue(num){
 changeMouseToHand();
 document.getElementById("btn-" + num).style.backgroundColor = "rgb(0,0,96)";
}

function fadeRed(num){
 changeMouseBack();
 if(activebutton != num){
  document.getElementById("btn-" + num).style.backgroundColor = "rgb(63,0,32)";
  repeatRed(num);
 }
}

function repeatRed(num){
 var red = document.getElementById("btn-" + num).style.backgroundColor.substring(4,6);
 if(("" + red).substring(1,2)==","){
  red = ("" + red).substring(0,1);
 }
 if(red < 64){
  red--;
  var newcolor = "rgb(" + red + ", 0, 32)";
  document.getElementById("btn-" + num).style.backgroundColor = newcolor;
  if(red > 0){
   setTimeout("repeatRed(" + num + ")", 1);
  }else{
   document.getElementById("btn-" + num).style.backgroundColor = "transparent";
  }
 }
}

function fadeBlue(num){
 changeMouseBack();
 if(activebutton != num){
  document.getElementById("btn-" + num).style.backgroundColor = "rgb(0,0,95)";
  repeatBlue(num);
 }
}

function repeatBlue(num){
 var color;
 if(document.getElementById("btn-" + num).style.backgroundColor.substring(6,7)==" "){
  color = document.getElementById("btn-" + num).style.backgroundColor.substring(10,12);
 }else{
  color = document.getElementById("btn-" + num).style.backgroundColor.substring(8,10);
 }
 if(color < 96){
  color--;
  var newcolor = "rgb(0, 0, " + color + ")";
  document.getElementById("btn-" + num).style.backgroundColor = newcolor;
  if(color > 32){
   setTimeout("repeatBlue(" + num + ")", 1);
  }else{
   document.getElementById("btn-" + num).style.backgroundColor = "transparent";
  }
 }
}

