function GetTempo() {
	pesquisar_dados('cotacao.php','cots');	
}

function expandcollapse(postid) { 
	whichpost = document.getElementById(postid); 
	if (whichpost.className=="compactar") { 
		whichpost.className="mostrar"; 
	} else { 
		whichpost.className="compactar"; 
	} 
}

function ocultar(postid) { 
	whichpost = document.getElementById(postid);
	whichpost.className="ocultar";
}

function mostrar(postid) {
	whichpost = document.getElementById(postid);
	whichpost.className="mostrar";
}

function pesquisar_dados(page, var1) {
	http.open("GET", page, true);
	http.onreadystatechange = function handleHttpResponse()	{
		if (http.readyState == 4) {
			document.getElementById(var1).innerHTML = http.responseText;
		} else {
			document.getElementById(var1).innerHTML = '<span class="carregando">carregando...</span>';
		}
	}
	http.send(null);
}

function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
		xmlhttp = false;
		}
	}
	@else
	xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
		xmlhttp = new XMLHttpRequest();
		} catch (e) {
		xmlhttp = false;
		}
	}
	return xmlhttp;
}

var http = getHTTPObject();
function abrejanela () { // cria uma janela para mostrar uma imagem
	var fotos, attribs, a = abrejanela.arguments;
	fotos = a[0];
	viewer = window.open ('',a[1],'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');
	doc = viewer.document;
	doc.open();

	if(navigator.appName.indexOf('Internet Explorer') > 0){
		var nwidth = 10;
		var nheight = 49;
	} else {
		var nwidth = 6;
		var nheight = 49;
	}

	doc.write ('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html lang="pt">\n<head>\n<title>Fotos</title>\n</head>\n<body style=\"background-color:#000;margin:0;\" onLoad=\"window.focus();resdetect()\" oncontextmenu="return false" onselectstart ="return false">\n');
	doc.write ('<table style="height:100%;width:100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" valign="middle"><a href="JavaScript:self.close()"><img src=\"'+fotos+'\" name="pop" border="0" alt="Fechar"></a></td></tr></table>');
	doc.write ('<script l type="text/javascript">function resdetect(){if((screen.Width <= (document.images.pop.width)) && (screen.availHeight <= (document.images.pop.height))){window.resizeTo(screen.Width, screen.availHeight)}else{window.resizeTo(document.images.pop.width+'+nwidth+',document.images.pop.height+'+nheight+')}}</script></body></html>');
	doc.close();
}