var afiseaza_continut_din_start = false;
var afiseaza = true;
function afiseaza_cod(delay)
{
     var ramasa = 0;

     if (afiseaza)
     {

          afiseaza = false;
     }

     if (delay>0)
     {
          var d = new Date();
          if (!afiseaza_continut_din_start)
          {
               document.getElementById('asteptare').style.display = '';
               afiseaza_continut_din_start = d.getTime();
          }
          ramasa =  afiseaza_continut_din_start + delay*1000 - d.getTime();
     }
     if (ramasa<=100)
     {
          document.getElementById('incarca_continut').style.display = '';

          if(document.getElementById('asteptare'))
               document.getElementById('asteptare').style.display = 'none';

          if(document.getElementById('blocheaza_cod'))
          {
    
               document.getElementById('blocheaza_cod').style.display="";
          }
     }
     else
     {
          ramasa = ramasa/1000;
          if(document.getElementById('asteptare_ramasa'))
          {
               document.getElementById('asteptare_ramasa').innerHTML = Math.round(ramasa);
          }
          setTimeout('afiseaza_cod('+(delay)+')', 1000);
     }
}

