//=========================================================================================================
//

// Copyright 2004 Macromedia, Inc. All rights reserved.
//
// Feature: Contribute object edit launcher
// Author:  KPS
// Module:  EditFlash.js
// Purpose:	This is a stub command that determines what object type is selected, and launches the
//          appropriate command (currently, either EditFlash.htm or EditMovie.htm, depending on classID.
//
// 7/20/06 gsr modified to include pdf class id
//=========================================================================================================

//********************** GLOBAL CONSTANTS ****************************

var CLASSID_QUICKTIME = "clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b";
var CLASSID_WINDOWSMP = "clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95";
var CLASSID_PDF	      = "clsid:ca8a9780-280d-11cf-a24d-444553540000";
//********************************************************************

function receiveArguments()
{
}

function canAcceptCommand()
{
  return !( dw.getDocumentDOM().getCCSharedSetting_TextOnlyInNonTemplates() );
}


function run()
{
	var selectedNode = dw.getDocumentDOM().getSelectedNode();
  if (selectedNode)
  {
    var classId = selectedNode.classId;  //get the CLASSID from the selected object tag
    if (classId)
    {
      classId = classId.toLowerCase();
      if ((classId == CLASSID_QUICKTIME) || (classId == CLASSID_WINDOWSMP))  //if movie classID
      {
        dw.runCommand("EditMovie.htm", classId, false, false, false);
      }
      //gsrupdate hitch - handle property dialog for PDF
      else if (classId == CLASSID_PDF)    
      {
       	dw.runCommand("EditPDF.htm", "", false, false, false);
      }
      else           //if flash classID
      {
        dw.runCommand("EditFlashMovie.htm", "", false, false, false);
      }
    }
  }
}
