Index: resource.class.php
===================================================================
--- resource.class.php	(revision 342)
+++ resource.class.php	(working copy)
@@ -401,7 +401,6 @@
                     link_to_popup_window ('/mod/resource/type/file/localpath.php', get_string('localfile', 'resource'), get_string('localfilehelp','resource'), 400, 500, get_string('localfilehelp', 'resource'));
                     echo '</div>';
                 }
-                echo '</div></div>';
 
             /// embedded file into iframe if the resource is on another domain
             ///
@@ -449,7 +448,7 @@
                 if (!empty($resource->summary)) {
                     print_simple_box(format_text($resource->summary, FORMAT_MOODLE, $formatoptions, $course->id), "center");
                 }
-                echo "</body></html>";
+                echo "</div></div></body></html>";
                 exit;
             }
             /// display the resource into a frame tag
