function toggleList(id, displayValue) {
    var obj = document.getElementById(id);
    if(!displayValue)
    {
        var displayValue = (obj.style.display!='none')?'none':'block';
    }
    obj.style.display = displayValue;
    setCookie(id, displayValue, 30); //Set expiration in days
    return;
}

window.onload = function()
{
    //Create a line for each object you need to set the toggle
    //value for on load of the page. Set the ID value accordingly
    toggleList('technicalInfoChart', getCookie('technicalInfoChart'));
		return;
}

function setCookie(name, value, expiredays)
{
    if (expiredays==null) { expiredays=0; }

    var expireDate = new Date();
    expireDate.setDate(expireDate.getDate()+expiredays);

    var cookieVal  = name + '=' +escape(value) + ';expires=' + expireDate.toGMTString();
    document.cookie = cookieVal;
    return;
}

function getCookie(searchName)
{
  if (document.cookie.length>0)
  {
    var nameValuePair, cookieName, cookieValue
    var pairs = document.cookie.split(';');
    for(var i=0; i<pairs.length; i++)
    {
      nameValuePair = pairs[i].split('=');
      cookieName    = nameValuePair[0].replace(/^\s+|\s+$/g,'');
      cookieValue   = nameValuePair[1].replace(/^\s+|\s+$/g,'');
      if(cookieName == searchName) { return cookieValue; }
    }
  }
  return false;
}
