function fixUnload ()
{
	// Is there things still loading, then fake the unload event
	if ( document.readyState === 'interactive' )
	{
		function stop ()
		{
			// Prevent memory leak
			document.detachEvent( 'onstop', stop );

			// Call unload handler
			window.fire( 'unload' );
			window.fire( 'onunload' );
		};

		// Fire unload when the currently loading page is stopped
		document.attachEvent ( 'onstop', stop );

		// Remove onstop listener after a while to prevent the unload function
		// to execute if the user presses cancel in an onbeforeunload
		// confirm dialog and then presses the stop button in the browser
		window.setTimeout ( function ()
		{
			document.detachEvent( 'onstop', stop );
		}, 0);
	}
};

if ( navigator.appName === "Microsoft Internet Explorer" )
{
	window.attachEvent('onbeforeunload', fixUnload);
}