//>>built
define("mill/instantMessages","dojo/io/iframe dijit/dijit dijit/Dialog dijit/_Widget dijit/_Container dijit/_Contained dijit/_Templated dijit/layout/_LayoutWidget dijit/layout/_ContentPaneResizeMixin dijit/layout/BorderContainer dijit/layout/ContentPane mill/mill mill/ToolBar mill/beep".split(" "),function(){mill.instantMessages=mill.instantMessages||{};dojo.mixin(mill.instantMessages,{getAttachmentBody:function(a,b,d){var c=document.createElement("form");if(dojo.isIE){c.insertAdjacentHTML("afterBegin",
"\x3cinput type\x3d'hidden' name\x3d'id'/\x3e");c.insertAdjacentHTML("afterBegin","\x3cinput type\x3d'hidden' name\x3d'filename'/\x3e");var e=c.childNodes[0];var f=c.childNodes[1]}else f=c.appendChild(document.createElement("input")),f.type="hidden",f.name="id",e=c.appendChild(document.createElement("input")),e.type="hidden",e.name="filename";c.method="POST";c.action=mill.getRequestUrl(a,"instantMessages.getAttachmentBody");c.target="_blank";f.value=b;e.value=d;document.body.appendChild(c);c.submit();
document.body.removeChild(c)}});dojo.declare("mill._InstantMessagesMixin",null,{_root:"",_handler:"",_imageList:"",_actionsImageList:"",constructor:function(){dojo.subscribe("instantMessages/getRoot/Result",this,function(a){this._root=a});dojo.publish("instantMessages/getRoot");this._handler=this._root.handler;this._imageList=this._root._imageList;this._actionsImageList=this._root._actionsImageList},queryGetXML:function(a){dojo.xhrGet(dojo.mixin({headers:{"Disable-Basic-Auth":"yes"},handleAs:"xml",
preventCache:!0},a))},queryPostXML:function(a){dojo.xhrPost(dojo.mixin({headers:{"Disable-Basic-Auth":"yes"},handleAs:"xml",preventCache:!0},a))},_destroyChildren:function(){var a=this.chat||this.contactsGrid;a&&dojo.forEach(a.getChildren(),function(b){b.destroyRecursive()})}});dojo.declare("mill._InstantMessagesContactsMixin",[mill._InstantMessagesMixin,dijit.layout._LayoutWidget,dijit.layout._ContentPaneResizeMixin,dijit._Templated],{widgetsInTemplate:!0,_parentPaneWidget:"",_getSelectedContacts:function(a){return dojo.map(dojo.filter(this.contactsGrid.getChildren(),
function(b){return b.attr("isSelected")}),function(b){return mill.fieldValue(b.dataNode,a||"ID")}).join(";")}});dojo.declare("mill._InstantMessagesContactRow",[mill._InstantMessagesMixin,dijit.layout._LayoutWidget,dijit._Templated],{templateString:dojo.cache("mill","instantMessagesContactRow.html",'\x3cdiv dojoattachevent\x3d"onclick: _selectRow, onmousedown: _onMouseDown" title\x3d"${_title}" unselectable\x3d"on"\x3e\x3cspan\x3e${_dataNodeDescription}\x3c/span\x3e\x3c/div\x3e'),dataNode:"",isSelected:!1,
_dataNodeDescription:"",_gridWidget:"",_title:"",postMixInProperties:function(){this.inherited(arguments);this.baseClass="icsPending"==mill.fieldValue(this.dataNode,"BackContactStatus$N")?"pendingContactRow":"contactRow";this.title=dojo.i18n.getLocalization("mill","resources").imMultipleSelectTooltip;this._dataNodeDescription=mill.fieldValue(this.dataNode,"Description")},_setIsSelectedAttr:function(a){(this.isSelected=a)?dojo.addClass(this.domNode,dojo.hasClass(this.domNode,"contactRow")?"selectedContact":
"selectedPendingContact"):dojo.removeClass(this.domNode,["selectedContact","selectedPendingContact"])},resize:function(a){dojo.marginBox(this.domNode,{w:a||dojo.contentBox(this.getParent().domNode).w})},_selectRow:function(a){!this._gridWidget&&(this._gridWidget=this.getParent());if(a.ctrlKey&&!a.shiftKey)this.attr("isSelected",!this.isSelected),this._gridWidget.attr("_lastSelectedContact",this);else if(a.ctrlKey&&a.shiftKey){if(!this._gridWidget.attr("_lastSelectedContact"))return;var b=!1,d=!1;
dojo.forEach(this._gridWidget.getChildren(),dojo.hitch(this,function(c){!c.attr("isSelected")&&c.attr("isSelected",b&&!d);c!=this&&c!=this._gridWidget.attr("_lastSelectedContact")||c.attr("isSelected",b?d?!1:d=!0:b=!0)}))}else dojo.forEach(this._gridWidget.getChildren(),dojo.hitch(this,function(c){this!=c&&c.attr("isSelected",!1)})),this.attr("isSelected",!0),this._gridWidget.attr("_lastSelectedContact",this);"mill._InstantMessagesContacts"==this._gridWidget.getParent().declaredClass&&this._root._dialogLayout._conversation.selectMessages(this._gridWidget.getParent()._getSelectedContacts("User"))},
_onMouseDown:function(a){a.preventDefault()}});dojo.declare("mill._InstantMessagesContactsGrid",[dijit._Widget,dijit._Contained,dijit._Container],{baseClass:"contactsGrid",_lastSelectedContact:"",render:function(){var a=dojo.contentBox(this.domNode).w;dojo.forEach(this.getChildren(),function(b){b.resize(a)});dojo.forEach(this.getChildren(),function(b){b.attr("isSelected")&&dijit.scrollIntoView(b.domNode)})}});dojo.declare("mill._InstantMessagesSearchUsers",[mill._InstantMessagesContactsMixin],{templateString:dojo.cache("mill",
"instantMessagesSearchUsers.html",'\x3cdiv\x3e\x3cdiv class\x3d"searchPattern" dojoattachpoint\x3d"searchPatternNode"\x3e\x3cspan\x3e${_imSearch}\x3c/span\x3e : \x3cinput dojoattachevent\x3d"onChange: _searchUsers" dojoattachpoint\x3d"searchPattern" dojotype\x3d"dijit.form.ValidationTextBox" intermediateChanges\x3d"true"\x3e\x3c/input\x3e\x3c/div\x3e\x3cdiv dojoattachpoint\x3d"containerNode"\x3e\x3cdiv dojoattachpoint\x3d"toolbar" dojotype\x3d"mill.ToolBarContainer" imageList\x3d"${_imageList}"\x3e\x3cdiv color\x3d"blue" dojotype\x3d"mill.ToolBarPane"\x3e\x3cdiv dojoattachevent\x3d"onClick: _addContact" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"85" label\x3d"${_imAddContact}"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"clear"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"searchUsersGrid" dojoattachpoint\x3d"contactsGrid" dojotype\x3d"mill._InstantMessagesContactsGrid"\x3e\x3c/div\x3e\x3c/div\x3e'),
_imSearch:"",_imAddContact:"",postMixInProperties:function(){this.inherited(arguments);this._imSearch=dojo.i18n.getLocalization("mill","resources").imSearch;this._imAddContact=dojo.i18n.getLocalization("mill","resources").imAddContact},resize:function(){this.inherited(arguments);!this._parentPaneWidget&&(this._parentPaneWidget=this.getParent());!this._parentPaneWidget.attr("minSize")&&this._parentPaneWidget.attr("minSize",dojo.marginBox(this._parentPaneWidget.domNode).w);dojo.marginBox(this.contactsGrid.domNode,
{h:dojo.contentBox(this._parentPaneWidget.domNode).h-dojo.marginBox(this.searchPatternNode).h-dojo.marginBox(this.toolbar.domNode).h,w:dojo.contentBox(this._parentPaneWidget.domNode).w});this.contactsGrid.render()},_searchUsers:function(){this.queryGetXML({url:"../"+this._handler+"/instantMessages.searchUsers.xml",content:{value:this.searchPattern.attr("value")||"*"},load:dojo.hitch(this,function(a){this._destroyChildren();dojo.forEach(a.childNodes[0].childNodes,dojo.hitch(this,function(b){this.contactsGrid.addChild(new mill._InstantMessagesContactRow({dataNode:b}))}));
return a}),error:dojo.hitch(this,function(a){this._destroyChildren();return a})})},_addContact:function(){this.queryGetXML({url:"../"+this._handler+"/instantMessages.addContact.xml",content:{users:this._getSelectedContacts()},load:dojo.hitch(this,function(a){this._root._dialogLayout._searchUsersWidget._searchUsers();this._root._dialogLayout._contactsPaneLayout._selectContacts();return a})})}});dojo.declare("mill._InstantMessagesContacts",[mill._InstantMessagesContactsMixin],{templateString:dojo.cache("mill",
"instantMessagesContacts.html",'\x3cdiv\x3e\x3cdiv dojoattachpoint\x3d"containerNode"\x3e\x3cdiv dojoattachpoint\x3d"toolbar" dojotype\x3d"mill.ToolBarContainer" imageList\x3d"${_imageList}"\x3e\x3cdiv color\x3d"green" dojotype\x3d"mill.ToolBarPane"\x3e\x3cdiv dojoattachevent\x3d"onClick: _toggleUserSearchPaneView" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"89" label\x3d"${_imAddNewContacts}"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv color\x3d"blue" dojotype\x3d"mill.ToolBarPane"\x3e\x3cdiv dojoattachevent\x3d"onClick: _revokeAuthorization" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"94" label\x3d"${_imRevokeAuthorization}"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv color\x3d"red" dojotype\x3d"mill.ToolBarPane"\x3e\x3cdiv dojoattachevent\x3d"onClick: _togglePendingAuthorization" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"93" label\x3d"${_imPendingAuthorization}"\x3e\x3c/div\x3e\x3cdiv dojoattachevent\x3d"onClick: _toggleBlocked" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"88" label\x3d"${_imBlocked}"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"clear"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv dojoattachpoint\x3d"contactsGrid" dojotype\x3d"mill._InstantMessagesContactsGrid"\x3e\x3c/div\x3e\x3c/div\x3e'),
_imAddNewContacts:"",_imRevokeAuthorization:"",_imPendingAuthorization:"",_imBlocked:"",postMixInProperties:function(){this.inherited(arguments);this._imAddNewContacts=dojo.i18n.getLocalization("mill","resources").imAddNewContacts;this._imRevokeAuthorization=dojo.i18n.getLocalization("mill","resources").imRevokeAuthorization;this._imPendingAuthorization=dojo.i18n.getLocalization("mill","resources").imPendingAuthorization;this._imBlocked=dojo.i18n.getLocalization("mill","resources").imBlocked},resize:function(){this.inherited(arguments);
!this._parentPaneWidget&&(this._parentPaneWidget=this.getParent());dojo.marginBox(this.contactsGrid.domNode,{h:dojo.contentBox(this._parentPaneWidget.domNode).h-dojo.marginBox(this.toolbar.domNode).h,w:dojo.contentBox(this._parentPaneWidget.domNode).w});this.contactsGrid.render()},_revokeAuthorization:function(){this.queryGetXML({url:"../"+this._handler+"/instantMessages.changeContactStatus.xml",content:{contacts:this._getSelectedContacts(),status:"icsPending"},load:dojo.hitch(this,function(a){this._root._dialogLayout._contactsPaneLayout._selectContacts();
return a})})},_toggleUserSearchPaneView:function(){dojo.toggleClass(this._root._dialogLayout._searchUsersPane.domNode,"hiddenPane");dojo.toggleClass(this._root._dialogLayout._searchUsersPane._splitterWidget.domNode,"hiddenPane");this._root._dialogLayout._searchUsersPane.resize();this._root._dialogLayout._searchUsersPane.getParent().resize();this._root._dialog.resize()},_togglePendingAuthorization:function(){dojo.toggleClass(this._root._dialogLayout._contactsPaneLayout._pendingContactsPane.domNode,
"hiddenPane");dojo.toggleClass(this._root._dialogLayout._contactsPaneLayout._pendingContactsPane._splitterWidget.domNode,"hiddenPane");this._root._dialogLayout._contactsPaneLayout.resize()},_toggleBlocked:function(){dojo.toggleClass(this._root._dialogLayout._contactsPaneLayout._refusedContactsPane.domNode,"hiddenPane");dojo.toggleClass(this._root._dialogLayout._contactsPaneLayout._refusedContactsPane._splitterWidget.domNode,"hiddenPane");this._root._dialogLayout._contactsPaneLayout.resize()}});dojo.declare("mill._InstantMessagesPendingContacts",
[mill._InstantMessagesContactsMixin],{templateString:dojo.cache("mill","instantMessagesPendingContacts.html",'\x3cdiv\x3e\x3cdiv dojoattachpoint\x3d"containerNode"\x3e\x3cdiv dojoattachpoint\x3d"toolbar" dojotype\x3d"mill.ToolBarContainer" imageList\x3d"${_imageList}"\x3e\x3cdiv color\x3d"blue" dojotype\x3d"mill.ToolBarPane"\x3e\x3cdiv dojoattachevent\x3d"onClick: _authorizeContact" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"86" label\x3d"${_imAuthorizeContact}"\x3e\x3c/div\x3e\x3cdiv dojoattachevent\x3d"onClick: _blockContact" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"88" label\x3d"${_imBlockContact}"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"clear"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv dojoattachpoint\x3d"contactsGrid" dojotype\x3d"mill._InstantMessagesContactsGrid"\x3e\x3c/div\x3e\x3c/div\x3e'),
_imAuthorizeContact:"",_imBlockContact:"",postMixInProperties:function(){this.inherited(arguments);this._imAuthorizeContact=dojo.i18n.getLocalization("mill","resources").imAuthorizeContact;this._imBlockContact=dojo.i18n.getLocalization("mill","resources").imBlockContact},resize:function(){this.inherited(arguments);!this._parentPaneWidget&&(this._parentPaneWidget=this.getParent());dojo.marginBox(this.contactsGrid.domNode,{h:dojo.contentBox(this._parentPaneWidget.domNode).h-dojo.marginBox(this.toolbar.domNode).h,
w:dojo.contentBox(this._parentPaneWidget.domNode).w});this.contactsGrid.render()},_authorizeContact:function(){this.queryGetXML({url:"../"+this._handler+"/instantMessages.changeContactStatus.xml",content:{contacts:this._getSelectedContacts(),status:"icsApproved"},load:dojo.hitch(this,function(a){this._root._dialogLayout._contactsPaneLayout._selectContacts();return a})})},_blockContact:function(){this.queryGetXML({url:"../"+this._handler+"/instantMessages.changeContactStatus.xml",content:{contacts:this._getSelectedContacts(),
status:"icsRefused"},load:dojo.hitch(this,function(a){this._root._dialogLayout._contactsPaneLayout._selectContacts();return a})})}});dojo.declare("mill._InstantMessagesRefusedContacts",[mill._InstantMessagesContactsMixin],{templateString:dojo.cache("mill","instantMessagesRefusedContacts.html",'\x3cdiv\x3e\x3cdiv dojoattachpoint\x3d"containerNode"\x3e\x3cdiv dojoattachpoint\x3d"toolbar" dojotype\x3d"mill.ToolBarContainer" imageList\x3d"${_imageList}"\x3e\x3cdiv color\x3d"blue" dojotype\x3d"mill.ToolBarPane"\x3e\x3cdiv dojoattachevent\x3d"onClick: _unblockContact" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"93" label\x3d"${_imUnblock}"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"clear"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv dojoattachpoint\x3d"contactsGrid" dojotype\x3d"mill._InstantMessagesContactsGrid"\x3e\x3c/div\x3e\x3c/div\x3e'),
_imUnblock:"",postMixInProperties:function(){this.inherited(arguments);this._imUnblock=dojo.i18n.getLocalization("mill","resources").imUnblock},resize:function(){this.inherited(arguments);!this._parentPaneWidget&&(this._parentPaneWidget=this.getParent());dojo.marginBox(this.contactsGrid.domNode,{h:dojo.contentBox(this._parentPaneWidget.domNode).h-dojo.marginBox(this.toolbar.domNode).h,w:dojo.contentBox(this._parentPaneWidget.domNode).w});this.contactsGrid.render()},_unblockContact:function(){this.queryGetXML({url:"../"+
this._handler+"/instantMessages.changeContactStatus.xml",content:{contacts:this._getSelectedContacts(),status:"icsPending"},load:dojo.hitch(this,function(a){this._root._dialogLayout._contactsPaneLayout._selectContacts();return a})})}});dojo.declare("mill._InstantMessagesConversationMessage",[mill._InstantMessagesMixin,dijit._Widget,dijit._Templated],{templateString:dojo.cache("mill","instantMessagesConversationMessage.html",'\x3cdiv\x3e\x3cdiv class\x3d"messageNode"\x3e\x3cdiv\x3e\x3cu\x3e\x3cspan\x3e${_userName}\x3c/span\x3e\x3c/u\x3e\x3c/div\x3e\x3cspan class\x3d"messageText"\x3e\x3cspan\x3e${_messageText}\x3c/span\x3e\x3c/span\x3e\x3cdiv dojoattachpoint\x3d"attachment"\x3e\x3c/div\x3e\x3cdiv class\x3d"messageTime"\x3e\x3cspan\x3e${_time}\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),
dataNode:"",multipleUsers:!1,attachmentNode:"",_imForUserMessage:"",_isOwner:"",_messageText:"",_time:"",_userName:"",postMixInProperties:function(){this.inherited(arguments);this._imForUserMessage=dojo.i18n.getLocalization("mill","resources").imForUserMessage;this._isOwner=mill.fieldValue(this.dataNode,"Owner")==this._root._currentUserID;this.multipleUsers&&(this._userName=(this._isOwner?this._imForUserMessage+" "+mill.fieldValue(this.dataNode,"User$D"):mill.fieldValue(this.dataNode,"Owner$D"))+
":");this._messageText=mill.fieldValue(this.dataNode,"Message");var a=mill.parseDate(mill.fieldValue(this.dataNode,"DeliveryTime"));0==dojo.date.compare(a,new Date,"date")?this._time=dojo.date.locale.format(a,{selector:"time",timePattern:"\u0421\u0435\u0433\u043e\u0434\u043d\u044f, HH:mm:ss"}):this._time=mill.formatDateTime(a)},_setAttachmentNodeAttr:function(a){this.attachmentNode=a;switch(mill.fieldValue(this.dataNode,"AttachmentType$N")){case "imaHyperLink":dojo.create("a",{innerHTML:mill.fieldValue(this.attachmentNode,
"HyperLink"),href:mill.fieldValue(this.attachmentNode,"HyperLink"),target:"_blank"},this.attachment);break;case "imaImage":a=dojo.create("a",{style:{display:"block"},href:"javascript:mill.instantMessages.getAttachmentBody('"+this._handler+"', '"+mill.fieldValue(this.attachmentNode,"ID")+"', '"+mill.fieldValue(this.attachmentNode,"HyperLink")+"')"},this.attachment.appendChild(document.createElement("div")));a=dojo.create("div",{className:"messageImage"},a);dojo.style(a,{backgroundImage:"url('"+mill.getRequestUrl(this._handler,
"instantMessages.getAttachmentBody")+"?id\x3d"+mill.fieldValue(this.attachmentNode,"ID")+"')"});9>dojo.isIE&&dojo.style(a,{backgroundImage:"none",width:"70px",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src\x3d'"+mill.getRequestUrl(this._handler,"instantMessages.getAttachmentBody")+"?id\x3d"+mill.fieldValue(this.attachmentNode,"ID")+"', sizingMethod\x3d'scale')"});dojo.create("a",{innerHTML:mill.fieldValue(this.attachmentNode,"HyperLink"),href:"javascript:mill.instantMessages.getAttachmentBody('"+
this._handler+"', '"+mill.fieldValue(this.attachmentNode,"ID")+"', '"+mill.fieldValue(this.attachmentNode,"HyperLink")+"')"},this.attachment);break;case "imaFile":dojo.create("a",{innerHTML:mill.fieldValue(this.attachmentNode,"HyperLink"),href:"javascript:mill.instantMessages.getAttachmentBody('"+this._handler+"', '"+mill.fieldValue(this.attachmentNode,"ID")+"', '"+mill.fieldValue(this.attachmentNode,"HyperLink")+"')"},this.attachment)}},buildRendering:function(){this.inherited(arguments);dojo.addClass(this.domNode,
this._isOwner?"chatMessageR":"chatMessageL")}});dojo.declare("mill._InstantMessagesConversationMessagesContainer",[dijit._Widget,dijit._Container,dijit._Templated],{templateString:dojo.cache("mill","instantMessagesConversationMessagesContainer.html",'\x3cdiv\x3e\x3cdiv class\x3d"chatContainer" dojoattachpoint\x3d"containerNode"\x3e\x3c/div\x3e\x3cspan class\x3d"chatContainerFix"\x3e\x3c/span\x3e\x3c/div\x3e')});dojo.declare("mill._InstantMessagesConversation",[mill._InstantMessagesMixin,dijit._Widget,
dijit._Contained,dijit._Templated],{baseClass:"instantMessagesConversation",templateString:dojo.cache("mill","instantMessagesConversation.html",'\x3cdiv\x3e\x3cdiv dojoattachpoint\x3d"chat" dojotype\x3d"mill._InstantMessagesConversationMessagesContainer"\x3e\x3c/div\x3e\x3cform action\x3d"${_action}" dojoattachpoint\x3d"form" enctype\x3d"multipart/form-data" method\x3d"post"\x3e\x3ctextarea class\x3d"sendMessageText" dojoattachevent\x3d"onKeyDown: _onKeyDown, onChange: _onChange, onFocus:_onFocus, onBlur: _onBlur" dojoattachpoint\x3d"editor" dojotype\x3d"dijit.form.SimpleTextarea" intermediatechanges\x3d"true" name\x3d"message"\x3e\x3c/textarea\x3e\x3cdiv class\x3d"controlsWrapper" dojoattachpoint\x3d"controls"\x3e\x3cdiv dojoattachevent\x3d"onClick: _sendMessage" dojotype\x3d"dijit.form.Button" title\x3d"${_imSendMessageTooltip}"\x3e ${_imSend} \x3c/div\x3e\x3cdiv class\x3d"icons"\x3e\x3cspan dojoattachpoint\x3d"attachmentText"\x3e\x3c/span\x3e\x3cspan dojoattachevent\x3d"onclick: _clear" dojoattachpoint\x3d"clearNode" style\x3d"display:none;cursor:pointer"\x3e \x26#160;\x26#215;\x26#160; \x3c/span\x3e\x3cdiv dojoattachevent\x3d"onClick: _attachFile" dojoattachpoint\x3d"attachFileIcon" dojotype\x3d"mill.icon" imageIndex\x3d"278"\x3e\x3c/div\x3e\x3cdiv dojoattachevent\x3d"onClick: _attachLink" dojoattachpoint\x3d"attachLinkIcon" dojotype\x3d"mill.icon" imageIndex\x3d"305"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv style\x3d"display:none"\x3e\x3cinput dojoattachevent\x3d"onchange: _fileAttached" dojoattachpoint\x3d"fileInput" name\x3d"file" type\x3d"file"\x3e\x3c/input\x3e\x3cinput dojoattachpoint\x3d"usersInput" name\x3d"users" type\x3d"text"\x3e\x3c/input\x3e\x3cinput dojoattachpoint\x3d"hyperlinkInput" name\x3d"hyperlink" type\x3d"text"\x3e\x3c/input\x3e\x3c/div\x3e\x3c/div\x3e\x3c/form\x3e\x3c/div\x3e'),
widgetsInTemplate:!0,_hyperlink:"",_imSend:"",_imSendMessageTooltip:"",_action:"",postMixInProperties:function(){this.inherited(arguments);this._imSend=dojo.i18n.getLocalization("mill","resources").imSend;this._imSendMessageTooltip=dojo.i18n.getLocalization("mill","resources").imSendMessageTooltip;this._action=mill.getRequestUrl(this._handler,"instantMessages.sendMessage.xml")},postCreate:function(){this.inherited(arguments);this.attachFileIcon.attr("imageList",this._actionsImageList);this.attachLinkIcon.attr("imageList",
this._actionsImageList);dojo.addClass(this.attachFileIcon.domNode,"dijitInline");dojo.addClass(this.attachLinkIcon.domNode,"dijitInline")},resize:function(){this.inherited(arguments);this.renderChat();dojo.marginBox(this.editor.domNode,{w:dojo.contentBox(this.getParent().domNode).w})},renderChat:function(){var a=dojo.contentBox(this.getParent().domNode).h-dojo.marginBox(this.editor.domNode).h-dojo.marginBox(this.controls).h;0<a&&(dojo.style(this.chat.domNode,{lineHeight:a+"px"}),dojo.style(this.chat.containerNode,
{maxHeight:a+"px"}),7>=dojo.isIE&&dojo.style(this.chat.containerNode,{height:this.chat.containerNode.scrollHeight>a?a+"px":"auto"}),(a=this.chat.getChildren()[this.chat.getChildren().length-1])&&dijit.scrollIntoView(a.domNode))},selectMessages:function(a){this.inherited(arguments);this._root._icon.attr("imageIndex","386");this._root._icon.startup();this.queryGetXML({url:"../"+this._handler+"/instantMessages.selectMessages.xml",content:{users:a},load:dojo.hitch(this,function(b){this._destroyChildren();
for(var d=[],c=b.childNodes[0].childNodes.length-1;0<=c;c--){var e=b.childNodes[0].childNodes[c];"imaNone"!=mill.fieldValue(e,"AttachmentType$N")&&d.push(mill.fieldValue(e,"ID"));this.chat.addChild(new mill._InstantMessagesConversationMessage({dataNode:e,multipleUsers:1<a.split(";").length}))}this.queryGetXML({url:"../"+this._handler+"/instantMessages.getAttachmentData.xml",content:{id:d.join(";")},load:dojo.hitch(this,function(f){for(var k=this.chat.getChildren(),g=f.childNodes[0].childNodes.length-
1;0<=g;g--){var h=dojo.filter(k,function(l){return mill.fieldValue(l.dataNode,"ID")==mill.fieldValue(f.childNodes[0].childNodes[g],"ID")});h[0]&&h[0].attr("attachmentNode",f.childNodes[0].childNodes[g])}this.renderChat();return f})});return b}),error:dojo.hitch(this,function(b){this._destroyChildren();return b})})},_sendMessage:function(){this.editor.attr("value").replace(/\s/g,"")&&(this.usersInput.value=this._root._dialogLayout._contactsPaneLayout._contacts._getSelectedContacts("User"),this.hyperlinkInput.value=
this._hyperlink,dojo.io.iframe.send({method:"POST",form:this.form,handleAs:"xml",handle:dojo.hitch(this,function(a,b){this.usersInput.value="";this.hyperlinkInput.value="";this.editor.attr("value","");this._clear();"error"==a.documentElement.nodeName?mill.alertError(a.documentElement):this.editor.attr("value","")&&this.selectMessages(this._root._dialogLayout._contactsPaneLayout._contacts._getSelectedContacts("User"));return a})}))},_attachFile:function(){this.fileInput.click()},_attachLink:function(){var a=
prompt(dojo.i18n.getLocalization("mill","resources").imLink,this.attr("_hyperlink"));null!==a&&(this.attachmentText.innerHTML=a?"\x3ca target\x3d'_blank' href\x3d'"+a+"'\x3e"+a+"\x3c/a\x3e":"",this.attr("_hyperlink",a),this.fileInput.value="",dojo.style(this.clearNode,{display:a?"inline":"none"}))},_fileAttached:function(){var a=this.fileInput.value.replace("C:\\fakepath\\","");this.attachmentText.innerHTML=a?a:"";this.attr("_hyperlink","");dojo.style(this.clearNode,{display:a?"inline":"none"})},
_clear:function(){this.attachmentText.innerHTML="";this.attr("_hyperlink","");this.fileInput.value="";dojo.style(this.clearNode,{display:"none"})},_onKeyDown:function(a){a.keyCode==dojo.keys.ENTER&&a.ctrlKey&&(a.preventDefault(),this._sendMessage())},_onChange:function(){dojo.style(this.editor.domNode,{backgroundColor:this.editor.attr("value").replace(/\s/g,"")?"#fff":"#a0ffa0"})},_onFocus:function(){this._root._dialog.resize()},_onBlur:function(){this._root._dialog.resize()}});dojo.declare("mill._InstantMessagesActionsToolbar",
[mill._InstantMessagesMixin,dijit._Widget,dijit.layout._ContentPaneResizeMixin,dijit._Templated],{baseClass:"actionsToolbar",templateString:dojo.cache("mill","instantMessagesActionsToolbar.html",'\x3cdiv\x3e\x3cdiv dojoattachpoint\x3d"containerNode"\x3e\x3cdiv dojoattachpoint\x3d"toolbar" dojotype\x3d"mill.ToolBarContainer" imageList\x3d"${_imageList}"\x3e\x3cdiv color\x3d"blue" dojotype\x3d"mill.ToolBarPane" style\x3d"margin:0;"\x3e\x3cdiv dojoattachevent\x3d"onClick: _queryData" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"52" label\x3d"${_imRefresh}"\x3e\x3c/div\x3e\x3cdiv dojoattachevent\x3d"onClick: _queryContactsData" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"52" label\x3d"${_imRefreshContacts}"\x3e\x3c/div\x3e\x3cdiv dojoattachevent\x3d"onClick: _queryMessagesData" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"52" label\x3d"${_imRefreshMessages}"\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv color\x3d"blue" dojotype\x3d"mill.ToolBarPane"\x3e\x3cdiv dojoattachevent\x3d"onClick: _hideDialog" dojotype\x3d"mill.ToolBarButton" imageindex\x3d"48" label\x3d"${_imClose}"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class\x3d"clear"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'),
widgetsInTemplate:!0,_imRefresh:"",_imRefreshContacts:"",_imRefreshMessages:"",_imClose:"",postMixInProperties:function(){this.inherited(arguments);this._imRefresh=dojo.i18n.getLocalization("mill","resources").imRefresh;this._imRefreshContacts=dojo.i18n.getLocalization("mill","resources").imRefreshContacts;this._imRefreshMessages=dojo.i18n.getLocalization("mill","resources").imRefreshMessages;this._imClose=dojo.i18n.getLocalization("mill","resources").imClose},_queryData:function(){this._root.queryData()},
_queryContactsData:function(){this._root.queryData("contacts")},_queryMessagesData:function(){this._root.queryData("messages")},_hideDialog:function(){this._root._dialog.hide()}});dojo.declare("mill._InstantMessagesDialogPane",[dijit.layout.ContentPane,dijit._Contained],{headerTitle:"",_headerTitleNode:"",parseOnLoad:!1,_setHeaderTitleAttr:function(a){this.headerTitle=a;this._headerTitleNode.innerHTML=this.headerTitle},buildRendering:function(){this.inherited(arguments);dojo.addClass(this.domNode,
"instantMessagesDialogPane")},postCreate:function(){this.inherited(arguments);this.headerTitle&&(this._headerTitleNode=dojo.create("div",{className:"dialogPaneHeader",innerHTML:this.headerTitle},this.domNode))},resize:function(){this.inherited(arguments);this._headerTitleNode&&dojo.marginBox(this._headerTitleNode,{w:dojo.marginBox(this.domNode).w});this._headerTitleNode&&dojo.style(this.domNode,{paddingTop:dojo.marginBox(this._headerTitleNode).h+3+"px"})}});dojo.declare("mill._InstantMessagesContactsPaneLayout",
[mill._InstantMessagesMixin,dijit.layout.BorderContainer],{style:"",_contacts:"",_pendingContacts:"",_pendingContactsPane:"",_refusedContacts:"",_refusedContactsPane:"",postMixInProperties:function(){this.inherited(arguments);this.style=dojo.delegate(dijit.layout.BorderContainer.prototype.style,{width:parseInt(.315*dojo.window.getBox().w)+"px"})},buildRendering:function(){this.inherited(arguments);this._contacts=new mill._InstantMessagesContacts;this.addChild(new mill._InstantMessagesDialogPane({region:"center",
headerTitle:dojo.i18n.getLocalization("mill","resources").imContacts,content:this._contacts}));this._pendingContacts=new mill._InstantMessagesPendingContacts;this._pendingContactsPane=new mill._InstantMessagesDialogPane({layoutPriority:"1",region:"bottom",splitter:"true",headerTitle:dojo.i18n.getLocalization("mill","resources").imPendingContacts,content:this._pendingContacts});this.addChild(this._pendingContactsPane);this._refusedContacts=new mill._InstantMessagesRefusedContacts;this._refusedContactsPane=
new mill._InstantMessagesDialogPane({layoutPriority:"0",region:"bottom",splitter:"true",headerTitle:dojo.i18n.getLocalization("mill","resources").imBlockedContacts,content:this._refusedContacts});this.addChild(this._refusedContactsPane)},startup:function(){this.inherited(arguments);dojo.addClass(this._pendingContactsPane.domNode,"hiddenPane");dojo.addClass(this._pendingContactsPane._splitterWidget.domNode,"hiddenPane");dojo.addClass(this._refusedContactsPane.domNode,"hiddenPane");dojo.addClass(this._refusedContactsPane._splitterWidget.domNode,
"hiddenPane")},_selectContacts:function(){this.queryGetXML({url:"../"+this._handler+"/instantMessages.selectContacts.xml",load:dojo.hitch(this,function(a){this._root._dialogLayout._conversation._destroyChildren();this._contacts._destroyChildren();this._pendingContacts._destroyChildren();this._refusedContacts._destroyChildren();0==dojo.filter(a.childNodes[0].childNodes,function(b){return"icsApproved"==mill.fieldValue(b,"Status$N")}).length&&dojo.hasClass(this._root._dialogLayout._searchUsersPane.domNode,
"hiddenPane")&&this._contacts._toggleUserSearchPaneView();0<dojo.filter(a.childNodes[0].childNodes,function(b){return"icsPending"==mill.fieldValue(b,"Status$N")}).length&&dojo.hasClass(this._pendingContactsPane.domNode,"hiddenPane")&&this._contacts._togglePendingAuthorization();dojo.forEach(a.childNodes[0].childNodes,dojo.hitch(this,function(b){switch(mill.fieldValue(b,"Status$N")){case "icsApproved":var d=new mill._InstantMessagesContactRow({dataNode:b});this._contacts.contactsGrid.addChild(d);mill.fieldValue(b,
"ID")==a.childNodes[0].getAttribute("lastUsed")&&(d._selectRow({}),dijit.scrollIntoView(d.domNode));break;case "icsPending":this._pendingContacts.contactsGrid.addChild(new mill._InstantMessagesContactRow({dataNode:b}));break;case "icsRefused":this._refusedContacts.contactsGrid.addChild(new mill._InstantMessagesContactRow({dataNode:b}))}}));return a}),error:dojo.hitch(this,function(a){this._root._dialogLayout._conversation._destroyChildren();this._contacts._destroyChildren();this._pendingContacts._destroyChildren();
this._refusedContacts._destroyChildren();return a})})}});dojo.declare("mill._InstantMessagesDialogLayout",[dijit.layout.BorderContainer],{_actionsToolbarPane:"",_searchUsersWidget:"",_searchUsersPane:"",_contactsPaneLayout:"",_conversation:"",style:{width:parseInt(.8*dojo.window.getBox().w)+"px",height:parseInt(.8*dojo.window.getBox().h)+"px"},buildRendering:function(){this.inherited(arguments);this._actionsToolbarPane=new mill._InstantMessagesDialogPane({region:"top",headerTitle:"\x26#160;",content:new mill._InstantMessagesActionsToolbar});
dojo.addClass(this._actionsToolbarPane.domNode,"actionsToolbarPane");this.addChild(this._actionsToolbarPane);this._searchUsersWidget=new mill._InstantMessagesSearchUsers;this._searchUsersPane=new mill._InstantMessagesDialogPane({region:"left",splitter:"true",headerTitle:dojo.i18n.getLocalization("mill","resources").imContactsSearch,content:this._searchUsersWidget});this.addChild(this._searchUsersPane);this._contactsPaneLayout=new mill._InstantMessagesContactsPaneLayout;this._contactsPaneLayout.startup();
var a=new mill._InstantMessagesDialogPane({region:"left",splitter:"true",content:this._contactsPaneLayout});dojo.addClass(a.domNode,"instantMessagesDialogContainerPane");this.addChild(a);this._conversation=new mill._InstantMessagesConversation;this.addChild(new mill._InstantMessagesDialogPane({region:"center",headerTitle:dojo.i18n.getLocalization("mill","resources").imMessages,content:this._conversation}))},resize:function(){this.inherited(arguments);dojo.style(this.domNode,{width:parseInt(.8*dojo.window.getBox().w)+
"px",height:parseInt(.8*dojo.window.getBox().h)+"px"})},startup:function(){this.inherited(arguments);dojo.addClass(this._searchUsersPane.domNode,"hiddenPane");dojo.addClass(this._searchUsersPane._splitterWidget.domNode,"hiddenPane")}});dojo.declare("mill.InstantMessages",[dijit._Widget,dijit._Templated],{templateString:"\x3cdiv title\x3d'${_imMessages}' dojoattachevent\x3d'onclick: showDialog'\x3e\x3c/div\x3e",baseClass:"instantMessages",handler:"",pollTimeout:6E4,_timestamp:"",_currentUserID:"",
_imMessages:"",_pollTimer:"",_imageList:"",_actionsImageList:"",_dialogLayout:"",_dialog:"",_icon:"",postMixInProperties:function(){this.inherited(arguments);dojo.subscribe("instantMessages/getRoot",this,function(){dojo.publish("instantMessages/getRoot/Result",[this])});this._imMessages=dojo.i18n.getLocalization("mill","resources").imMessages;this._imageList=(new mill.imageList({url:dojo.moduleUrl("mill","theme/SmallIcons.js")})).id;this._actionsImageList=new mill.imageList({url:dojo.moduleUrl("mill",
"theme/Actions.js")})},buildRendering:function(){this.inherited(arguments);this._icon=new mill.icon({imageList:this._actionsImageList,imageIndex:"386"},this.domNode.appendChild(document.createElement("div")));this._icon.startup();this._dialogLayout=new mill._InstantMessagesDialogLayout;this._dialogLayout.startup();this._dialog=new dijit.Dialog({parseOnLoad:!1,title:this._imMessages,content:this._dialogLayout,style:{visibility:"hidden"}});dojo.addClass(this._dialog.domNode,"instantMessagesDialog");
this._dialog.startup();dojo.place(this.domNode,window.document.body)},startup:function(){this.inherited(arguments);6==dojo.isIE&&dojo.connect(window,"resize",dojo.hitch(this,function(){this._dialog.resize()}));this.queryData();this._pollTimer&&clearInterval(this._pollTimer);this.attr("_pollTimer",setInterval(dojo.hitch(this,function(){this.poll()}),this.pollTimeout));setTimeout(dojo.hitch(this,function(){this.poll()}),0)},destroyRecursive:function(){clearInterval(this._pollTimer);this._dialog.destroyRecursive();
this.inherited(arguments)},_getCurrentUserInfo:function(){dojo.xhrGet({headers:{"Disable-Basic-Auth":"yes"},handleAs:"xml",preventCache:!0,url:"../"+this.handler+"/instantMessages.currentUserInfo.xml",load:dojo.hitch(this,function(a){this._currentUserID=mill.fieldValue(a.childNodes[0].childNodes[0],"ID");this._dialogLayout._actionsToolbarPane.attr("headerTitle",mill.fieldValue(a.childNodes[0].childNodes[0],"Description"));return a}),error:dojo.hitch(this,function(a){this._currentUserID="";this._dialogLayout._actionsToolbarPane.attr("headerTitle",
"\x26#160;");return a})})},showDialog:function(){this._dialog.show().always(dojo.hitch(this,function(){this._dialogLayout._layoutChildren();this._dialogLayout.resize();this._dialogLayout.layout();this._dialog._size();this._dialog._position();dojo.style(this._dialog.domNode,{visibility:"visible"})}));this._icon.attr("imageIndex","386");this._icon.startup()},queryData:function(a){switch(a){case "contacts":this._dialogLayout._contactsPaneLayout._selectContacts();break;case "messages":this._dialogLayout._conversation.selectMessages(this._dialogLayout._contactsPaneLayout._contacts._getSelectedContacts("User"));
break;default:this._getCurrentUserInfo(),this._dialogLayout._searchUsersWidget._searchUsers(),this._dialogLayout._contactsPaneLayout._selectContacts()}},poll:function(){dojo.xhrGet({headers:{"Disable-Basic-Auth":"yes"},handleAs:"xml",preventCache:!0,url:"../"+this.handler+"/instantMessages.checkEvents.xml",content:{timestamp:this._timestamp},load:dojo.hitch(this,function(a){this._timestamp=a.childNodes[0].getAttribute("timestamp");0<a.childNodes[0].childNodes[0].childNodes.length&&this._dialogLayout._contactsPaneLayout._selectContacts();
var b=this._dialog.open;dojo.forEach(a.childNodes[0].childNodes[1].childNodes,dojo.hitch(this,function(d){var c=dojo.filter(this._dialogLayout._contactsPaneLayout._contacts.contactsGrid.getChildren(),dojo.hitch(this,function(e){return(!e.attr("isSelected")||!this._dialog.attr("open"))&&mill.fieldValue(e.dataNode,"User")==mill.fieldValue(d,"Owner")}));!b&&c[0]&&(new mill.InstantMessagesNotification({contactRow:c[0]})).startup();dojo.filter(this._dialogLayout._contactsPaneLayout._contacts.contactsGrid.getChildren(),
dojo.hitch(this,function(e){return e.attr("isSelected")&&mill.fieldValue(e.dataNode,"User")==mill.fieldValue(d,"Owner")}))[0]&&this._dialogLayout._conversation.selectMessages(this._dialogLayout._contactsPaneLayout._contacts._getSelectedContacts("User"));c[0]&&(this._icon.attr("imageIndex","387"),this._icon.startup())}));return a})})}});dojo.declare("mill.InstantMessagesNotification",[mill._InstantMessagesMixin,dijit._Widget,dijit._Templated],{baseClass:"instantMessagesNotification",templateString:dojo.cache("mill",
"instantMessagesNotification.html",'\x3cdiv dojoattachevent\x3d"onclick: _onClick"\x3e\x3cdiv\x3e\x3cb\x3e\x3cspan\x3e${_imNewMessageReceived}\x3c/span\x3e\x3c/b\x3e\x3c/div\x3e\x3cdiv\x3e ${_userName} \x3c/div\x3e\x3c/div\x3e'),contactRow:"",_imNewMessageReceived:"",_userName:"",constructor:function(){dojo.forEach(dojo.query(".instantMessagesNotification"),function(a){dijit.byNode(a).destroyRecursive()})},postMixInProperties:function(){this.inherited(arguments);this._userName=this.contactRow._dataNodeDescription;
this._imNewMessageReceived=dojo.i18n.getLocalization("mill","resources").imNewMessageReceived},buildRendering:function(){this.inherited(arguments);dojo.place(this.domNode,window.document.body)},startup:function(){this.inherited(arguments);mill.beep.instantMessage();setTimeout(dojo.hitch(this,this.destroyRecursive),3E4)},_onClick:function(){this._root.showDialog();!this.contactRow.attr("isSelected")&&this.contactRow._selectRow({});this.destroyRecursive()}})});