var UOLAF = window.UOLAF || {};

UOLAF.init = function () {
	UOLAF.pg = 1;
	UOLAF.ads();
}

UOLAF.ads = function () {
	adBlockCount = (typeof adBlockCount != "undefined")? adBlockCount+1:0;
	UOLAF.pg++;
	UOLAF.pg = (UOLAF.pg>9)?0:UOLAF.pg;
	url  = 'http://adclient-af.uol.com.br/host/';
	try{url += 'format'+formatId+'.html?&amp;';}catch(e){void(null)}
	try{url += 'formatId='+formatId+'&amp;';}catch(e){void(null)}
	try{url += 'adBlockCount='+adBlockCount+'&';}catch(e){void(null)}
	try{url += 'page='+UOLAF.pg+'&amp;';}catch(e){void(null)}
	try{url += 'urlReferer='+encodeURIComponent(document.location.href)+'&amp;';}catch(e){void(null)}
	try{url += 'altColor='+altColor+'&amp;';}catch(e){void(null)}
	try{url += 'numads='+numads+'&amp;';}catch(e){void(null)}
	try{url += 'deslabel='+deslabel+'&amp;';}catch(e){void(null)}
	try{url += 'coddisplaysupplier='+coddisplaysupplier+'&amp;';}catch(e){void(null)}
	try{url += 'idtShape='+idtShape+'&amp;';}catch(E){void(null)}
	try{url += 'category='+category+'&amp;';}catch(e){void(null)}
	try{url += 'type='+type+'&amp;';}catch(e){void(null)}
	document.cookie = 'UOLAFpg='+UOLAF.pg;
	html = '<iframe src="'+url+'" ';
	html += 'marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" scrolling="no"';
	tipos = [];
    tipos[55] = [728,90]; // Cabeçalho (728 x 90)
    tipos[56] = [125,125]; // Botão (125 x 125)
    tipos[57] = [120,600]; // Arranha-céu (120 x 600)
    tipos[58] = [160,600]; // Arranha-céu largo (160 x 600)
    tipos[59] = [180,150]; // Retângulo pequeno (180 x 150)
    tipos[60] = [300,250]; // Retângulo médio (300 x 250)
    tipos[61] = [250,250]; // Quadrado (250 x 250)
    tipos[62] = [336,280]; // Retângulo grande (336 x 280)
    tipos[63] = [120,240]; // Banner vertical (120 x 240)
    tipos[64] = [468,60]; // Banner (468 x 60)
    tipos[65] = [234,60]; // Meio-banner (234 x 60)
	height = tipos[Number(formatId)][1];
	width  = tipos[Number(formatId)][0];
	html += 'height="'+height+'" width="'+width+'"></iframe>';
	document.write(html);

	delete deslabel; //deleta deslabel para nao gerar conflito na prÃ³xima requisiÃ§Ã£o

}

UOLAF.init();