
// Show and hide the subcategory.
function ShowHide(aVar)
{
	var obj, objImg;
	obj = document.getElementById("div" + aVar);
	objImg = document.getElementById("img" + aVar);
	
	if (obj.style.visibility=="hidden")
	{
		obj.style.display="block";	
		obj.style.visibility="visible";
		objImg.src="Images/DownArrow.gif";
	}
	else
	{
		obj.style.display="none";		
		obj.style.visibility="hidden";
		objImg.src="Images/RightArrow.gif";		
	}
  return false;
}

// This fuction will navigate to url
// also write cookie and show the selected one.
function Go(url, aVar)
{
  window.location = url;
  
  // This function is from CookieManger.js
  if (detectCookies())
  {
	  setCookie("ExpandedCatId", aVar, 1);
  }
}

// This function will expand the category which has
// the given id
function ExpandCategory()
{
  if (detectCookies())
  {
	  var catId = getCookie("ExpandedCatId");
	  if (catId)
	  {
	    ShowHide(catId);
	  }
  }
}
