if (parent.frames.length != '0') {
  var URI = location.href;
  var thisFile = URI.slice(0,URI.lastIndexOf('.'));
  var extension = URI.slice(URI.lastIndexOf('.'),(URI.lastIndexOf('.')+5));
  thisFile = thisFile + extension;
  top.frames.location.href = thisFile;
}