function carregaFlashInvisivel(caminho,largura,altura,float,id,visivel) {
	document.write('<object id="'+id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+largura+'" height="'+altura+'" style="float:'+float+'; display: '+visivel+';">');
	document.write('<param name="movie" value="'+caminho+'">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="menu" value="false">');
	document.write('<embed src="'+caminho+'" wmode="transparent" quality="high"  menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+largura+'" height="'+altura+'"></embed>');
	document.write('</object>');
}

function loadFoto(caminho) {
	foto1= new Image();
	foto1.src=(caminho);
	largh=foto1.width;
	altez=foto1.height;
	
	if (altez > largh) {
		var caminho = '<img style="margin: 2px;" src="'+caminho+'" >';
		
	}
	else {
		var caminho = '<img style="margin: 2px;" src="'+caminho+'">';
	}

	document.getElementById('C3').innerHTML=caminho ;
}

var xmlHttp
function EnviaRecado()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Seu browser não suporta AJAX!");
		return;
	} 
	var url="recadoenvia.php";
	var variaveis = "?nome="+document.getElementById("rnome").value+
    	            "&email="+document.getElementById("remail").value+
	                "&cidade="+document.getElementById("rcidade").value+
					"&uf="+document.getElementById("ruf").value+
	                "&recado="+document.getElementById("rrecado").value;

	if ((document.getElementById("rnome").value != "") && 
		(document.getElementById("remail").value != "") && 
		(document.getElementById("rcidade").value != "") && 
		(document.getElementById("ruf").value != "") && 
		(document.getElementById("rrecado").value != ""))
	{
		xmlHttp.onreadystatechange=MandaRespostaEnviaRecado;
		xmlHttp.open("POST",url+variaveis,true);
		xmlHttp.send(variaveis);
	
		document.getElementById("WRECADO").reset();	
	}
}

function MandaRespostaEnviaRecado()
{ 
	if (xmlHttp.readyState==1)
	{ 
		//document.getElementById("MENSAGEM").innerHTML='Enviando recado...';
		document.getElementById("RECADOENVIANDO").style.display="block"; 		
	}
	if (xmlHttp.readyState==4)
	{ 
//		document.getElementById("MENSAGEM").innerHTML=xmlHttp.responseText;
		document.getElementById("RECADOENVIANDO").style.display="none"; 	
		document.getElementById("RECADOENVIADO").style.display="block"; 
	}
}

var xmlHttp
function EnviaMsg()
{ 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Seu browser não suporta AJAX!");
		return;
	} 
	var url="contatoenvia.php";
	var variaveis = "?nome="+document.getElementById("cnome").value+
    	            "&email="+document.getElementById("cemail").value+
	                "&cidade="+document.getElementById("ccidade").value+
	                "&uf="+document.getElementById("cuf").value+
	                "&mensagem="+document.getElementById("cmensagem").value;
	if ((document.getElementById("cnome").value != "") && 
		(document.getElementById("cemail").value != "") && 
		(document.getElementById("ccidade").value != "") && 
		(document.getElementById("cmensagem").value != ""))
	{
		xmlHttp.onreadystatechange=MandaRespostaEnviaMsg;
		xmlHttp.open("POST",url+variaveis,true);
		xmlHttp.send(variaveis);
	
	    document.getElementById("WCONTATO").reset();		
	}
}

function MandaRespostaEnviaMsg()
{ 
	if (xmlHttp.readyState==1)
	{ 
		document.getElementById("MENSAGEM").innerHTML='Enviando...';
	}
	if (xmlHttp.readyState==4)
	{ 
		document.getElementById("MENSAGEM").innerHTML=xmlHttp.responseText;
	}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}