$(window).load(function() {
	initMenuTop();
});

function initMenuTop() {
	/*
	 * Para menú sobre el flash
	 */
	$(".BotonMenuTop").not(".disabled").not(".Link").bind('mouseenter', function() {
		setMenuHover($(this));
	});

	$(".BotonMenuTop").not(".disabled").bind('mouseleave', function() {
		unsetMenuHover($(this));
	});

	$(".disabled").css({ 'cursor' : 'default' }).click(function(e) { e.preventDefault(); });
}

function setMenuHover(obj) {
	if (typeof obj == "string") obj = $(obj); // Si se pasa un string, es un selector CSS. Se selecciona con jQuery
	else if (typeof obj != "object") return; // Si no, debe ser un objeto. De otra manera, se cancela.
	
	var temp = obj.attr('src').replace('.jpg', '-hover.jpg');

	obj.addClass('Link').attr('src', temp);
}

function unsetMenuHover(obj) {
	if (typeof obj == "string") obj = $(obj); // Si se pasa un string, es un selector CSS. Se selecciona con jQuery
	else if (typeof obj != "object") return; // Si no, debe ser un objeto. De otra manera, se cancela.
	
	var temp = obj.attr('src').replace('-hover.jpg', '.jpg');
	var seccionDestino = temp.split('-')[2].replace('.jpg', '');

	if (seccionDestino != Home) obj.removeClass('Link').attr('src', temp);
}