function PopDisclaimer() {
    if ( ! get_cookie ( "disclaimer" ) ) 
    {
        window.open ('http://chathamcounty.org/disclaimer.aspx','Disclaimer','menubar=yes,scrollbars=yes,width=640,height=500');
        return false;
    } else {
        return true;
    }
}

function setDisclaimerCookie() {
	
	if (document.disclaimerForm.terms.checked) {
	
		document.domain = "chathamcounty.org";
		
		var current_date = new Date;
		var cookie_year = current_date.getFullYear ( ) + 1;
		var cookie_month = current_date.getMonth ( );
		var cookie_day = current_date.getDate ( );
		set_cookie ( "disclaimer", "accept", cookie_year, cookie_month, cookie_day, "", "chathamcounty.org" );
		
		//window.opener.document.PropSales.submit();
		window.close();
		return true;
		
	} else {
		
		alert("You must accept the disclaimer before proceeding.");
		return false;
	}

}

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;
}

