// JavaScript Document
function styleCalque(idCalque)
{
  if (document.all) calqueStyle = document.all[idCalque].style;
  if (document.layers) calqueStyle = document.layers[idCalque];
  if (document.getElementById) 
  calqueStyle = document.getElementById(idCalque).style;
  return calqueStyle;
}

function cache()
{
  montre("default");
}

function montre(c)
{
  base = "<img src=\"images/imgdefault.gif\" border=\"0\">";
  if (c=="attente") base = "<img src=\"images/attente.gif\" border=\"0\">";
  if (c=="eco") base = "<img src=\"images/imgeco.gif\" border=\"0\">";
  if (c=="cultura") base = "<img src=\"images/imgcultura.gif\" border=\"0\">";
  if (c=="info") base = "<img src=\"images/imginfo.gif\" border=\"0\">";
  if (c=="sol") base = "<img src=\"images/imgsol.gif\" border=\"0\">";
  if (document.all) rubrique.innerHTML = base;
  if (document.layers) 
  {
    document.layers["rubrique"].document.open();
    document.layers["rubrique"].document.write(base);
    document.layers["rubrique"].document.close();
  }
  if (document.getElementById) 
  document.getElementById("rubrique").innerHTML = base;
  styleCalque("rubrique").visibility = "visible";
}

function montreattente(lg, nbimg, taille)
{
  var tps_36K = Math.floor( taille/4.5 )+1;
  var tps_56K = Math.floor( taille/7 )+1;
  var tps_1M = Math.floor( taille/147 )+1;

  base_fr = "<div id='attente2'><p>Bienvenue sur le site de la Direction du Tourisme de São Tomé e Príncipe</p><p>La page contient "+nbimg+" médias pour une taille totale de "+taille+" Ko.</p><p>"+tps_1M+" seconde(s) d'attente avec un modem ADSL 1 Mbits/s<br>"+tps_56K+" seconde(s) d'attente avec un modem 56 Kbits/s<br>"+tps_36K+" seconde(s) d'attente avec un modem 36 Kbits/s</p><p>Merci de votre patience, nous vous souhaitons une agréable visite</p></div>";
  base_pt = "<div id='attente2'><p>Bem-vindo ao sitio da Direcção do Turismo de São Tomé e Príncipe</p><p>A pagina contem "+nbimg+" medias para um tamanho total de "+taille+" Ko.</p><p>"+tps_1M+" segundo(s) de espera com um modem ADSL 1 Mbits/s<br>"+tps_56K+" segundo(s) de espera com um modem 56 Kbits/s<br>"+tps_36K+" segundo(s) de espera com um modem 36 Kbits/s</p><p>Obrigado pela sua paciência, desejamos-lhe uma visita agradavel</p></div>";
  base_en = "<div id='attente2'><p>Welcome to the website of the Tourism Board of São Tomé and Príncipe</p><p>This page contains "+nbimg+" media totaling "+taille+" Kb.</p><p>"+tps_1M+" second(s) downloading with DSL modem at 1Mbit/s<br>"+tps_56K+" second(s) downloading with modem running at 56 Kbits/s<br>"+tps_36K+" second(s) downloading with modem running at 36 Kbits/s</p><p>Thank you for your patience, we hope you will enjoy the site</p></div>";

  if (lg=='pt') base = base_pt;
  if (lg=='fr') base = base_fr;
  if (lg=='en') base = base_en;
  if (document.all) attente.innerHTML = base;
  if (document.layers) 
  {
    document.layers["attente"].document.open();
    document.layers["attente"].document.write(base);
    document.layers["attente"].document.close();
  }
  if (document.getElementById) 
  document.getElementById("attente").innerHTML = base;
  
  styleCalque("attente").width='800px';
  styleCalque("attente").height='600px';
  styleCalque("attente").visibility = "visible";
}

function cacheattente()
{
  base = "";
  if (document.all) attente.innerHTML = base;
  if (document.layers) 
  {
    document.layers["attente"].document.open();
    document.layers["attente"].document.write(base);
    document.layers["attente"].document.close();
  }
  if (document.getElementById) 
  document.getElementById("attente").innerHTML = base;
  styleCalque("attente").visibility = "hidden";
  //montre("default");
}
