<html xmlns:MMString="http://www.macromedia.com/schemes/data/string/">
<HEAD>
<!-- Copyright 1999, 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved. -->
<TITLE><MMString:loadString id="Menus/MM/CC_Properties/title" /></TITLE>
<SCRIPT LANGUAGE="javascript" SRC="../../Shared/MM/Scripts/CMN/string.js"></SCRIPT>
<SCRIPT LANGUAGE="javascript">

<!--
//--------------- LOCALIZEABLE GLOBALS---------------
var LABEL_Spry_Widget_Accordion = dw.loadString('Menus/MM/CC_Properties/spry/widgets/accordion/label');
var LABEL_Spry_Widget_CollapsiblePanel = dw.loadString('Menus/MM/CC_Properties/spry/widgets/collapsiblepanel/label');
var LABEL_Spry_Widget_MenuBar = dw.loadString('Menus/MM/CC_Properties/spry/widgets/menubar/label');
var LABEL_Spry_Widget_TabbedPanels = dw.loadString('Menus/MM/CC_Properties/spry/widgets/tabbedpanels/label');
var LABEL_Spry_Widget_Tooltip = dw.loadString('Menus/MM/CC_Properties/spry/widgets/tooltip/label');
var LABEL_Spry_Widget_ValidationCheckBox = dw.loadString('Menus/MM/CC_Properties/spry/widgets/validationcheckbox/label');
var LABEL_Spry_Widget_ValidationConfirm = dw.loadString('Menus/MM/CC_Properties/spry/widgets/validationconfirm/label');
var LABEL_Spry_Widget_ValidationPassword = dw.loadString('Menus/MM/CC_Properties/spry/widgets/validationpassword/label');
var LABEL_Spry_Widget_ValidationRadio = dw.loadString('Menus/MM/CC_Properties/spry/widgets/validationradio/label');
var LABEL_Spry_Widget_ValidationSelect = dw.loadString('Menus/MM/CC_Properties/spry/widgets/validationselect/label');
var LABEL_Spry_Widget_ValidationTextArea = dw.loadString('Menus/MM/CC_Properties/spry/widgets/ValidationTextarea/label');
var LABEL_Spry_Widget_ValidationTextField = dw.loadString('Menus/MM/CC_Properties/spry/widgets/ValidationTextField/label');
var LABEL_Spry_Widget = dw.loadString('Menus/MM/CC_Properties/spry/widget/label');
var LABEL_Other = dw.loadString('Menus/MM/CC_Properties/LABEL_Other');
//--------------- END LOCALIZEABLE   ---------------
// -->

//This command should show one of the four properties dialogs, depending on
//the selection. Here's the spec:
//1- When nothing's selected, "Properties..." is grayed out (default).
//When an image is selected, "Image Properties..." appears.
//When a link is selected, "Link Properties..." appears.
//When an anchor is selected, "Anchor Properties..." appears.
//When a flash object is selected, "Flash Properties..." appears.
//When a movie object is selected, "Movie Properties..." appears.
//When a pdf object is selected, "PDF Properties..." appears.
//When an hr is selected, "Horizontal Rule Properties..." appears.
//When a table is selected, "Format Table Properties..." appears.
function showIf() {
    var show = true;
    
    if (CCWorkspaceManager.getManager(dw.getDocumentDOM()).IsCurrentPageXML()) { return false; }

    return show;
}

