//implementação das funções
Num=Math.floor (Math.random()*1000000);

function ordem(){
  for(i = 0; i < ordem.arguments.length; i++){
    this.tagsPublicidade += "<scr"+"ipt src=\""+ ordem.arguments[i] + "\"></scr"+"ipt>";
  }
}

function anuncios(){
  this.tagsPublicidade="";
  this.ordem = ordem;
  this.mostra = function (){document.write(this.tagsPublicidade);}
}

anuncioEsquerda = new anuncios();
anuncioDireita = new anuncios();
anuncioCentroDireita = new anuncios();
anuncioMiolo = new anuncios();
anuncioRodape = new anuncios();

//espaçador
espacador = "http://www.terra.com.br/ads/espaco.js";

//Sorteio
var cotaId = new Array();
cotaId = ["cota1","cota3"];
idx = (Math.floor(Math.random() * 10000) % cotaId.length);

//sources dos anuncios
superbanner = "http://ad.doubleclick.net/adj/br.terra.verao/gral;dcopt=ist;sz=728x90;tile=1;ord="+Num+"?";
arroba = "http://ad.doubleclick.net/adj/br.terra.verao/gral;sz=250x250;ord="+Num+"?";


//posição dos anuncios
anuncioDireita.ordem();
anuncioCentroDireita.ordem(arroba);
anuncioMiolo.ordem(superbanner);
anuncioRodape.ordem();
