if (top==self) {
  writeCookie('redirector', getFileName(), 0);
  window.location.replace('../index.htm');
}

function getFileName(loc) {
  if (!loc) loc = window.location.href;
  var index = loc.lastIndexOf('/');
  if (index == -1) index = loc.lastIndexOf('\\');
  return loc.substring(index + 1);
}
function writeCookie(name, value, days) {
  var expires = "";
  if (!value) value = '';
  if (days) {
    var date = new Date();
    date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
    expires = "; expires=" + date.toGMTString();
  }
  document.cookie = name + "=" + value + expires + "; path=/";
}

