// search through all the links in array, if one points to
// the same file, apply the class .storemenu_selected to it and to its parent
function setActiveMenu(arr, crtPage)
{
  for(var i=0; i < arr.length; i++)
  if(arr[i].href == crtPage)
  {
    arr[i].className = "storemenu_selected";
    arr[i].parentNode.className = "storemenu_selected";
  }
}

// call this method from page
function setMenuSelection()
{
  if(document.location.href) 
    hrefString = document.location.href;
  else
    hrefString = document.location;
	if (document.getElementById("storemenu")!=null)
	  setActiveMenu(document.getElementById("storemenu").getElementsByTagName("a"), hrefString);
}