<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_Image = dw.loadString('Menus/MM/CC_Properties/LABEL_Image');
var LABEL_Table = dw.loadString('Menus/MM/CC_Properties/LABEL_Table');
var LABEL_Link = dw.loadString('Menus/MM/CC_Properties/LABEL_Link');
var LABEL_WAPayPal = dw.loadString('Menus/MM/CC_Properties/LABEL_WAPayPal');
var LABEL_WAGoogleFree = dw.loadString('Menus/MM/CC_Properties/LABEL_WAGoogleFree');
var LABEL_Anchor = dw.loadString('Menus/MM/CC_Properties/LABEL_Anchor');
var LABEL_Flash = dw.loadString('Menus/MM/CC_Properties/LABEL_Flash');
var LABEL_Movie = dw.loadString('Menus/MM/CC_Properties/LABEL_Movie');
var LABEL_PDF = dw.loadString('Menus/MM/CC_Properties/LABEL_PDF');    //gsrupdate hitch - to handle pdf properties
var LABEL_HorizontalRule = dw.loadString('Menus/MM/CC_Properties/LABEL_HorizontalRule');
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 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;
		}
		case "image":
		{
			dw.showProperties('image');
			break;
		}
		case "table":
		{
			dw.showProperties('table cells');
			break;
		}
		case "horizontal rule":
		{
			dw.runCommand("ccHR.htm");
			break;
		}
		case "link":
		{
			dw.getDocumentDOM().setCCLink('-1');
			break;
		}
		case "anchor":
		{
			dw.runCommand( "EditAnchor.htm" );
			break;
		}
		case "flash":
		{
			dw.runCommand( "EditFlashMovie.htm" );
			break;
		}
		case "flashVideo":
		{
			dw.runCommand( "EditFlashVideo.htm" );
			break;
		}
     	case "movie":
   		{
      		dw.runCommand( "EditMovie.htm" );
      		break;
    	}
    	case "pdf":			//gsrupdate hitch - pdf properties
		{
			dw.runCommand( "EditPDF.htm" );
			break;
    	}
		case "WAPayPal":
		{
			dw.runCommand(dw.getDocumentDOM().getSelectedNode().edit);
			break;
		}
		case "WAGoogleFree":
		{
			dw.runCommand(dw.getDocumentDOM().getSelectedNode().edit);
			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()
{
	var dom = dw.getDocumentDOM ("document");
	var offsets = dom.getSelection ();
	var theSelection = dw.offsetsToNode (offsets[0], offsets[1]);
	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";
	}
	if (theSelection.nodeType == Node.ELEMENT_NODE && theSelection.tagName == 'IMG')
	{
		return "image";
	}
	if (theSelection.nodeType == Node.ELEMENT_NODE && theSelection.type == 'WAPayPal')
	{
	    // for eto we dont want to have it selected
	    if ( ! dom.getCCSharedSetting_TextOnlyInNonTemplates() )
		    return "WAPayPal";
	}
	if (theSelection.nodeType == Node.ELEMENT_NODE && theSelection.type == 'WAGoogleFree')
	{
	    // for eto we dont want to have it selected
	    if ( ! dom.getCCSharedSetting_TextOnlyInNonTemplates() )
		    return "WAGoogleFree";
	}

  //if it's an object, determine if movie file type or flash
	if ( !dw.getDocumentDOM().getCCSharedSetting_TextOnlyInNonTemplates() &&
	     theSelection.nodeType == Node.ELEMENT_NODE &&
		 theSelection.tagName == 'OBJECT')
	{
		var retVal = "";
		for( var index in theSelection.childNodes )
		{
			var node = theSelection.childNodes[index];
			if ( node.tagName == 'PARAM' )
			{
				var paramName = node.getAttribute("name");  //get the name of the param tag
				if (paramName)
				{
					paramName = paramName.toLowerCase();
					if (paramName == "movie")
					{
						var paramValue;
						paramValue = node.value;
						if ( paramValue.search(".swf") != -1 )
						{
							if ( retVal != "flashVideo" )
								retVal = "flash" ;
						}
					}

					if (paramName == "flashvars")				// get values from flashVars
					{
						var paramValue;
						paramValue = node.value;
						if (paramValue) {
							paramValue = paramValue.toLowerCase();
							if (/streamname/i.test(paramValue))
							if (/skinname/i.test(paramValue))
							{
								retVal = "flashVideo";
							}
						}
					}
				}
			}

			if ( node.tagName == 'EMBED' )
			{
				// make sure we return flash video if flashvars have skin & stream
				var paramVal;
				paramVal = node.getAttribute("flashvars");
				if(paramVal)
				{
					paramVal = paramVal.toLowerCase();
					if(/streamname/i.test(paramVal))
						if(/skinname/i.test(paramVal))
						{
							retVal = "flashVideo";
						}
				}

				if ((node.getAttribute("type") == "application/x-shockwave-flash") && (!retVal))
					retVal = "flash";

				if (( node.getAttribute( "type" ) == "application/pdf" ) && (!retVal))
					retVal = "pdf";		//gsrupdate hitch - pdf properties
			}
		}
    if (!retVal) //if not flash, keep checking
    {
      var classId = theSelection.classId;  //get the CLASSID from the selected object tag
      if (classId)
      {
        classId = classId.toLowerCase();
        var CLASSID_QUICKTIME = "clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b";
        var CLASSID_WINDOWSMP = "clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95";
        if ((classId == CLASSID_QUICKTIME) || (classId == CLASSID_WINDOWSMP))  //if movie classID
        {
          retVal = "movie";
        }
      }
    }
    if (retVal)
    {
      return retVal;
    }
	}

	if (theSelection.nodeType == Node.ELEMENT_NODE && theSelection.tagName == 'HR')
	{
		return "horizontal rule";
	}


	if (dom.isLinkSelected())
	{
		return "link";
	}

	if (theSelection.nodeType == Node.ELEMENT_NODE && theSelection.tagName == 'A' && theSelection.getAttribute("name"))
	{
		return "anchor";
	}

	if (dw.getDocumentDOM() != null && dw.getFocus() == 'document' && dw.getDocumentDOM().getParseMode() == 'html'
		&& dw.getDocumentDOM().isInsideTable() && !dw.getDocumentDOM().isTableLocked())
	{
		return "table";
	}

	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);
		}
		case "image":
		{
			return (LABEL_Image);
		}

		case "table":
		{
			return (LABEL_Table);
		}

		case "anchor":
		{
			return (LABEL_Anchor);
		}

		case "flash":
		{
			return (LABEL_Flash);
		}
		case "flashVideo":
		{
			return (LABEL_Movie);
		}

   	    case "movie":
    	{
   		  	 return (LABEL_Movie);
   		}
		case "pdf":
		{
			 return (LABEL_PDF);
		}
		case "horizontal rule":
		{
			return (LABEL_HorizontalRule);
		}

		case "link":
		{
			return (LABEL_Link);
		}
		case "WAPayPal":
		{
			return (LABEL_WAPayPal);
		}
		case "WAGoogleFree":
		{
			return (LABEL_WAGoogleFree);
		}
		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');

  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');

  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>
