//
// Copyright 2001-2006 Adobe Macromedia Software LLC and its licensors. All rights reserved.
// ----------------------------------------------------
//
// Flash Text.js
//
// See Commands/Flash Text.js for implementation of
// Insert Flash Text object
//

//
// ---- Object API ---
//
function objectTag()
{
  var flashButtonCmdURL, flashButtonDoc, retVal, theURL;
  if (!dw.getDocumentPath("document"))
  {
    alert(MSG_PleaseSaveDocument);
	return "";
  }

  if (dreamweaver.getDocumentDOM().getIsTemplateDocument())
	if (!confirm(MSG_ConfirmTemplateSWF))
      return "";

  var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/Flash Text.htm";
  var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);

  retVal = callCommand("Flash Text");

  // check to see if accessibility option for media objects is turned on
  prefsAccessibilityOption = dw.getPreferenceString("Accessibility", "Accessibility Media Options", "");
  if (prefsAccessibilityOption == 'TRUE' && cmdDOM.parentWindow.clickedOK) 
  {
    var objDOM = dreamweaver.getDocumentDOM();
    addAccessibility(objDOM);
  }
  
  return "";
}

function addAccessibility(objDom) 
{
  var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/Flash Options.htm";
  var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
   
  cmdDOM.parentWindow.setFormItem(objDom);
  dreamweaver.popupCommand("Flash Options.htm");
}
