function showCadastro()
{
	var obj = document.getElementById("cadastre");
	var sub_menu = document.getElementById("sub_menu");
	
	if(obj && sub_menu)
	{
		if(obj.style.display == "none")
		{
			obj.style.display = "block";
			sub_menu.style.display = "none";
		}
		else
		{
			obj.style.display = "none";
			sub_menu.style.display = "block";
		}
	}
}

function showCompartilhe(flag)
{
	var obj = document.getElementById("compartilhe");

	if(obj)
	{
		if(flag)
		{
			obj.style.display = "block";
		}
		else
		{
			obj.style.display = "none";
		}	
	}
}

function atendimentoOnline()
{
	lpButtonCTTUrl = 'http://server.iad.liveperson.net/hc/84313897/?cmd=file&file=visitorWantsToChat&site=84313897&referrer='+escape(document.location);
	lpButtonCTTUrl = (typeof(lpAppendVisitorCookies) != 'undefined' ? lpAppendVisitorCookies(lpButtonCTTUrl) : lpButtonCTTUrl);
	window.open(lpButtonCTTUrl,'chat6144957','width=475,height=400,resizable=yes');
}

function scrollTo(target)
{
	var obj = $("#side_container");
	var arr_menu = Array("apresentacao","localizacao","descricao","servicos","acompanhe","imagens");
	var totalHeight = 0;
	
	if(obj.length > 0)
	{
		for(i = 0; i < arr_menu.length; i++)
		{
			if(arr_menu[i] == target)
			{
				break;
			}
			else if($("#" + arr_menu[i]).length > 0)
			{
				height = $("#" + arr_menu[i]).attr("scrollHeight");

				heightNum = Number(height);
				//heightNum = Number(height.substring(0,height.length-2));

				totalHeight += (heightNum + 3);
				
			
			}
		}

		var finalHeight = new String("-" + totalHeight + "px");

		obj.animate({ marginTop:finalHeight }, 500 );
	}
}
