/*////////  FLASH   //////////// */
function flash(movie, flashvars, width, height, retorna){
	swfid = movie.split("/");
	swfid = swfid[swfid.length-1].replace(".swf", "");
	strSWF= '<object id="' + swfid + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + width + '" height="' + height + '">'+
			'<param name="movie" value="' + movie + '">'+
			'<param name="quality" value="high">'+
			'<param name="wmode" value="transparent">'+
			'<param name="FlashVars" value="' + flashvars + '">'+
			'<embed name="' + swfid + '" src="' + movie + '" width="' + width + '" height="' + height + '" flashvars="' + flashvars + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>'+
			'</object>';
	if(!retorna) this.document.write(strSWF);
	else return(strSWF);
}

function TheFlash(moviename) {
    if(document.all) return document.all[moviename];
	else return document.embeds[moviename];
}

/*////////  FERRAMENTAS   //////////// */

function $(id){
	return document.all? document.all[id] : document.getElementById(id);
}

function ferramentas(qual, titulo){
	$("iframe_ferramenta").src = "ferramentas/" + qual;
	$("div_fundao").innerHTML = flash("imagens/fundo_ferramentas.swf", "titulo=" + titulo, document.documentElement.clientWidth, document.documentElement.clientHeight, true);
	$("div_fundao").style.top = document.documentElement.scrollTop + "px";
	$("div_fundao").style.display = "block";	
	$("div_fundao").style.visibility = "";
}

function MostraFerramenta(){
	$("iframe_ferramenta").style.top = document.documentElement.scrollTop + (((document.documentElement.clientHeight - 600) / 2) + 62) + "px";
	$("iframe_ferramenta").style.left = (((document.documentElement.clientWidth - 630) / 2)) + "px";
	$("iframe_ferramenta").style.display = "block";
}

function ApagaFerramenta(){
	$("iframe_ferramenta").style.display = "none";
	setTimeout(function()
	{
		$("div_fundao").style.display = "block";
		$("div_fundao").style.visibility = "hidden";
		$("div_fundao").innerHTML = "";
	}, 300);
}

