function mostraFlash(flashNome,flashW,flashH,endereco){
	//alert(endereco+flashNome);
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + flashW + '" height="' + flashH + '" id="' + flashNome + '" align="middle">');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="movie" value="' + endereco + flashNome + '.swf" />');
		document.write('<param name="quality" value="high" />');
		document.write('<param name="wmode" value="transparent" />');
		document.write('<embed src="' + endereco + flashNome + '.swf" quality="high" wmode="transparent" width="' + flashW + '" height="' + flashH + '" name="' + flashNome + '" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}
function fecha_envelope(nomeId){
	document.getElementById(nomeId).style.display='none';			
}
function ocultaSelect(){
	var check = document.getElementsByTagName('select');
	for(var x = 0; x < check.length; x++) {
		check[x].style.visibility = 'hidden';
	}
}
function mostraSelect(){
	var check = document.getElementsByTagName('select');
	for(var x = 0; x < check.length; x++) {
		check[x].style.visibility = 'visible';
	}
}	
function executaAjax(id, arq){
	var urlDet = arq;
	if(window.ActiveXObject) // IE 
		req = new ActiveXObject("Microsoft.XMLHTTP");
	else if(window.XMLHttpRequest) // nao IE
		req = new XMLHttpRequest();
		
	req.onreadystatechange = function() {
		if(req.readyState == 1){
			//document.getElementById(id).innerHTML = "<img src='../img/spinner.gif' border='0'/> carregando...";
		}
		if(req.readyState == 4){
			var detalheImg = document.getElementById(id);
			detalheImg.innerHTML  = req.responseText;
			detalheImg.style.display='';
		}
	}
										
	req.open("POST", urlDet, true);
	req.send(null);
}

function abrePopup(url,largura,altura,scroll){
	if(scroll == null){
	scroll = "no";
	}
	if (document.all)
		var xMax = screen.width, yMax = screen.height;
	else
		if (document.layers)
			var xMax = window.outerWidth, yMax = window.outerHeight;
		else
			var xMax = 640, yMax=480;
			var xOffset = (xMax - 750)/2, yOffset = (yMax - 500)/2;
			window.open(url,'popup','scrollbars='+scroll+',width='+largura+',height='+altura+',screenX='+xOffset+',screenY='+yOffset+',top='+yOffset+',left='+xOffset+'');
}

