﻿//______________________________________________________
// js para MenuBotones.ascx
//______________________________________________________


function onMouseOverBotonMenu(idName)
{
	setBotonMenu(idName, false);
}

function onMouseOutBotonMenu(idName)
{
	setParticulares(false);
	setEmpresas(false);
	setPatrimonios(false);
	setGrupos(false);
	setBotonMenu(paginaActual, false);
}

function setBotonMenu(pagina, yLosDemasOff)
{
	switch(pagina)
	{
		case "particulares":
			setParticulares(true);
			if( yLosDemasOff )
			{
				setEmpresas(false);
				setPatrimonios(false);
				setGrupos(false);
			}
			break;
		case "empresas":
			setEmpresas(true);
			if( yLosDemasOff )
			{
				setParticulares(false);
				setPatrimonios(false);
				setGrupos(false);
			}
			break;
		case "patrimonios":
			setPatrimonios(true);
			if( yLosDemasOff )
			{
				setParticulares(false);
				setEmpresas(false);
				setGrupos(false);
			}
			break;
		case "grupo":
			setGrupos(true);
			if( yLosDemasOff )
			{			
				setParticulares(false);
				setEmpresas(false);
				setPatrimonios(false);
			}
			break;
	}
}

function setParticulares(onOff)
{
	var idBoton = document.getElementById("bmParticulares");
	if( idBoton != null )
	{
		if( onOff == true )
		{
			idBoton.src = webRoot+"img/menusup1on.gif";
		}
		else
		{
			idBoton.src = webRoot+"img/menusup1off.gif";
		}
	}
	else
	{
		alert("Error al establecer imagen en setParticulares.");
	}
}

function setEmpresas(onOff)
{
	var idBoton = document.getElementById("bmEmpresas");
	if( idBoton != null )
	{
		if( onOff == true )
		{
			idBoton.src = webRoot+"img/menusup2on.gif";
		}
		else
		{
			idBoton.src = webRoot+"img/menusup2off.gif";
		}
	}
	else
	{
		alert("Error al establecer imagen en setEmpresas.");
	}
}

function setPatrimonios(onOff)
{
	var idBoton = document.getElementById("bmPatrimonios");
	if( idBoton != null )
	{
		if( onOff == true )
		{
			idBoton.src = webRoot+"img/menusup3on.gif";
		}
		else
		{
			idBoton.src = webRoot+"img/menusup3off.gif";
		}
	}
	else
	{
		alert("Error al establecer imagen en setPatrimonios.");
	}
}

function setGrupos(onOff)
{
	var idBoton = document.getElementById("bmGrupos");
	if( idBoton != null )
	{
		if( onOff == true )
		{
			idBoton.src = webRoot+"img/menusup4on.gif";
		}
		else
		{
			idBoton.src = webRoot+"img/menusup4off.gif";
		}
	}
	else
	{
		alert("Error al establecer imagen en setGrupos.");
	}
}
