function checkEnv() {
   var DocumentLocation = "";

   DocumentLocation = top.document.location.toString();
   
   if (document.forms[0].Envcount.value==""){
     document.forms[0].Envcount.value = "1";
     if (DocumentLocation.indexOf("dev")>=0){
       document.forms[0].Env.value = "dev";
     }
     else {
       document.forms[0].Env.value = "prod";
     } 
     document.forms[0].submit();
   }
}

function cancelnav(venv){
  document.cf.docancel.value = "";
  var ThreeDays = 3 * 24 * 60 * 60 * 1000;
  var expDate   = new Date();
  expDate.setTime( expDate.getTime() - ThreeDays );
  document.cookie = "web_co_num=ImoutOfHere; expires=" + expDate.toGMTString() + "; path=/";
  if (venv=="prod") {
    parent.location.href = "https://www.nauticalchartsonline.com/n.c/index.html";
  }
  else {
    parent.location.href = "http://www.nauticalchartsonline.dev/n.c/index.html";
  }
}
