﻿var makeSecureZBV = true;

function doSecure()
{
   if (! makeSecureZBV)
      return;
      
   if (! secureCheck())
      top.location.href = "/login.aspx";

   if (! (top === self))
   {   
      window.top.adaptHeight(document.body.scrollHeight);
//      window.top.setBackground(document.body.style.backgroundColor);
      window.top.setBackground("#CFCFCF");
   }
}

function parentFileName()
{
   var file_name = parent.location.href;
   var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
   return file_name.substring(file_name.lastIndexOf("/")+1, end);
}

function secureCheck()
{
  if (! (top === self))
  {
     filename = parentFileName();
     if (filename == "securebox.aspx")
        return true;
     else
        return false; 
   }
   else
      return false;
}
