Index: branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/ajax.js =================================================================== diff -u -r6899 -r6903 --- branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/ajax.js (.../ajax.js) (revision 6899) +++ branches/unlabeled/unlabeled-1.1.2/core/admin_templates/js/ajax.js (.../ajax.js) (revision 6903) @@ -291,6 +291,11 @@ switch ($params[0]) { case 'GetSize': // store responce to cache for future use + if (!$responce.match(/([\d]+)x([\d]+)/)) { + // invalid responce was received, may be php fatal error during AJAX request + $responce = '750x400'; + } + $object.PopupSizes[ $params[1] ] = $responce; break; } Index: branches/unlabeled/unlabeled-1.2.2/core/admin_templates/js/script.js =================================================================== diff -u -r6899 -r6903 --- branches/unlabeled/unlabeled-1.2.2/core/admin_templates/js/script.js (.../script.js) (revision 6899) +++ branches/unlabeled/unlabeled-1.2.2/core/admin_templates/js/script.js (.../script.js) (revision 6903) @@ -1154,11 +1154,18 @@ function getFrame($name) { - var $frameset = window.parent.frames; + var $main_window = window; + + while ($main_window.opener) { + // cycle through popups to get main window + $main_window = $main_window.opener; + } + + var $frameset = $main_window.parent.frames; for ($i = 0; $i < $frameset.length; $i++) { if ($frameset[$i].name == $name) { return $frameset[$i]; } } - return window.parent; + return $main_window.parent; } \ No newline at end of file