<?xml version="1.0" encoding="UTF-8"?>
<!--
****************************************************************************

     File Name:   imAppLib.box

****************************************************************************
   C O P Y R I G H T   A N D   C O N F I D E N T I A L I T Y   N O T I C E
****************************************************************************

//      Copyright (c) 2006 AOL LLC.  All rights reserved.
//      This software contains valuable confidential and proprietary
//      information of AOL LLC. and is subject to applicable
//      licensing agreements.  Unauthorized reproduction, transmission or
//      distribution of this file and its contents is a violation of
//      applicable laws.
//
//            A O L   C O N F I D E N T I A L

****************************************************************************
-->


<!DOCTYPE window [
  <!ENTITY % mainGadgets SYSTEM "box://aimToolkit/resources/localization.dtd">
  <!ENTITY % general SYSTEM "box://imApp/resources/imAppLib.dtd">
  <!ENTITY % away SYSTEM "box://imApp/resources/im.dtd">
  %mainGadgets;
  %general;
  %away;
]>



<?import href="box://aimToolkit/content/gadgets.box"?>
<?import href="box://aimToolkit/theme/toolkit.box"?>
<?import href="box://imApp/theme/coreGadgetStyles.box"?>
<?import href="box://imApp/content/imAppLibStyles.box"?>

