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;
	urlAdvertiseUol = 'http://adclient-af.uol.com.br/assinaturas/';
	try{urlAdvertiseUol += 'format'+formatId+'.html?&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'formatId='+formatId+'&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'adBlockCount='+adBlockCount+'&';}catch(e){void(null)}
	try{urlAdvertiseUol += 'page='+UOLAF.pg+'&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'urlReferer='+encodeURIComponent(document.location.href)+'&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'altColor='+altColor+'&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'numads='+numads+'&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'deslabel='+deslabel+'&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'coddisplaysupplier='+coddisplaysupplier+'&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'idtShape='+idtShape+'&amp;';}catch(E){void(null)}
    try{urlAdvertiseUol += 'category=21&amp;';}catch(e){void(null)}
	try{urlAdvertiseUol += 'type='+type+'&amp;';}catch(e){void(null)}
	document.cookie = 'UOLAFpg='+UOLAF.pg;
	html = '<iframe src="'+urlAdvertiseUol+'" ';
	html += 'marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" scrolling="no"';
	tipos = [ null, null, null, null, null, null, null, null, null, null, null,null, null, null, null, null, null, null, null, null, null, null, null, [728,90], [125,125], [120,600], [160,600], [180,150], [300,250], [250,250], [336,280], [120,240], [468,60], [234,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();

