//Helper javascript routines to assist in showing the changes in highlighted pages

//prevent page unload before the whole document is displayed.
function im_onBeforeUnload()
{
   if (!g_fIMBodyLoaded) {
	 	msg = "-------------------------------------------------------------\n";
	 	msg += "The webpage is trying to refresh before it is completely loaded.\n";
	 	msg += "Click on Cancel if you want to see the changes highlighted.\n";
	 	msg += "------------------------------------------------------------";
       	if (window.event) {
   	  		window.event.cancelBubble = true ;
   	  		window.event.returnValue=msg ;
       	}
       	return msg ;
   }
}
window.onbeforeunload=im_onBeforeUnload ;

//None of the following seem to work with Firefox
//else if (window.addEventListener) window.addEventListener("beforeunload",im_onBeforeUnload,false);
//else if (document.addEventListener) document.addEventListener("beforeunload", im_onBeforeUnload, false) ;
//else if (window.attachEvent) window.attachEvent("onbeforeunload",im_onBeforeUnload);

