// Copyright 2000 Macromedia, Inc. All rights reserved.

function receiveArguments()
{
	var dom = dw.getDocumentDOM();
	if (dom && dom.getFocus() == 'frameset')
		dw.saveFrameset(dw.getDocumentDOM());
	else
	{
		if (dom && dom.getFocus() == 'none')
			dw.setFocus('document');
		dw.saveDocument(dw.getDocumentDOM());
	}
}

function canAcceptCommand()
{
	var dom = dw.getDocumentDOM();
	if (dom && dom.getFocus() == 'frameset')
		return (dw.getFocus(true) == 'html' || dw.getFocus() == 'textView' || dw.getFocus() == 'document') && dw.canSaveFrameset(dw.getDocumentDOM());
	else
		return (dw.getFocus() == 'document' || dw.getFocus(true) == 'html' || dw.getFocus() == 'textView') && dw.canSaveDocument(dw.getDocumentDOM());
}

function setMenuText()
{
	var dom = dw.getDocumentDOM();
	if (dom && dom.getFocus() == 'frameset')
		return MENU_SaveFrameset;
    else if (dom && dom.isDocumentInFrame())
		return MENU_SaveFrame;
	else
		return MENU_Save;
}
