var tdselbotareas = "";
var tdmarcadabotareas = "";

function rolloverbotareas(i){
  if (tdselbotareas != ""){
    if (document.getElementById("td" + tdselbotareas).style.background != "#fffffe"){ // && document.getElementById("td" + tdsel).style.background != "rgb(228, 236, 253) none repeat scroll 0% 0%")
       document.getElementById("td" + tdselbotareas).style.background = "#0066CC";
	   document.getElementById("td" + tdselbotareas).style.color = "#FFFFFF";
    }
  }

  if (document.getElementById("td" + i).style.background != "#fffffe") { // && window.frames.contenido.document.getElementById("filai" + i).style.background != "rgb(228, 236, 253) none repeat scroll 0% 0%")
    document.getElementById("td" + i).style.background="#FFFFFF";
    document.getElementById("td" + i).style.color = "#0066CC";
  }

  tdselbotareas = i;
}

function estadoinicialbotareas(i){
	if (document.getElementById("td" + tdselbotareas).style.background != "#fffffe"){
  	  document.getElementById("td" + i).style.background = "#0066CC";
      document.getElementById("td" + i).style.color = "#ffffff";
	}
}

function marcartdbotareas(i){
  
  //Seleccionamos la fila que ha pinchado
  if (tdmarcadabotareas != ""){
    document.getElementById("td" + tdmarcadabotareas).style.background="#0066CC";
	document.getElementById("td" + tdmarcadabotareas).style.color = "#FFFFFF";
  }
  
  document.getElementById("td" + i).style.background="#FFFFFE";
  document.getElementById("td" + i).style.color = "#0066CC";

  tdmarcadabotareas = i;
}
var tdselsubbot = "";
var tdmarcadasubbot = "";

function rolloversubbot(i){
   if (document.getElementById("td" + i).style.background != "#fffffe") { //color de fondo marcado(minusculas)
    document.getElementById("td" + i).style.background="#ffffff"; //color de fondo rollover
    document.getElementById("td" + i).style.color = "#ffffff"; // color de texto rollover
  }
  if (document.getElementById("td" + i).style.background != "#fffffe") { // && window.frames.contenido.document.getElementById("filai" + i).style.background != "rgb(228, 236, 253) none repeat scroll 0% 0%")
    document.getElementById("td" + i).style.background="#FFFFFF";
    document.getElementById("td" + i).style.color = "#FFFFFF";
  }


  tdselsubbot = i;
}

function estadoinicialsubbot(i){
	if (document.getElementById("td" + tdselsubbot).style.background != "#fffffe"){ //color de fondo marcado (minusculas)
  	  document.getElementById("td" + i).style.background = "#CCE0F5"; // color de fondo normal
      document.getElementById("td" + i).style.color = "#0066CC"; // color de texto normal
	}
}

function marcartdsubbot(i){
  
  //Seleccionamos la fila que ha pinchado
  if (tdmarcadasubbot != ""){
    document.getElementById("td" + tdmarcadasubbot).style.background="#CCE0F5";//color de fondo estado normal
	document.getElementById("td" + tdmarcadasubbot).style.color = "#0066CC"; // color de texto estado normal
  }
  
  document.getElementById("td" + i).style.background="#fffffe"; //color de fondo marcado
  document.getElementById("td" + i).style.color = "#FFFFFF"; //color texto marcado

  tdmarcadasubbot = i;
}