if (typeof Destaque != "object")
var Destaque = 
{
   time_t: 0,
   idx: 0,
   altern_t: 0,
   list: Array(),
   
   load: function (codigo, desc, det, image)
   {
      var d = new Object();
      d.codigo = codigo;
      d.desc = desc;
      d.det = det;
      d.image = image;
      this.list.push(d); 
   },
   
   init: function ()
   {
     if (this.list.length > 0)
         setInterval("Destaque.wait()", 1000);
   },
   
   wait: function ()
   {
      if (this.time_t == 0)
      {
         this.show(this.idx);
         this.time_t++;
      } else if (this.time_t < 10)
         this.time_t++;
      else
      {
         this.time_t = 0;
         
         if (this.idx == (this.list.length-1))
            this.idx = 0;
         else
            this.idx++;
      }
   },

   show: function (idx)
   {
      this.time_t = 1;
      this.idx = idx;
            
      idx = idx == undefined ? 0 : idx;
 	
 	  var link = 'index.php?call=conteudo&id='+this.list[idx].codigo;
 	  
 	  $("#littleFeact .feacture").removeClass('hover');
 	  $("#littleFeact .feacture:eq("+idx+")").addClass('hover');
      
	  $("#bigFeact .text h2").html(this.list[idx].desc);
      $("#bigFeact .text p").html(this.list[idx].det);
      $("#bigFeact .text a").attr('href', link);
      
      $("#bigFeact .img").css('background-image', 'url("'+this.list[idx].image+'")');
      
      var btnOpac = jQuery("#nav a img").get(idx);
      jQuery("#nav a img").css("opacity", 1);
      jQuery(btnOpac).css("opacity", .7);
      
      return this.list[idx];		   
   }
}
