Short answer: You can't do what you are trying to do.
Longer answer:
The asp, mvc and razor code all runs on the server. After it runs on the server, it is turned into a stream of HTML which is then handed to the client.
At that point, server-side code no longer runs. It is no longer available. The browser knows nothing about it at all.
The only thing you can do is run some client side code, written in JavaScript.
As I look at your code and try to guess the intent, I believe that you are trying to make a set of extra buttons available when the user clicks the navigate button.
One possible alternative is to go ahead and create the buttons using razor, but wrap them in a something like this:
// Example code -- Not meant for actual production
<div style="display:none" id="extra-nav">
@Html.loadSubMenu(4);
</div>
<img src="~/Content/images/b1.png" id="b1"
onclick="handleNavClick" onmouseover="
bigImg(this)" onmouseout=" normalImg(this)"> </a>
<script>
function handleNavClick() {
document.getElementById("extra-nav").style.display = "block";
}
</script>