/* * Plugin: bouncer.js * Description: A simple script to determine if a visitor is of legal drinking age. * Author: Ryan Kozak * Author's website: https://ryankozak.com * PluginURL: https://github.com/d0n601/drinkingAge * */ var config; function drinkingAge(settings) { config = settings; insertHTML(); checkCookie(); } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i= drinkAge) { setCookie("age_verification", age, 1); window.location.reload(); } else { denyEntry(); } } function denyEntry() { var err_msg; err_msg = "
×"; err_msg+=config.deny_message; err_msg+= "
"; $('body').prepend(err_msg); setTimeout('denyRedirect()', config.deny_timeout); } function denyRedirect() { window.location = config.redirect; } function insertHTML() { var html; html = "
"; html+=""; html+="
"; html+= config.message; html+= "
"; html+=""; html+=" "; html+=" "; html+="
"; html+="
"; html+="
"; html+="
"; html+="
"; html+=" "; html+="
"; html+=" "; html+="
"; html+="
"; html+="
"; html+="
"; html+="
"; html+=" "; html+=" By entering this site you agree to our"; html+=" Terms & Conditions"; html+= " and"; html+= " Privacy & Cookie Notice"; html+= "
"; html+="
"; html+="
"; $('body').prepend(html); }