//funcao que pega um parametro na URL
//param: nome do parametro a ser pego
//url: OPCIONAL, se nao for passado pega a URL local
//retorno: parametro ou vazio se nao existir
function getParam(param, url)
{
	var iPosI, iPosF, retorno
	
	if (url==null)
		url = window.location.href;
	
	//separa ancora da URL passada
	iPosI = url.indexOf("#");
	if (iPosI != -1)
		url = url.substr(0,iPosI);
		
   iPosI = url.indexOf(param+"=");
	if (iPosI !=-1)
	{
		retorno = url.substr(iPosI + param.length + 1, url.length);
		iPosF = retorno.indexOf("&");
		
		if (iPosF != -1)
			retorno = retorno.substr(0,iPosF);
	}
	else
		retorno = "";
		
   return(retorno);
}

function ExibeAviso()
{
	var Texto="<BR><BR><table><tr><td bgcolor='#cccccc'><font size=2>";
	Texto += "Caro Visitante,<BR><BR>";
	Texto += "De acordo com a resolução Nº 1.701/2003 do Conselho Federal de Medicina (CFM), do Conselho Regional de "
	Texto += "Medicina (CRM) e do Código de Ética Médica, não é permitido ao médico disponibilizar fotos de antes e"
	Texto += " depois dos procedimentos médicos estéticos, mesmo com a permissão expressa dos pacientes.<BR><BR>"
	//Texto += "</font></td></tr></table>"
	//document.write(Texto);
	//var Texto="<BR><table><tr><td bgcolor='#cccccc'><font size=2>";
	Texto += "Aviso: Esse texto tem caráter meramente informativo e suas figuras são ilustrativas. Sempre procure o seu médico para uma melhor avaliação.";
	Texto += "</font></td></tr></table>"
	document.write(Texto);
}

function TestaFrame(pagina)
{
	if (top.location.pathname == location.pathname || location.host != top.location.host)
	{
		if (pagina==null)
			top.location.href = "http://" + location.host + "/index.html" + "?page=" + "http://" + location.host + location.pathname;
		else
			top.location.href = "http://" + location.host + "/index.html" + "?page=" + "http://" + location.host + pagina;
	}
}