<library xmlns="http://www.aol.com/boxely/resource.xsd"
	        xmlns:box="http://www.aol.com/boxely/box.xsd"
	        xmlns:s="http://www.aol.com/boxely/style.xsd"
	        xmlns:on="http://www.aol.com/boxely/reaction.xsd"
	        persists="true">
    <gadget id="awayMessageEditor" type="box" language="jscript" script="box://imApp/content/prefs/prefMessagePanel.js">
        <script language="jscript" href="box://imApp/content/htmlSupport.js"/>
        <attributes aolInputLabel="&im.newAway.typeTitleHere;" awayTitle="&im.newAway.enterTitle;" messageTitle="&im.newAway.enterMessage;" leftCollapse="true"
            inputTitleTab="1" dhtmlTab="2" listOfMessagesTab="6"/>
        <parts>
            <box:vbox s:flex="1">
                <box:hbox s:flex="1">
                    <box:vbox id="hboxListAndEdit" s:flex="1" s:stroke="none url(#pen.aimWindow.contentSection.border) none none" s:strokeWidth="1" s:padding="9 1 1 1" inherits="collapsed=leftCollapse">	
                        <box:aolListBox	id="lstStatusMessages" selectMode="single" inherits="tabIndex=listOfMessagesTab" s:overflow="scroll" s:maxHeight="auto" s:flex="1"
                            accName="&pref.message.titleListbox.accName;" on:select="gadget:updateOnListSelectionChange();">
                            <box:columns>					            
                                <box:aolColumn/>
                                <box:aolColumn id="colMessageTitle" s:flex="1"/>
                            </box:columns>
                            <box:rows id="rowsStatusMessage" focusMode="ignore"/>
                            <box:reaction event="keyPress" keyCode="DELETE" action="gadget:onDeleteMessage();"/>
                        </box:aolListBox>
                        <box:hbox s:hAlign="left" s:padding="6 6 8 6" s:hSpace="3">
                            <box:aolButton id="btnNew" label="&im.quickAway.new;" on:command="gadget:onNewMessage();" tabIndex="7" s:margin="0"/>
                            <box:aolButton id="btnDelete" label="&im.quickAway.delete;" on:command="gadget:onDeleteMessage();" tabIndex="8" s:margin="0"/>
                            <box:aolButton id="btnUseThisMessage" label="&im.quickAway.default;" labelUse="&im.quickAway.default;" labelDefault="&im.quickAway.default;" on:command="gadget:onMakeCurrentMessageDefault();" tabIndex="9" s:padding="4 10 4 10" s:margin="0"/>
                        </box:hbox>   
                    </box:vbox>	
                    <box:hbox s:flex="1">
                        <box:vbox s:flex="1" s:padding="8" s:vSpace="4">
                            <box:aolLabel inherits="value=awayTitle" s:fontBold="true" />
                                <box:hbox>
                                    <box:aolInput id="inputTitle" inherits="value=aolInputLabel,tabIndex=inputTitleTab" s:flex="1" maxlength="97" on:blur="gadget:onInputTitleEdited();" on:modified="gadget:onTitleChange(); " >
                                        <box:reaction event="keyPress" keyCode="ENTER" action="gadget:onInputTitleEdited();" />
                                    </box:aolInput>
                                </box:hbox>
                            <box:aolLabel inherits="value=messageTitle" s:fontBold="true" s:marginTop="11"/>
                            <box:vbox s:flex="1" s:stroke="url(#pen.aimWindow.contentSection.border)" s:strokeWidth="1">
                                <box:vbox s:flex="1" on:blur="gadget:onMessageEditComplete();" s:padding="1">
                                    <box:imAppFontToolbar id="fontbar"/>
                                    <box:imAppEditor context="awayContext" id="editMessage" s:flex="1" s:stroke="red" s:strokeWidth="1" inherits="tabIndex=dhtmlTab"
                                        fontbar="fontbar" 
                                        href="box://imApp/content/prefs/messageTemplate.html"
                                        messageIndex="-1" smileyKeySupportingBar="fontbar" 
                                        wantTab="false" on:focus="gadget:onEditFocused();" on:blur="gadget:onEditDoesNotHaveFocus();" on:modified="gadget:onTestMessageLength();" 
                                        on:dragOver="gadget:onEditorDragOver();" on:dragDrop="gadget:onEditorDragDrop();">
                                        <box:reaction event="attributeSet" attributeName="editorInitialized" action="gadget:onMessageEditReady();" />
                                    </box:imAppEditor>
                                </box:vbox>
                            </box:vbox>
                            <box:vbox s:hAlign="center">
                                <box:aolLabel value="&im.quickAway.specialCharacters;" s:textColor="#747474" s:margin="-2 0 8 0" />
                            </box:vbox>   
                        </box:vbox>
                    </box:hbox>              
                </box:hbox>         
            </box:vbox>
            <box:menupopup id="awayContext" popupAlign="cursor_left_top" on:popping="gadget:awayMenuPop();" style="popupWithoutTransition">
                <box:aolMenuItem label="&im.form.favorites.insertHyperlink;" id="insertHyperlink" on:command="gadget:contextCommand('insertHyperlink');" acceltext="&im.form.favorites.insertHyperlink_acceltext;" accesskey="&im.form.favorites.insertHyperlink_accesskey;" />
                <box:aolMenuSeparator/>
                <box:aolMenuItem label="&im.form.undo;" id="inputundoMenu" on:command="gadget:contextCommand('undo');" acceltext="&im.form.undo_acceltext;" accesskey="&im.form.undo_accesskey;" />
                <box:aolMenuItem label="&im.form.redo;" id="inputredoMenu" on:command="gadget:contextCommand('redo');" acceltext="&im.form.redo_acceltext;" accesskey="&im.form.redo_accesskey;" />
                <box:aolMenuItem label="&im.form.cut;"  id="inputcutMenu" on:command="gadget:contextCommand('cut');" acceltext="&im.form.cut_acceltext;" accesskey="&im.form.cut_accesskey;"/>
                <box:aolMenuItem label="&im.form.copy;" id="inputcopyMenu" on:command="gadget:contextCommand('copy');" acceltext="&im.form.copy_acceltext;" accesskey="&im.form.copy_accesskey;" />
                <box:aolMenuItem label="&im.form.paste;" id="inputpasteMenu" on:command="gadget:contextCommand('paste');" acceltext="&im.form.paste_acceltext;" accesskey="&im.form.paste_accesskey;" />
                <box:aolMenuItem label="&im.form.selectall;" on:command="gadget:contextCommand('selectAll');" acceltext="&im.form.selectall_acceltext;" accesskey="&im.form.selectall_accesskey;" />
                <box:aolMenuItem label="&im.form.print;" on:command="gadget:contextCommand('print');"  acceltext="&im.form.print_acceltext;" accesskey="&im.form.print_accesskey;" />
            </box:menupopup> 
        </parts>
        <behavior>
            <reaction event="boxDestroyed" action="gadget:onBoxDestroyed();"/>
        </behavior>
    </gadget>

	<gadget id="displayAndEdit" type="box" language="jscript" script="box://imApp/content/prefs/displayAndEdit.js">
        <attributes focusMode="defer" editMode="false" label="" placeholder="false" 
            accNameAt="label" accDefaultAction="&pref.message.titleListbox.accDefualtAction;" autoEditOnClick="false"/>
        <parts>
            <box:aolLabel id="label" plaintext="true" fontBold="true" inherits="$fontBold=fontBold,placeholder">
                <box:binding elementSource="_gadget" targetProperty="value" path="label" method="twoWay"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="editMode" method="twoWay"/>
            </box:aolLabel>
            <box:aolInput id="input" collapsed="true" maxLength="97">
                <box:binding elementSource="_gadget" targetProperty="backup" path="label" method="twoWay"/>
                <box:reaction event="keyPress" keyCode="RETURN" action="gadget:onEditSave();"/> 
                <box:reaction event="keyPress" keyCode="TAB" action="gadget:onEditSave();"/> 
                <box:reaction event="keyPress" keyCode="ESCAPE" action="gadget:onEditAbort();"/> 
                <box:reaction event="modified" action="gadget:onModified();"/> 
                <box:reaction event="blur" action="gadget:onLostFocus();"/> 
            </box:aolInput>
        </parts>
        <behavior>
            <reaction event="attributeSet" attributeName="editMode" action="gadget:onEditModeChanged();" />
            <reaction event="message" action="gadget:onMessage();" />
            <reaction event="mouseDown" action="gadget:testForSecondClick();"/>
            <reaction event="click" action="gadget:editOnSecondClick();"/>
        </behavior>
    </gadget>

    <gadget id="imColorPanel" type="select" inherits="#aolColorPanel" language="jscript" code="box://imApp/content/imColorPanel.js"/>

    <gadget id="imFontBarTextButton" type="select" inherits="#menuBox">
        <attributes popup="_child" blockEvents="true"
            accRole="buttonMenu" textColor="#000000" textColorAdd="#00000000" 
            fill="none" hideSample="false"/>
        <parts>
            <box:hbox id="container">
                <box:box id="frame" inherits="$fill=fill">
                    <box:aolLabel value="&fontToolbar.text.sample;" id="sample" ornament="true" inherits="hidden=hideSample,$textColor=textColor"/>
                </box:box>
                <box:box id="separator">
                    <box:binding elementSource="_gadget" targetProperty="$fill" path="$stroke" method="oneWay"/>
                </box:box>
                <box:box id="dropdown" ornament="true"/>
            </box:hbox>
        </parts>
        <behavior inherits="box://aimToolkit/content/behaviors.box#selectable"/>
    </gadget>

    <gadget id="imFontBarImageButton" type="select" inherits="#menuBox">
        <attributes popup="_child" blockEvents="true"
            accRole="buttonMenu" fill="none"
            collapseDropMark="false"/>
        <parts>
            <box:hbox id="container">
                <box:image id="sample" ornament="true" inherits="src=icon"/>
                <box:box id="dropdown" inherits="collapsed=collapseDropMark" ornament="true"/>
            </box:hbox>
        </parts>
        <behavior inherits="box://aimToolkit/content/behaviors.box#selectable"/>
    </gadget>

    <gadget id="imFontBarSpacer" type="box">
        <attributes s:fill="url(#bmp.text.toolbarbutton.separator)" s:fillRepeat="y" s:width="2" s:pading="0 3"/>
    </gadget>
    
    <gadget id="imAppFontBarPopup" type="box" language="jscript" code="box://imApp/content/imAppFontBarPopup.js">
        <attributes fontList="&aolFontbar.fontList;"/>
        <parts>
            <box:imFontBarSpacer/>
            <box:aolImageButton icon="box://imApp/resources/inactive_x.png" focusMode="ignore" tooltip="&FontBar.close.popup;"/>

            <box:binding elementSource="_gadgetParent" targetProperty="fontName" path="fontName" method="twoWay"/>
            <box:binding elementSource="_gadgetParent" targetProperty="fontSizeIndex" path="fontSizeIndex" method="twoWay"/>
            <box:binding elementSource="_gadgetParent" targetProperty="fgColor" path="fgColor" method="twoWay"/>
            <box:binding elementSource="_gadgetParent" targetProperty="bkColor" path="bkColor" method="twoWay"/>
            <box:binding elementSource="_gadgetParent" targetProperty="windowColor" path="windowColor" method="twoWay"/>
            <box:binding elementSource="_gadgetParent" targetProperty="fontDefault" path="fontDefault" method="twoWay"/>
        </parts>
    </gadget>
    
    <gadget id="imFontBarMenuBox" type="select" language="jscript" code="box://aimToolkit/content/menuPack/aolCombobox.js">
        <attributes wantEnter="false" blockEvents="true" focusMode="normal" popup="_child" ignoreMouseDown="true" accRole="comboBox" showImage="false"/>
        <parts>
            <box:image id="image" ornament="true">
                <box:binding elementSource="_gadget" targetProperty="src" path="displayImg" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="showImage" method="oneWay" sourceTransformer="toolkit:not"/>
            </box:image>
            <box:aolLabel id="label" ornament="true">
                <box:binding elementSource="_gadget" targetProperty="$width" path="labelWidth" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="$maxWidth" path="labelWidth" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="value" path="display" method="oneWay"/>
                <box:binding elementSource="_gadget" targetProperty="collapsed" path="showImage" method="oneWay"/>
            </box:aolLabel>
            <box:box id="separator">
                <box:binding elementSource="_gadget" targetProperty="$fill" path="$stroke" method="oneWay"/>
            </box:box>
            <box:box focusMode="defer" id="menuArea">
                <box:box id="dropdown" ornament="true"/>
                <box:comboPopup id="thePopup" inherits="listHeight" popupAlign="after_start" showNoActivate="false" on:popping="gadget:onPopping();" on:shutting="gadget:onPopupClosed();"
                    on:command="gadget:onCommand();" on:popped="gadget:onPopped();">
                    <box:content/>
                    <box:reaction event="keyPress" keyCode="UP" alt="false" override="true" action="gadget:updateLabel(true);"/>
                    <box:reaction event="keyPress" keyCode="DOWN" alt="false" override="true" action="gadget:updateLabel(false);"/>
                    <box:reaction event="keyDown" keyCode="ALT" action="toolkit:StopEventPropagation"/>
                    <box:reaction event="mouseWheel" detail="1" action="gadget:onMouseWheel(1);"/>
                    <box:reaction event="mouseWheel" detail="-1" action="gadget:onMouseWheel(-1);"/>
                </box:comboPopup>
            </box:box>
        </parts>
        <behavior>
            <reaction event="keyPress" keyCode="DOWN" alt="true" action="gadget:showPopup();"/>
            <reaction event="keyPress" keyCode="UP" alt="true" action="gadget:showPopup();"/>
            <reaction event="keyPress" alt="false" action="gadget:onKeyPress();"/>
            <reaction event="keyPress" keyCode="TAB" action="gadget:onTabPress();"/>
            <reaction event="keyPress" shift="true" keyCode="TAB" action="gadget:onTabPress();"/>
            <reaction event="mouseWheel" detail="1" action="gadget:onMouseWheel(1);"/>
            <reaction event="mouseWheel" detail="-1" action="gadget:onMouseWheel(-1);"/>
        </behavior>
    </gadget>
    
    <gadget id="imFontBarPushButton" type="control" inherits="#aolCheckButton">
        <attributes toggleMode="two" selectableMode="item" focusMode="defer" accRole="pushButton"/>
        <parts>
            <box:vbox id="container">
                <box:box id="icon" inherits="$mask=icon"/>
            </box:vbox>
        </parts>
        <behavior inherits="box://aimToolkit/content/behaviors.box#checkbutton"/>
    </gadget>

   
    <gadget id="imAppFontToolbar" type="box" language="jscript" code="box://imApp/content/imAppFontToolbar.js">
        <attributes fontList="&aolFontbar.fontList;" fgColor="black" bkColor="none" windowColor="none"
                fontName="&aolFontbar.fontDefualt;" fontDefault="&aolFontbar.fontDefualt;" fontSizeIndex="2"
                fontSizeLabel="10" bold="false" italic="false" underline="false" focusMode="ignore"
                fontSettingsOnly="false"
                hideSeparators="false"
                fontMenuDisplayFont=""
                chatMode="false"
                />
        <parts>
            <box:vbox s:flex="1">
                <box:hbox id="insideSeparators" s:flex="1" s:vAlign="stretch" s:hSpace="3">
                    <box:separator s:width="1"/>
                    <box:imFontBarMenuBox id="fontFamily" focusMode="ignore" inherits="fontList" 
                    labelWidth="40" on:mouseDown="gadget:loadFontMenu();">
                        <box:aolMenuItem id="fontPlaceHolder"/>
                        <box:aolMenuSeparator id="systemTextToolsSeparator" />
                        <box:aolMenuItem id="systemTextTools" label="&aolFontbar.selectFont;" on:command="gadget:systemFontDialog();"/>
                        <box:reaction event="attributeSet" attributeName="value" action="gadget:targetAttributeToGadgetAttribute( 'value', 'fontName');" />
                        <box:binding elementSource="_gadget" targetProperty="display" path="fontName" method="oneWay"/>
                        <box:binding elementSource="_gadget" targetProperty="tooltip" path="fontName" method="oneWay" sourceTransformer="gadget:setFontFamilyTooltip();"/>
                    </box:imFontBarMenuBox>
                    <box:imFontBarMenuBox id="fontSize" focusMode="ignore" tooltip="&aolFontbar.fontSize.toolTip;">
                        <box:aolMenuItem label="8"  value="1"/>
                        <box:aolMenuItem label="10" value="2" selected="true"/>
                        <box:aolMenuItem label="12" value="3"/>
                        <box:aolMenuItem label="14" value="4"/>
                        <box:aolMenuItem label="18" value="5"/>
                        <box:aolMenuItem label="24" value="6"/>
                        <box:aolMenuItem label="36" value="7"/>
                        <box:binding elementSource="_gadget" targetProperty="display" path="fontSizeLabel" method="twoWay"/>
                        <box:binding elementSource="_gadget" targetProperty="value" path="fontSizeIndex" method="twoWay"/>
                    </box:imFontBarMenuBox>
                    <box:separator s:width="1"/>
                    <box:imFontBarPushButton id="bold" icon="url(#fontbar.brush.bold)" focusMode="ignore" tooltip="&aolFontbar.bold.toolTip;" on:click="gadget:toggleEditor('bold');">
                        <box:binding elementSource="_gadget" targetProperty="toggled" path="bold" method="twoWay"/>
                    </box:imFontBarPushButton>
                    <box:imFontBarPushButton id="italic" icon="url(#fontbar.brush.italic)" focusMode="ignore" tooltip="&aolFontbar.italic.toolTip;" on:click="gadget:toggleEditor('italic');">
                        <box:binding elementSource="_gadget" targetProperty="toggled" path="italic" method="twoWay"/>
                    </box:imFontBarPushButton>
                    <box:imFontBarPushButton id="underline" style="imThemeTextToolbarPushButtonUnderline" icon="url(#fontbar.brush.underline)" focusMode="ignore" tooltip="&aolFontbar.underline.toolTip;" on:click="gadget:toggleEditor('underline');">
                        <box:binding elementSource="_gadget" targetProperty="toggled" path="underline" method="twoWay"/>
                    </box:imFontBarPushButton>
                    <box:separator s:width="1"/>
                    <box:imFontBarTextButton id="textColor" focusMode="ignore" forceStrokeWidth="2" tooltip="&aolFontbar.textColor.toolTip;">
                        <box:aolControlContainingPopup popupAlign="after_start" id="popupTextColor" s:maxWidth="auto" showNoActivate="false">
                            <box:imColorPanel>
                                <box:binding elementSource="_gadget" targetProperty="color" path="fgColor" method="twoWay"/>
                            </box:imColorPanel>
                            <box:vbox id="groupCustomTextColor">
                                <box:aolMenuSeparator/>
                                <box:aolMenuItem id="customTextColor" label="&aolFontbar.setCustomColor;" on:command="gadget:systemColorDialog('fgColor');"/>
                            </box:vbox>
                        </box:aolControlContainingPopup>
                        <box:binding elementSource="_gadget" targetProperty="textColor" path="fgColor" method="oneWay"/>
                    </box:imFontBarTextButton>
                    <box:imFontBarTextButton id="backgroundColor" focusMode="ignore" forceStrokeWidth="2" tooltip="&aolFontbar.textHighlightColor.toolTip;" s:marginLeft="-1">
                        <box:aolControlContainingPopup popupAlign="after_start" id="popupBkColor" s:maxWidth="auto" showNoActivate="false">
                            <box:imColorPanel hideClearButton="false">
                                <box:binding elementSource="_gadget" targetProperty="color" path="bkColor" method="twoWay"/>
                            </box:imColorPanel>
                            <box:vbox id="groupCustomBackgroundColor">
                                <box:aolMenuSeparator/>
                                <box:aolMenuItem id="customBackgroundColor" label="&aolFontbar.setCustomColor;" on:command="gadget:systemColorDialog('bkColor');" />
                            </box:vbox>
                        </box:aolControlContainingPopup>
                        <box:binding elementSource="_gadget" targetProperty="textColor" path="fgColor" method="oneWay"/>
                        <box:binding elementSource="_gadget" targetProperty="fill" path="bkColor" method="oneWay"/>
                        <box:binding elementSource="_gadget" targetProperty="collapsed" path="chatMode" method="oneWay"/>
                    </box:imFontBarTextButton>
                    <box:imFontBarTextButton hideSample="true" id="windowColor" focusMode="ignore" forceStrokeWidth="2" tooltip="&aolFontbar.backgroundColor.toolTip;" s:marginLeft="-1">
                        <box:aolControlContainingPopup popupAlign="after_start" id="popupWindowColor" s:maxWidth="auto" showNoActivate="false">
                            <box:imColorPanel hideClearButton="false">
                                <box:binding elementSource="_gadget" targetProperty="color" path="windowColor" method="twoWay"/>
                            </box:imColorPanel>
                            <box:vbox id="groupCustomWindowColor">
                                <box:aolMenuSeparator/>
                                <box:aolMenuItem id="customWindowColor" label="&aolFontbar.setCustomColor;" on:command="gadget:systemColorDialog('windowColor');"/>
                            </box:vbox>
                        </box:aolControlContainingPopup>
                        <box:binding elementSource="_gadget" targetProperty="fill" path="windowColor" method="oneWay"/>
                        <box:binding elementSource="_gadget" targetProperty="collapsed" path="chatMode" method="oneWay"/>
                    </box:imFontBarTextButton>
                    <box:separator s:width="1"/>
                    <box:imFontBarImageButton inherits="collapsed=fontSettingsOnly" id="favorites" collapseDropMark="true" icon="box://imApp/resources/link.png" focusMode="ignore" tooltip="&menu.hyperlink.ToolTip;" on:click="gadget:editURL();" s:marginLeft="-2"/>
                    <box:imFontBarImageButton inherits="collapsed=fontSettingsOnly" icon="box://imApp/resources/smiley.png" id="smileys" focusMode="ignore" tooltip="&menu.smiley.ToolTip;">
                        <box:reaction event="command" action="gadget:onSmiley();" />
                        <box:menuPopup id="smileyPopup" showNoActivate="false">
                            <box:aolMenuItem id="smiley1" icon="box://aimToolkit/resources/smiley_yellow_01.gif" label="&menu.smiley.standard.label.Smile;" acceltext="&menu.smiley.standard.label.Smile.acceltext;"/>
                            <box:aolMenuItem id="smiley2" icon="box://aimToolkit/resources/smiley_yellow_02.gif" label="&menu.smiley.standard.label.Wink;" acceltext="&menu.smiley.standard.label.Wink.acceltext;"/>
                            <box:aolMenuItem id="smiley3" icon="box://aimToolkit/resources/smiley_yellow_03.gif" label="&menu.smiley.standard.label.Frown;" acceltext="&menu.smiley.standard.label.Frown.acceltext;"/>
                            <box:aolMenuItem id="smiley4" icon="box://aimToolkit/resources/smiley_yellow_04.gif" label="&menu.smiley.standard.label.Tongue;" acceltext="&menu.smiley.standard.label.Tongue.acceltext;"/>
                            <box:aolMenuItem id="smiley5" icon="box://aimToolkit/resources/smiley_yellow_05.gif" label="&menu.smiley.standard.label.UhOh;" acceltext="&menu.smiley.standard.label.UhOh.acceltext;"/>
                            <box:aolMenuItem id="smiley6" icon="box://aimToolkit/resources/smiley_yellow_06.gif" label="&menu.smiley.standard.label.Kiss;" acceltext="&menu.smiley.standard.label.Kiss.acceltext;"/>
                            <box:aolMenuItem id="smiley7" icon="box://aimToolkit/resources/smiley_yellow_07.gif" label="&menu.smiley.standard.label.Yell;" acceltext="&menu.smiley.standard.label.Yell.acceltext;"/>
                            <box:aolMenuItem id="smiley8" icon="box://aimToolkit/resources/smiley_yellow_08.gif" label="&menu.smiley.standard.label.Grin;" acceltext="&menu.smiley.standard.label.Grin.acceltext;"/>
                            <box:aolMenuItem id="smiley9" icon="box://aimToolkit/resources/smiley_yellow_09.gif" label="&menu.smiley.standard.label.MoneyWhereMouth;" acceltext="&menu.smiley.standard.label.MoneyWhereMouth.acceltext;"/>
                            <box:aolMenuItem id="smiley10" icon="box://aimToolkit/resources/smiley_yellow_10.gif" label="&menu.smiley.standard.label.FootInMouth;" acceltext="&menu.smiley.standard.label.FootInMouth.acceltext;"/>
                            <box:aolMenuItem id="smiley11" icon="box://aimToolkit/resources/smiley_yellow_11.gif" label="&menu.smiley.standard.label.Blush;" acceltext="&menu.smiley.standard.label.Blush.acceltext;"/>
                            <box:aolMenuItem id="smiley12" icon="box://aimToolkit/resources/smiley_yellow_12.gif" label="&menu.smiley.standard.label.Angel;" acceltext="&menu.smiley.standard.label.Angel.acceltext;"/>
                            <box:aolMenuItem id="smiley13" icon="box://aimToolkit/resources/smiley_yellow_13.gif" label="&menu.smiley.standard.label.Hmmmm;" acceltext="&menu.smiley.standard.label.Hmmmm.acceltext;"/>
                            <box:aolMenuItem id="smiley14" icon="box://aimToolkit/resources/smiley_yellow_14.gif" label="&menu.smiley.standard.label.Cry;" acceltext="&menu.smiley.standard.label.Cry.acceltext;"/>
                            <box:aolMenuItem id="smiley15" icon="box://aimToolkit/resources/smiley_yellow_15.gif" label="&menu.smiley.standard.label.LipsSealed;" acceltext="&menu.smiley.standard.label.LipsSealed.acceltext;"/>
                            <box:aolMenuItem id="smiley16" icon="box://aimToolkit/resources/smiley_yellow_16.gif" label="&menu.smiley.standard.label.JoeCool;" acceltext="&menu.smiley.standard.label.JoeCool.acceltext;"/>
                            <box:aolMenuSeparator id="changeSmileysSeparator" collapsed="true"/>
                            <box:aolMenuItem id="changeSmileys"  collapsed="true" label="&aolFontbar.changeSmileys;" editCommandType="expressions"/>
                        </box:menuPopup>
                    </box:imFontBarImageButton>
                    <box:content/>  
                </box:hbox>
            <box:hbox id="bottomSeparator" s:height="1" s:fill="#CACAC8"/>
            </box:vbox>
        </parts>
        <behavior>
            <reaction event="command" action="gadget:focusEditor();" />
            <reaction event="attributeSet" attributeName="fontName" action="gadget:setEditorIfDifferent('fontName', 'fontName');" />
            <reaction event="attributeSet" attributeName="fontSizeIndex" action="gadget:onFontSizeSet();" />
            <reaction event="attributeSet" attributeName="fgColor" action="gadget:onFontbarFgColorSet();" />
            <reaction event="attributeSet" attributeName="bkColor" action="gadget:onFontbarBkColorSet();" />
            <reaction event="attributeSet" attributeName="windowColor" action="gadget:onFontbarWindowColorSet();" />
            <reaction event="attributeSet" attributeName="chatMode" action="gadget:clearForChatMode();" />
            <reaction event="presented" action="gadget:onPresented();" />
        </behavior>
    </gadget>



    <animation id="ani.shortTimerLoop" repeatCount="indefinite" dur="50ms">
    </animation>

    <style tag="imAppEditor" id="imAppEditorStyle">
        <attribute name="desiredHeight" animate="url(#ani.shortTimerLoop)"/>
    </style>

    <gadget id="imAppEditor" type="dhtml" language="jscript" code="box://imApp/content/imAppEditor.js">
        <attributes editable="true" minEditorHeight="0" maxEditorHeight="0" defaultFontName="&aolFontbar.fontDefualt;" defaultFontSizeIndex="2"
        smileyKeySupportingBar="" liveResize="true" constrainProportions="true" accRole="dhtml" autoConvertEnter="true"
        editorInitialized="false" />

        <behavior>
            <reaction event="contextChanged" action="gadget:onEditorSelectionChanged();" />
            <reaction event="boxCreated" action="gadget:onOnEditorCreated();"/>
            <reaction event="firstFrame" action="gadget:onEditorLastFrame();" />
            <reaction event="readyStateChanged" action="gadget:initializeInReadyStateThree();" />

            <reaction event="keyPress" ctrl="true" keyCode="A" action="gadget:onCommand('selectAll');"/>
            <reaction event="keyPress" ctrl="true" keyCode="C" action="gadget:onCommand('copy');"/>
            <reaction event="keyPress" ctrl="true" keyCode="&editor.keyCode.Bold;" action="gadget:onCommand('bold');"/>
            <reaction event="keyPress" ctrl="true" keyCode="&editor.keyCode.Italic;" action="gadget:onCommand('italic');"/>
            <reaction event="keyPress" ctrl="true" keyCode="&editor.keyCode.Underline;" action="gadget:onCommand('underline');"/>
            <reaction event="keyPress" ctrl="true" keyCode="&editor.keyCode.Font;" action="gadget:onOpenFontDialogKey();"/>
            <reaction event="keyPress" ctrl="true" keyCode="V" action="gadget:onCommand('paste');"/>
            <reaction event="keyPress" ctrl="true" keyCode="X" action="gadget:onCut();"/>
            <reaction event="keyPress" ctrl="true" keyCode="Y" action="gadget:onCommand('redo');"/>
            <reaction event="keyPress" ctrl="true" keyCode="Z" action="gadget:onCommand('undo');"/>
            <reaction event="keyPress" ctrl="true" keyCode="DELETE" action="gadget:onCut();"/>
            <reaction event="keyPress" ctrl="true" keyCode="INSERT" action="gadget:onCommand('copy');"/>
            <reaction event="keyPress" shift="true" keyCode="INSERT" action="gadget:onCommand('paste');"/>

            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="1" action="gadget:onInsertSmiley(1);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="2" action="gadget:onInsertSmiley(2);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="3" action="gadget:onInsertSmiley(3);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="4" action="gadget:onInsertSmiley(4);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="5" action="gadget:onInsertSmiley(5);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="6" action="gadget:onInsertSmiley(6);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="7" action="gadget:onInsertSmiley(7);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="false" keyCode="8" action="gadget:onInsertSmiley(8);"/>

            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="1" action="gadget:onInsertSmiley(9);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="2" action="gadget:onInsertSmiley(10);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="3" action="gadget:onInsertSmiley(11);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="4" action="gadget:onInsertSmiley(12);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="5" action="gadget:onInsertSmiley(13);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="6" action="gadget:onInsertSmiley(14);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="7" action="gadget:onInsertSmiley(15);"/>
            <reaction event="keyPress" ctrl="true" alt="false" shift="true" keyCode="8" action="gadget:onInsertSmiley(16);"/>

            <reaction event="keyPress" keyCode="DELETE" action="gadget:deleteChars(1);"/>
            <reaction event="keyPress" shift="true" keyCode="DELETE" action="gadget:deleteChars(1);"/>
            <reaction event="keyPress" keyCode="BACK" action="gadget:deleteChars(-1);"/>
            <reaction event="keyPress" shift="true" keyCode="BACK" action="gadget:deleteChars(-1);"/>
            <reaction event="keyPress" ctrl="true" keyCode="BACK" action="gadget:deleteChars(-1, 'word');"/>

            <box:reaction event="keyPress" ctrl="false" keyCode="RETURN" action="gadget:checkEnterAutoConvert();"/>
            <box:reaction event="keyPress" shift="true" keyCode="RETURN" action="gadget:checkEnterAutoConvert();"/>
            <box:reaction event="keyPress" ctrl="true"  alt="false" keyCode="l" action="gadget:editURL();"/>
            <box:reaction event="keyPress" ctrl="true"  alt="false" keyCode="9" action="gadget:resizeFont(-1);"/>
            <box:reaction event="keyPress" ctrl="true"  alt="false" keyCode="0" action="gadget:resizeFont(1);"/>
        </behavior>
    </gadget>
</library>
    
