//PREREQUISITES FOR THIS FILE:
//    Global variables: ns4, ns6, and ie (instantiated via bdiusa_functions.js)
//
//

// PUBLIC DOMAIN COOKIE FUNCTIONS
function getCookieVal (offset)
{
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1) { endstr = document.cookie.length; }
    return unescape(document.cookie.substring(offset, endstr));
}

function 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 getCookieVal (j);
            }
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break;
        }
    return null;
}

function SetCookie (name,value,expires,path,domain,secure)
{
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}



//CHECK IF BROWSER-WARNING COOKIE HAS BEEN SET MORE THAN TWICE - DISPLAY ALERT MESSAGE IF NOT
if( !ns4 && !ie && !ns6 )
{
    cookie_counter = ( GetCookie('browserwarn') ) ? GetCookie('browserwarn') : 0;

    if( cookie_counter < 2 )
    {
        alert( 'This site was designed for viewing on the following browsers:\n\n Internet Explorer 4.0 and above \n Netscape 4.0 and above \n Mozilla 5.0 (Netscape 6)\n\n\nIf you are experiencing challenges with one of \nthe above browsers, please contact us at:\n info@bdiusa.com\n\n\nTHIS MESSAGE WILL DISPLAY ONLY TWICE' );
        cookie_counter++;
        SetCookie( 'browserwarn',cookie_counter );
    }
}
