function checkDisclaimer()
{
	var result = get_cookie('agree');
	
	if (result == 'yes')
	{
		
		window.location = 'http://www.icrimewatch.net/shastaca';
	}
	else
	{
		window.location = 'ow_disclaimer.htm';
	}
}

function setSheriffCookie(field, value, days)
{
	if(days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = ";expires="+date.toGMTString();
	}
	else
	{
		expires="";
	}
	document.cookie = field+"="+value+expires+";path=/";

	window.location = 'http://www.icrimewatch.net/shastaca';
}

//Get cookie routine
function get_cookie(Name)
{
	var searchName = Name + "=";
  	var returnvalue = "";
  	if (document.cookie.length > 0)
  	{
    	offset = document.cookie.indexOf(searchName)
    	// if cookie exists
    	if (offset != -1)
		{ 
      		offset += searchName.length
      		// set index of beginning of value
      		end = document.cookie.indexOf(";", offset);
      		// set index of end of cookie value
      		if (navigator.appName == 'Microsoft Internet Explorer')
			{
				if (end == -1)
				{
					end = document.cookie.length;
					returnvalue = unescape(document.cookie.substring(offset, end));
				}
			}
			else
			{
				if (end != -1)
				{
					/*end = document.cookie.length;*/
					returnvalue = unescape(document.cookie.substring(offset, end));
				}
			}
      	}
   	}
  	return returnvalue;
}