<!-- MENU-LOCATION=NONE -->
<html xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
<head>
<!-- Copyright 2006-2007 Adobe Systems Incorporated.  All rights reserved. -->
<title><MMString:LoadString id="spry/widgets/collapsiblepanel/title" /></title>

<script type="text/javascript" src="../../Shared/Common/Scripts/dwscripts.js"></script>
<script type="text/javascript" src="../../Shared/MM/Scripts/CMN/TemplateUtils.js"></script> 
<script type="text/javascript" src="../../Shared/Spry/DesignTime/EditingUtils.js"></script>

<script language="javascript">

function canInsertObject(){    
  var dom = dw.getDocumentDOM();
  return dom.getIsLibraryDocument() == false;
}

function isDOMRequired() {
  return true;
}

function objectTag(){
  // We're keeping this a separate command, as we want to use the
  // "buttons at the bottom" style.
  var dom = dreamweaver.getDocumentDOM();
  
  Spry.DesignTime.Editing.Utils.removeCachedObjects(dom, "Spry.Widget.CollapsiblePanel");

  if( !Spry.DesignTime.Editing.Utils.canInsertWidget(dom) )
  {
    return;
  }
  
  var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/SpryCollapsiblePanel.htm";
  var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
  dreamweaver.popupCommand("SpryCollapsiblePanel.htm");

  var assetList = cmdDOM.parentWindow.getAssetList();
  var scriptStr = cmdDOM.parentWindow.getScriptStr();

  // tell Dreamweaver to add js references and copy the necessary js file to the site
  if (assetList && assetList.length)
    dom.copyAssets(assetList);

  // add JavaScript constructor of our widget
  if (scriptStr)
    dom.addJavaScript(scriptStr, false);

  return (cmdDOM.parentWindow.createWidgetStr());
}

</script>
</head>
<body>
</body>
</html>
