function amplia(){
document.getElementById('fotoZoom').style.display='block';
document.getElementById('bgFotoZoom').style.display='block';
}

function abre(img,legenda,credito,largura,altura) {
document.getElementById("fotoZoom").innerHTML="<center><table bgcolor='#ff9900' cellspadding='1' cellspacing='1'><tr><td align=center><font size=2 face=Verdana>"+legenda+"</td></tr><tr><td><a href='javascript:fecha();'><img alt='"+legenda+"' src='"+img+"' width='"+largura+"' height='"+altura+"'></a></td></tr><tr><td align=right><font size=2 face=Verdana>"+credito+"&nbsp;</font></td></tr></table>";
}

function fecha() {
document.getElementById('fotoZoom').style.display='none';
document.getElementById('bgFotoZoom').style.display='none';
}


function setSearchOptions(idElement, tipo, busca){
	tot_tab = 3;
	var no = tipo.name;
	//var busca = busca.value;
	/*alert(busca);*/

	document.getElementById("tipo").value = no;
	pagina = "pesquisar.php?busca=" + busca.value;
	pagina =  pagina + "&tipo=" + no + "&pag=Home&subpag=Arquivo de Notícias" ;
	ExecAjax(pagina, 'base');
	
	tab		= document.getElementById('tab'+idElement);
	search_option = document.getElementById('searchopt');
	for(i=1; i<=3; i++){
		if(i==idElement){
			tab.setAttribute("class","selected");
			search_option.value=idElement;
		} else {
			document.getElementById("tab"+i).setAttribute("class","");
		}
	}
	
}


var limite=600;
function soma() 
{
	var mais_um=eval(document.form.caracteres.value.length-1);
	mais_um++; 
	if (document.form.caracteres.value.length>limite)  
	{  
		document.form.caracteres.value='';  
		document.form.caracteres.value=valor_limite;  
		alert("Você deve digitar no máximo "+limite+" caracteres"); 
	} else {  
				document.form.exibe.value='';  
				document.form.exibe.value=eval(mais_um);  
				valor_limite=document.form.caracteres.value;  
				document.form.exibe2.value=''; 
				document.form.exibe2.value=(limite-mais_um); 
			}
			document.form.caracteres.focus();
}
function mostra_tamanho()
{
	document.form.exibe2.value=limite;
}
