// JavaScript Document
function f_get_publicidade(v_publicidade_id, v_tipo, v_script, v_formato, v_largura, v_altura, v_background, v_url, v_url_acesso, v_reduzido, v_obj) {


	
	v_result = '';

	if(v_tipo == 1){
		switch (String(v_formato).toUpperCase()) {
			case "SWF":
				v_pub_id = Number(v_obj.id.replace('td_posicao_pub_',''));
				
				if(v_pub_id == 20){
					v_result += ' <div style="position:absolute; width:1000px; height:123px; text-align:left; vertical-align:top; z-index:1000; margin-left:-2px; cursor:pointer;">';
					
						v_result += ' <div style="position:absolute; display:none; width:1000px; height:123px; text-align:left; vertical-align:top; z-index:9999998; margin-left:-2px; cursor:pointer;">';
						
							v_result += ' <table width="100%" cellpadding="0" cellspacing="0" border="0">';
							v_result += '   <tr>';
							v_result += '       <td width="99%">&nbsp;</td>';
							v_result += '   	<td width="1%" align="rigth">';
							v_result += '			<iframe frameborder="0" style="width:70; height:17px;  background-color:#fff; color:#FFF; vertical-align:top" >';
							v_result += ' 	        </iframe>';
							v_result += '       </td>';
							v_result += '   </tr>';
							v_result += '</table>';
						
						v_result += ' </div>';
						
						v_result += ' <div style="position:absolute;  display:none; width:1000px; height:123px; text-align:left; vertical-align:top; z-index:9999999; margin-left:-2px; cursor:pointer;">';
						
							v_result += ' <table width="100%" cellpadding="0" cellspacing="0" border="0">';
							v_result += '   <tr>';
							v_result += '       <td width="99%">&nbsp;</td>';
							v_result += '   	<td width="1%" align="rigth">';
							v_result += '             <button class="home_btn_1" style="background-color:#FFF; color:#006"  onClick="document.getElementById(\'tbl_footer\').style.display =\'none\';"><nobr>[x] Fechar</nobr></button></td>';
							v_result += '   </tr>';
							v_result += '</table>';
						
						v_result += ' </div>';
				}

				v_result += '<div ';
				v_result += '	id="dv_pub_'+v_pub_id+'" ';
				v_result += '	style=" width:'+v_largura+'px; ';
				v_result += '		z-index:'+(500000-(v_pub_id*20))+'; ';
				v_result += '		overflow: hidden; ';
				v_result += '		position:absolute;  ';
				v_result += '		height: '+v_reduzido+'px; "';
				v_result += ' onload="document.getElementById(\'tbl_footer\').style.display = \'\'" ';
				v_result += 'onmouseover=" ';
				v_result += '   this.style.height = \''+v_altura+'px\'; ';
				v_result += '	document.getElementById(\'dv_pub_shield_'+v_pub_id+'\').style.height = \''+v_altura+'px\';';
				v_result += '" ';
				v_result += 'onmouseout=" ';
				v_result += '	this.style.height = '+v_reduzido+'; ';
				v_result += '	document.getElementById(\'dv_pub_shield_'+v_pub_id+'\').style.height = \''+v_reduzido+'px\';';
				v_result += '">';
				v_result += '<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+v_largura+'" height="'+v_altura+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">';
				v_result += '<param name="allowScriptAccess" value="sameDomain" />';
				v_result += '<param name="movie" value="'+v_url+'?clickTAG='+v_url_acesso+'" />';
				v_result += '<param name="quality" value="high" />';
				v_result += '<param name="bgcolor" value="'+v_background+'" />';
				v_result += '<param name="SCALE" value="exactfit" />';
				if(String(v_background).replace(/ /g,'') == '' || v_altura != v_reduzido) {
					v_result += '<param name="wmode" value="transparent" />';
				}
				v_result += '<embed src="'+v_url+'?clickTAG='+v_url_acesso+'" width="'+v_largura+'" scale="exactfit" height="'+v_altura+'" ';
				if(String(v_background).replace(/ /g,'') == '' || v_altura != v_reduzido) {
					v_result += 'wmode="transparent" ';
				}
				v_result += 'quality="high" bgcolor="'+v_background+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed>';
				v_result += '</object>';
				v_result += '</div>';
				v_result += '<div id="dv_pub_shield_'+v_pub_id+'"  style="alpha(opacity=0); opacity:0; ';
				if(!window.event)
					v_result += 'display:none; ';
				v_result += 'width:'+v_largura+'px; z-index:'+(500000-(v_pub_id*21))+'; overflow: hidden; position:absolute;  height: '+v_reduzido+'px" onmouseover=" window.status = this.style.zIndex; this.style.height = \''+v_altura+'px\'" onmouseout=" this.style.height = '+v_reduzido+'">';
				v_result += '<iframe width="100%" height="100%" frameborder="0" scrolling="no" style="alpha(opacity=0); opacity:0"></iframe>';
				v_result += '</div>';
				
				/*v_result += '<script defer>';
				v_result += '  alert(\'teste\');';
				v_result += '  document.getElementById(\'tbl_footer\').style.display=\'\';';
				v_result += '</script>';*/
				
				if(v_pub_id == 20)
					v_result += ' <div>';
				
				
				break;
			case "GIF":
			case "JPG":
			case "PNG":
				
				v_pub_id = Number(v_obj.id.replace('td_posicao_pub_',''));
				
				
				/*if(v_pub_id != 20 && v_pub_id != 61)
					v_result += '<div style="overflow-y: hidden; position:absolute; text-align:left; z-index:'+(2000-Number(v_obj.id.replace('td_posicao_pub_','')))+'; height: '+v_reduzido+'" onmouseover="this.style.height = '+v_altura+'" onmouseout="this.style.height = '+v_reduzido+'">';*/
				if(v_pub_id == 61)
					v_result += '<div style="overflow-y: hidden; position:absolute; width:732px; left:0px; height: '+v_reduzido+'" onmouseover="this.style.height = '+v_altura+'" onmouseout="this.style.height = '+v_reduzido+'">';					
				if(v_pub_id == 101)
					v_result += '<div style="overflow-y: hidden; position:relative; text-align:left; z-index:1000; width:295px; height: '+v_reduzido+'" onmouseover="this.style.height = '+v_altura+'" onmouseout="this.style.height = '+v_reduzido+'">';
					
			/*	if(v_pub_id == 20){
					v_result += ' <div style="position:absolute; display:none; width:1000px; height:123px; text-align:left; vertical-align:top; z-index:1000; margin-left:-2px; cursor:pointer;">';
					
					v_result += ' <table width="100%" cellpadding="0" cellspacing="0" border="0" style="display:none">';
					v_result += '   <tr>';
					v_result += '       <td width="99%">&nbsp;</td>';
					v_result += '   	<td width="1%" align="rigth"></td>';
					v_result += '   </tr>';
					v_result += '</table>';

					v_result += ' </div>';
				}*/
					
				if(v_url_acesso.replace(/ /g,'') != '')
					v_result += '<a href="'+unescape(v_url_acesso)+'" target="_blank">';
					
				v_result += '<img style="border:0;" width="'+v_largura+'" height="'+v_altura+'" src="'+v_url+'"';
				
				if(v_pub_id == 20)
					v_result += ' onload="document.getElementById(\'tbl_footer\').style.display = \'\'" ';
					
				v_result += '/>';
				if(v_url_acesso.replace(/ /g,'') != '')
					v_result += '</a>';
				if(v_pub_id != 20)
					v_result += '</div>';
					
				break;
			default:	
				v_result = '<span class="obrigatorio">Somente são aceitos arquivos nos formatos SWF (Flash), JPG e GIF.</span>';
				break;
		  }
		}else{
			/*v_scr = v_script;
			
			while(v_scr.indexOf('</s"+"cript>') > 0){
				v_scr = v_scr.replace('</s"+"cript>',"</script>"); 
			}
			v_scr = '<div style="position:absolute" >'+v_scr+'</div>';
*/
			v_scr = "<iframe frameborder='0' scrolling='no' src='/diariodoscampos/dinamicas/publicidade_script.cfm?publicidade_id="+v_publicidade_id+"' style='width:100%; height:"+v_altura+"px;'></iframe>";

			v_result = v_scr;
		}
	v_obj.innerHTML = v_result;

}

function f_query_ajax_inner(url, obj) {
	f_query_ajax(url 
				,function (obj2) {
					obj.innerHTML = String(obj2).replace('<NOSCRIPT>','').replace('</NOSCRIPT>','');
				}//,
				//function(obj2) {
			//		return '';
				//}
				);
}