function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain, secure )
{
  var cookie_string = name + "=" + escape ( value );
  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }
  if ( path )
        cookie_string += "; path=" + escape ( path );
  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  if ( secure )
        cookie_string += "; secure";
  document.cookie = cookie_string;
}

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}

function delete_cookie( name, path, domain ) {
if ( get_cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function toggle_visibility(id) {
var toggle = document.getElementById(id);
if(toggle.style.display == 'block')
{toggle.style.display = 'none';
delete_cookie(id, "/");
}
else
{toggle.style.display = 'block';
set_cookie(id, "on", 2010, 01, 15, "/" );}
}

function HideBubble(bub) 
{
if(bub.length < 1) { return; }
document.getElementById(bub).style.display = 'none';
}
function ShowBubble(bub) 
{
document.getElementById(bub).style.display = 'block';
}

