$(document).ready(function(){
	$('body').attr('scrollTop', 'no');
});

function menu_selecionado(){
	var url = new String(window.location);
	var menu = new String();
	
	if (url.indexOf("unique-fitness") != -1){
		menu = "#menu-item-1 a";
	}
	else if (url.indexOf("estrutura") != -1){
		menu = "#menu-item-2 a";
	}
	else if (url.indexOf("atividades") != -1){
		menu = "#menu-item-3 a";
	}
	else if (url.indexOf("programas") != -1){
		menu = "#menu-item-4 a";
	}
	else if (url.indexOf("atendimento") != -1){
		menu = "#menu-item-5 a";
	}
	else if (url.indexOf("localizacao") != -1){
		menu = "#menu-item-6 a";
	}
	
	$(menu).css("color","#fbc9b5");
	$(menu).css("background", "url('" + document.getElementById("url").value + "/images/setaBrancaMenuInt.png') no-repeat top center");
}
	
	
function menu_novidades(url){
	var menu = new String();
	
	if (url.indexOf("novidades") != -1){
		menu = "#menu-item-1 a";
	}

	$(menu).css("color","#fbc9b5");
	$(menu).css("background", "url('" + document.getElementById("url").value + "/images/setaBrancaMenuInt.png') no-repeat top center");
}
	
function getPosicaoElemento(elemID, containerID){
    var offsetTrail = document.getElementById(elemID);
    var offsetLeft = 0;
    var offsetTop = 0;
    while (offsetTrail) {
        offsetLeft += offsetTrail.offsetLeft;
        offsetTop += offsetTrail.offsetTop;
        offsetTrail = offsetTrail.offsetParent;
    }
    if (navigator.userAgent.indexOf("Mac") != -1 && 
        typeof document.body.leftMargin != "undefined") {
        offsetLeft += document.body.leftMargin;
        offsetTop += document.body.topMargin;
    }
	
	if (containerID!==""){
		offsetTop -= document.getElementById(containerID).scrollTop;
	}

    return {left:offsetLeft, top:offsetTop};
}

function muda_margin_left_div(div, valor){
	document.getElementById(div).style.marginLeft = valor+"px";
}

function apaga_lista_agenda(elem1, elem2){
	
	var pai = document.getElementById(elem1);
	var filho = document.getElementById(elem2);
	
	pai.removeChild(filho);
}

function ajusta_pg_interna(div){
	document.getElementById(div).style.paddingTop = "50px";
}

$(document).ready(function() {
	
	var intervalo;
	
	$("#nav a").hover(
		function(){
			clearInterval(intervalo);
			$("#nav li.current_page_item a").css("background-image","none");
		}, function(){
			intervalo = window.setInterval(exibe_seta, 200);
		}
	);
});

function exibe_seta(){
	$("#nav li.current_page_item a").css("background-image","url('"+ document.getElementById("url").value +"/images/setaBrancaMenuInt.png')");
}

function ajusta_height_slider(){
	
	var ht = document.getElementById("slider").clientHeight;
	
	ht += 76;
	
	$('#slider').css('height',ht+'px');	
}

function esconde_up_down(id){
	alert("teste");
	$("#"+id).hide();
}