function receiveArguments()
{
	switch (selectionType())
	{
		case "Spry.Widget.Accordion":
				{
					dw.runCommand("spry_accordion.htm");
					break;
		}
		case "Spry.Widget.CollapsiblePanel":
		{
			dw.runCommand("spry_collapsiblepanel.htm");
			break;
		}
		case "Spry.Widget.MenuBar":
		{
			dw.runCommand("spry_menubar.htm");
			break;
		}
		case "Spry.Widget.TabbedPanels":
		{
			dw.runCommand("spry_tabbedpanels.htm");
			break;
		}
		case "Spry.Widget.ValidationCheckbox":
				{
					dw.runCommand("spry_validationcheckbox.htm");
					break;
		}
		case "Spry.Widget.Tooltip":
		{
			dw.runCommand("spry_tooltip.htm");
			break;
		}

		case "Spry.Widget.ValidationConfirm":
		{
			dw.runCommand("spry_ValidationConfirm.htm");
			break;
		}
		case "Spry.Widget.ValidationPassword":
				{
					dw.runCommand("spry_ValidationPassword.htm");
					break;
		}
		case "Spry.Widget.ValidationRadio":
				{
					dw.runCommand("spry_ValidationRadio.htm");
					break;
		}
		case "Spry.Widget.ValidationSelect":
				{
					dw.runCommand("spry_validationSelect.htm");
					break;
		}
		case "Spry.Widget.ValidationTextarea":
				{
					dw.runCommand("spry_ValidationTextarea.htm");
					break;
		}
		case "Spry.Widget.ValidationTextField":
				{
					dw.runCommand("spry_ValidationTextField.htm");
					break;
		}
		case "Spry.Widget":
				{
					dw.runCommand("spry_widget.htm");
					break;
		}
	}
} //receiveArguments

//Look at the selection, and return a string reporting the type. Possible
//return values are:
// "image"
// "table"
// "link"
// "anchor"
// "flash"
// "movie"
// "pdf"
// "horizontal rule"
// "other"

function selectionType()
{
    
	if(isAccordionSelected() && dw.isWidgetEditingEnabled())
	{
			return "Spry.Widget.Accordion";
	}
	if(isCollapsiblePanelSelected() && dw.isWidgetEditingEnabled())
	{
		return "Spry.Widget.CollapsiblePanel";
	}
	if(isMenuBarSelected() && dw.isWidgetEditingEnabled())
	{
		return "Spry.Widget.MenuBar";
	}
	if(isTabbedPanelsSelected() && dw.isWidgetEditingEnabled())
	{
			return "Spry.Widget.TabbedPanels";
	}
	if(isValidationCheckBoxSelected() && dw.isWidgetEditingEnabled())
	{
		return "Spry.Widget.ValidationCheckbox";
	}
	if(isTooltipSelected() && dw.isWidgetEditingEnabled())
		{
			return "Spry.Widget.Tooltip";
	}
	if(isValidationConfirmSelected() && dw.isWidgetEditingEnabled())
		{
			return "Spry.Widget.ValidationConfirm";
	}
	if(isValidationPasswordSelected() && dw.isWidgetEditingEnabled())
		{
			return "Spry.Widget.ValidationPassword";
	}
	if(isValidationRadioSelected() && dw.isWidgetEditingEnabled())
		{
			return "Spry.Widget.ValidationRadio";
	}
	if(isValidationSelectSelected() && dw.isWidgetEditingEnabled())
		{
			return "Spry.Widget.ValidationSelect";
	}
	if(isValidationTextAreaSelected() && dw.isWidgetEditingEnabled())
	{
			return "Spry.Widget.ValidationTextarea";
	}
	if(isValidationTextFieldSelected() && dw.isWidgetEditingEnabled())
		{
			return "Spry.Widget.ValidationTextField";
	}
	if(isSpryWidgetSelected() && dw.isWidgetEditingEnabled())
		{
			return "Spry.Widget";
	}


	return "other";

} //selectionType

function canAcceptCommand(itemID)
{
	if (!(dw.getFocus() == 'document'))
	return false;

	var dom = dw.getDocumentDOM();

	if (dom)
	{
		if (!(dom.getParseMode () == 'html'))
		return false;

		if( dom.isHotSpotSelected() )
			return false;
	//	if (dom.getCCSharedSetting_TextOnlyInNonTemplates() && !dom.isTemplateInstance())
	//	return false;

	}

	return selectionType () != "other";
}

// getDynamicContent returns the contents of a dynamically generated menu.
// returns an array of strings to be placed in the menu, with a unique
// identifier for each item separated from the menu string by a semicolon.
//
// return null from this routine to indicate that you are not adding any
// items to the menu

