function mostrar_tooltip(id){
  if(document.getElementById(id))
    document.getElementById(id).style.display="";
}
function ocultar_tooltip(id){
  if(document.getElementById(id))
    document.getElementById(id).style.display="none";
}
function index_previsualizar_caso(ID){
  for(i=1;document.getElementById("previsualizar_caso_"+i);i++){
    document.getElementById("previsualizar_caso_"+i).style.display="none";
  }
  if(document.getElementById("previsualizar_caso_"+ID)){
    if(/nofoto\.jpg$/.test(document.getElementById("previsualizar_caso_logo_"+ID).src)){
      document.getElementById("previsualizar_caso_logo_"+ID).src=CARPETA_FICHEROS+CasosExito[eval("ID-1")][0]+"/"+CasosExito[eval("ID-1")][1]+"/logoindexgrande.jpg";
    }
    document.getElementById("previsualizar_caso_"+ID).style.display="";
  }
}
function mostrar_caso_siguiente(){
  cargar_imagenes_no_cargadas();
  var aux_src=document.getElementById("caso-exito1").src;
  var aux_onclick=document.getElementById("caso-exito1").onclick;
  for(i=1;document.getElementById("caso-exito"+i);i++){
    if(document.getElementById("caso-exito"+eval("i+1"))){
      document.getElementById("caso-exito"+i).src=document.getElementById("caso-exito"+eval("i+1")).src;
      document.getElementById("caso-exito"+i).onclick=document.getElementById("caso-exito"+eval("i+1")).onclick;
    }
    else{
      document.getElementById("caso-exito"+i).src=aux_src;
      document.getElementById("caso-exito"+i).onclick=aux_onclick;
    }
  }
}
function mostrar_caso_anterior(){
  cargar_imagenes_no_cargadas();
  for(i=1;document.getElementById("caso-exito"+i);i++);
  i--;
  var aux_src=document.getElementById("caso-exito"+i).src;
  var aux_onclick=document.getElementById("caso-exito"+i).onclick;
  for(;document.getElementById("caso-exito"+i);i--){
    if(document.getElementById("caso-exito"+eval("i-1"))){
      document.getElementById("caso-exito"+i).src=document.getElementById("caso-exito"+eval("i-1")).src;
      document.getElementById("caso-exito"+i).onclick=document.getElementById("caso-exito"+eval("i-1")).onclick;
    }
    else{
      document.getElementById("caso-exito"+i).src=aux_src;
      document.getElementById("caso-exito"+i).onclick=aux_onclick;
    }
  }
}
TODAS_LAS_IMAGENES_CARGADAS=0;
function cargar_imagenes_no_cargadas(){
  if(TODAS_LAS_IMAGENES_CARGADAS==1)
    return false;
  TODAS_LAS_IMAGENES_CARGADAS=1;
  for(i=1;document.getElementById("caso-exito"+i);i++){
    if(document.getElementById("caso-exito"+i)){
      if(/nofoto\.jpg$/.test(document.getElementById("caso-exito"+i).src)){
        document.getElementById("caso-exito"+i).src=CARPETA_FICHEROS+CasosExito[eval("i-1")][0]+"/"+CasosExito[eval("i-1")][1]+"/logo.jpg";
      }
    }
  }
}
function cargar_cuadricula(pag){
  $.post('casos-de-exito-cuadricula.php', "pagina="+pag, function(txt) {
    document.getElementById("cuadricula_casos_de_exito").innerHTML=txt;
	});
}
SLIDER_EJECUTADO=1;
function caso_abajo(columna){
    var FECHA = new Date();
    if(eval(SLIDER_EJECUTADO+"+"+310)>FECHA.getTime()){
      return false;
    }
    for(i=1;document.getElementById("divtt"+i+columna);i++);
    i--;
    var aux='';
    aux=document.getElementById("tt"+i+columna).className;
    for(i--;document.getElementById("divtt"+i+columna);i--){
      document.getElementById("tt"+eval(i+"+1")+columna).className=document.getElementById("tt"+i+columna).className;
    }
    i++;
    document.getElementById("tt"+i+columna).className=aux;
    SLIDER_EJECUTADO=FECHA.getTime();
}
function caso_arriba(columna){
    var FECHA = new Date();
    if(eval(SLIDER_EJECUTADO+"+"+310)>FECHA.getTime()){
      return false;
    }
    var aux='';
    aux=document.getElementById("tt0"+columna).className;
    for(i=1;document.getElementById("divtt"+i+columna);i++){
      document.getElementById("tt"+eval(i+"-1")+columna).className=document.getElementById("tt"+i+columna).className;
    }
    i--
    document.getElementById("tt"+i+columna).className=aux;
    SLIDER_EJECUTADO=FECHA.getTime();
}

