var ns = (navigator.appName.indexOf("Netscape") != -1);
var baseHeight = 183;
var t = null;
var animated = false;

function getObj(id)
{
	var obj = ( document.getElementById ? document.getElementById(id) : ( document.all ? document.all[id] : ( document.layers ? document.layers[id] : null ) ) );
	if(obj != null && document.layers) obj.style = obj;

	return obj;
}

function moveMenu()
{
	if(animated) {
		menuTop = parseInt(menu.style.marginTop);
		t = ( ns ? pageYOffset : document.body.scrollTop ) - baseHeight;
		t = menuTop + ((t - menuTop) / 2);
		if(t < 0 || isNaN(t)) t = 0;
		if(menuTop != t) menu.style.marginTop = t + "px";
		setTimeout("moveMenu();", 100);
	}

	return;
}

function animatedMenu(a)
{
	var obj = getObj("animatedMenuButton");
	if(obj != null) {
		var img = obj.childNodes[0];
		if(img) {
			if(document.layers) img.style = img;
			if(animated) {
				animated  = false;
				obj.title = "off";
				img.alt   = "off";
				img.style.background = "url(\"imagens/menu_animation_off.jpg\") top left no-repeat";
			} else {
				animated  = true;
				obj.title = "on";
				img.alt   = "on";
				img.style.background = "url(\"imagens/menu_animation_on.jpg\") top left no-repeat";
				moveMenu();
			}
		}
	}
	if(a != null) a.blur();

	return void(0);
}

function menu_over(li)
{
	li.id = "menuOver";
	var obj = getObj("menuOver");
	if(obj != null) obj.childNodes[0].className = "atual";
	li.id = "";

	return;
}

function menu_out(li)
{
	li.id = "menuOver";
	var obj = getObj("menuOver");
	if(obj != null) obj.childNodes[0].className = "";
	li.id = "";

	return;
}


function menu_click(li)
{
	li.id = "menuClick";
	var obj = getObj("menuClick");
	if(obj != null) {
		if(obj.childNodes[0].click) {
			obj.childNodes[0].click();
		} else {
			document.location.href = obj.childNodes[0].href;
		}
	}
	li.id = "";

	return;
}

document.fisioesporteFotoPopup = null;
function popup(url, width, height)
{
	if(document.fisioesporteFotoPopup != null
	&& typeof(document.fisioesporteFotoPopup) == "object"
	&& (typeof(document.fisioesporteFotoPopup.close) == "object"
		||
		typeof(document.fisioesporteFotoPopup.close) == "function"
		)
	) {
		document.fisioesporteFotoPopup.close();
	}
	document.fisioesporteFotoPopup = window.open(url, "fisioesporteFotoPopup", "width=" + width + ",height=" + height + ",left=" + parseInt((screen.width - width) / 2) + ",top=" + parseInt((screen.height - height) / 2));
	document.fisioesporteFotoPopup.focus();
	return true;
}