function setMenuText(itemID)
{
	dom = dw.getDocumentDOM();
	var result = new Array();

	//alert('selction id: ' + itemID);
	switch (selectionType())
	{
		case "Spry.Widget.Accordion":
		{
			return (LABEL_Spry_Widget_Accordion);
		}
		case "Spry.Widget.CollapsiblePanel":
		{
			return (LABEL_Spry_Widget_CollapsiblePanel);
		}
		case "Spry.Widget.MenuBar":
		{
			return (LABEL_Spry_Widget_MenuBar);
		}
		case "Spry.Widget.TabbedPanels":
		{
			return (LABEL_Spry_Widget_TabbedPanels);
		}
		case "Spry.Widget.ValidationCheckbox":
				{
					return (LABEL_Spry_Widget_ValidationCheckBox);
		}
		case "Spry.Widget.Tooltip":
		{
			return (LABEL_Spry_Widget_Tooltip);
		}

		case "Spry.Widget.ValidationConfirm":
		{
			return (LABEL_Spry_Widget_ValidationConfirm);
		}
		case "Spry.Widget.ValidationPassword":
		{
			return (LABEL_Spry_Widget_ValidationPassword);
		}
		case "Spry.Widget.ValidationRadio":
		{
			return (LABEL_Spry_Widget_ValidationRadio);
		}
		case "Spry.Widget.ValidationSelect":
		{
			return (LABEL_Spry_Widget_ValidationSelect);
		}
		case "Spry.Widget.ValidationTextarea":
		{
			return (LABEL_Spry_Widget_ValidationTextArea);
		}
		case "Spry.Widget.ValidationTextField":
		{
			return (LABEL_Spry_Widget_ValidationTextField);
		}
		case "Spry.Widget":
		{
			return (LABEL_Spry_Widget);
		}
		default:
		{
			return (LABEL_Other);
		}
	}

	return result;

} //getDynamicContent

function isValidationRadioSelected()
{
	  var bCanInspectSelection = false;
	  var dom = dw.getDocumentDOM();
	  var selectedNode = dom.getSelectedNode(true, false, true);

	  var attr;

	  if( selectedNode && selectedNode.getTranslatedAttribute )
	  {
	    attr = selectedNode.getTranslatedAttribute("Spry.Widget.ValidationRadio");
	  }

	  if( attr && attr.length > 0 )
	  {
	    bCanInspectSelection = true;

/*	    //if the widget manager is out of sync, run the translator
	    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
	    if( !widgetMgr.getWidget("Spry.Widget.ValidationRadio", selectedNode.id ) )
	    {
	      dom.runTranslator("Spry Widget");

	      if( !widgetMgr.getWidget('Spry.Widget.ValidationRadio', selectedNode.id ) )
	      {
	        // Running the translator failed to create a design time object
	        // for this widget. Either caInspectSelection() was called in the
	        // middle of an edit operation, which prevents the translator from
	        // running right now, or an error occurred during the translation.

	        bCanInspectSelection = false;
	      }
	    }*/
	  }

  return bCanInspectSelection; //comments in html file limit us to just one tag
}
function isValidationPasswordSelected()
{
  var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode(true, false, true);

  var attr;

  if( selectedNode && selectedNode.getTranslatedAttribute )
  {
    attr = selectedNode.getTranslatedAttribute("Spry.Widget.ValidationPassword");
  }

  if( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;

  /*  //if the widget manager is out of sync, run the translator
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if( !widgetMgr.getWidget("Spry.Widget.ValidationPassword", selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if( !widgetMgr.getWidget('Spry.Widget.ValidationPassword', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    }*/
  }

  return bCanInspectSelection; //comments in html file limit us to just one tag

}

function isValidationConfirmSelected()
{
 var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode(true, false, true);

  var attr;

  if( selectedNode && selectedNode.getTranslatedAttribute )
  {
    attr = selectedNode.getTranslatedAttribute("Spry.Widget.ValidationConfirm");
  }

  if( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;

 /*   //if the widget manager is out of sync, run the translator
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if( !widgetMgr.getWidget("Spry.Widget.ValidationConfirm", selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if( !widgetMgr.getWidget('Spry.Widget.ValidationConfirm', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    }*/
  }

  return bCanInspectSelection; //comments in html file limit us to just one tag
}

