If you are only switching between two items, why not try the following.
Code:
function switchMenu(show, hide) {
var hide_obj = document.getElementById(hide);
var show_obj = document.getElementById(show);
show_obj.style.display = "block";
hide_obj.style.display = "none";
}
Then, in your HTML code (where you define the id[s] of the element[s]), place the following (as an example):
Code:
<a href="#" onclick="switchMenu('price', 'description'); return false;">Sort By Price</a>
<div id="price" style="display: block;">This is the price div</div>
Replace the part in red with the div/table id that you want to show, and the part in blue with the div/table id you want to hide.
If you wanted to show a third sorting option, simply add a third attribute to the function.
Hope this helps.
Bookmarks