

	var size=11;
	var hide=0;
	
	
	function tamanhoFont(tamanho,objeto){
		if(tamanho=="+"){
			size++;
		}else{
			size--;
		}
		sizetxt=size+"px";
		texto=document.getElementById(objeto);		
		texto.style.fontSize=sizetxt;
		

	}
	
	function imprmirNoticia(){	
		win=janela("print.php", "imprime", 670, 500);		
	}
	
	function sizeHidden(){		
		document.form1.fonte.value=size;
	}
	
	function noticiaHidden(){
	
	objt=document.getElementById("noticia");
	esquerdo=document.getElementById("centroEsquerdo");
	objMax=document.getElementById("max");
		if(objt.style.display=="block" || hide==0){
			
			
			objt.style.display="none";
			esquerdo.style.width="100%";
			objMax.style.display="block";
			
		}else{
			objt.style.display="block";
			esquerdo.style.width="470px";
			objMax.style.display="none";
		}
		hide++;
	}
	
	
	function divDysplay(objFloatjs,imgSrc){		
		divFloat=document.getElementById(objFloatjs);
		if(divFloat.style.display!="block"){
			divFloat.style.display="block";
			divFloat.getElementsByTagName("img")[0].src=imgSrc;
			divFloat.style.top=document.body.scrollTop + 100;		
			alert(document.body.scrollTop);
		}else{			
			divFloat.style.display="none";			
		}		
	}
	
	
	function imageMaxReplace(objArena){
	
		imagens=document.getElementById(objArena).getElementsByTagName("img");
		for(i=0;i<imagens.length;i++){
		var port=i;
			imagens[i].onclick=function(){
				divDysplay("objFloat",this.src);					
			}
		}
	}
	
	function XMLHttpRequestConstructor(){
	
		try{
			xmlhttp= new XMLHttpRequest();
		}catch(ee){
				try{
					xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
				}catch(e){
					try{
						xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
					}catch(E){
						xmlhttp= false;
					}					
				}
		}
		return xmlhttp;
	}
	
	
	function chamadaNoticiaJs(id_conteudo,obj){
	// lembrese xhmlhttp nao deve ficar aqui
	//tente fazer mais generico
	
		xmlhttp= XMLHttpRequestConstructor();	
		xmlhttp.open("GET","chamadaNoticia.php?id_conteudo="+id_conteudo,true);	
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState==4){		
				var texto=xmlhttp.responseText;				
				var conteudo= document.getElementById("txtNoticia");
				texto=texto.replace(/\+/g," ");
				texto=unescape(texto);
				conteudo.innerHTML=texto;
				document.getElementById("objFloat").style.display="none";
				imageMaxReplace("txtNoticia");
				
				}
		}
	xmlhttp.send(null);
	
	}
	
	
	function chamadaControle(objeto,arquivo){
		
	// lembrese xhmlhttp nao deve ficar aqui
	//tente fazer mais generico
	controle=arquivo;
		xmlhttp= XMLHttpRequestConstructor();	
		xmlhttp.open("GET",controle,true);	
		xmlhttp.onreadystatechange=function(){
			if(xmlhttp.readyState==4){		
			
				var texto=xmlhttp.responseText;
				var conteudo= document.getElementById(objeto);
				texto=texto.replace(/\+/g," ");
				texto=unescape(texto);
				conteudo.innerHTML=texto;
				
				//document.getElementById("objFloat").style.display="none";
				//imageMaxReplace(objeto);
				
				}
		}
	xmlhttp.send(null);
	
	}
	
	
	
	
	

 function janela(mypage, myname, w, h) {
   var winl = (screen.width - w) / 2;
   var wint = (screen.height - h) / 2;
   winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,noresizable,status=no, location=no, toolbar=no, menubar=no';
   win = window.open(mypage, myname, winprops)
}

function imgUp(dados,w,h) {
	janela("envieaumAmigo.php?"+dados, "Fotos", w, h);
}
	function popUp(url,dados,w,h){
		
		janela(url+dados, "Produto", w, h);
		
		} 
	
function linkar(url,variavel){
	if(variavel){
		valor=document.getElementById(variavel).value;
		window.location=url+"&"+variavel+"="+valor;
	}else{
		window.location=url;
	}
}

	 
