
function confirm18(partner, url)
{
	if (getCookie("18_PLUS_COOKIE") != "1")
	{	
		document.body.style.display = "none";
		var accept = confirm("Warning! You are about to view a page that may contain adult content and/or photographs. Please review our Terms & Conditions (http://" + url + "/action/terms/" + partner + ".html), then click on the button below to verify that you are at least 18 years of age and consent to viewing adult material. Are you 18+ and do you wish to see results?");
		if (accept)
		{
			document.body.style.display = "";
			setExpireCookie();
		}
		else
			document.location.href = "http://www.google.com";
	}
	else
		document.body.style.display = "";
}

function setExpireCookie() 
{
		var today = new Date();
		var expMinutes = 1440; //one day
		var expireMill = today.getTime() + (expMinutes*60*1000); 
		var expires = new Date(expireMill);			
		
		setCookie("18_PLUS_COOKIE", "1", expires);
}

function setCookie(name, value, expire) 
{
	document.cookie = name + "=" + escape(value)
	+ ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}

function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}
