﻿function ShowHideLayer(divID) {
	var box = document.getElementById(divID);	
		
	if(box.style.display == "none") {
		box.style.display = "block"; 
		set_cookie(divID, 'block', 2009, 12, 31);
	}
	else {
		box.style.display = "none";		
		set_cookie(divID, 'none', 2009, 12, 31);
	}
}
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 hide_on_load (divName)
{
	var box = document.getElementById(divName);	
	var x = get_cookie (divName);
	if (x == 'none')
			box.style.display = "none";		
}
