DaysToLive = 1

function GetCookie(name) {
// Start by assuming no cookie exists.
var cookiecontent = '0';

if(document.cookie.length > 0) {
	// Determine begin position of the cookie with the specified name.
	var cookiename = name + '=';
	var cookiebegin = document.cookie.indexOf(cookiename);
	// Initialize the end position at zero.
	var cookieend = 0;
	// If a cookie with the specified name is actually available ...
	if(cookiebegin > -1) {
		// Offset the begin position of the cookie by the lengh of the cookie name.
		cookiebegin += cookiename.length;
		// Determine the end position of the cookie.
		cookieend = document.cookie.indexOf(";",cookiebegin);
		if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
		// Put the cookie into our own variable "cookiecontent".
		cookiecontent = document.cookie.substring(cookiebegin,cookieend);
	}
}
// Increment cookie content by 1 and store in variable "value".
var value = parseInt(cookiecontent) + 1;
// Put the incremented value as a new cookie on the visitor's hard drive.
PutCookie(name,value);
// Return the incremented value to the calling line of code.
return value;
}


// This function puts the cookie on the visitor's hard drive.
function PutCookie(n,v) {
// Begin by assuming no expiration date is applicable.
var exp = '';
// If an expiration date is applicable, determine the future date 
//      and store the date in variable "exp" in the correct format.
if(DaysToLive > 0) {
	var now = new Date();
	then = now.getTime() + (15*1000*60);
	now.setTime(then);
	exp = '; expires=' +
	now.toGMTString();
}
// Put the cookie on the user's hard drive with path set to root 
//     and with any applicable expiration date.
document.cookie = n + "=" + v + '; path=/' + exp;
}
visits = GetCookie('page_name');

if(visits == 1)  {  window.location = "disclaimer.html"; }

function DeleteCookie(name,value){
mycookie = GetCookie('page_name');
var now = new Date();
	then = now.getTime() + (10);
	now.setTime(then);
	exp = '; expires=' +
	now.toGMTString();
document.cookie = name + "=" + value + '; path=/' + exp;
}