function isValidationCheckBoxSelected()
{

 var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode(true, false, true);
  var attr;

  if( selectedNode && selectedNode.getTranslatedAttribute )
  {
    attr = selectedNode.getTranslatedAttribute('Spry.Widget.ValidationCheckbox');
  }

  if( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;

   /* //if the widget manager is out of sync, run the translator
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if( !widgetMgr.getWidget('Spry.Widget.ValidationCheckbox', selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if( !widgetMgr.getWidget('Spry.Widget.ValidationCheckbox', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    }*/
  }

  return bCanInspectSelection; //comments in html file limit us to just one tag
}

function isTooltipSelected()
{
	 var bCanInspectSelection = false;
	  var dom = dw.getDocumentDOM();
	  var selectedNode = dom.getSelectedNode(true, false, true);

	  var attr;

	  if( selectedNode && selectedNode.getTranslatedAttribute )
	  {
	    attr = selectedNode.getTranslatedAttribute("Spry.Widget.Tooltip");
	  }

	  if( attr && attr.length > 0 )
	  {
	    bCanInspectSelection = true;

	  /*  //if the widget manager is out of sync, run the translator
	    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
	    if( !widgetMgr.getWidget("Spry.Widget.Tooltip", selectedNode.id ) )
	    {
	      dom.runTranslator("Spry Widget");

	      if( !widgetMgr.getWidget('Spry.Widget.Tooltip', selectedNode.id ) )
	      {
	        // Running the translator failed to create a design time object
	        // for this widget. Either caInspectSelection() was called in the
	        // middle of an edit operation, which prevents the translator from
	        // running right now, or an error occurred during the translation.

	        bCanInspectSelection = false;
	      }
	    }*/
	  }

  return bCanInspectSelection; //comments in html file limit us to just one tag
}

function isMenuBarSelected()
{
 var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode();

  if ( !selectedNode || !selectedNode.getTranslatedAttribute )
    return false;

  var attr = selectedNode.getTranslatedAttribute('Spry.Widget.MenuBar');

  if( attr && attr.length > 0 )
  {
	  bCanInspectSelection = true;

	 /* //if the widget manager is out of sync, run the translator
	  var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
	  if( !widgetMgr.getWidget('Spry.Widget.MenuBar', selectedNode.id ) )
	  {
	  	dom.runTranslator("Spry Widget");
	    if( !widgetMgr.getWidget('Spry.Widget.MenuBar', selectedNode.id ) )
		{
			//If we can't get it now there's some error where the translator is
			//marking this as found, but the widget manager isn't finding it
			bCanInspectSelection = false;
		}
	  }*/
  }

  return bCanInspectSelection;
}


function isTabbedPanelsSelected()
{
 var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode();

  if ( !selectedNode || !selectedNode.getTranslatedAttribute )
    return false;

  var attr = selectedNode.getTranslatedAttribute('Spry.Widget.TabbedPanels');

//	alert('TabbedPanel:'+attr);
  if( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;
/*
    // If the widget manager is out of sync, run the translator.
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if( !widgetMgr.getWidget('Spry.Widget.TabbedPanels', selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if( !widgetMgr.getWidget('Spry.Widget.TabbedPanels', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    } */
  }

  return bCanInspectSelection;
}

function isCollapsiblePanelSelected()
{
  var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode();

  if ( !selectedNode || !selectedNode.getTranslatedAttribute )
    return false;

  var attr = selectedNode.getTranslatedAttribute('Spry.Widget.CollapsiblePanel');

  if ( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;

 /*   // If the widget manager is out of sync, run the translator.
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if ( !widgetMgr.getWidget('Spry.Widget.CollapsiblePanel', selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if ( !widgetMgr.getWidget('Spry.Widget.CollapsiblePanel', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    } */
  }

  return bCanInspectSelection;
}

