function closestSibling(node,direction)
{
  var tempObj;
  if(direction==-1 && node.previousSibling!=null)
  {
    tempObj=node.previousSibling;
    while(tempObj.nodeType!=1 && tempObj.previousSibling!=null)
    {
       tempObj=tempObj.previousSibling;
    }
  }
  else if(direction==1 && node.nextSibling!=null)
  {
    tempObj=node.nextSibling;
    while(tempObj.nodeType!=1 && tempObj.nextSibling!=null)
    {
      tempObj=tempObj.nextSibling;
    }
  }
  return tempObj.nodeType==1?tempObj:false;
}

function closeExpand()
{
  allDiv = document.getElementsByTagName("div");
  for (var i=0; i < allDiv.length; i++)
  {
    if (allDiv[i].className == "contentExpand")
    {
      allDiv[i].style.display = "none";
    }
    if (allDiv[i].className == "expandIcon")
    {
      allDiv[i].innerHTML = "<span style='font-weight: normal; font-style: italic;'>see details</span> +";
    }
  }
}

function expand(titleExpand) {
  var expandIcon = closestSibling(titleExpand.firstChild, 1);
  var contentExpand = closestSibling(titleExpand, 1);
  if (expandIcon.innerHTML == "-")
  {
    contentExpand.style.display = "none";
    expandIcon.innerHTML = "<span style='font-weight: normal; font-style: italic;'>see details</span> +";
  }
  else
  {
    contentExpand.style.display = "block";
    expandIcon.innerHTML = "-";
  }
}
