expandImg = new Image();
expandImg.src = "../images/expand.gif";
reduceImg = new Image();
reduceImg.src = "../images/reduce.gif";

function ContractOrExpand(obj,sectionName)
{
	var section = GetElement(sectionName);
  if (!section)
  	return;
  ShowSection(obj,section,section.style.display=='none');
}

function ShowSection(obj,section,bShow)
{
	if (bShow==1)
  {
  	obj.className = "SummarySectionE";
  	section.style.display = 'block';
  }
  else
  {
  	obj.className = "SummarySectionR";
  	section.style.display = 'none';
  }
  document.cookie=section.id+"="+escape(Number(bShow));
}

function GetCookie(name)
{
  begin = document.cookie.indexOf(name + "=")
  if (begin >= 0)
  {
    begin += name.length + 1
    end = document.cookie.indexOf(";",begin)
    if (end < 0) end = document.cookie.length
    return unescape(document.cookie.substring(begin,end))
  }
  return null;
}

function OnSectionInit(sectionName)
{
	bShow = GetCookie(sectionName);
  if (bShow==null)
  	return;
	var obj = GetElement(sectionName + "_parent");
	var section = GetElement(sectionName);
  if (!section)
  	return;
  if (bShow==1 && obj.className!="SummarySectionE")
  {
  	ShowSection(obj,section,1);
    return;
  }
  if (bShow==0 && obj.className!="SummarySectionR")
  {
	  ShowSection(obj,section,0);
    return;
  }
}

function OnSummaryItemClick(e,href)
{
	if (e.button && e.button != 1)
  	return;
  if (e.which && e.which != 1)
  	return;
  window.open(href,'_self');
}