// JavaScript criado por Vicente Eugenio
// vicente.eugenio@hotmail.com



function mostrar(id1,id2)
	{
	document.getElementById(id1).style.display = "";
	if(id2 != ''){
	document.getElementById(id2).style.display = "";
	}
	}
	
function ocultar(id1,id2)
	{
	document.getElementById(id1).style.display = "none";
	if(id2 != ''){
	document.getElementById(id2).style.display = "none";
	}
	}

function abreJanela(largura, altura, pagina, opcoes) 
	{
	var janela = window.open(pagina,'janela','top='+(screen.height - altura) / 2+', left='+(screen.width - largura) / 2+', width='+largura+', height='+altura + ',' + opcoes);
	//alert (janela);
	janela.focus();
	}

function trocaImagem (id, arquivo)
	{
	id.src = arquivo;
	}
function enviarForm(id) {
	document.getElementById(id).submit();
	}
	
	
// temperatura do clima tempo


function temperatura()
{
	var xmlHttp;
	document.getElementById('respostaTemp').innerHTML='Obtendo informação do clima...';

	try 
	{  // Firefox, Opera 8.0+, Safari  
	xmlHttp=new XMLHttpRequest();  
	}
	catch (e) 
		{  // Internet Explorer  
		try
    		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
			}
  			catch (e)
    			{    
				try
      				{
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
					}
    				catch (e)
      					{
						alert("Seu navegador não pode mostrar a temperatura!");
						return false;
						}
				}
		}
	// este é o evento chamado quando houver algum tipo de alteração no xmlhttp
	xmlHttp.onreadystatechange=function()
	{
	if(xmlHttp.readyState==4)
	  {
	  //xmlHttp.responseXML
	  //x=xmlHttp.responseXML.getElementsByTagName("cidade")[0].attributes;
	  //x = x.getNamedItem("frase").nodeValue + "&nbsp;<a href='javascript:abreJanela(90, 200, \"temperatura.html\", \"\")'>Mais detalhes</a>"
	  x = xmlHttp.responseText + "&nbsp;<a href='javascript:abreJanela(180, 200, \"temperatura.html\", \"\")'>Mais detalhes</a>";
	  document.getElementById('respostaTemp').innerHTML=x;
	  }
	}
	xmlHttp.open("GET","temperatura.asp",true);
  	xmlHttp.send(null);
}