//
//  Function to return the value of the cookie specified by "name".
//    name - String object containing the cookie name.
//    returns - String object containing the cookie value, or null if
//      the cookie does not exist.
//
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 to work around Version 2.0 window open bug
function makeNewWindow() {
 var newWindow =
open("http://www.nist.gov/apde/disclaimer.htm",
"newWindow", "resizable", "width=400, height=300")
 var newWindow =
open("http://www.nist.gov/apde/disclaimer.htm",
"newWindow", "resizable", "width=400, height=300")
}

// "Internal" function to return the decoded value of a cookie
//
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
//***Disclaimer script****
//shows disclaimer in html file 
//
function ShowDisclaimer () {
//uses bug fix function
   makeNewWindow()
        }
// checks for cookie;  shows disclaimer if not there or if contains show
//
function DisclaimerCheck (destination) {
 if (GetCookie("Disclaimer") == "show" || !(GetCookie("Disclaimer"))){
 ShowDisclaimer()
}
}
//

