function openMenu(menuID,menuX,menuY)
{
	//if the menu code is ready
	if(um.ready)
	{
		//activate menu
		um.activateMenu(menuID, menuX + 'px', menuY + 'px');
	}
}

//close menu with given ID
function closeMenu(menuID)
{
	//if the menu code is ready
	if(um.ready)
	{
		//deactive menu
		um.deactivateMenu(menuID);
	}
}

function ShowHide(id) {
    if(document.getElementById(id).className != "oculta"){
        document.getElementById(id).className = "oculta";
    } else {
        document.getElementById(id).className = "mostra";
    }
}


function irA(menu)
{
	//window.parent.frames["main"].location.href = menu.options[menu.selectedIndex].value;
	var url=menu.options[menu.selectedIndex].value
	var array_url=url.split("|");
	if (url != "no")
	{
		if (array_url[1]=="1")
		{
			WindowName=window.open(array_url[0], "NewWin", "")
		}
		else
		{
			//window.parent.frames[3].window.location.href = array_url[0];
			window.location = array_url[0];
		}
	}
}

function ompleTraduccions(optSelected)
{
	var list = document.getElementById("nomConstantList");
	//alert (list);
	//alert (list.selectedIndex);
	var txtCat = document.getElementById("textCatala");
	var txtEsp = document.getElementById("textCastella");
	var txtEng = document.getElementById("textAngles");

	if (optSelected == -1 )
	{
		txtCat.value = "";
		txtEsp.value = "";
		txtEng.value = "";
	}else
	{
		txtCat.value = arrTrad[list.selectedIndex-1][0];
		txtEsp.value = arrTrad[list.selectedIndex-1][1];
		txtEng.value = arrTrad[list.selectedIndex-1][2];
	}

}

function canviarEstatClau()
{
	var nomConstant = document.getElementById("nomConstant");
	var nomConstantList = document.getElementById("nomConstantList");
	nomConstant.disabled=!nomConstant.disabled;
	nomConstantList.disabled=!nomConstantList.disabled;
	
}

function desactivarCamps()
{
	var nomConstant = document.getElementById("nomConstant");
	var nomConstantList = document.getElementById("nomConstantList");
	nomConstant.disabled=false;
	nomConstantList.disabled=true;
	nomConstantList.selectedIndex = 0;
}



