/**
 * Only show the disclaimer once every 24 hours.
 * The cookie value expires at midnight.
 *
 */

function show_disclaimer()
{
	//alert(getCookie("SEARCH_DISCLAIMER"));
	if(getCookie("SEARCH_DISCLAIMER") != "true")
	{
		document.getElementById("disclaimer_table").style.display="";
		document.getElementById("search_div").style.display="none";
	}
	else
	{
		document.getElementById("SearchForm").submit();		
	}
	
	document.body.scrollTop = 0;

}

/**
 * Pull up search results page
 */
 
function submit_disclaimer()
{
	document.getElementById("SearchForm").submit();
	setCookie("SEARCH_DISCLAIMER", "true");
}

/**
 * Returns the cookie of a given name
 */
function getCookie ( cookie_name )
{
  var results = document.cookie.match ( cookie_name + '=(.*?)(;|$)' );

  if ( results )
    return ( unescape ( results[1] ) );
  else
    return null;
}

/**
 * Sets a cookie
 */
function setCookie(cookieName, cookieData)
{
	var now = new Date();

	if(navigator.appName == "Microsoft Internet Explorer")
		var expires = new Date(now.getYear(), now.getMonth(), now.getDate(), 23, 59, 59);
	else
		var expires = new Date(now.getYear() + 1900, now.getMonth(), now.getDate(), 23, 59, 59);
	
	document.cookie = cookieName + "=" + escape(cookieData) + "; expires=" + expires;
}
