// detect if cookies are being blocked: set, then check.
var x_cookieName = "xyzzy"; // unique
var x_domain  = ".naturisimo.com"; // set to whatever domain you want to test, with the standard provisos

var x_expires = new Date(); x_expires.setFullYear(x_expires.getFullYear()+1); // testing persistent cookies
xDeleteCookie(x_cookieName); // don't get false positive

// add path if you want to. drop expires for session cookie. drop domain for default domain test.
document.cookie = x_cookieName + "=test; expires=" + x_expires.toGMTString() + "; domain=" + x_domain;

// now look for it.
var x_cookieString = document.cookie || "";
var x_cookies = x_cookieString.split(/\s*;\s*/);
var x_found = 0;
for (var i in x_cookies) {
    var cookie = x_cookies[i];
    var dough = cookie.split(/\s*=\s*/);
    if (dough[0] == x_cookieName) { x_found = 1; break; }
}

// ensure it's gone
xDeleteCookie(x_cookieName);

// do whatever you want with x_found bool
if (x_found == 1) {
    document.write(" ");
}
else {
    document.write("<br><font color='##ff0000'>Your browser does not allow cookies for this site<br>and therefore it won't let you buy online.<br>To allow cookies please follow these instructions:<br><br><b>Firefox users</b>: Go to 'Tools' then to 'Options'.<br>Click on the 'exceptions' button in the 'Cookies' section.<br>Select naturisimo.com underneath 'Site' and click on 'Remove'.<br>Click on 'Close' and 'OK' to end.<br><br><b>Explorer users:</b> Go to 'Tools' then click on 'Internet Options'<br>then on 'Privacy' then on 'Sites', select the domain naturisimo.com<br>and click on 'Remove', click on 'OK' and then 'OK' again to close.<br><br>If you are still experiencing problems, please contact us.</font>");
}

function xDeleteCookie(name) {
    var oldDate = new Date(1970, 1, 1);
    document.cookie = x_cookieName + "=0; expires=" + oldDate.toGMTString();
}