function isAccordionSelected()
{
	 var bCanInspectSelection = false;
	  var dom = dw.getDocumentDOM();
	  var selectedNode = dom.getSelectedNode();

	  if ( !selectedNode || !selectedNode.getTranslatedAttribute )
	    return false;

	  var attr = selectedNode.getTranslatedAttribute('Spry.Widget.Accordion');

	  if ( attr && attr.length > 0 )
	  {
	    bCanInspectSelection = true;
/*
	    // If the widget manager is out of sync, run the translator
	    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
	    if ( !widgetMgr.getWidget('Spry.Widget.Accordion', selectedNode.id ) )
	    {
	      dom.runTranslator("Spry Widget");

	      if ( !widgetMgr.getWidget('Spry.Widget.Accordion', selectedNode.id ) )
	      {
	        // Running the translator failed to create a design time object
	        // for this widget. Either caInspectSelection() was called in the
	        // middle of an edit operation, which prevents the translator from
	        // running right now, or an error occurred during the translation.

	        bCanInspectSelection = false;
	      }
	    } */
	  }

  return bCanInspectSelection;
}

function isValidationTextFieldSelected()
{

 var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode(true, false, true);

  var attr;

  if( selectedNode && selectedNode.getTranslatedAttribute )
  {
    attr = selectedNode.getTranslatedAttribute("Spry.Widget.ValidationTextField");
  }

  if( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;

  /*    //if the widget manager is out of sync, run the translator
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if( !widgetMgr.getWidget("Spry.Widget.ValidationTextField", selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if( !widgetMgr.getWidget('Spry.Widget.ValidationTextField', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    }*/
  }

  return bCanInspectSelection; //comments in html file limit us to just one tag
}

function isValidationTextAreaSelected()
{
 var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode(true, false, true);
  var attr;

  if( selectedNode && selectedNode.getTranslatedAttribute )
  {
    attr = selectedNode.getTranslatedAttribute("Spry.Widget.ValidationTextarea");
  }

  if( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;

  /*  //if the widget manager is out of sync, run the translator
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if( !widgetMgr.getWidget("Spry.Widget.ValidationTextarea", selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if( !widgetMgr.getWidget('Spry.Widget.ValidationTextarea', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    }*/
  }

  return bCanInspectSelection; //comments in html file limit us to just one tag
}

function isValidationSelectSelected()
{
 var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode(true, false, true);

  if ( !selectedNode || !selectedNode.getTranslatedAttribute )
    return false;

  var attr = selectedNode.getTranslatedAttribute('Spry.Widget.ValidationSelect');
//	alert('validationSelect:' + attr);
  if( attr && attr.length > 0 )
  {
    bCanInspectSelection = true;

    /* //if the widget manager is out of sync, run the translator
    var widgetMgr = Spry.DesignTime.Widget.Manager.getManagerForDocument(dom);
    if( !widgetMgr.getWidget('Spry.Widget.ValidationSelect', selectedNode.id ) )
    {
      dom.runTranslator("Spry Widget");

      if( !widgetMgr.getWidget('Spry.Widget.ValidationSelect', selectedNode.id ) )
      {
        // Running the translator failed to create a design time object
        // for this widget. Either caInspectSelection() was called in the
        // middle of an edit operation, which prevents the translator from
        // running right now, or an error occurred during the translation.

        bCanInspectSelection = false;
      }
    }*/
  }

  return bCanInspectSelection; //comments in html file limit us to just one tag
}


function isSpryWidgetSelected()
{
  var bCanInspectSelection = false;
  var dom = dw.getDocumentDOM();
  var selectedNode = dom.getSelectedNode(true, false, true);

  var transAttrs;
  var attr;

  if( selectedNode && selectedNode.translatedAttributes )
  {
    transAttrs = selectedNode.translatedAttributes;

    for (var i=0; i < transAttrs.length; i++)
    {
      attr = transAttrs[i].name.toLowerCase();
	  
      if (attr.indexOf('spry.widget') != -1)
      {
        bCanInspectSelection = true;
        break;
      }
    }
  }

  return bCanInspectSelection; //comments in html file limit us to just one tag

}

</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>
