var fChanged = 0;
window.onbeforeunload = Window_onbeforeunload;

function Window_onbeforeunload() 
{ 
    if (fOnUnloadUnLoad && fChanged)
    {
        var fPrompt = !g_fHosted;
        
        if (!fPrompt)
        {
            try
            {
                fPrompt = fIngoreUnSavedChanges == false;    
            }
            catch(e)
            {
                fPrompt = false;
            }                
        }
        
        if (fPrompt)
        {
            Form_SetProcessing(false);
            return "You have made changes to this page that you have not yet committed.";
        }            
    }        
}
