/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.drawing.plugins.drawing.GreekPalette"],["require","dojox.drawing.library.greek"],["require","dijit._Widget"],["require","dijit._Templated"],["require","dijit._PaletteMixin"],["require","dojo.i18n"],["requireLocalization","dojox.editor.plugins","latinEntities",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw","ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,kk,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.drawing.plugins.drawing.GreekPalette"]){_4._hasResource["dojox.drawing.plugins.drawing.GreekPalette"]=true;_4.provide("dojox.drawing.plugins.drawing.GreekPalette");_4.require("dojox.drawing.library.greek");_4.require("dijit._Widget");_4.require("dijit._Templated");_4.require("dijit._PaletteMixin");_4.require("dojo.i18n");_4.declare("dojox.drawing.plugins.drawing.GreekPalette",[_5._Widget,_5._Templated,_5._PaletteMixin],{postMixInProperties:function(){var _7=_6.drawing.library.greek;var _8=0;var _9;for(_9 in _7){_8++;}var _a=Math.floor(Math.sqrt(_8));var _b=_a;var _c=0;var _d=[];var _e=[];for(_9 in _7){_c++;_e.push(_9);if(_c%_b===0){_d.push(_e);_e=[];}}if(_e.length>0){_d.push(_e);}this._palette=_d;},onChange:function(_f){var _10=this._textBlock;_5.popup.close(this);_10.insertText(this._pushChangeTo,_f);_10._dropMode=false;},onCancel:function(_11){_5.popup.close(this);this._textBlock._dropMode=false;},id:"dropdown",templateString:"<div class=\"dojoxEntityPalette\">\n"+"\t<table>\n"+"\t\t<tbody>\n"+"\t\t\t<tr>\n"+"\t\t\t\t<td>\n"+"\t\t\t\t\t<table class=\"dijitPaletteTable\">\n"+"\t\t\t\t\t\t<tbody dojoAttachPoint=\"gridNode\"></tbody>\n"+"\t\t\t\t   </table>\n"+"\t\t\t\t</td>\n"+"\t\t\t</tr>\n"+"\t\t\t<tr>\n"+"\t\t\t\t<td>\n"+"\t\t\t\t\t<table dojoAttachPoint=\"previewPane\" class=\"dojoxEntityPalettePreviewTable\">\n"+"\t\t\t\t\t\t<tbody>\n"+"\t\t\t\t\t\t\t<tr>\n"+"\t\t\t\t\t\t\t\t<td class=\"dojoxEntityPalettePreviewDetailEntity\">Type: <span class=\"dojoxEntityPalettePreviewDetail\" dojoAttachPoint=\"previewNode\"></span></td>\n"+"\t\t\t\t\t\t\t</tr>\n"+"\t\t\t\t\t\t</tbody>\n"+"\t\t\t\t\t</table>\n"+"\t\t\t\t</td>\n"+"\t\t\t</tr>\n"+"\t\t</tbody>\n"+"\t</table>\n"+"</div>",baseClass:"dojoxEntityPalette",showPreview:true,dyeClass:"dojox.drawing.plugins.Greeks",paletteClass:"editorLatinEntityPalette",cellClass:"dojoxEntityPaletteCell",buildRendering:function(){this.inherited(arguments);var _12=_4.i18n.getLocalization("dojox.editor.plugins","latinEntities");this._preparePalette(this._palette,_12);var _13=_4.query(".dojoxEntityPaletteCell",this.gridNode);_4.forEach(_13,function(_14){this.connect(_14,"onmouseenter","_onCellMouseEnter");},this);},_onCellMouseEnter:function(e){if(this.showPreview){this._displayDetails(e.target);}},_onCellClick:function(evt){var _15=evt.type=="click"?evt.currentTarget:this._currentFocus,_16=this._getDye(_15).getValue();this._setCurrent(_15);setTimeout(_4.hitch(this,function(){_5.focus(_15);this._setValueAttr(_16,true);}));_4.removeClass(_15,"dijitPaletteCellHover");_4.stopEvent(evt);},postCreate:function(){this.inherited(arguments);if(!this.showPreview){_4.style(this.previewNode,"display","none");}},_setCurrent:function(_17){if("_currentFocus" in this){_4.attr(this._currentFocus,"tabIndex","-1");_4.removeClass(this._currentFocus,"dojoxEntityPaletteCellHover");}this._currentFocus=_17;if(_17){_4.attr(_17,"tabIndex",this.tabIndex);_4.addClass(this._currentFocus,"dojoxEntityPaletteCellHover");}if(this.showPreview){this._displayDetails(_17);}},_displayDetails:function(_18){var dye=this._getDye(_18);if(dye){var _19=dye.getValue();var _1a=dye._alias;this.previewNode.innerHTML=_19;}else{this.previewNode.innerHTML="";this.descNode.innerHTML="";}},_preparePalette:function(_1b,_1c){this._cells=[];var url=this._blankGif;var _1d=_4.getObject(this.dyeClass);for(var row=0;row<_1b.length;row++){var _1e=_4.create("tr",{tabIndex:"-1"},this.gridNode);for(var col=0;col<_1b[row].length;col++){var _1f=_1b[row][col];if(_1f){var _20=new _1d(_1f);var _21=_4.create("td",{"class":this.cellClass,tabIndex:"-1",title:_1c[_1f]});_20.fillCell(_21,url);this.connect(_21,"ondijitclick","_onCellClick");this._trackMouseState(_21,this.cellClass);_4.place(_21,_1e);_21.index=this._cells.length;this._cells.push({node:_21,dye:_20});}}}this._xDim=_1b[0].length;this._yDim=_1b.length;},_navigateByArrow:function(evt){var _22={38:-this._xDim,40:this._xDim,39:this.isLeftToRight()?1:-1,37:this.isLeftToRight()?-1:1};var _23=_22[evt.keyCode];var _24=this._currentFocus.index+_23;if(_24<this._cells.length&&_24>-1){var _25=this._cells[_24].node;this._setCurrent(_25);}}});_4.declare("dojox.drawing.plugins.Greeks",null,{constructor:function(_26){this._alias=_26;},getValue:function(){return this._alias;},fillCell:function(_27){_27.innerHTML="&"+this._alias+";";}});}}};});