function hideSubCategory(tmp_int_catId)
{
/*
   Function Name	:	hideSubCategory
   Purpose		:	to hide sub category
   Input		:	tmp_int_catId
   Output 		:	hide sub category
*/
 document.getElementById(tmp_int_catId).style.display="none";

}

function showSubCategory(tmp_int_catId)
{
 /*
    Function Name	:	showSubCategory
    Purpose		:	to show sub category
    Input		:	tmp_int_catId
    Output 		:	display sub category
*/
 //alert(tmp_int_catId);
     var privMCatId =  document.getElementById("crtpid").value;
 
     if (privMCatId!="")
     {
       hideSubCategory(privMCatId);
     }

     document.getElementById("crtpid").value = tmp_int_catId; 
     //alert("test ="+document.getElementById("crtpid").value);
  document.getElementById(tmp_int_catId).style.display="";
  
}


function SwapId(element_to_swap)
{
  
  /* Change CSS of arrow */
  var x = document.getElementsByTagName('div');
  //var stage = document.getElementById(element_to_swap.id).getAttribute("stage");

  /* Loop through all DIVs and change their CSS to normal */
  for (var i=0;i<x.length;i++)
  {
    if(x[i].id == "main-menu-s")
    {
      x[i].id = "main-menu";
    }
    if(x[i].id == "main-menu-arrow-s")
    {
      x[i].id = "main-menu-arrow";
    }
  }

  
  /* Chanege CSS of menu text */
  element_to_swap.id = "main-menu-s"; 
  stage = element_to_swap.getAttribute("stage");
  /* Change CSS of arrow */
  for (var i=0;i<x.length;i++)
  {
    if (x[i].getAttribute("stage") == stage && x[i].getAttribute("attr") == "arr")
    {
      x[i].id = "main-menu-arrow-s" ;
    }
  }   
}