function addFav()
{
   if (window.sidebar) 
   {
   		window.sidebar.addPanel(document.title, document.location,"");
   }
   else if(window.opera && window.print)
   {
        var mbm = document.createElement('a');
        mbm.setAttribute('rel','sidebar');
        mbm.setAttribute('href',document.location);
        mbm.setAttribute('title',document.title);
        mbm.click();
    }
    else if(document.all)
	{
		window.external.AddFavorite(document.location, document.title);
	}
}

function rolaPrevisao(num)
{
	document.getElementById('prevTempoTopo').innerHTML = '<img src="../images/carregando_barra.gif" align="middle" />';
	
	var xmlhttp;
	try {xmlhttp = new XMLHttpRequest();} catch(ee){try{xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch(e){try{xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch(E){ xmlhttp = false; }}}
	xmlhttp.open('GET', '../page/_tempo.asp?trocarCidadePrev='+num, true);
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState==4)
			document.getElementById('prevTempoTopo').innerHTML=xmlhttp.responseText;			
	}
	xmlhttp.send('');
}

function clickBanner(cod)
{
	try 
	{
		xmlhttpBanner = new XMLHttpRequest();
	} catch(ee) {
		try {
			xmlhttpBanner = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xmlhttpBanner = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(E) {
				xmlhttpBanner = false;
			}
		}
	}

	xmlhttpBanner.open("POST", '../page/_clickBanner.asp', true);		
	xmlhttpBanner.onreadystatechange = function()	
	{
		/*if (xmlhttpBanner.readyState==4){}*/
	}
	xmlhttpBanner.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
	xmlhttpBanner.send("cod=" + cod)
}


function toogle(id,idInverso)
{
	if(document.getElementById(id).style.display=='none')
	{
		document.getElementById(id).style.display='';
		if(idInverso && document.all)
			document.getElementById(idInverso).style.visibility='hidden';
	}
	else
	{
		document.getElementById(id).style.display='none';
		if(idInverso && document.all)
			document.getElementById(idInverso).style.visibility='';
	}
}