

function DML_makeCookie (name,value) {
pathname = location.pathname;
myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (365 * 24 * 3600 * 1000));
DML_SetCookie(name,value,largeExpDate,myDomain);}  

function DML_TCookie (name,value) {
pathname = location.pathname;
myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
var largeExpDate = new Date ();
largeExpDate.setTime(largeExpDate.getTime() + (300000));
DML_SetCookie(name,value,largeExpDate,myDomain);}  

function DML_getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));}

function DML_GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return DML_getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;}
return null;}

function DML_SetCookie (name, value) {
var argv = DML_SetCookie.arguments;
var argc = DML_SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");}

function DML_fetchCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return DML_getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;}
return "";}

function DML_killCookie(name, path, domain) {
var firstChar, lastChar, theValue;
var BDLcookie = document.cookie;
firstChar = BDLcookie.indexOf(name);
if(firstChar != -1) {
firstChar += name.length + 1;
lastChar = BDLcookie.indexOf(';', firstChar);
if(lastChar == -1) lastChar = BDLcookie.length;
theValue = BDLcookie.substring(firstChar, lastChar);} 
else {
theValue = false;}
if(theValue) {
document.cookie = name + '=' + theValue + '; expires=Fri, 13-Apr-1970 00:00:00 GMT' + ((path)?';path=' + path:'') + ((domain)?';domain=' + domain:'');}}

DML_makeCookie('BDLCOOKIE','YES');

function DML_COOK(){
var COOK = DML_fetchCookie('BDLCOOKIE');
if (!COOK == 'YES'|| COOK == " " || COOK == "" || !COOK){
alert("This site uses cookies, which are not currently active on your browser - some feature may not be accessible")}
else {return(COOK);}}