<!-- tag:CF_PIGLATIN,priority:5,selection:exact,vline,hline -->
<!DOCTYPE HTML SYSTEM "-//Macromedia//DWExtension layout-engine5.0//pi">
<HTML>
<HEAD>
<TITLE>CF_Piglatin Inspector</TITLE>
<SCRIPT LANGUAGE="JavaScript">

function canInspectSelection(){
  return true;
}

function inspectSelection(){
  // the value of the SYLLABLE attribute
  var syllableIndex = -1;
  
  // If there was a SYLLABLE attribute
  if (theSyllable){
    // If the value of SYLLABLE is "ay", set syllableIndex to 0
    if (theSyllable.toLowerCase() == "ay"){
      syllableIndex = 0;
    // If the value of SYLLABLE is "ey", set syllableIndex to 1
    }else if (theSyllable.toLowerCase() == "ey"){
      syllableIndex = 1;
    // If the value of SYLLABLE is "oy", set syllableIndex to 2
    }else if (theSyllable.toLowerCase() == "oy"){
      syllableIndex = 2;
    }
  }
  
  // If the value of the SYLLABLE attribute was set,
  // choose the corresponding option from the pop-up menu
  if (syllableIndex!= -1){
    document.topLayer.document.topLayerForm.intSyllable.
    selectedIndex = syllableIndex;
  }
}

function setPiglatinTag(){
  // Get the DOM of the current document
  var theDOM = dw.getDocumentDOM();
  // Get the selected node
  var theObj = theDOM.getSelectedNode();
  
  // Get the index of the selected option in the pop-up menu
  var syllableIndex = document.topLayer.document.
  topLayerForm.intSyllable.selectedIndex;
  // Get the value of the selected option in the pop-up menu
  var theSyllable = document.topLayer.document.
  topLayerForm.intSyllable.options[syllableIndex].value;

  // Set the value of the SYLLABLE attribute to theSyllable
  theObj.setAttribute('syllable',theSyllable);
}

</SCRIPT>
</HEAD>

<BODY>
<SPAN ID="image" STYLE="position:absolute; width:23px; 
height:17px; z-index:16; left: 3px; top: 2px">
<IMG SRC="piggy.gif" WIDTH="36" HEIGHT="36" 
NAME="pigImage">
</SPAN> 
<SPAN ID="label" STYLE="position:absolute; width:23px; 
height:17px; z-index:16; left: 44px; top: 5px">CF_Piglatin</SPAN>

<!-- If your form fields are in different layers, you must 
create a separate form inside each layer and reference it as 
shown in the inspectSelection() and setInterjectionTag() 
functions above. -->

<SPAN ID="topLayer" STYLE="position:absolute; z-index:1; 
left: 125px; top: 3px; width: 431px; height: 32px">
<FORM NAME="topLayerForm">
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR> 
<TD VALIGN="baseline" ALIGN="right">Syllable:</TD>
<TD VALIGN="baseline" ALIGN="right"> 
<SELECT NAME="intSyllable" STYLE="width:86" 
onChange="setPiglatinTag()">
<OPTION VALUE="ay">AY</OPTION>
<OPTION VALUE="ey">EY</OPTION>
<OPTION VALUE="oy">OY</OPTION>
</SELECT>
</TR>
</TABLE>
</FORM>
</SPAN>

</BODY>
</HTML>
