var licenseFile = '/license.shtml';
var licenseText = 'License=OK';
var expDate = 'August 13, 2010';
var opts = 'width=550,height=450,scrollbars=yes,resizable=yes,dependent=yes,alwaysRaised=yes';
var time = null


// Check for cookie, popup license if none found
function checkLicense(name)
{
//alert("checkLicense: "+name+" "+document.cookie);
  if (document.cookie.indexOf(licenseText) > -1)
  {
    gotitFile(name);
    return true;
  }
  else
  {
    showLicense();
    return false;
  }
}

// Redirect to examples_accepted.html if cookie found
function gotitFile(name)
{
//alert("to: "+name);
  // must be replaced with desired destination
  window.location = name;
}

// Popup license page
function showLicense()
{
  window.open(licenseFile,'_blank',opts);
  return true;
}

