var STK={VERSION:"0.9.0",Assert:function(c,d){if(c){return}if(arguments.length>2){var b=[];for(var a=1;a<arguments.length;a++){b.push(arguments[a])}d=SEK.String.Format(b)}SEK.Log.Critical("Assertion Triggered! from %s\n%s",STK.Assert.caller,d)},_requeue_time:0,Requeue:function(a){return window.setTimeout(a,STK._requeue_time)},UNIMPLEMENTED:function(){window.alert("STK ERROR!  Method Unimplemented.")}};if(!window.bab){var bab=function(a){return a}}function LoadLibrary(a){if(!a){a=window}a.STK=window.STK}function main(){if(navigator.userAgent.indexOf("MSIE")!=-1){STK._requeue_time=1}}if(window.Saki){Saki.Library.Require(["sek","0.0.x"],["slk","0.0.x"])}else{main()}STK.Position={LEFT:0,RIGHT:1,TOP:2,BOTTOM:3};STK.Keycode={ENTER:13,ESCAPE:27,TAB:9,CAPSLOCK:20,NUMLOCK:144,DELETE:46,LEFTARROW:37,RIGHTARROW:39,UPARROW:38,DOWNARROW:40,DOT:8226,_last:-1};STK.IconSize={INVALID:0,MENU:1,SMALL_TOOLBAR:2,LARGE_TOOLBAR:3,BUTTON:4,DND:5,DIALOG:6,LARGE:7};STK.Stock={ABOUT:"gtk-about",ADD:"gtk-add",APPLY:"gtk-apply",BOLD:"gtk-bold",BUSY:"stk-busy",CANCEL:"gtk-cancel",CDROM:"gtk-cdrom",CLEAR:"gtk-clear",CLOSE:"gtk-close",COLOR_PICKER:"gtk-color-picker",CONVERT:"gtk-convert",CONNECT:"gtk-connect",COPY:"gtk-copy",CUT:"gtk-cut",DELETE:"gtk-delete",DIALOG_AUTHENTICATION:"gtk-dialog-authentication",DIALOG_ERROR:"gtk-dialog-error",DIALOG_INFO:"gtk-dialog-info",DIALOG_QUESTION:"gtk-dialog-question",DIALOG_WARNING:"gtk-dialog-warning",DIRECTORY:"gtk-directory",DISCARD:"gtk-discard",DISCONNECT:"gtk-disconnect",DND:"gtk-dnd",DND_MULTIPLE:"gtk-dnd-multiple",EDIT:"gtk-edit",EXECUTE:"gtk-execute",FILE:"gtk-file",FIND:"gtk-find",FIND_AND_REPLACE:"gtk-find-and-replace",FLOPPY:"gtk-floppy",FULLSCREEN:"gtk-fullscreen",GOTO_BOTTOM:"gtk-goto-bottom",GOTO_FIRST:"gtk-goto-first",GOTO_LAST:"gtk-goto-last",GOTO_TOP:"gtk-goto-top",GO_BACK:"gtk-go-back",GO_DOWN:"gtk-go-down",GO_FORWARD:"gtk-go-forward",GO_UP:"gtk-go-up",HARDDISK:"gtk-harddisk",HELP:"gtk-help",HOME:"gtk-home",INDENT:"gtk-indent",INDEX:"gtk-index",INFO:"gtk-info",ITALIC:"gtk-italic",JUMP_TO:"gtk-jump-to",JUSTIFY_CENTER:"gtk-justify-center",JUSTIFY_FILL:"gtk-justify-fill",JUSTIFY_LEFT:"gtk-justify-left",JUSTIFY_RIGHT:"gtk-justify-right",LEAVE_FULLSCREEN:"gtk-leave-fullscreen",MEDIA_FORWARD:"gtk-media-forward",MEDIA_NEXT:"gtk-media-next",MEDIA_PAUSE:"gtk-media-pause",MEDIA_PLAY:"gtk-media-play",MEDIA_PREVIOUS:"gtk-media-previous",MEDIA_RECORD:"gtk-media-record",MEDIA_REWIND:"gtk-media-rewind",MEDIA_STOP:"gtk-media-stop",MISSING_IMAGE:"gtk-missing-image",NETWORK:"gtk-network",NEW:"gtk-new",NO:"gtk-no",OK:"gtk-ok",OPEN:"gtk-open",ORIENTATION_LANDSCAPE:"gtk-orientation-landscape",ORIENTATION_PORTRAIT:"gtk-orientation-portrait",ORIENTATION_REVERSE_LANDSCAPE:"gtk-orientation-reverse-landscape",ORIENTATION_REVERSE_PORTRAIT:"gtk-orientation-reverse-portrait",PASTE:"gtk-paste",PREFERENCES:"gtk-preferences",PRINT:"gtk-print",PRINT_PREVIEW:"gtk-print-preview",PROPERTIES:"gtk-properties",QUESTION:"stk-question",QUIT:"gtk-quit",REDO:"gtk-redo",REFRESH:"gtk-refresh",REMOVE:"gtk-remove",REVERT_TO_SAVED:"gtk-revert-to-saved",SAVE:"gtk-save",SAVE_AS:"gtk-save-as",SELECT_ALL:"gtk-select-all",SELECT_COLOR:"gtk-select-color",SELECT_FONT:"gtk-select-font",SHUTDOWN:"stk-shutdown",SORT_ASCENDING:"gtk-sort-ascending",SORT_DESCENDING:"gtk-sort-descending",SPELL_CHECK:"gtk-spell-check",STOP:"gtk-stop",STRIKETHROUGH:"gtk-strikethrough",UNDELETE:"gtk-undelete",UNDERLINE:"gtk-underline",UNDO:"gtk-undo",UNINDENT:"gtk-unindent",YES:"gtk-yes",ZOOM_100:"gtk-zoom-100",ZOOM_FIT:"gtk-zoom-fit",ZOOM_IN:"gtk-zoom-in",ZOOM_OUT:"gtk-zoom-out",USER:"stk-user",BUSY:"stk-busy"};STK.StockItemsStack={_sets:[],Lookup:function(b,a){if(STK.StockItemsStack._sets.length==0){STK.StockItems.CreateDefault()}for(var c=STK.StockItemsStack._sets.length-1;c>=0;c--){var d=STK.StockItemsStack._sets[c].Lookup(b,a);if(d){return d}}return null},LookupNativeSize:function(b,a){if(STK.StockItemsStack._sets.length==0){STK.StockItems.CreateDefault()}for(var c=STK.StockItemsStack._sets.length-1;c>=0;c--){var d=STK.StockItemsStack._sets[c].LookupNativeSize(b,a);if(d){return d}}return null},Push:function(a){STK.StockItemsStack._sets.push(a)},__guard:null};STK.StockItems=function(){var a={};this.Lookup=function(d,b){if(a[d]==undefined){return null}var c=this.__IconToNative(b);return{"stock-id":d,label:a[d].label,icon:this.__GetIcon(a[d].icon,c),accel:a[d].accel,"translation-domain":a[d]["translation-domain"]}};this.LookupNativeSize=function(c,b){if(a[c]==undefined){return null}return{"stock-id":c,label:a[c].label,icon:this.__GetIcon(a[c].icon,b),accel:a[c].accel,"translation-domain":a[c]["translation-domain"]}};this.Add=function(b,f,c,d,e){a[b]={"stock-id":b,label:c,icon:f,accel:d,"translation-domain":e}};this.__IconToNative=function(b){var c=16;if(b!==undefined){switch(b){default:case STK.IconSize.INVALID:case STK.IconSize.MENU:case STK.IconSize.SMALL_TOOLBAR:case STK.IconSize.BUTTON:c=16;break;case STK.IconSize.LARGE_TOOLBAR:case STK.IconSize.DND:c=32;break;case STK.IconSize.DIALOG:c=64;break;case STK.IconSize.LARGE:c=128;break}}return c};this.__GetIcon=function(e,c){var d="/data/icons/"+c+"x"+c+"/"+e;var b=STK.Path.FindImage(d);return{location:b,width:c,height:c}}};STK.StockItems.CreateDefault=function(){var a=new STK.StockItems();a.Add(STK.Stock.ABOUT,null,bab("About"));a.Add(STK.Stock.ADD,"add",bab("Add"));a.Add(STK.Stock.BOLD,null,bab("Bold"));a.Add(STK.Stock.APPLY,"apply",bab("Apply"));a.Add(STK.Stock.CANCEL,"cancel",bab("Cancel"));a.Add(STK.Stock.CDROM,null,bab("CD-Rom"));a.Add(STK.Stock.CLEAR,null,bab("Clear"));a.Add(STK.Stock.CLOSE,"close",bab("Close"));a.Add(STK.Stock.COLOR_PICKER,null,bab("Color Picker"));a.Add(STK.Stock.CONVERT,null,bab("Convert"));a.Add(STK.Stock.CONNECT,null,bab("Connect"));a.Add(STK.Stock.COPY,null,bab("Copy"));a.Add(STK.Stock.CUT,null,bab("Cut"));a.Add(STK.Stock.DELETE,null,bab("Delete"));a.Add(STK.Stock.DIALOG_AUTHENTICATION,"dialog_authentication",bab("Authentication"));a.Add(STK.Stock.DIALOG_ERROR,"stop",bab("Error"));a.Add(STK.Stock.DIALOG_INFO,"user",bab("Information"));a.Add(STK.Stock.DIALOG_QUESTION,"question",bab("Question"));a.Add(STK.Stock.DIALOG_WARNING,"warning",bab("Warning"));a.Add(STK.Stock.DIRECTORY,"directory",bab("Directory"));a.Add(STK.Stock.DISCARD,null,bab("Discard"));a.Add(STK.Stock.DISCONNECT,null,bab("Disconnect"));a.Add(STK.Stock.DND,null,bab("Drag-And-Drop"));a.Add(STK.Stock.DND_MULTIPLE,null,bab("Drag-And-Drop multiple"));a.Add(STK.Stock.EDIT,"edit",bab("Edit"));a.Add(STK.Stock.EXECUTE,null,bab("Execute"));a.Add(STK.Stock.FILE,"file",bab("File"));a.Add(STK.Stock.FIND,null,bab("Find"));a.Add(STK.Stock.FIND_AND_REPLACE,null,bab("Find and Replace"));a.Add(STK.Stock.FLOPPY,null,bab("Floppy"));a.Add(STK.Stock.FULLSCREEN,null,bab("Fullscreen"));a.Add(STK.Stock.GOTO_BOTTOM,null,bab("Bottom"));a.Add(STK.Stock.GOTO_FIRST,null,bab("First"));a.Add(STK.Stock.GOTO_LAST,null,bab("Last"));a.Add(STK.Stock.GOTO_TOP,null,bab("Top"));a.Add(STK.Stock.GO_BACK,"arrow-west",bab("Back"));a.Add(STK.Stock.GO_DOWN,"arrow-south",bab("Down"));a.Add(STK.Stock.GO_FORWARD,"arrow-east",bab("Forward"));a.Add(STK.Stock.GO_UP,"arrow-north",bab("Up"));a.Add(STK.Stock.HARDDISK,"harddisk",bab("Harddisk"));a.Add(STK.Stock.HELP,null,bab("Help"));a.Add(STK.Stock.HOME,null,bab("Home"));a.Add(STK.Stock.INDENT,null,bab("Indent"));a.Add(STK.Stock.INDEX,null,bab("Index"));a.Add(STK.Stock.INFO,null,bab("Info"));a.Add(STK.Stock.ITALIC,null,bab("Italic"));a.Add(STK.Stock.JUMP_TO,null,bab("Jump to"));a.Add(STK.Stock.JUSTIFY_CENTER,null,bab("Center"));a.Add(STK.Stock.JUSTIFY_FILL,null,bab("Fill"));a.Add(STK.Stock.JUSTIFY_LEFT,null,bab("Left"));a.Add(STK.Stock.JUSTIFY_RIGHT,null,bab("Right"));a.Add(STK.Stock.LEAVE_FULLSCREEN,null,bab("Leave Fullscreen"));a.Add(STK.Stock.MEDIA_FORWARD,"arrow-east",bab("Forward"));a.Add(STK.Stock.MEDIA_NEXT,"arrow-east",bab("Next"));a.Add(STK.Stock.MEDIA_PAUSE,"pause",bab("Pause"));a.Add(STK.Stock.MEDIA_PLAY,"play",bab("Play"));a.Add(STK.Stock.MEDIA_PREVIOUS,"arrow-west",bab("Previous"));a.Add(STK.Stock.MEDIA_RECORD,"led_red",bab("Record"));a.Add(STK.Stock.MEDIA_REWIND,"arrow-west",bab("Rewind"));a.Add(STK.Stock.MEDIA_STOP,"stop",bab("Stop"));a.Add(STK.Stock.MISSING_IMAGE,null,bab("Missing Image"));a.Add(STK.Stock.NETWORK,null,bab("Network"));a.Add(STK.Stock.NEW,null,bab("New"));a.Add(STK.Stock.NO,"led_red",bab("No"));a.Add(STK.Stock.OK,"check",bab("OK"));a.Add(STK.Stock.OPEN,null,bab("Open"));a.Add(STK.Stock.ORIENTATION_LANDSCAPE,null,bab("Landscape Orientation"));a.Add(STK.Stock.ORIENTATION_PORTRAIT,null,bab("Portrait Orientation"));a.Add(STK.Stock.ORIENTATION_REVERSE_LANDSCAPE,null,bab("Reverse Landscape Orientation"));a.Add(STK.Stock.ORIENTATION_REVERSE_PORTRAIT,null,bab("Reverse Portrait Orientation"));a.Add(STK.Stock.PASTE,null,bab("Paste"));a.Add(STK.Stock.PREFERENCES,null,bab("Preference"));a.Add(STK.Stock.PRINT,null,bab("Print"));a.Add(STK.Stock.PRINT_PREVIEW,null,bab("Print Preview"));a.Add(STK.Stock.PROPERTIES,null,bab("Properties"));a.Add(STK.Stock.QUESTION,"question",bab("Question"));a.Add(STK.Stock.QUIT,"ex",bab("Quit"));a.Add(STK.Stock.REDO,null,bab("Redo"));a.Add(STK.Stock.REFRESH,"cycle",bab("Refresh"));a.Add(STK.Stock.REMOVE,"remove",bab("Remove"));a.Add(STK.Stock.REVERT_TO_SAVED,null,bab("Revert"));a.Add(STK.Stock.SAVE,null,bab("Save"));a.Add(STK.Stock.SAVE_AS,null,bab("Save As"));a.Add(STK.Stock.SELECT_ALL,null,bab("Select All"));a.Add(STK.Stock.SELECT_COLOR,null,bab("Select Color"));a.Add(STK.Stock.SELECT_FONT,null,bab("Select Font"));a.Add(STK.Stock.SORT_ASCENDING,null,bab("Ascending"));a.Add(STK.Stock.SORT_DESCENDING,null,bab("Descending"));a.Add(STK.Stock.SPELL_CHECK,null,bab("Spell Check"));a.Add(STK.Stock.STOP,"stop",bab("Stop"));a.Add(STK.Stock.STRIKETHROUGH,null,bab("Strikethrough"));a.Add(STK.Stock.UNDELETE,null,bab("Undelete"));a.Add(STK.Stock.UNDERLINE,null,bab("Underline"));a.Add(STK.Stock.UNDO,null,bab("Undo"));a.Add(STK.Stock.UNINDENT,null,bab("Unindent"));a.Add(STK.Stock.YES,"led_green",bab("Yes"));a.Add(STK.Stock.ZOOM_100,null,bab("Zoom 100%"));a.Add(STK.Stock.ZOOM_FIT,null,bab("Zoom to Fit"));a.Add(STK.Stock.ZOOM_IN,null,bab("Zoom In"));a.Add(STK.Stock.ZOOM_OUT,null,bab("Zoom Out"));a.Add(STK.Stock.BUSY,"busy.gif",bab("Busy"));a.Add(STK.Stock.SHUTDOWN,"shutdown",bab("Shutdown"));a.Add(STK.Stock.USER,"user",bab("User"));STK.StockItemsStack.Push(a)};STK.Widget=function(){SEK.Object.apply(this);this.RegisterProperty("height-request",-1);this.RegisterProperty("width-request",-1);this.RegisterProperty("sensitive",true,SEK.Delegate(this,"OnSensitiveChanged"));this.OnSensitiveChanged=function(b,d,c,a){};this.RegisterProperty("cursor","",SEK.Delegate(this,"OnCursorChanged"));this.OnCursorChanged=function(c,e,d,a){for(var b in this._elements){this._elements[b].SetStyle("cursor",a)}for(var b in this._subwidgets){this._subwidgets[b].SetProperty("cursor",a)}};this.RegisterProperty("tooltip","",SEK.Delegate(this,"OnTooltipChanged"));this.OnTooltipChanged=function(c,e,d,a){for(var b in this._elements){this._elements[b].SetAttribute("title",a)}for(var b in this._subwidgets){this._subwidgets[b].SetProperty("tooltip",a)}};this.RegisterProperty("selectable",true,SEK.Delegate(this,"OnSelectableChanged"));this.OnSelectableChanged=function(c,e,d,a){for(var b in this._elements){this._elements[b].SetSelectable(a);if(SEK.UserAgent.IsKhtml()||SEK.UserAgent.IsOpera()){if(!a){this._elements[b].Listen("mousedown",function(f){f.PreventDefault()})}}}for(var b in this._subwidgets){this._subwidgets[b].SetProperty("selectable",a)}};this.Register("hide");this.Register("map");this.Register("show");this.Register("unmap");this.Register("style-property-changed");this.Register("size-allocate");this.Register("size-request");this.SetData("__mapped__",false);this._style_properties={};this._elements={};this._subwidgets={};this.SetElement=function(a,b){this._elements[a]=b};this.GetElement=function(a){return this._elements[a]};this.UnsetElement=function(a){delete this._elements[a]};this.HasElement=function(a){return a in this._elements};this.SetSubWidget=function(a,b){this._subwidgets[a]=b};this.GetSubWidget=function(a){return this._subwidgets[a]};this.UnsetSubWidget=function(a){delete this._subwidgets[a]};this.HasSubWidget=function(a){return a in this._subwidgets};this.SetStyleProperty=function(c,b){var a=this._style_properties[c];this._style_properties[c]=b;this.OnStylePropertyChanged(this,c,a,b);this.Emit("style-property-changed",this,c,a,b)};this.OnStylePropertyChanged=function(b,d,c,a){};this.GetStyleProperty=function(a){return this._style_properties[a]};this.SetTooltip=function(a){this.SetProperty("tooltip",a)};this.Show=function(){if(!this.IsMapped()){this.Map(SEK.Doc.Body())}for(var a in this._elements){this._elements[a].Show()}for(var a in this._subwidgets){this._subwidgets[a].Show()}this.SetData("__shown__",true);this.Emit("show")};this.Hide=function(){for(var a in this._elements){this._elements[a].Hide()}for(var a in this._subwidgets){this._subwidgets[a].Hide()}this.SetData("__shown__",false);this.Emit("hide")};this.IsShown=function(){return this.GetData("__shown__")};this.Map=function(a){this.SetData("__mapped__",true);this.Emit("map")};this.Embed=function(c,a){if(a){var b=document.getElementById(c);b.innerHTML=""}var d=new STK.EmbeddedWindow(c,this);d.Show();return d};this.IsMapped=function(){return this.GetData("__mapped__")};this.Unmap=function(){var a=this.GetElement("frame");if(a){a.Remove()}this.SetData("__mapped__",false);this.Emit("unmap")};this.Measure=function(c){if(!c){c={w:0,h:0}}var a=this.GetProperty("width-request");var b=this.GetProperty("height-request");if(a>=0){c.w=a}if(b>=0){c.h=b}return c};this.Reallocate=function(a,b){};this.SetSensitive=function(a){this.SetProperty("sensitive",a)};this.GetSensitive=function(){return this.GetProperty("sensitive")};this.SetSelectable=function(a){this.SetProperty("selectable",a)};this.GetSelectable=function(){return this.GetProperty("selectable")};this.SetSizeRequest=function(a,b){this.SetProperty("width-request",a);this.SetProperty("height-request",b);this.Emit("size-request")};this.GetSizeRequest=function(){return{w:this.GetProperty("width-request"),h:this.GetProperty("height-request")}};this.CreateType("Widget")};STK.Container=function(){STK.Widget.apply(this);this.Register("add");this.Register("remove");this._container_widgets={};this._container_properties={};this.Add=function(a){this._container_widgets[a.Name()]=a;this._container_properties[a.Name()]=new Object();this.Emit("add",a)};this.AddWithProperties=function(c,b){this.Add(c);for(var a in b){this.SetChildProperty(c,b[a][0],b[a][1])}};this.Remove=function(a){this.Emit("remove",a);this._container_widgets[a.Name()]=null;this._container_properties[a.Name()]=null;delete this._container_widgets[a.Name()];delete this._container_properties[a.Name()]};this.SetChildProperty=function(c,a,b){this._container_properties[c.Name()][a]=b};this.GetChildProperty=function(b,a){return this._container_properties[b.Name()][a]};this.GetChildren=function(){return this._container_widgets};this.Count=function(){var b=0;for(var a in this._container_widgets){if(this._container_widgets.hasOwnProperty(a)){b+=1}}return b};this.OnSensitiveChanged=function(c,e,d,a){for(var b in this._container_widgets){if(this._container_widgets.hasOwnProperty(b)){this._container_widgets[b].SetSensitive(a)}}this.StkWidgetOnSensitiveChanged(c,e,d,a)};this.CreateType("Container")};STK.Bin=function(){STK.Container.apply(this);this.Add=function(c){var b=this.GetChildren();for(var a in b){this.Remove(b[a])}this.StkContainerAdd(c)};this.GetChild=function(){for(var a in this._container_widgets){if(this._container_widgets[a]&&this._container_widgets[a].Map){return this._container_widgets[a]}}return null};this.CreateType("Bin")};STK.Item=function(){STK.Bin.apply(this);this.Register("select");this.Register("deselect");this.Register("toggle");this.Select=function(){this.Emit("select")};this.Deselect=function(){this.Emit("deselect")};this.Toggle=function(){this.Emit("toggle")};this.CreateType("Item")};STK.Path={_img_suffix:false,_DetectSuffix:function(){var a=navigator.userAgent.toLowerCase();var b=a.match(/msie\s(\d+|\d+\.\d+).*?win/);if(b!=null){if(Number(b[1])==6){STK.Path._img_suffix=".gif";return}}STK.Path._img_suffix=".png"},FindImage:function(a,b){var c=window.location.protocol+"//"+window.location.host+"/lib/stk/"+STK.VERSION+a;if(b!=undefined&&b){return c}if(c.match(/\.[a-zA-Z0-9]{1,6}$/)){return c}if(!STK.Path._img_suffix){STK.Path._DetectSuffix()}return c+STK.Path._img_suffix}};STK.Misc=function(){STK.Widget.apply(this);this.RegisterProperty("xalign",0.5,SEK.Delegate(this,"OnXAlignChanged"));this.RegisterProperty("yalign",0.5,SEK.Delegate(this,"OnYAlignChanged"));this.RegisterProperty("xpad",0,SEK.Delegate(this,"OnXPadChanged"));this.RegisterProperty("ypad",0,SEK.Delegate(this,"OnYPadChanged"));var a=new SEK.Element.Div();a.SetStyle("textAlign","center");a.SetStyle("verticalAlign","middle");this.SetElement("misc-frame",a);this.OnXAlignChanged=function(c,f,d,b){var e=this.GetElement("misc-frame");if(b<0.5){e.SetStyle("textAlign","left")}else{if(b>0.5){e.SetStyle("textAlign","right")}else{e.SetStyle("textAlign","center")}}};this.OnYAlignChanged=function(c,f,d,b){var e=this.GetElement("misc-frame");if(b<0.5){e.SetStyle("verticalAlign","top")}else{if(b>0.5){e.SetStyle("verticalAlign","bottom")}else{e.SetStyle("verticalAlign","middle")}}};this.OnXPadChanged=function(c,f,d,b){var e=this.GetElement("misc-frame");e.SetStyle("paddingLeft",String(parseInt(b))+"px");e.SetStyle("paddingRight",String(parseInt(b))+"px");this.Emit("size-request")};this.OnYPadChanged=function(c,f,d,b){var e=this.GetElement("misc-frame");e.SetStyle("paddingTop",String(parseInt(b))+"px");e.SetStyle("paddingBottom",String(parseInt(b))+"px");this.Emit("size-request")};this.SetAlignment=function(b,c){this.SetProperty("xalign",b);this.SetProperty("yalign",c)};this.SetPadding=function(b,c){this.SetProperty("xpad",b);this.SetProperty("ypad",c)};this.GetAlignment=function(){return{x:this.GetProperty("xalign"),y:this.GetProperty("yalign")}};this.GetPadding=function(){return{x:this.GetProperty("xpad"),y:this.GetProperty("ypad")}};this.Map=function(b){var c=this.GetElement("misc-frame");b.Add(c);this.StkWidgetMap()};this.Measure=function(){return{w:2*parseInt(this.GetProperty("xpad")),h:2*parseInt(this.GetProperty("ypad"))}};this.Reallocate=function(b,c){var d=this.GetElement("misc-frame");d.SetStyle("width",String(b)+"px");d.SetStyle("height",String(c)+"px")};this.CreateType("Misc")};STK.Label=function(a,c){STK.Misc.apply(this);this._layout=new SLK.TextLayout();this._layout.SetMarkup("");this._style=new SLK.TextStyle();this.SetProperty("selectable",false);this.SetProperty("cursor","default");for(var b in STK.Label.ClassStyles){this.SetStyleProperty(b,STK.Label.ClassStyles[b])}this.OnStylePropertyChanged=function(e,g,f,d){this._style.SetStyle(g,d);this.TouchProperty("label")};this._style.LoadFromStyles(this);this.RegisterProperty("label","",SEK.Delegate(this,"OnLabelChanged"));this.OnLabelChanged=function(f,h,g,d){var e=d;if(!this.GetProperty("use-markup")){e=SEK.String.EscapeHtml(d)}this._layout.SetMarkup(e,this._style);this.Emit("size-request");this._ApplyLayout()};this.RegisterProperty("ellipsize",STK.EllipsizeMode.NONE,SEK.Delegate(this,"OnEllipsizeChanged"));this.OnEllipsizeChanged=function(e,g,f,d){this.TouchProperty("label")};this.RegisterProperty("max-width-chars",-1,SEK.Delegate(this,"OnMaxWidthCharsChanged"));this.OnMaxWidthCharsChanged=function(e,g,f,d){this.TouchProperty("label")};this.RegisterProperty("use-markup",false,SEK.Delegate(this,"OnUseMarkupChanged"));this.OnUseMarkupChanged=function(e,g,f,d){this.TouchProperty("label")};this.RegisterProperty("width-chars",-1,SEK.Delegate(this,"OnWidthCharsChanged"));this.OnWidthCharsChanged=function(e,g,f,d){this.TouchProperty("label")};this.RegisterProperty("wrap",STK.WrapMode.NONE,SEK.Delegate(this,"OnWrapChanged"));this.OnWrapChanged=function(e,g,f,d){this.TouchProperty("label")};this.OnSelectableChanged=function(f,i,g,e){if(SEK.UserAgent.IsExplorer()){var h=this.GetElement("misc-frame");var d=function(m,k,l){for(var j=0;j<k.GetChildCount();j++){var n=k.GetChild(j);if(n.GetTagName()=="span"){n.SetSelectable(l);m(m,n,l)}}};d(d,h,e)}this.StkMiscOnSelectableChanged(f,i,g,e)};this.OnSensitiveChanged=function(e,g,f,d){if(d){this._style.SetStyle("color",this.GetStyleProperty("color"))}else{this._style.SetStyle("color",STK.Label.ClassStyles["insensitive-color"])}this.TouchProperty("label");this.StkMiscOnSensitiveChanged(e,g,f,d)};this._ApplyLayout=function(){if(this.GetData("__label_width__")===undefined){this.Measure()}var f=this.GetElement("misc-frame");var d=this.GetData("__label_width__");var e;if(this.GetProperty("ellipsize")!=STK.EllipsizeMode.NONE&&d){e=this._layout.GetMarkupEllipsized(d,this.GetProperty("ellipsize"))}else{if(this.GetProperty("wrap")!=STK.WrapMode.NONE&&d){e=this._layout.GetMarkupWrapped(d,this.GetProperty("wrap"))}else{e=this._layout.GetMarkup()}}f.SetContent(e);this.TouchProperty("selectable")};this.Measure=function(){var l=this.StkMiscMeasure();this.SetData("__misc_width__",l.w);this.SetData("__misc_height__",l.h);var e;var n;var k=-1;var h=this._layout.Measure();e=h.w;k=h.h;var d=this.GetSizeRequest();if(d.w>=0){e=d.w}else{var g=Number(this.GetProperty("width-chars"));if(g>0){var j=SLK.Text.GetAverageCharSize(this._style);e=Math.round(Math.max(j.w*3,j.w*g));k=j.h}else{var p=Number(this.GetProperty("max-width-chars"));if(p>0){var j=SLK.Text.GetAverageCharSize(this._style);var f=Math.round(Math.max(j.w*3,j.w*g));e=Math.min(e,f);k=j.h}}}if(this.GetProperty("ellipsize")!=STK.EllipsizeMode.NONE&&d.w<0){e=(SLK.Text.Measure("...",this._style)).w}if(k<0){var j=SLK.Text.GetAverageCharSize(this._style);k=j.h}if(this.GetProperty("wrap")!=STK.WrapMode.NONE){var m=this._layout.GetMarkupWrapped(e,this.GetProperty("wrap"));if(m){var o=1;var i=m.match(/<br\/>/g);if(i&&i!=-1&&i.length>0){o=i.length+1}else{i=m.match(/\n/g);if(i&&i!=-1&&i.length>0){o=i.length+1}}n=o*k}if(!n){n=k*Math.ceil(h.w/e)}}else{n=k}if(SEK.UserAgent.IsExplorer()){e+=2;n+=2}this.SetData("__label_width__",e);this.SetData("__label_height__",n);return{w:l.w+e,h:l.h+n}};this.Reallocate=function(d,e){this.StkMiscReallocate(d,e);d-=this.GetData("__misc_width__");e-=this.GetData("__misc_height__");this.SetData("__label_width__",d);this.SetData("__label_height__",e);this._ApplyLayout()};this.GetText=function(){return this.GetProperty("label")};this.SetText=function(d){this.CoerceProperty("use-markup",false);this.SetProperty("label",d)};this.GetMarkup=function(){return this.GetProperty("label")};this.SetMarkup=function(d){this.CoerceProperty("use-markup",true);this.SetProperty("label",d)};this.SetEllipsize=function(d){this.SetProperty("ellipsize",d)};this.GetEllipsize=function(){return this.GetProperty("ellipsize")};this.SetWrap=function(d){this.SetProperty("wrap",d)};this.GetWrap=function(){return this.GetProperty("wrap")};this.SetWidthChars=function(d){this.SetProperty("width-chars",Number(d))};this.GetWidthChars=function(){return this.GetProperty("width-chars")};this.SetMaxWidthChars=function(d){this.SetProperty("max-width-chars",Number(d));this.StkWidgetUpdate()};this.GetMaxWidthChars=function(){return this.GetProperty("max-width-chars")};this.CreateType("Label");if(c){this.SetProperty("use-markup",Boolean(c))}if(a){this.SetProperty("label",a)}};STK.Label.ClassStyles={"font-family":"sans-serif","font-size":"1em","font-size-adjust":"none","font-stretch":"normal","font-style":"normal","font-variant":"normal","font-weight":"normal",color:"#000000",direction:"ltr","line-height":"normal","letter-spacing":"normal","text-decoration":"none","text-shadow":"none","text-transform":"none","unicode-bidi":"normal","word-spacing":"normal","insensitive-color":"#555555"};STK.EllipsizeMode={NONE:"none",START:"start",MIDDLE:"middle",END:"end"};STK.Justification={LEFT:0,RIGHT:1,CENTER:2,FILL:3};STK.WrapMode={NONE:"none",WORD:"word",CHAR:"char"};STK.Box=function(){STK.Container.apply(this);var a=0;this.RegisterProperty("spacing",0,SEK.Delegate(this,"OnSpacingChanged"));this.RegisterProperty("homogeneous",false,SEK.Delegate(this,"OnHomogeneousChanged"));this.SetElement("box-frame",new SEK.Element.Table());this.GetElement("box-frame").SetAttribute("cellPadding",0);this.GetElement("box-frame").SetAttribute("cellSpacing",0);this.OnSpacingChanged=function(c,e,d,b){this.Emit("size-request")};this.OnHomogeneousChanged=function(c,e,d,b){this.Emit("size-request")};this.PackStart=function(f,c,e,d){if(!f){SEK.Log.Error("STK::Box::PackStart -- attempted null child pack");return}if(f.Name&&f.Name()==this.Name()){SEK.Log.Error("STK::Box::PackStart -- attempted self pack");return}if(c===undefined){c=true}if(e===undefined){e=true}if(d===undefined){d=0}c=Boolean(c);e=Boolean(e);d=Math.floor(Number(d));this.StkContainerAdd(f);this.SetChildProperty(f,"expand",c);this.SetChildProperty(f,"fill",e);this.SetChildProperty(f,"padding",d);this.SetChildProperty(f,"pack-type",STK.BoxPack.START);this.SetChildProperty(f,"need-measure",true);this.SetChildProperty(f,"need-alloc",true);this.SetChildProperty(f,"__size_request_handler__",f.Connect("size-request",SEK.Delegate(this,"OnChildSizeChanged")));this.SetChildProperty(f,"__hide_handler__",f.Connect("hide",SEK.Delegate(this,"OnChildSizeChanged")));this.SetChildProperty(f,"__show_handler__",f.Connect("show",SEK.Delegate(this,"OnChildSizeChanged")));if(this.IsMapped()){var b=this.ThemeMapChildArea(f,a);this.SetChildProperty(f,"position",a);a++;f.Map(b);f.Show();this.Emit("size-request")}};this.PackEnd=function(f,c,e,d){if(!f){SEK.Log.Error("STK::Box::PackEnd -- attempted null child pack");return}if(f.Name&&f.Name()==this.Name()){SEK.Log.Error("STK::Box::PackEnd -- attempted self pack");return}if(c===undefined){c=true}if(e===undefined){e=true}if(d===undefined){d=0}c=Boolean(c);e=Boolean(e);d=Math.floor(Number(d));this.Add(f);this.SetChildProperty(f,"expand",c);this.SetChildProperty(f,"fill",e);this.SetChildProperty(f,"padding",d);this.SetChildProperty(f,"pack-type",STK.BoxPack.END);this.SetChildProperty(f,"need-measure",true);this.SetChildProperty(f,"need-alloc",true);this.SetChildProperty(f,"__size_request_handler__",f.Connect("size-request",SEK.Delegate(this,"OnChildSizeChanged")));this.SetChildProperty(f,"__hide_handler__",f.Connect("hide",SEK.Delegate(this,"OnChildSizeChanged")));this.SetChildProperty(f,"__show_handler__",f.Connect("show",SEK.Delegate(this,"OnChildSizeChanged")));if(this.IsMapped()){var b=this.ThemeMapChildArea(f,-1);this.SetChildProperty(f,"position",-1);f.Map(b);f.Show();this.Emit("size-request")}};this.SetChildPacking=function(f,b,d,c,e){this.SetChildProperty(f,"expand",b);this.SetChildProperty(f,"fill",d);this.SetChildProperty(f,"padding",c);this.SetChildProperty(f,"pack-type",e);this.SetChildProperty(f,"need-allocate",true);this.SetChildProperty(f,"need-measure",true);this.Emit("size-request")};this.QueryChildPacking=function(b){return{expand:this.GetChildProperty(b,"expand"),fill:this.GetChildProperty(b,"fill"),padding:this.GetChildProperty(b,"padding"),pack_type:this.GetChildProperty(b,"pack-type")}};this.GetSpacing=function(){return this.GetProperty("spacing")};this.SetSpacing=function(b){this.SetProperty("spacing",Number(b))};this.GetHomogeneous=function(){return this.GetProperty("homogeneous")};this.SetHomogeneous=function(b){this.SetProperty("homogeneous",Boolean(b))};this.Remove=function(b){b.Disconnect(this.GetChildProperty(b,"__size_request_handler__"));b.Disconnect(this.GetChildProperty(b,"__show_handler__"));b.Disconnect(this.GetChildProperty(b,"__hide_handler__"));this.ThemeUnmapChildArea(b);if(this.GetChildProperty(b,"pack-type")==STK.BoxPack.START){a--}this.StkContainerRemove(b)};this.Add=function(b){return this.PackStart(b)};this.MapChild=function(f,c){var b=this.ThemeMapChildArea(f,c);f.Map(b);this.SetChildProperty(f,"position",c);var d=this.GetChildProperty(f,"last-allocated-w");var e=this.GetChildProperty(f,"last-allocated-h");if(d&&e){f.Reallocate(d,e)}};this.Map=function(f){if(this.IsMapped()){return}var g=this.GetElement("box-frame");f.Add(g);var b=0;var e=this.GetChildren();for(var d in e){if(e.hasOwnProperty(d)){var h=e[d];if(!h){continue}if(this.GetChildProperty(h,"pack-type")!=STK.BoxPack.END){this.MapChild(h,b);b++}}}a=b;for(var d in e){if(e.hasOwnProperty(d)){var h=e[d];if(!h){continue}if(this.GetChildProperty(h,"pack-type")==STK.BoxPack.END){this.MapChild(h,b);b++}}}this.StkContainerMap(f)};this.Unmap=function(){this.GetElement("box-frame").Remove();this.StkContainerUnmap()};this.OnChildSizeChanged=function(d){if(this.Count()==0){return}if(d.Name()==this.Name()){return}if(!this.IsMapped()){return}var e=this.GetChildren()[d.Name()];if(!e){SEK.Log.Error("Box::OnChildSizeChanged - no child with the name '%s' in the box!",d.Name());return}this.SetChildProperty(e,"need-measure",true);var c=this.GetChildren();for(var b in c){if(this.GetChildProperty(c[b],"fill")){this.SetChildProperty(c[b],"need-allocate",true)}}this.Emit("size-request")};this._MeasureAllChildren=function(){var c=this.GetChildren();for(var b in c){if(c.hasOwnProperty(b)){var e=c[b];if(this.GetChildProperty(e,"need-measure")){var d={w:0,h:0};if(false!==e.IsShown()){d=e.Measure()}this.SetChildProperty(e,"last-measured-w",d.w);this.SetChildProperty(e,"last-measured-h",d.h);this.SetChildProperty(e,"need-measure",false);this.SetChildProperty(e,"need-allocate",true)}}}};this.Measure=function(){this._MeasureAllChildren();var b=this._PreAllocateScan();return b};this._ReallocateAllChildren=function(b,e){var d=this.GetChildren();for(var c in d){if(d.hasOwnProperty(c)){var f=d[c];if(this.GetChildProperty(f,"need-allocate")){f.Reallocate(this.GetChildProperty(f,"last-allocated-w"),this.GetChildProperty(f,"last-allocated-h"));this.SetChildProperty(f,"need-allocate",false)}}}};this.Reallocate=function(b,c){if(this.Count()==0){return}this._AllocateScan(b,c);this._ReallocateAllChildren(b,c);this.GetElement("box-frame").SetStyle("width",String(b)+"px");this.GetElement("box-frame").SetStyle("height",String(c)+"px")};this.CreateType("Box")};STK.BoxPack={START:0,END:1};STK.HBox=function(a,b){STK.Box.apply(this);this.SetChildExpansion=function(g,e,c,d){var f=this.GetElement(g.Name());f.SetStyle("width",String(c)+"px");f.SetStyle("padding",Math.floor(d/2)+"px")};this.ThemeMapChildArea=function(g,c){var e=this.GetElement("box-frame");var d=e.GetRowAtOffset(0);if(!d){d=e.InsertRow(-1)}var f=d.InsertCell(c);this.SetElement(g.Name(),f);return f};this.ThemeUnmapChildArea=function(d){var c=this.GetElement(d.Name());if(!c){return}this.UnsetElement(d.Name());c.Remove()};this._PreAllocateScan=function(){var k=2*parseInt(this.GetProperty("spacing"));var o=0;var e=0;var m=0;var c=0;var l=0;var i=0;var g=this.GetChildren();for(var d in g){if(g.hasOwnProperty(d)){var f=g[d];var j={w:this.GetChildProperty(f,"last-measured-w"),h:this.GetChildProperty(f,"last-measured-h")};if(j.w>c){c=j.w}if(j.h>l){l=j.h}var n=2*parseInt(this.GetChildProperty(g[d],"padding"));if(k){n+=k}this.SetChildProperty(g[d],"last-measured-padding",n);if(n){j.w+=n;j.h+=n}if(j.w>e){e=j.w}if(j.h>m){m=j.h}o+=j.w;i++}}var h={w:o,h:m};if(this.GetHomogeneous()){h.w=i*e}this.SetData("max-width",e);this.SetData("max-height",m);this.SetData("max-child-width",c);this.SetData("max-child-height",l);this.SetData("total-width",o);return h};this._AllocateScan=function(o,u){var x=this.GetData("max-width");var i=this.GetData("max-height");var p=this.GetData("max-child-width");var y=this.GetData("max-child-height");if(this.GetHomogeneous()){var k=0;var j=this.GetChildren();for(var B in j){if(j.hasOwnProperty(B)){var m=j[B];var n=this.GetChildProperty(m,"last-measured-padding");var A=this.GetChildProperty(m,"last-allocated-w");var l=this.GetChildProperty(m,"last-allocated-h");this.SetChildProperty(m,"last-allocated-w",p);this.SetChildProperty(m,"last-allocated-h",y);this.SetChildExpansion(m,k,x,n);k+=1}}return}var g=0;var v=0;var q=0;var j=this.GetChildren();for(var B in j){if(j.hasOwnProperty(B)){var m=j[B];var d=this.GetChildProperty(m,"expand");if(!d){var s=this.GetChildProperty(m,"last-measured-w");var c=this.GetChildProperty(m,"last-measured-h");var A=this.GetChildProperty(m,"last-allocated-w");var l=this.GetChildProperty(m,"last-allocated-h");var n=this.GetChildProperty(m,"last-measured-padding");var k=this.GetChildProperty(m,"position");var t=this.GetChildProperty(m,"fill");var r,z;if(t){r=s;z=u-n;this.SetChildExpansion(m,k,s,n)}else{r=s;z=c;this.SetChildExpansion(m,k,s,n)}this.SetChildProperty(m,"last-allocated-w",r);this.SetChildProperty(m,"last-allocated-h",z);g+=s;q+=1}v+=1}}if(v==0){return}var f=o-this.GetData("total-width");if(f<0){SEK.Log.Error("VBox::Reallocate - extra_size is negative: how did we shrink beneath measured size?")}var e=Math.floor(f/(v-q));if(isNaN(e)){return}for(var B in j){if(j.hasOwnProperty(B)){var m=j[B];var d=this.GetChildProperty(m,"expand");if(d){var s=this.GetChildProperty(m,"last-measured-w");var c=this.GetChildProperty(m,"last-measured-h");var A=this.GetChildProperty(m,"last-allocated-w");var l=this.GetChildProperty(m,"last-allocated-h");var n=this.GetChildProperty(m,"last-measured-padding");var k=this.GetChildProperty(m,"position");var t=this.GetChildProperty(m,"fill");var r,z;if(t){r=s+e;z=u-n;this.SetChildExpansion(m,k,s+e,n)}else{r=s;z=c;this.SetChildExpansion(m,k,s+e,n)}this.SetChildProperty(m,"last-allocated-w",r);this.SetChildProperty(m,"last-allocated-h",z)}}}};if(a!=undefined){this.SetProperty("homogeneous",Boolean(a))}if(b!=undefined){this.SetProperty("spacing",Number(b))}this.CreateType("HBox")};STK.Button=function(e,h,d){STK.Bin.apply(this);this.RegisterProperty("image",null,SEK.Delegate(this,"OnImageChanged"));this.OnImageChanged=function(k,m,l,j){if(!j){return}this.Add(j);if(l){this.Remove(l)}this._SetupForStockDisplay();var i=this.GetSubWidget("button-hbox");if(l){i.Remove(l)}this.SetSubWidget("button-image",j);i.PackStart(j,false,false,0)};this.RegisterProperty("stock-image",null,SEK.Delegate(this,"OnStockImageChanged"));this.OnStockImageChanged=function(l,n,m,j){if(!j){return}this._SetupForStockDisplay();var k=STK.StockItemsStack.Lookup(j,STK.IconSize.BUTTON);if(!k){return}var i=this.GetProperty("image");if(!i){i=new STK.Image()}i.SetFromIconSet(k.icon);this.SetImage(i)};this.RegisterProperty("label",null,SEK.Delegate(this,"OnLabelChanged"));this.OnLabelChanged=function(m,o,n,j){if(!j){return}this._SetupForStockDisplay();if(this.GetProperty("use-stock")){var k=this.GetSubWidget("button-label");var l=STK.StockItemsStack.Lookup(j,STK.IconSize.BUTTON);if(!l){k.SetMarkup(j);return}k.SetMarkup(l.label);var i=this.GetProperty("image");if(!i){i=new STK.Image()}i.SetFromIconSet(l.icon);this.SetImage(i)}else{this.GetSubWidget("button-label").SetMarkup(j)}};this.RegisterProperty("use-stock",false,SEK.Delegate(this,"OnUseStockChanged"));this.OnUseStockChanged=function(j,l,k,i){this.TouchProperty("label")};this.RegisterProperty("xalign",0.5,SEK.Delegate(this,"OnXalignChanged"));this.OnXalignChanged=function(k,m,l,i){var j=this.GetChild();if(!j){return}if(j.GetType()=="Misc"){j.SetAlignment(i,this.GetProperty("yalign"))}else{if(j.GetType()=="Alignment"){j.SetAlignment(i,this.GetProperty("yalign"),1,1)}}};this.RegisterProperty("yalign",0.5,SEK.Delegate(this,"OnYalignChanged"));this.OnYalignChanged=function(k,m,l,i){var j=this.GetChild();if(!j){return}if(j.HasType("Misc")){j.SetAlignment(this.GetProperty("xalign"),i)}else{if(j.HasType("Alignment")){j.SetAlignment(this.GetProperty("xalign"),i,1,1)}}};this.Register("clicked");this.Register("enter");this.Register("leave");this.Register("pressed");this.Register("released");for(var f in STK.Button.ClassStyles){this.SetStyleProperty(f,STK.Button.ClassStyles[f])}this.OnStylePropertyChanged=function(l,n,m,k){var j=parseInt(k)+"px";var i=this.GetElement("frame");if(n=="background-image"){if(!SEK.UserAgent.IsExplorer6()){i.SetStyle("backgroundImage",this.GetStyleProperty("background-image"))}return}else{if(n.indexOf("color")!=-1){c.SetProperty("base-rate",this.GetStyleProperty("color-fade-rate"));a.SetProperty("period",this.GetStyleProperty("color-fade-period"));this._UpdateStyle();return}}switch(n){case"inner-border-left":i.SetStyle("paddingLeft",j);break;case"inner-border-right":i.SetStyle("paddingRight",j);break;case"inner-border-top":i.SetStyle("paddingTop",j);break;case"inner-border-bottom":i.SetStyle("paddingBottom",j);break;case"border-width-left":i.SetStyle("borderLeftWidth",0);break;case"border-width-right":i.SetStyle("borderRightWidth",0);break;case"border-width-top":i.SetStyle("borderTopWidth",0);break;case"border-width-bottom":i.SetStyle("borderBottomWidth",0);break;default:}if(SEK.UserAgent.IsGecko()){switch(n){case"border-radius-bottomleft":i.SetStyleCSS("-moz-border-radius-bottomleft",j);break;case"border-radius-bottomright":i.SetStyleCSS("-moz-border-radius-bottomright",j);break;case"border-radius-topleft":i.SetStyleCSS("-moz-border-radius-topleft",j);break;case"border-radius-topright":i.SetStyleCSS("-moz-border-radius-topright",j);break;default:}}this.Emit("size-request")};this.SetSubWidget("button-label",new STK.Label(null));this.SetSubWidget("button-hbox",new STK.HBox());this.SetElement("frame",new SEK.Element.Div());this.SetElement("button-child-area",this.GetElement("frame"));if(this._SetupFrame===undefined){this._SetupFrame=function(){var i=this.GetElement("frame");i.SetAttribute("id","button-"+this.Name());i.SetStyle("borderTopStyle","solid");i.SetStyle("borderBottomStyle","solid");i.SetStyle("borderLeftStyle","solid");i.SetStyle("borderRightStyle","solid");i.SetStyle("borderTopWidth",String(this.GetStyleProperty("border-width-top"))+"px");i.SetStyle("borderBottomWidth",String(this.GetStyleProperty("border-width-bottom"))+"px");i.SetStyle("borderLeftWidth",String(this.GetStyleProperty("border-width-left"))+"px");i.SetStyle("borderRightWidth",String(this.GetStyleProperty("border-width-right"))+"px");i.SetStyle("paddingLeft",this.GetStyleProperty("inner-border-left")+"px");i.SetStyle("paddingRight",this.GetStyleProperty("inner-border-right")+"px");i.SetStyle("paddingTop",this.GetStyleProperty("inner-border-top")+"px");i.SetStyle("paddingBottom",this.GetStyleProperty("inner-border-bottom")+"px");if(!SEK.UserAgent.IsExplorer6()){i.SetStyle("backgroundImage",this.GetStyleProperty("background-image"));i.SetStyle("backgroundRepeat","repeat-x");i.SetStyle("backgroundPosition","0px 50%")}if(SEK.UserAgent.IsGecko()){i.SetStyleCSS("-moz-border-radius-bottomleft",parseInt(this.GetStyleProperty("border-radius-bottomleft"))+"px");i.SetStyleCSS("-moz-border-radius-bottomright",parseInt(this.GetStyleProperty("border-radius-bottomright"))+"px");i.SetStyleCSS("-moz-border-radius-topleft",parseInt(this.GetStyleProperty("border-radius-topleft"))+"px");i.SetStyleCSS("-moz-border-radius-topright",parseInt(this.GetStyleProperty("border-radius-topright"))+"px")}i.ListenRaw("mouseover",SEK.Delegate(this,"OnFrameMouseOver"));i.ListenRaw("mouseout",SEK.Delegate(this,"OnFrameMouseOut"));i.ListenRaw("mousedown",SEK.Delegate(this,"OnFrameMouseDown"));i.ListenRaw("mouseup",SEK.Delegate(this,"OnFrameMouseUp"));i.ListenRaw("click",SEK.Delegate(this,"OnFrameClick"))}}this._SetupFrame();this.OnApplyColor=function(q){var q=c.GetValue();var k=[0/255,97/255,207/255];var n=c._sub(k,q);var j=(1+a.GetValue())*0.2;var m=c._scale(n,j);q=c._add(q,m);var i=this.GetElement("frame");i.SetStyle("backgroundColor",SEK.Color.ToString(q));var o={top:-3/255,bottom:36/255,left:28/255,right:34/255};for(var p in o){var j=o[p];var l=c._sub(q,[j,j,j]);i.SetStyleCSS("border-"+p+"-color",SEK.Color.ToString(l))}};var c=new SEK.Animator.Vec3(SEK.Delegate(this,"OnApplyColor"),SEK.Color.FromString(this.GetStyleProperty("color-normal")),this.GetStyleProperty("color-fade-rate"));var a=new SEK.Animator.Sin(SEK.Delegate(this,"OnApplyColor"),this.GetStyleProperty("color-fade-period"));c.SetValue(c.GetValue());this._currentstyle="normal";this._laststyle="normal";this._UpdateStyle=function(){var i=SEK.Color.FromString(this.GetStyleProperty("color-"+this._currentstyle));if(this._currentstyle=="hover"&&this._laststyle!="active"){c.MoveTo(i,2*this.GetStyleProperty("color-fade-rate"))}else{if(this._currentstyle=="active"){c.MoveTo(i,2*this.GetStyleProperty("color-fade-rate"))}else{c.MoveTo(i)}}this._laststyle=this._currentstyle};this.OnFrameMouseOver=function(i){if(this.GetSensitive()==false){this._currentstyle="inactive"}else{this._currentstyle="hover";this.Enter();a.Start()}this._UpdateStyle()};this.OnFrameMouseOut=function(i){if(this.GetSensitive()==false){this._currentstyle="inactive"}else{a.Finish();this._currentstyle="normal";this.Leave()}this._UpdateStyle()};this.OnFrameMouseDown=function(i){if(this.GetSensitive()==false){this._currentstyle="inactive"}else{this._currentstyle="active";this.Pressed()}this._UpdateStyle()};this.OnFrameMouseUp=function(i){if(this.GetSensitive()==false){this._currentstyle="inactive"}else{this._currentstyle="hover";this.Released()}this._UpdateStyle()};this.OnFrameClick=function(i){if(this.GetSensitive()==false){return}this.Clicked();this._UpdateStyle()};this.OnSensitiveChanged=function(j,l,k,i){if(!i){this._currentstyle="inactive";this.SetProperty("cursor","default")}else{this._currentstyle="normal";this.SetProperty("cursor","pointer")}this._UpdateStyle();this.StkBinOnSensitiveChanged(j,l,k,i)};this._SetupForStockDisplay=function(){var i=this.GetSubWidget("button-hbox");if(this.GetChild()&&this.GetChild().Name()==i.Name()){return}if(this.GetChild()){this.Remove(this.GetChild())}var j=this.GetSubWidget("button-label");i.PackEnd(j,true,true,0);this.Add(i)};this.OnChildSizeChanged=function(){if(!this.IsMapped()){return}this.Emit("size-request")};this.SetLabel=function(i){this.SetProperty("label",i)};this.GetLabel=function(){return this.GetProperty("label")};this.SetImage=function(i){this.SetProperty("image",i)};this.GetImage=function(){return this.GetProperty("image")};this.SetUseStock=function(i){this.SetProperty("use-stock",i)};this.GetUseStock=function(){return this.GetProperty("use-stock")};this.SetAlignment=function(j,i){this.CoerceProperty("xalign",j);this.SetProperty("yalign",i)};this.GetAlignment=function(){return{xalign:this.GetProperty("xalign"),yalign:this.GetProperty("yalign")}};this.Map=function(i){if(this.IsMapped()){return}var j=this.GetElement("frame");if(this.GetChild()){this.GetChild().Map(j)}i.Add(j);this.StkBinMap(i)};this.Measure=function(){var l=this.GetChild();var j={w:0,h:0};if(l){j=l.Measure()}var i=0;var k=0;i+=parseInt(this.GetStyleProperty("inner-border-left"))+parseInt(this.GetStyleProperty("inner-border-right"));k+=parseInt(this.GetStyleProperty("inner-border-top"))+parseInt(this.GetStyleProperty("inner-border-bottom"));i+=this.GetStyleProperty("border-width-left")+this.GetStyleProperty("border-width-right");k+=this.GetStyleProperty("border-width-top")+this.GetStyleProperty("border-width-bottom");var m={w:i+j.w,h:k+j.h};return this.StkWidgetMeasure(m)};this.Reallocate=function(i,k){i-=parseInt(this.GetStyleProperty("border-width-left"))+parseInt(this.GetStyleProperty("border-width-right"));k-=parseInt(this.GetStyleProperty("border-width-top"))+parseInt(this.GetStyleProperty("border-width-bottom"));i-=parseInt(this.GetStyleProperty("inner-border-left"))+parseInt(this.GetStyleProperty("inner-border-right"));k-=parseInt(this.GetStyleProperty("inner-border-top"))+parseInt(this.GetStyleProperty("inner-border-bottom"));var l=this.GetElement("frame");l.SetStyle("width",String(i)+"px");l.SetStyle("height",String(k)+"px");if(k>100){l.SetStyle("backgroundImage","")}var j=this.GetChild();if(j){j.Reallocate(i,k)}};this.Add=function(j){this.StkBinAdd(j);var i=this.GetChild().Connect("size-request",SEK.Delegate(this,"OnChildSizeChanged"));this.SetData("__child_size_handler_id__",i);if(this.IsMapped()){this.GetChild().Map(this.GetElement("button-child-area"));this.Emit("size-request")}};this.Remove=function(i){if(this.GetChild().IsMapped()){this.GetChild().Unmap()}this.GetChild().Disconnect(this.GetData("__child_size_handler_id__"));this.StkBinRemove(i)};this.Clicked=function(){this.Emit("clicked")};this.Pressed=function(){this.Emit("pressed")};this.Released=function(){this.Emit("released")};this.Enter=function(){this.Emit("enter")};this.Leave=function(){this.Emit("leave")};this.CreateType("Button");if(e){var g=STK.StockItemsStack.Lookup(e,STK.IconSize.BUTTON);if(g){this.SetProperty("use-stock",true)}this.SetProperty("label",e)}if(h){var b=h;if(typeof h=="string"){var b=new STK.Image();var g=STK.StockItemsStack.Lookup(h,STK.IconSize.BUTTON);if(g){b.SetFromIconSet(g.icon)}else{b.SetFromLocation(h)}}this.SetProperty("image",b)}if(d){this.Connect("clicked",d)}this.TouchProperty("sensitive")};STK.Button.ClassStyles={"inner-border-left":4,"inner-border-right":4,"inner-border-top":4,"inner-border-bottom":4,"border-radius-bottomleft":3,"border-radius-bottomright":3,"border-radius-topleft":3,"border-radius-topright":3,"border-width-left":1,"border-width-right":1,"border-width-top":1,"border-width-bottom":1,"background-image":"url("+STK.Path.FindImage("/data/images/button/shine")+")","color-normal":"#bebebe","color-hover":"#a1cff1","color-active":"#81cfff","color-inactive":"#888888","color-fade-rate":1,"color-fade-period":1.25};STK.ButtonRelief={NORMAL:1,HALF:2,NONE:3};STK.ToggleButton=function(a,c){STK.Button.apply(this,[a,c]);this._toggle_state=false;this.RegisterProperty("active",false,SEK.Delegate(this,"OnActiveChanged"));this.Register("toggled");for(var b in STK.ToggleButton.ClassStyles){this.SetStyleProperty(b,STK.ToggleButton.ClassStyles[b])}this.OnActiveChanged=function(e,h,f,d){var g=f!=d;if(!g){return}this.Toggled();this._UpdateStyle()};this._UpdateStyle=function(){if(this.GetActive()&&this._currentstyle.search(/-on$/)==-1){this._currentstyle+="-on"}if(!this.GetActive()&&this._currentstyle.search(/-on$/)!=-1){this._currentstyle=this._currentstyle.replace(/-on$/,"")}this.StkButton_UpdateStyle()};this.GetActive=function(){return this.GetProperty("active")};this.SetActive=function(d){this.SetProperty("active",Boolean(d))};this.Toggled=function(){this.Emit("toggled")};this.Clicked=function(){this.SetActive(!Boolean(this.GetActive()));this.StkButtonClicked();this.Toggled();this._UpdateStyle()};this.CreateType("ToggleButton")};STK.ToggleButton.ClassStyles={"color-active-on":"#76dfb6","color-hover-on":"#78f478","color-normal-on":"#48f448","color-inactive-on":"#AAAAAA"};STK.CheckButton=function(a){if(this._input_type===undefined){this._input_type="checkbox"}this._SetupFrame=function(){var c=new SEK.Element.Input();c.SetAttribute("type",this._input_type);c.SetStyle("cursor","pointer");c.SetStyle("marginBottom","3px");var e=new SEK.Element.Table();e.SetAttribute("cellPadding",0);e.SetAttribute("cellSpacing",0);e.ListenRaw("mouseover",SEK.Delegate(this,"OnFrameMouseOver"));e.ListenRaw("mouseout",SEK.Delegate(this,"OnFrameMouseOut"));e.ListenRaw("mousedown",SEK.Delegate(this,"OnFrameMouseDown"));e.ListenRaw("mouseup",SEK.Delegate(this,"OnFrameMouseUp"));e.ListenRaw("click",SEK.Delegate(this,"OnFrameClick"));var f=e.InsertRow(-1);var d=f.InsertCell(-1);d.Add(c);var b=f.InsertCell(-1);this.SetElement("frame",e);this.SetElement("button-child-area",b);this.SetElement("button-input",c)};STK.ToggleButton.apply(this,[a]);this._UpdateStyle=function(){};this.OnApplyColor=function(){};this.OnActiveChanged=function(c,e,d,b){this.StkToggleButtonOnActiveChanged(c,e,d,b);if(b){this.GetElement("button-input").SetAttribute("checked","checked")}else{this.GetElement("button-input").SetAttribute("checked","")}};this.OnSensitiveChanged=function(d,f,e,b){var c=this.GetElement("button-input");if(b){c.SetAttribute("disabled",false);c.SetStyle("cursor","pointer")}else{c.SetAttribute("disabled",true);c.SetStyle("cursor","default")}this.StkToggleButtonOnSensitiveChanged(d,f,e,b)};this.Map=function(c){if(this.IsMapped()){return}var d=this.GetElement("frame");var b=this.GetElement("button-child-area");if(this.GetChild()){this.GetChild().Map(b)}c.Add(d);this.StkBinMap(c)};this.Measure=function(){var b=this.StkToggleButtonMeasure();return{w:20+b.w,h:Math.max(23,b.h)}};this.Reallocate=function(b,c){this.StkToggleButtonReallocate(b-20,c)};this.CreateType("CheckButton")};STK.RadioButton=function(a,b){this._input_type="radio";STK.CheckButton.apply(this,[a]);this.RegisterProperty("group",null,SEK.Delegate(this,"OnGroupChanged"));this.OnGroupChanged=function(e,g,f,c){if(f){var d=0;while(d<f.length){if(f[d].Name()==this.Name()){f.splice(d,1)}else{d++}}}c.push(this);this.TouchProperty("active");this.Emit("group-changed")};this.Register("group-changed");this.OnActiveChanged=function(f,k,j,c){var h=this.GetProperty("group");if(c){for(var e=0;e<h.length;e++){var d=h[e];if(d.Name()!=this.Name()){d.SetProperty("active",false)}else{d.CoerceProperty("active",true)}}}var g=false;for(var e=0;e<h.length;e++){var d=h[e];if(d.GetProperty("active")){g=true}}if(!g&&j&&!c){this.CoerceProperty("active",true);return}this.StkCheckButtonOnActiveChanged(f,k,j,c)};this.GetGroup=function(){return this.GetProperty("group")};this.SetGroup=function(c){this.SetProperty("group",c);return};this.Measure=function(){var d=this.GetChild();var c={w:0,h:0};if(d){c=d.Measure()}return this.StkWidgetMeasure(c)};this.Reallocate=function(c,e){var d=this.GetChild();if(d){d.Reallocate(c,e)}};this.CreateType("RadioButton");if(!b){b=[];this.SetProperty("group",b);this.SetActive(true)}else{this.SetProperty("group",b)}};STK.CellRendererMarkup=function(){SEK.Object.apply(this);for(var a in STK.CellRendererMarkup.ClassStyles){if(STK.CellRendererMarkup.ClassStyles.hasOwnProperty(a)){this.RegisterProperty(a,STK.CellRendererMarkup.ClassStyles[a])}}this.__BuildStyleForIter=function(d,b,c){var f=d.IterGetId(b);style=new SLK.TextStyle();style.Reset();for(var e in STK.CellRendererMarkup.ClassStyles){if(STK.CellRendererMarkup.ClassStyles.hasOwnProperty(e)){if(c[e]!==undefined){style.SetStyle(e,d.GetValue(b,c[e]))}else{style.SetStyle(e,this.GetProperty(e))}}}return style};this.Render=function(d,i,g,j){var e=j.GetModel();var c=d.dom_elmt;if(c.iter_id==e.IterGetId(i)&&c.generation==e.IterGetGeneration(i)){return false}c.iter_id=e.IterGetId(i);c.generation=e.IterGetGeneration(i);var b=this.__BuildStyleForIter(e,i,g);var h=e.GetValue(i,g.markup);if(!h){h="-"}var f=new SLK.TextLayout(h,b);d.SetContent(f.GetMarkup());return true};this.Measure=function(c,i,j){var d=j.GetModel();var b=this._ThemeBuildStyleForIter(d,i);var f=this._ThemeGetCellContent(d,i);var k=f[0];var h=f[1];var g;if(h==0){g=SLK.Text.Measure(c.innerHTML,b);g.w+=4;g.h+=4}else{var e=new SLK.TextLayout(k,b);g=e.Measure();g.w+=4;g.h+=4}return g};this.Reallocate=function(d,e,f,c,b){d-=4;e-=4;if(SEK.UserAgent.IsExplorer()){d+=4;e+=4}if(d>0&&e>0){f.style.width=d+"px";f.style.height=e+"px"}}};STK.CellRendererMarkup.ClassStyles={cursor:"default","font-family":"sans-serif","font-size":"1em","font-size-adjust":"none","font-stretch":"normal","font-style":"normal","font-variant":"normal","font-weight":"normal",color:"#000000",direction:"ltr","line-height":"normal","letter-spacing":"normal","text-decoration":"none","text-shadow":"none","text-transform":"none","unicode-bidi":"normal","word-spacing":"normal"};STK.CellRendererPixbuf=function(){SEK.Object.apply(this);this.RegisterProperty("width",16);this.RegisterProperty("height",16);this.RegisterProperty("icon-name",null);this.RegisterProperty("stock-id",null);this.RegisterProperty("stock-size",1);this.Render=function(d,i,h,j){var f=j.GetModel();var c=d.dom_elmt;if(c.iter_id==f.IterGetId(i)&&c.generation==f.IterGetGeneration(i)){return false}c.iter_id=f.IterGetId(i);c.generation=f.IterGetGeneration(i);if(d.GetChildCount()<1){var e=new SEK.Element.Image();d.Add(e)}var e=d.GetChild(0);var a=this.GetProperty("icon-name");if("icon-name" in h){a=f.GetValue(i,h["icon-name"])}if(a){e.SetAttribute("src",a);var b=this.GetProperty("width");var l=this.GetProperty("height");if("width" in h){b=f.GetValue(i,h.width)}if("height" in h){l=f.GetValue(i,h.height)}e.SetAttribute("width",parseInt(b));e.SetAttribute("height",parseInt(l))}else{var g=this.GetProperty("stock-id");if("stock-id" in h){g=f.GetValue(i,h["stock-id"])}var k=this.GetProperty("stock-size");if("stock-size" in h){k=f.GetValue(i,h["stock-size"])}var m=STK.StockItemsStack.Lookup(g,k);if(m){e.SetAttribute("src",m.icon.location);e.SetAttribute("width",m.icon.width);e.SetAttribute("height",m.icon.height)}}}};STK.CellRendererPixbuf.ClassStyles={"default":STK.Path.FindImage("/theme/Plain/icons/blank")};STK.CellRendererText=function(){SEK.Object.apply(this);for(var a in STK.CellRendererText.ClassStyles){if(STK.CellRendererText.ClassStyles.hasOwnProperty(a)){this.RegisterProperty(a,STK.CellRendererText.ClassStyles[a])}}this.Render=function(e,c,d,b){for(var f in STK.CellRendererText.ClassStyles){if(STK.CellRendererText.ClassStyles.hasOwnProperty(f)){var h=this.GetProperty(f);if(f in d){h=b.GetModel().GetValue(c,d[f])}e.SetStyleRaw(f,h,"")}}var g=b.GetModel().GetValue(c,d.text);g=SEK.String.RenderHtml(g);g=g.replace(/ /g,"&nbsp;");e.SetContent(g);e.SetSelectable(false)}};STK.CellRendererText.ClassStyles={cursor:"default","font-family":"sans-serif","font-size":"1em","font-size-adjust":"none","font-stretch":"normal","font-style":"normal","font-variant":"normal","font-weight":"normal",color:"#000000",direction:"ltr","line-height":"normal","letter-spacing":"normal","text-decoration":"none","text-shadow":"none","text-transform":"none","unicode-bidi":"normal","word-spacing":"normal"};STK.CellRendererToggle=function(){SEK.Object.apply(this);this.RegisterProperty("active",false);this.Register("toggled");this.Render=function(f,b,d,a){var e=a.GetModel();var g=f.dom_elmt;if(g.iter_id==e.IterGetId(b)&&g.generation==e.IterGetGeneration(b)){return false}g.iter_id=e.IterGetId(b);g.generation=e.IterGetGeneration(b);if(f.GetChildCount()<1){var c=new SEK.Element.Input();c.SetAttribute("type","checkbox");c.Listen("click",SEK.Callback(SEK.Delegate(this,"OnToggleClicked"),e,e.IterGetId(b),d.active));c.Listen("mousedown",function(i){return false});f.Add(c)}var c=f.GetChild(0);var h=this.GetProperty("active");if("active" in d){h=e.GetValue(b,d.active)}c.SetAttribute("checked",h)};this.OnToggleClicked=function(e,c,h,g){if(!g){e.Target().checked=this.GetProperty("active");return}var b=c.GetIterById(h);if(!b){SEK.Log.Error("CellRendererToggle::OnToggleClicked -- failed to map iter_id to an iter.");return}var d=c.GetValue(b,g);var f=e.Target().checked;if(f!=d){var a=b;while(!c.SetValue){a=c.ConvertIterToChildIter(a);c=c.GetModel()}c.SetValue(a,g,f);this.Emit("toggled",c.IterGetPath(b))}}};STK.TreePath=function(a){this.indicies=[];this.ToString=function(){if(this.indicies==null){return""}var d="";for(var e in this.indicies){d+=this.indicies[e];if(e<(this.indicies.length-1)){d+=":"}}return d};this.AppendIndex=function(d){this.indicies.push(d)};this.PrependIndex=function(d){this.indicies.unshift(d)};this.GetDepth=function(){return this.indicies.length};this.GetIndicies=function(){return this.indicies};this.Copy=function(){var d=new STK.TreePath();d.indicies=this.indicies.slice();return d};this.Compare=function(e){if(e.indicies.length!=this.indicies.length){return false}for(var d in this.indicies){if(e.indicies[d]!=this.indicies[d]){return false}}return true};this.IsAncestor=function(e){if(e.indicies.length>=this.indicies.length){return false}for(var d in e.indicies){if(e.indicies[d]!=this.indicies[d]){return false}}return true};this.IsDescendant=function(e){if(this.indicies.length>=e.indicies.length){return false}for(var d in this.indicies){if(this.indicies[d]!=e.indicies[d]){return false}}return true};this.IsBefore=function(d){if(Number(this.GetIndicies()[0])<Number(d.GetIndicies()[0])){return true}if(this.Compare(d)){return false}if(this.IsAncestor(d)){return true}return false};this.Next=function(){if(this.indicies.length==0){return false}this.indicies[this.indicies.length-1]++;return true};this.Prev=function(){if(this.indicies.length==0){return false}if(this.indicies[this.indicies.length-1]==0){return false}this.indicies[this.indicies.length-1]--;return true};this.Up=function(){if(this.indicies.length<=1){return false}this.indicies.pop();return true};this.Down=function(){this.indicies.push(0);return true};if(typeof a=="object"&&a.constructor==Array){this.indicies=a.slice()}else{if(typeof a=="string"||(typeof inital=="object"&&a.constructor==String)){var c=a.split(":");for(var b in c){this.AppendIndex(Number(c[b]))}}}};STK.TreeRowReference=function(c,e){SEK.Object.apply(this);this._type="STK_TREE_ROW_REFERENCE";this.model=null;this.path=null;this.valid=true;this.destroyed=false;var b=null;var a=null;var d=null;this.GetModel=function(){return this.model};this.GetPath=function(){if(!this.valid){return false}return this.path};this.Valid=function(){return this.valid};this.Copy=STK.UNIMPLEMENTED;this.OnRowAdded=function(j,f,i){if(!this.valid){return}var k=j.IterGetPath(f);var g=this.path.Copy();if(k.IsAncestor(this.path)){return}var h=Math.min(k.GetDepth(),this.path.GetDepth())-1;if(Number(k.GetIndicies()[h])<=Number(this.path.GetIndicies()[h])){this.path.GetIndicies()[h]++}this.Emit("path-updated",g)};this.OnRowDeleted=function(i,k,h){if(!this.valid){return}if(!i||!k){this.valid=false;this.path=null;return}if(this.path.Compare(k)){this.valid=false;this.path=null;this.Emit("path-updated",k);return}var j=k;var f=this.path.Copy();var g=Math.min(j.GetDepth(),this.path.GetDepth())-1;if(Number(j.GetIndicies()[g])<Number(this.path.GetIndicies()[g])){this.path.GetIndicies()[g]--}this.Emit("path-updated",f)};this.OnRowsReordered=function(i,k,j,h){if(!this.valid){return}if(!k||!j){return}var f=this.path.Copy();var g=Math.min(k.GetDepth(),this.path.GetDepth())-1;if(Number(k.GetIndicies()[g])==Number(this.path.GetIndicies()[g])){this.path=j.Copy();this.Emit("path-updated",f);return}if(Number(k.GetIndicies()[g])<Number(this.path.GetIndicies()[g])){this.path.GetIndicies()[g]--}g=Math.min(j.GetDepth(),this.path.GetDepth())-1;if(Number(j.GetIndicies()[g])<=Number(this.path.GetIndicies()[g])){this.path.GetIndicies()[g]++}this.Emit("path-updated",f)};this.Destroy=function(){var f="null";if(this.path){f=this.path.ToString()}this.model.Disconnect(this._sig_row_added);this.model.Disconnect(this._sig_row_deleted);this.model.Disconnect(this._sig_row_reordered);this.Unregister("path-updated")};b=SEK.Delegate(this,"OnRowAdded");a=SEK.Delegate(this,"OnRowDeleted");d=SEK.Delegate(this,"OnRowsReordered");this.model=c;this._sig_row_added=this.model.ConnectFirst("row-added",b,null);this._sig_row_deleted=this.model.ConnectFirst("row-deleted",a,null);this._sig_row_reordered=this.model.ConnectFirst("rows-reordered",d,null);this.path=e.Copy();this.Register("path-updated")};STK.TreeModel=function(){this.GetIter=STK.UNIMPLEMENTED;this.StkTreeModelGetIterFirst=this.GetIterFirst=function(){return this.GetIter("0")};this.ForEach=STK.UNIMPLEMENTED;this.RowChanged=STK.UNIMPLEMENTED;this.RowInserted=STK.UNIMPLEMENTED;this.RowHasChildToggled=STK.UNIMPLEMENTED;this.RowDeleted=STK.UNIMPLEMENTED;this.RowsReordered=STK.UNIMPLEMENTED};STK.ListStoreIter=function(){this.model_id;this.model_generation;this.position};STK.ListStore=function(){SEK.Object.apply(this);STK.TreeModel.apply(this);this._list=[];this._generation=1;this._id=Math.floor(Math.random()*4294967294)+1;this._last_node_id=0;this.Register("row-added");this.Register("row-changed");this.Register("row-deleted");this.Register("rows-reordered");this.GetIter=function(c){var b;if(typeof c=="string"){b=c.split(":");b=Number(b[0])}else{if(typeof c=="number"){b=c}else{b=c.GetIndicies()[0]}}var a=new STK.ListStoreIter();a.position=b;a.model_id=this._id;a.model_generation=this._generation;return a};this.GetIterById=function(b){for(var a=0;a<this._list.length;a++){if(this._list[a]["__id__"]==b){return this.GetIter(a)}}return null};this.Foreach=function(d,c,a){if(!a){a=this.GetIterFirst()}var b=true;while(a){b=d(a,c);if(!b){return}a=this.IterNext(a)}return b};this.IterCopy=function(a){if(!this.IterIsValid(a)){SEK.Log.Error("ListStore::IterCopy: invalid iter");return false}return this.GetIter(a.position)};this.IterNext=function(a){if(!this.IterIsValid(a)){SEK.Log.Error("ListStore::IterNext: invalid iter");return false}var b=this.GetIter(a.position+1);if(!this.IterIsValid(b)){delete b;return false}return b};this.IterChildren=function(a){return false};this.IterHasChild=function(a){return false};this.IterNChildren=function(a){return 0};this.IterNthChild=function(a,b){return false};this.IterParent=function(a){return false};this.IterDepth=function(a){return 1};this.IterToString=function(a){return String(a.position)};this.IterGetPath=function(a){if(!this.IterIsValid(a)){SEK.Log.Error("ListStore::IterGetPath: invalid iter");return false}return new STK.TreePath([a.position])};this.GetValue=function(a,b){if(!this.IterIsValid(a)){SEK.Log.Error("ListStore::GetValue: invalid iter");return false}return this._list[a.position][b]};this.Get=function(a){if(!this.IterIsValid(a)){SEK.Log.Error("ListStore::IterGet: invalid iter");return false}var b={};for(var c in this._list[a.position]){if(this._list[a.position].hasOwnProperty(c)){b[c]=this._list[a.position][c]}}return b};this.IterIsValid=function(a){if(this._id!=a.model_id){return false}if(this._generation!=a.model_generation){return false}if(a.position<0||a.position>=this._list.length){return false}return true};this.IterGetId=function(a){return this.GetValue(a,"__id__")};this.IterGetGeneration=function(a){return this.GetValue(a,"__generation__")};this.SetValue=function(a,b,c){if(!this.IterIsValid(a)){SEK.Log.Error("SetValue: invalid iter");return false}this._list[a.position][b]=c;this._list[a.position]["__generation__"]++;this.RowChanged(a)};this.Set=function(a,d,b){if(!this.IterIsValid(a)){SEK.Log.Error("Set: invalid iter");return false}for(var c in d){if(d.hasOwnProperty(c)){this._list[a.position][c]=d[c]}}this._list[a.position]["__generation__"]++;if(b){return}this.RowChanged(a)};this.Insert=function(c,b){if(c>this._list.length){c=this._list.length}if(c<0){c=0}this._list.splice(c,0,{});this._generation++;this._list[c]["__id__"]=++this._last_node_id;this._list[c]["__generation__"]=0;var a=this.GetIter(c);if(b!=undefined){this.Set(a,b,true)}this.RowInserted(a);return a};this.Prepend=function(a){return this.Insert(0,a)};this.Append=function(a){return this.Insert(this._list.length,a)};this.InsertAfter=function(b,a){if(!this.IterIsValid(b)){SEK.Log.Error("ListStore::InsertAfter - invalid sibling");return false}return this.Insert(b.position+1,a)};this.InsertBefore=function(b,a){if(!this.IterIsValid(b)){SEK.Log.Error("ListStore::InsertAfter - invalid sibling");return false}return this.Insert(b.position,a)};this.Remove=function(a){if(!this.IterIsValid(a)){SEK.Log.Error("ListStore::Remove - invalid iterator");return false}var d=a.position;var b=this.IterGetPath(a);var c=this.GetValue(a,"__id__");this._list.splice(d,1);this._generation++;this.RowDeleted(b,c)};this.Clear=function(){this._list=new Array();this._generation++;this.RowDeleted(null,null)};this.MoveBefore=function(b,e){var a=this.IterGetPath(b);var g=b.position;var f=e.position;var d=this._list[g];this._list.splice(g,1);if(g<f){f--}this._list.splice(f,0,d);this._generation++;var c=this.GetIter(f);this.RowsReordered([a],[this.IterGetPath(c)]);return c};this.MoveAfter=function(b,e){var a=this.IterGetPath(b).Copy();var g=b.position;var f=e.position;var d=this._list[g];this._list.splice(g,1);if(g<f){f--}f++;this._list.splice(f,0,d);this._generation++;var c=this.GetIter(f);this.RowsReordered([a],[this.IterGetPath(c)]);return c};this.Count=function(){return this._list.length};this.Generation=function(){return this._generation};this.RowChanged=function(a){this.Emit("row-changed",a)};this.RowInserted=function(a){this.Emit("row-added",a)};this.RowDeleted=function(a,b){this.Emit("row-deleted",a,b)};this.RowsReordered=function(b,a){this.Emit("rows-reordered",b,a)};this.CreateType("ListStore")};STK.TreeSelection=function(a){SEK.Object.apply(this);this.RegisterProperty("mode",STK.TreeSelectionMode.SINGLE);this.Register("changed");var c=a;var b=[];this.SetMode=function(d){this.SetProperty("mode",d)};this.GetMode=function(){return this.GetProperty("mode")};this.GetTreeView=function(){return c};this.GetSelected=function(){var d=this.GetProperty("mode");if(d!=STK.TreeSelectionMode.SINGLE&&d!=STK.TreeSelectionMode.BROWSE){return false}if(b.length==0){return false}return c.GetModel().GetIterById(b[0])};this.GetSelectedRows=function(){var d=[];for(var e=0;e<b.length;e++){d.push(c.GetModel().GetIterById(b[e]))}return d};this.CountSelectedRows=function(){return b.length};this.SelectPath=function(e){var d=c.GetModel().GetIter(e);return this.SelectIter(d)};this.SelectIter=function(e){var g=c.GetModel().IterGetId(e);var f=this.GetProperty("mode");if(f==STK.TreeSelectionMode.NONE){return}if(f==STK.TreeSelectionMode.SINGLE||STK.TreeSelectionMode.BROWSE){var d=this.GetSelectedRows();b=[g];this.Emit("changed",d);return}if(f==STK.TreeSelectionMode.MULTIPLE){b.push(g);this.Emit("changed",[]);return}};this.UnselectPath=function(e){var d=c.GetModel().GetIter(e);return this.UnselectIter(d)};this.UnselectIter=function(e){if(!c.GetModel().IterIsValid(e)){return}var h=c.GetModel().IterGetId(e);var g=this.GetProperty("mode");if(g==STK.TreeSelectionMode.BROWSE){return}if(g==STK.TreeSelectionMode.SINGLE||g==STK.TreeSelectionMode.MULTIPLE){var d=this.GetSelectedRows();for(var f=0;f<b.length;f++){if(b[f]==h){b.splice(f,1);this.Emit("changed",d);return}}}};this.PathIsSelected=function(e){var d=c.GetModel().GetIter(e);return this.IterIsSelected(d)};this.IterIsSelected=function(d){var e=c.GetModel().IterGetId(d);return this.IdIsSelected(e)};this.IdIsSelected=function(e){for(var d=0;d<b.length;d++){if(b[d]==e){return true}}return false};this.UnselectAll=function(){var d=this.GetSelectedRows();b=[];this.Emit("changed",d)};this.UnselectMissing=function(){var e=c.GetModel();var f=0;while(f<b.length){var d=c.GetModel().GetIterById(b[f]);if(!d){b.splice(f,1)}else{f++}}};this.CreateType("TreeSelection")};STK.TreeSelectionMode={NONE:0,SINGLE:1,BROWSE:2,MULTIPLE:3};STK.ListView=function(a){STK.Widget.apply(this);var b=new SEK.Element.Table();b.SetAttribute("cellSpacing",0);b.SetAttribute("cellPadding",0);b.SetStyle("verticalAlign","top");var c=b.InsertRow(-1);c.SetStyle("backgroundColor","#A0A0A0");c.SetStyle("backgroundImage","url("+STK.Path.FindImage("/data/images/dataview/treeviewcolumn/header-shine")+")");c.SetStyle("backgroundRepeat","repeat-x");this.SetElement("header",c);this.SetElement("frame",b);this.RegisterProperty("show-expanders",false);this.RegisterProperty("model",null,SEK.Delegate(this,"OnModelChanged"));this.OnModelChanged=function(l,d,e,f){var k=this.GetData("__model_connections__");if(e&&k){for(var h=0;h<4;h++){e.Disconnect(k[h])}}k=[];k.push(f.Connect("row-added",SEK.Delegate(this,"OnRowAdded")));k.push(f.Connect("row-changed",SEK.Delegate(this,"OnRowChanged")));k.push(f.Connect("row-deleted",SEK.Delegate(this,"OnRowDeleted")));k.push(f.Connect("rows-reordered",SEK.Delegate(this,"OnRowsReordered")));this.SetData("__model_connections__",k);var n=this.GetElement("frame");while(n.RowCount()>1){n.DeleteRow(-1)}for(var h=0;h<f.Count();h++){var m=f.GetIter(h);var p=n.InsertRow(h+1);this.__SetupRow(p);for(var g=0;g<this.columns.length;g++){var o=p.InsertCell(g);this.__SetupCell(o);this.columns[g].RenderCell(o,m,this)}}};this.Register("row-activated");this.columns=[];this.selection=new STK.TreeSelection(this);this.selection.Connect("changed",SEK.Delegate(this,"OnSelectionChanged"));this.__SetupRow=function(d){d.Listen("mousedown",SEK.Delegate(this,"OnRowMouseDown"));d.Listen("dblclick",SEK.Delegate(this,"OnRowDoubleClick"))};this.__SetupCell=function(d){d.SetStyle("padding","4px");d.SetSelectable(false)};this.OnRowMouseDown=function(f){var h=f.Target();while(h&&h.tagName.toLowerCase()!="tr"){h=h.parentNode}if(!h){return}var g=h.rowIndex-1;var e=this.GetModel();var d=e.GetIter(g);this.selection.SelectIter(d)};this.OnRowDoubleClick=function(d){var f=d.Target();while(f&&f.tagName.toLowerCase()!="tr"){f=f.parentNode}if(!f){return}var e=f.rowIndex-1;this.Emit("row-activated",e)};this.OnRowAdded=function(f,e){var h=f.IterGetPath(e);var l=h.GetIndicies()[0];var k=this.GetElement("frame");var j=k.InsertRow(l+1);this.__SetupRow(j);for(var g=0;g<this.columns.length;g++){var d=j.InsertCell(g);this.__SetupCell(d);this.columns[g].RenderCell(d,e,this)}};this.OnRowChanged=function(f,e){var h=f.IterGetPath(e);var l=h.GetIndicies()[0];var k=this.GetElement("frame");var j=k.GetRowAtOffset(l+1);for(var g=0;g<this.columns.length;g++){var d=j.GetCellAtOffset(g);this.columns[g].RenderCell(d,e,this)}};this.OnRowDeleted=function(d,e){this.selection.UnselectMissing();var g=this.GetElement("frame");if(!e){while(g.RowCount()>1){g.DeleteRow(-1)}return}var f=e.GetIndicies()[0];this.selection.UnselectPath(e);g.DeleteRow(f+1)};this.OnRowsReordered=function(k,o,d){var e=this.GetElement("frame");for(var h=0;h<o.length;h++){var f=o[h].GetIndicies()[0];var l=d[h].GetIndicies()[0];e.DeleteRow(f+1);var p=e.InsertRow(l+1);this.__SetupRow(p);var m=k.GetIter(l);for(var g=0;g<this.columns.length;g++){var n=p.InsertCell(g);this.__SetupCell(n);this.columns[g].RenderCell(n,m,this)}}this.OnSelectionChanged(this.selection,[])};this.OnSelectionChanged=function(k,j){var h=k.GetSelectedRows();var d=this.GetElement("frame");var g=this.GetModel();for(var f=0;f<j.length;f++){var m=g.IterGetPath(j[f]);var e=m.GetIndicies()[0];var l=d.GetRowAtOffset(e+1);l.SetStyle("backgroundColor","transparent")}for(var f=0;f<h.length;f++){var e=g.IterGetPath(h[f]).GetIndicies()[0];var l=d.GetRowAtOffset(e+1);l.SetStyle("backgroundColor","#cfd9fb")}};this.GetSelection=function(){return this.selection};this.AppendColumn=function(h){this.columns.push(h);var l=this.GetElement("header");var d=l.InsertCell(-1);d.SetStyle("borderRight","1px solid #666666");d.SetStyle("borderTop","1px solid #666666");d.SetStyle("borderBottom","1px solid #666666");if(d.dom_elmt.cellIndex==0){d.SetStyle("borderLeft","1px solid #666666")}h.Map(d);h.Show();var f=this.GetProperty("model");if(!f){return}var k=this.GetElement("frame");if(k.RowCount()-1!=f.Count()){SEK.Log.Error("STK::ListStore::AppendColumn - mismatched rowcounts");return}for(var g=0;g<f.Count();g++){var j=k.GetRowAtOffset(g+1);var d=j.InsertCell(-1);this.__SetupCell(d);var e=f.GetIter(g);h.RenderCell(d,e,this)}};this.SetShowExpanders=function(d){};this.GetShowExpanders=function(){return false};this.GetModel=function(){return this.GetProperty("model")};this.SetModel=function(d){this.SetProperty("model",d)};this.Measure=function(){return this.GetElement("frame").GetSize()};this.Reallocate=function(d,e){};this.Map=function(d){if(this.IsMapped()){return}var e=this.GetElement("frame");d.Add(e);this.StkWidgetMap()};this.CreateType("ListView");if(a){this.SetProperty("model",a)}};STK.CellLayoutEntity=function(b,a){this.renderer=b;this.expand=a;this.attrs={}};STK.CellLayout=function(){STK.Widget.apply(this);this.entities=[];this.PackStart=function(b,a){this.entities.unshift(new STK.CellLayoutEntity(b,a));this.Emit("size-request")};this.PackEnd=function(b,a){this.entities.push(new STK.CellLayoutEntity(b,a));this.Emit("size-request")};this.Reorder=0;this.Clear=0;this.SetAttributes=function(c,a){for(var b=0;b<this.entities.length;b++){if(this.entities[b].renderer==c){this.entities[b].attrs=a;this.Emit("size-request");return}}};this.AddAttribute=function(d,c,b){for(var a=0;a<this.entities.length;a++){if(this.entities[a].renderer==d){this.entites[a].attrs[c]==b;this.Emit("size-request");return}}};this.SetCellDataFunc=0;this.ClearAttributes=0;this.GetCells=0;this.RenderCell=function(b,j,k,m,d){if(this.GetProperty("visible")===false){b.SetStyle("padding","0px");return}if(b.GetChildCount()!=this.entities.length){while(b.GetChildCount()>0){b.Remove(-1)}for(var c=0;c<this.entities.length;c++){var l=new SEK.Element.Span();b.Add(l)}}var e=k.GetModel();for(var c=0;c<this.entities.length;c++){var g=b.GetChild(c);var f=this.entities[c];var n=f.renderer;var a={};n.Render(g,j,f.attrs,k)}};this.MeasureCell=function(c,a,b){};this.CreateType("CellLayout")};STK.TreeViewColumnSizing={GROW_ONLY:0,AUTO:1,FIXED:2};STK.TreeViewColumnSort={ASCENDING:0,DESCENDING:1};STK.TreeViewColumn=function(e,g,b){STK.Widget.apply(this);STK.CellLayout.apply(this);this.sort_column_id=false;this.renderer_props=new Object();this.SetData("view",null);this.RegisterProperty("title","",SEK.Delegate(this,"OnTitleChanged"));this.RegisterProperty("visible",true,SEK.Delegate(this,"OnVisibleChanged"));this.Register("clicked");for(var d in STK.TreeViewColumn.ClassStyles){if(STK.TreeViewColumn.ClassStyles.hasOwnProperty(d)){this.SetStyleProperty(d,STK.TreeViewColumn.ClassStyles[d])}}this.OnTitleChanged=function(j,l,k,h){var i=this.GetData("__label__");i.SetMarkup(h)};this.OnVisibleChanged=function(i,k,j,h){this.GetSubWidget("header").Hide()};var f=new STK.HBox();var a=new STK.Image(this.GetStyleProperty("sort-order-none-img"),8,8);var c=new STK.Label();c.SetStyleProperty("font-size","0.6em");c.SetStyleProperty("font-weight","bold");f.PackStart(c,false,true,0);f.PackStart(a,false,false,0);f.Connect("size-request",SEK.Payload(SEK.Delegate(this,"Emit"),"size-request"));this.SetSubWidget("header",f);this.SetData("__label__",c);this.SetData("__order__",a);this.Map=function(h){h.SetStyle("paddingLeft","2px");h.SetStyle("paddingRight","2px");if(this.IsMapped()){return}var i=this.GetSubWidget("header");i.Map(h);this.StkWidgetMap()};this.Measure=function(){var h=this.GetSubWidget("header");return h.Measure()};this.Reallocate=function(i,j){var k=this.GetSubWidget("header");k.Reallocate(i,j)};this.ReallocateColumn=function(o,k,s,m,n){var l=o;var r=0;for(var j in this.renderers){if(this.renderers.hasOwnProperty(j)){if(r>=s.childNodes.length){continue}if(l<=0){continue}var q=this.renderers[j];var i=s.childNodes[r];var p=q.Reallocate(l,k,i,m,n);l-=p;r+=1}}if(o>0){s.style.width=o+"px"}};this.SetTitle=function(h){this.SetProperty("title",h)};this.GetTitle=function(){return this.GetProperty("title")};this.GetCellRenderers=this.GetCells;this.SetSpacing=0;this.GetSpacing=0;this.SetVisible=function(h){this.SetProperty("visible",h)};this.GetVisible=function(){return this.GetProperty("visible")};this.SetResizable=0;this.GetResizable=0;this.SetSizing=function(h){this.SetProperty("sizing",h)};this.GetSizing=function(){return this.GetProperty("sizing")};this.SetEllipsize=function(h){this.SetProperty("ellipsize",h)};this.GetEllipsize=function(){return this.GetProperty("ellipsize")};this.GetFixedWidth=function(){return this.GetProperty("fixed-width")};this.SetFixedWidth=function(h){this.SetProperty("fixed-width",h)};this.SetMinWidth=0;this.GetMinWidth=0;this.SetMaxWidth=0;this.GetMaxWidth=0;this.GetWidth=0;this.Clicked=function(){this.Emit("clicked")};this.SetExpand=function(h){this.SetData("expand",h)};this.GetExpand=function(){return this.GetData("expand")};this.SetClickable=function(h){this.SetProperty("clickable",h)};this.GetClickable=0;this.SetWidget=0;this.GetWidget=0;this.SetAlignment=0;this.GetAlignment=0;this.SetReorderable=0;this.GetReorderable=0;this.SetSortColumnId=function(h){this.sort_column_id=h;this.SetClickable(true)};this.GetSortColumnId=function(){return this.sort_column_id};this.SetSortIndicator=0;this.GetSortIndicator=0;this.SetSortOrder=function(h){var i=this.GetProperty("sort-order");this.SetProperty("sort-order",h);if(i==h){return}this.ThemeUpdateOrder()};this.GetSortOrder=function(){return this.GetProperty("sort-order")};this.SetCellData=0;this.CellGetSize=0;this.CellGetPosition=0;this.CellIsVisible=0;this.FocusCell=0;this.CreateType("TreeViewColumn");if(e!=undefined){this.SetTitle(e)}if(g!=undefined){this.PackStart(g)}if(b!=undefined){this.SetAttributes(g,b)}};STK.TreeViewColumn.ClassStyles={"active-color":"#E0E0FF","hover-color":"#C0C0C9","normal-color":"#A0A0A0","background-attachment":"fixed","background-color":"transparent","background-image":"none","background-position":"top left","background-repeat":"no-repeat",cursor:"default","font-family":"arial, sans-serif","font-size":"0.75em","font-size-adjust":"none","font-stretch":"normal","font-style":"normal","font-variant":"normal","font-weight":"bold","outline-color":"#cf0061","outline-style":"none","outline-width":"medium",color:"#000000",direction:"ltr","line-height":"normal","letter-spacing":"normal","text-decoration":"none","text-shadow":"none","text-transform":"none","unicode-bidi":"normal","word-spacing":"normal","sort-order-down-img":STK.Path.FindImage("/data/images/dataview/treeviewcolumn/treeviewcolumn_sortorder_down"),"sort-order-up-img":STK.Path.FindImage("/data/images/dataview/treeviewcolumn/treeviewcolumn_sortorder_up"),"sort-order-none-img":STK.Path.FindImage("/data/images/dataview/treeviewcolumn/treeviewcolumn_sortorder_none")};STK.Html=function(a){STK.Widget.apply(this);var b=new SEK.Element.Div();this.SetElement("frame",b);this.SetChild=function(c){if(c&&c.parentNode!==undefined){c.parentNode.removeChild(c)}var d=new SEK.Element.Wrapper(c);this.GetElement("frame").Add(d);this.Emit("size-request")};this.SetContents=function(c){this.GetElement("frame").SetContent(c);this.Emit("size-request")};this.Map=function(c){if(this.IsMapped()){return}c.Add(this.GetElement("frame"));this.StkWidgetMap()};this.Measure=function(){return this.GetElement("frame").GetSize()};this.Reallocate=function(c,d){};this.CreateType("Html");if(a){if(typeof(a)=="string"){this.SetContents(a)}else{this.SetChild(a)}}};STK.ProgressBar=function(){STK.Widget.apply(this);var e=75;var b=26;this.RegisterProperty("fraction",0,SEK.Delegate(this,"OnFractionChanged"));this.RegisterProperty("text","",SEK.Delegate(this,"OnTextChanged"));this.SetStyleProperty("animated",STK.ProgressBar.ClassStyles.animated);this.SetData("__max_size__",e-3);this.SetData("__pulse_interval__",null);this.SetData("__animate_interval__",null);this.OnTextChanged=function(h,j,i,g){this.GetSubWidget("text").SetText(g);this.Emit("size-request")};this._StartAnimate=function(){var g=this.GetData("__animate_interval__");if(g!=null){return}var h=this.GetElement("progress-fill");g=SEK.Timer.StartRepeating(function(){var i=parseInt(h.GetStyle("backgroundPosition"));i+=1;h.SetStyle("backgroundPosition",i+"px")},0.038);this.SetData("__animate_interval__",g)};this._StopAnimate=function(){var g=this.GetData("__animate_interval__");if(g==null){return}SEK.Timer.StopRepeating(g);this.SetData("__animate_interval__",null)};this._StartPulse=function(){var l=this.GetData("__pulse_interval__");if(l!=null){return}var k=this.GetData("__max_size__");var j=this.GetElement("progress-fill");var g=Math.floor(k*0.33);j.SetStyle("width",g+"px");var h=k-g;var m=0;var i=1;l=SEK.Timer.StartRepeating(function(){m+=Math.round(2*i);if(m<=0){i*=-1;m=0}else{if(m>=h){i*=-1;m=h}}m=Math.max(0,Math.min(h,m));j.SetStyle("left",m+"px");j.SetStyle("backgroundPosition","-"+m+"px")},0.038);this.SetData("__pulse_interval__",l)};this._StopPulse=function(){var h=this.GetData("__pulse_interval__");if(h==null){return}var g=this.GetElement("progress-fill");g.SetStyle("left","0px");g.SetStyle("backgroundPosition","0px");SEK.Timer.StopRepeating(h);this.SetData("__pulse_interval__",null)};this.OnFractionChanged=function(i,m,k,g){var l=Math.max(0,Math.min(1,Number(g)));this.CoerceProperty("fraction",l);this._StopPulse();if(this.GetStyleProperty("animated")){if(l==0||l==1){this._StopAnimate()}else{this._StartAnimate()}}var j=this.GetData("__max_size__");var h=Math.floor(j*l);this.GetElement("progress-fill").SetStyle("width",parseInt(h)+"px")};var f=new SEK.Element.Table();f.SetAttribute("cellSpacing",0);f.SetAttribute("cellPadding",0);f.SetAttribute("border",0);var c=f.InsertRow(-1).InsertCell(-1);var d=f.InsertRow(-1).InsertCell(-1);var a=new SEK.Element.Div();d.Add(a);d.SetStyle("border","1px solid #A0A0A0");d.SetStyle("textAlign","left");d.SetStyle("backgroundColor","#BBBBBB");d.SetStyle("backgroundRepeat","repeat-x");d.SetStyle("backgroundImage","url("+STK.Path.FindImage("/data/images/display/progressbar/shine")+")");d.SetStyle("position","relative");a.SetStyle("borderRight","1px solid #A0A0A0");a.SetStyle("height","24px");a.SetStyle("backgroundColor","#0061CF");a.SetStyle("backgroundRepeat","repeat-x");a.SetStyle("backgroundImage","url("+STK.Path.FindImage("/data/images/display/progressbar/glint.jpg")+")");a.SetStyle("backgroundPosition","0px");a.SetStyle("position","relative");this.SetElement("text-area",c);this.SetElement("progress-area",d);this.SetElement("progress-fill",a);this.SetElement("frame",f);this.SetSubWidget("text",new STK.Label());this.Map=function(h){if(this.IsMapped()){return}var g=this.GetSubWidget("text");g.Map(this.GetElement("text-area"));h.Add(this.GetElement("frame"));this.StkWidgetMap(h)};this.Measure=function(){var h=this.GetSubWidget("text").Measure();var g={w:Math.max(e,h.w),h:b+h.h};return g};this.Reallocate=function(g,j){var k=this.GetElement("frame");var i=parseInt(k.GetStyle("width"));var l=j-b;this.GetSubWidget("text").Reallocate(g,l);k.SetStyle("width",g+"px");k.SetStyle("height",j+"px");this.SetData("__max_size__",g-3);if(this.GetData("__pulse_interval__")){if(i!=g){this._StopPulse();this._StartPulse()}}else{this.TouchProperty("fraction")}};this.GetText=function(){return this.GetProperty("text")};this.SetText=function(g){this.SetProperty("text",g)};this.SetPulseStep=function(){};this.GetPulseStep=function(){};this.Pulse=function(){this._StartPulse()};this.SetFraction=function(g){this.SetProperty("fraction",g)};this.GetFraction=function(){this.GetProperty("fraction")};this.CreateType("ProgressBar")};STK.ProgressBar.ClassStyles={animated:true};STK.ProgressBarModeType={ACTIVITY:1,PERCENT:2};STK.ProgressBarOrient={LEFT_TO_RIGHT:1,RIGHT_TO_LEFT:2,BOTTOM_TO_TOP:3,TOP_TO_BOTTOM:4};STK.Image=function(e,c,a){STK.Misc.apply(this);var b=new SEK.Element.Image();b.Listen("load",SEK.Delegate(this,"OnImageLoaded"));this.SetElement("image",b);this.GetElement("misc-frame").Add(b);this.OnImageLoaded=function(f){this.Emit("size-request")};this.RegisterProperty("url",STK.Path.FindImage("/data/icons/blank"),SEK.Delegate(this,"OnUrlChanged"));this.OnUrlChanged=function(g,i,h,f){this.GetElement("image").SetAttribute("src",f)};this.RegisterProperty("url-width",1,SEK.Delegate(this,"OnUrlWidthChanged"));this.OnUrlWidthChanged=function(g,i,h,f){this.Emit("size-request")};this.RegisterProperty("url-height",1,SEK.Delegate(this,"OnUrlHeightChanged"));this.OnUrlHeightChanged=function(g,i,h,f){this.Emit("size-request")};this.Measure=function(){var g=this.StkMiscMeasure();this.SetData("__misc_width__",g.w);this.SetData("__misc_height__",g.h);var f=this.GetProperty("url-width");var h=this.GetProperty("url-height");g.w+=f;g.h+=h;return g};this.Reallocate=function(f,j){this.StkMiscReallocate(f,j);var k=this.GetData("__misc_width__");var g=this.GetData("__misc_height__");f-=k;j-=g;var i=this.GetElement("image");f=Math.min(this.GetProperty("url-width"),f);j=Math.min(this.GetProperty("url-height"),j);i.SetAttribute("width",f);i.SetAttribute("height",j)};this.SetFromLocation=function(g,h,f){this.SetProperty("url",g);this.SetProperty("url-width",parseInt(h));this.SetProperty("url-height",parseInt(f))};this.SetFromStock=function(f,g){var h=STK.StockItemsStack.Lookup(f,g);return this.SetFromIconSet(h.icon)};this.SetFromIconSet=function(f){this.SetProperty("url",f.location);this.CoerceProperty("url-width",f.width);this.SetProperty("url-height",f.height)};this.Get=function(){return this.GetProperty("url")};this.GetSize=function(){return{w:this.GetProperty("url-width"),h:this.GetProperty("url-height")}};this.GetWidth=function(){return this.GetProperty("url-width")};this.GetHeight=function(){return this.GetProperty("url-height")};this.CreateType("Image");if(e!=undefined){if(typeof e=="string"){var d=e.slice(0,4);if(d=="gtk-"||d=="stk-"){this.SetFromStock(e,c)}else{this.SetFromLocation(e,c,a)}}else{this.SetFromIconSet(e,c)}}else{this.TouchProperty("url");this.TouchProperty("url-width");this.TouchProperty("url-height")}};STK.Editable=function(){};STK.Entry=function(c,b){STK.Widget.apply(this);STK.Editable.apply(this);var a=new SEK.Element.Input();a.SetAttribute("type","text");a.Listen("blur",SEK.Delegate(this,"OnBlurEvent"));a.Listen("keyup",SEK.Delegate(this,"OnKeyupEvent"));a.Listen("focus",SEK.Delegate(this,"OnFocusEvent"));a.Listen("mousedown",SEK.Delegate(this,"OnMouseDownEvent"));this.SetElement("entry",a);this.SetProperty("selectable",true);this.RegisterProperty("max-length",-1,SEK.Delegate(this,"OnMaxLengthChanged"));this.OnMaxLengthChanged=function(e,g,f,d){this.GetElement("entry").SetAttribute("maxLength",String(d))};this.RegisterProperty("text","",SEK.Delegate(this,"OnTextChanged"));this.OnTextChanged=function(e,g,f,d){this.GetElement("entry").SetAttribute("value",d)};this.RegisterProperty("visibility",true,SEK.Delegate(this,"OnVisibilityChanged"));this.OnVisibilityChanged=function(e,h,f,d){var g=d?"text":"password";this.GetElement("entry").SetAttribute("type",g)};this.RegisterProperty("width-chars",-1,SEK.Delegate(this,"OnWidthCharsChanged"));this.OnWidthCharsChanged=function(e,g,f,d){this.Emit("size-request")};this.RegisterProperty("name","",SEK.Delegate(this,"OnNameChanged"));this.OnNameChanged=function(e,g,f,d){this.GetElement("entry").SetAttribute("name",d)};this.OnSensitiveChanged=function(e,g,f,d){this.GetElement("entry").SetAttribute("disabled",!d)};this.Register("activate");this.Register("backspace");this.Register("delete-from-cursor");this.Register("insert-at-cursor");this.Register("move-cursor");this.Register("toggle-overwrite");this.Register("focus-out-event");this.Register("focus-in-event");this.OnFocusEvent=function(d){this.Emit("focus-in-event")};this.OnBlurEvent=function(d){this.Emit("focus-out-event")};this.OnKeyupEvent=function(d){if(d.CharCode()==STK.Keycode.ENTER){this.Emit("activate");return}if(d.IsChar()){STK.Requeue(SEK.Payload(SEK.Delegate(this,"Emit"),"insert-at-cursor",d.GetChar()))}return true};this.OnMouseDownEvent=function(d){d.StopPropagation()};this.GrabFocus=function(){this.GetElement("entry").dom_elmt.focus();this.StkWidgetGrabFocus()};this.SelectAll=function(){this.GetElement("entry").dom_elmt.select()};this.SetText=function(d){this.SetProperty("text",d)};this.GetText=function(){this.CoerceProperty("text",this.GetElement("entry").dom_elmt.value);return this.GetProperty("text")};this.SetVisibility=function(d){this.SetProperty("visibility",d)};this.GetVisibility=function(){return this.GetProperty("visibility")};this.SetMaxLength=function(d){this.SetProperty("max-length",parseInt(d))};this.GetMaxLength=function(){return this.GetProperty("max-length")};this.SetWidthChars=function(d){this.SetProperty("width-chars",d)};this.GetWidthChars=function(){return this.GetProperty("width-chars")};this.Map=function(d){if(this.IsMapped()){return}d.Add(this.GetElement("entry"));this.StkWidgetMap(d)};this.Measure=function(){var i=this.GetElement("entry");var h=14;var f=14;if(SEK.UserAgent.IsGecko()){h=12;f=8}else{if(SEK.UserAgent.IsExplorer8()){h=12;f=6}}var d=new SLK.TextStyle(i.dom_elmt);var e=SLK.Text.GetAverageCharSize(d);var g=Number(this.GetWidthChars());if(!g||g<0){g=20}var j={w:parseInt(g*e.w)+h,h:e.h+f};j=this.StkWidgetMeasure(j);return j};this.Reallocate=function(d,f){var g=14;var e=14;if(SEK.UserAgent.IsGecko()){g=12;e=8}else{if(SEK.UserAgent.IsExplorer8()){g=12;e=6}}var i=this.GetElement("entry");i.SetStyle("width",String(d-g)+"px");i.SetStyle("height",String(f-e)+"px")};this.CreateType("Entry");if(c!==undefined){this.SetMaxLength(c)}if(b!==undefined){this.SetText(b)}};STK.VBox=function(a,b){STK.Box.apply(this);this.SetChildExpansion=function(h,f,c,e){var d=this.GetElement(h.Name()+"-tr");var g=this.GetElement(h.Name()+"-td");d.SetStyle("height",String(c)+"px");g.SetStyle("padding",Math.floor(e/2)+"px")};this.ThemeMapChildArea=function(f,c){var d=this.GetElement("box-frame").InsertRow(c);var e=d.InsertCell(-1);this.SetElement(f.Name()+"-tr",d);this.SetElement(f.Name()+"-td",e);return e};this.ThemeUnmapChildArea=function(e){var c=this.GetElement(e.Name());if(!c){return}this.UnsetElement(e.Name());var d=c.GetParent();c.Remove();d.Remove()};this._PreAllocateScan=function(){var k=2*parseInt(this.GetProperty("spacing"));var h=0;var e=0;var m=0;var c=0;var l=0;var i=0;var f=this.GetChildren();for(var d in f){if(f.hasOwnProperty(d)){var j={w:this.GetChildProperty(f[d],"last-measured-w"),h:this.GetChildProperty(f[d],"last-measured-h")};if(j.w>c){c=j.w}if(j.h>l){l=j.h}var n=2*parseInt(this.GetChildProperty(f[d],"padding"));if(k){n+=k}this.SetChildProperty(f[d],"last-measured-padding",n);if(n){j.w+=n;j.h+=n}if(j.w>e){e=j.w}if(j.h>m){m=j.h}h+=j.h;i++}}var g={w:e,h:h};if(this.GetHomogeneous()){g.h=i*m}this.SetData("max-width",e);this.SetData("max-height",m);this.SetData("max-child-width",c);this.SetData("max-child-height",l);this.SetData("total-height",h);return g};this._AllocateScan=function(n,t){var v=this.GetData("max-width");var i=this.GetData("max-height");var o=this.GetData("max-child-width");var x=this.GetData("max-child-height");if(this.GetHomogeneous()){var k=0;var j=this.GetChildren();for(var z in j){if(j.hasOwnProperty(z)){var l=j[z];var m=this.GetChildProperty(l,"last-measured-padding");this.SetChildProperty(l,"last-allocated-w",o);this.SetChildProperty(l,"last-allocated-h",x);this.SetChildExpansion(l,k,i,m);k+=1}}return}var g=0;var u=0;var p=0;var j=this.GetChildren();for(var z in j){if(j.hasOwnProperty(z)){var l=j[z];var d=this.GetChildProperty(l,"expand");if(!d){var r=this.GetChildProperty(l,"last-measured-w");var c=this.GetChildProperty(l,"last-measured-h");var m=this.GetChildProperty(l,"last-measured-padding");var k=this.GetChildProperty(l,"position");var s=this.GetChildProperty(l,"fill");var q,y;if(s){q=n-m;y=c;this.SetChildExpansion(l,k,c,m)}else{q=r;y=c;this.SetChildExpansion(l,k,c,m)}this.SetChildProperty(l,"last-allocated-w",q);this.SetChildProperty(l,"last-allocated-h",y);g+=c;p+=1}u+=1}}if(u==0){return}var f=t-this.GetData("total-height");if(f<0){SEK.Log.Error("VBox::Reallocate - extra_size is negative: how did we shrink beneath measured size?")}var e=Math.floor(f/(u-p));if(isNaN(e)){return}for(var z in j){if(j.hasOwnProperty(z)){var l=j[z];var d=this.GetChildProperty(l,"expand");if(d){var r=this.GetChildProperty(l,"last-measured-w");var c=this.GetChildProperty(l,"last-measured-h");var m=this.GetChildProperty(l,"last-measured-padding");var k=this.GetChildProperty(l,"position");var s=this.GetChildProperty(l,"fill");var q,y;if(s){q=n-m;y=c+e;this.SetChildExpansion(l,k,c+e,m)}else{q=r;q=c;this.SetChildExpansion(l,k,c+e,m)}this.SetChildProperty(l,"last-allocated-w",q);this.SetChildProperty(l,"last-allocated-h",y)}}}};if(a!=undefined){this.SetProperty("homogeneous",Boolean(a))}if(b!=undefined){this.SetProperty("spacing",Number(b))}this.CreateType("VBox")};STK.Adjustment=function(e,a,c,f,d,b){SEK.Object.apply(this);this.RegisterProperty("value",Number(e),SEK.Delegate(this,"OnValueChanged"));this.OnValueChanged=function(h,j,i,g){};this.RegisterProperty("lower",Number(a),SEK.Delegate(this,"OnLowerChanged"));this.OnLowerChanged=function(h,j,i,g){};this.RegisterProperty("upper",Number(c),SEK.Delegate(this,"OnUpperChanged"));this.OnUpperChanged=function(h,j,i,g){};this.RegisterProperty("step-increment",Number(f),SEK.Delegate(this,"OnStepIncrementChanged"));this.OnStepIncrementChanged=function(h,j,i,g){};this.RegisterProperty("page-increment",Number(d),SEK.Delegate(this,"OnPageIncrementChanged"));this.OnPageIncrementChanged=function(h,j,i,g){};this.RegisterProperty("page-size",Number(b),SEK.Delegate(this,"OnPageSizeChanged"));this.OnPageSizeChanged=function(h,j,i,g){};this.Register("changed");this.Register("value-changed");this.GetValue=function(){return this.GetProperty("value")};this.SetValue=function(i){var g=Number(this.GetProperty("lower"));var h=Number(this.GetProperty("upper"));i=Number(i);if(i>=h){i=h}if(i<=g){i=g}this.SetProperty("value",i)};this.ClampPage=function(g,i){g=Number(g);i=Number(i);var h=Number(this.GetProperty("page-size"));var j=Number(this.GetProperty("value"));if(i<g){return}if((i-g)>=h){this.SetValue(g);this.ValueChanged();return}if(j<g){this.SetValue(g);this.ValueChanged();return}if((j+h)>i){this.SetValue(i-h);this.ValueChanged()}};this.Changed=function(){this.Emit("changed")};this.ValueChanged=function(){this.Emit("value-changed")}};STK.SpinButton=function(k,a,b){STK.Entry.apply(this);this.SetText("0");this.Connect("focus-out-event",SEK.Delegate(this,"_OnUpdateSpinValue"));this.Connect("activate",SEK.Delegate(this,"_OnActivateChild"));var j=new STK.Button();var f=new STK.Button();j.SetStyleProperty("inner-border-left",0);j.SetStyleProperty("inner-border-right",0);j.SetStyleProperty("inner-border-top",2);j.SetStyleProperty("inner-border-bottom",0);j.SetStyleProperty("border-radius-topleft",0);j.SetStyleProperty("border-radius-topright",3);j.SetStyleProperty("border-radius-bottomleft",0);j.SetStyleProperty("border-radius-bottomright",0);f.SetStyleProperty("inner-border-left",0);f.SetStyleProperty("inner-border-right",0);f.SetStyleProperty("inner-border-top",0);f.SetStyleProperty("inner-border-bottom",2);f.SetStyleProperty("border-radius-topleft",0);f.SetStyleProperty("border-radius-topright",0);f.SetStyleProperty("border-radius-bottomleft",0);f.SetStyleProperty("border-radius-bottomright",3);var d=new STK.Image(STK.Path.FindImage("/data/images/entry/spinbutton/arrow-up"),8,8);j.Add(d);var g=new STK.Image(STK.Path.FindImage("/data/images/entry/spinbutton/arrow-down"),8,8);f.Add(g);j.Emit("size-request");f.Emit("size-request");j.Connect("pressed",SEK.Callback(SEK.Delegate(this,"_OnSpinPressed"),1,STK.SpinType.STEP_FORWARD));j.Connect("released",SEK.Delegate(this,"_OnSpinButtonReleased"));j.Connect("leave",SEK.Delegate(this,"_OnSpinButtonReleased"));f.Connect("pressed",SEK.Callback(SEK.Delegate(this,"_OnSpinPressed"),-1,STK.SpinType.STEP_BACKWARD));f.Connect("released",SEK.Delegate(this,"_OnSpinButtonReleased"));f.Connect("leave",SEK.Delegate(this,"_OnSpinButtonReleased"));var i=new STK.VBox();i.PackStart(j,false,false,0);i.PackEnd(f,false,false,0);i.GetElement("box-frame").SetStyle("position","relative");i.GetElement("box-frame").SetStyle("left","-3px");var e=new SEK.Element.Table();e.SetAttribute("cellPadding",0);e.SetAttribute("cellSpacing",0);var l=e.InsertRow(-1);var c=l.InsertCell(-1);var h=l.InsertCell(-1);this.SetSubWidget("button-box",i);this.SetSubWidget("button-up",j);this.SetSubWidget("button-down",f);this.SetElement("sb-frame",e);this.SetElement("entry-area",c);this.SetElement("button-area",h);this.RegisterProperty("adjustment",null,SEK.Delegate(this,"OnAdjustmentChanged"));this.OnAdjustmentChanged=function(n,p,o,m){this.SetValue(this.GetValue())};this.RegisterProperty("climb-rate",0.4,null);this.RegisterProperty("digits",0,SEK.Delegate(this,"OnDigitsChanged"));this.OnDigitsChanged=function(n,p,o,m){this.SetValue(this.GetValue())};this.RegisterProperty("wrap",false,null);this.Register("value-changed");this.Register("wrapped");this._OnUpdateSpinValue=function(n,m){var o=this.GetText();this.SetValue(o)};this._OnActivateChild=function(n,m){var o=this.GetText();this.SetValue(o)};this._OnSpinPressed=function(q,r,m){this._OnUpdateSpinValue();var o=this.GetAdjustment().GetProperty("step-increment");this.Spin(m,1);var n=this.GetProperty("climb-rate");var p=new STK.SpinButton.Deltas(SEK.Callback(SEK.Delegate(this,"_OnHoldUpdate"),m),this.GetValue(),r,o,n);p.Start();this.SetData("__animator__",p)};this._OnHoldUpdate=function(n,m){if(!n){return}this.Spin(m,n)};this._OnSpinButtonReleased=function(n,m){var o=this.GetData("__animator__");this.SetData("__animator__",null);if(o){o.Stop()}};this.Map=function(n){if(this.IsMapped()){return}var q=this.GetSubWidget("button-box");var m=this.GetElement("button-area");q.Map(m);var p=this.GetElement("sb-frame");n.Add(p);var o=this.GetElement("entry-area");this.StkEntryMap(o)};this.Measure=function(){var n=this.StkEntryMeasure();var m=this.GetSubWidget("button-box").Measure();this.SetData("__vbox_w__",m.w);this.SetData("__vbox_h__",m.h);return{w:n.w+m.w,h:Math.max(n.h,m.h)}};this.Reallocate=function(m,o){var n=this.GetData("__vbox_w__");var p=this.GetData("__vbox_h__");this.GetSubWidget("button-box").Reallocate(n,p);this.StkEntryReallocate(m-n,o)};this.SetAdjustment=function(m){this.SetProperty("adjustment",m)};this.GetAdjustment=function(){return this.GetProperty("adjustment")};this.SetIncrements=function(n,o){var m=this.GetProperty("adjustment");m.SetProperty("step-increment",n);m.SetProperty("page-increment",o);m.Changed()};this.GetIncrements=function(){var m=this.GetProperty("adjustment");return[m.GetProperty("step-increment"),m.GetProperty("page-increment")]};this.SetRange=function(o,m){var n=this.GetProperty("adjustment");n.SetProperty("lower",o);n.SetProperty("upper",m);n.Changed()};this.GetRange=function(){var m=this.GetProperty("adjustment");return[m.GetProperty("lower"),m.GetProperty("upper")]};this.SetClimbRate=function(m){this.SetProperty("climb-rate",m)};this.GetClimbRate=function(){return this.GetProperty("climb-rate")};this.SetDigits=function(m){this.SetProperty("digits",m)};this.GetDigits=function(){return this.GetProperty("digits")};this.SetWrap=function(m){this.SetProperty("wrap",m)};this.GetWrap=function(){return this.GetProperty("wrap")};this.SetValue=function(p){var m=this.GetProperty("adjustment");var o=this.GetProperty("digits");var n=Math.pow(10,o);var q=Math.round(Number(p)*n)/n;m.SetValue(q);m.ValueChanged();this.SetText(m.GetValue());this.Emit("value-changed")};this.GetValue=function(m){return this.GetProperty("adjustment").GetValue()};this.Spin=function(s,x){x=Number(x);var v=this.GetProperty("adjustment");var r=this.GetRange();var q=Number(r[0]);var w=Number(r[1]);var n=this.GetIncrements();var p=Number(n[0]);var t=Number(n[1]);var m=this.GetWrap();var u=false;var o=Number(v.GetValue());switch(s){case STK.SpinType.STEP_FORWARD:o+=(p*x);if(m&&o>w){o-=((w-q)+(p*x));u=true}break;case STK.SpinType.STEP_BACKWARD:o-=(p*x);if(m&&o<q){o+=((w-q)+(p*x));u=true}break;case STK.SpinType.PAGE_FORWARD:o+=(t*x);if(m&&o>w){o-=((w-q)+(t*x));u=true}break;case STK.SpinType.PAGE_BACKWARD:o-=(t*x);if(m&&o<q){o+=((w-q)+(t*x));u=true}break;case STK.SpinType.HOME:o=q;break;case STK.SpinType.END:o=w;break}this.SetValue(o);if(u){this.Emit("wrapped")}};this.SetSensitive=function(m){this.GetSubWidget("button-up").SetSensitive(m);this.GetSubWidget("button-down").SetSensitive(m);this.StkEntrySetSensitive(m)};this.CreateType("SpinButton");if(k){this.SetAdjustment(k)}else{this.SetAdjustment(new STK.Adjustment(1,-10,10,1,10,10))}if(a){this.SetClimbRate(a)}if(b){this.SetDigits(b)}};STK.SpinButton.Deltas=function(e,c,d,b,a){SEK.Animator.Base.apply(this,[e,0]);this.RegisterProperty("base",c);this.RegisterProperty("absolute",c);this.RegisterProperty("direction",d);this.RegisterProperty("step",b);this.RegisterProperty("climb-rate",a);this.Update=function(){var m=this.GetProperty("absolute");var g=this.GetProperty("base");var i=this.GetProperty("direction");var h=this.GetProperty("step");var q=2;var o=SEK.Timer.GetTime()-this.GetProperty("start-time");if(o<0.5){return}o-=0.5;var p=Math.round(o*4);if(o<q){var j=h*p*d;var n=g+j;this.SetProperty("absolute",n)}else{var f=this.GetProperty("climb-rate");var j=h*p*d;var l=(o-q)*f+1;var k=Math.pow(2,l)-1;j*=k;var n=Math.round(g+j);this.SetProperty("absolute",n)}this.SetProperty("value",Math.abs(m-this.GetProperty("absolute")))};this.SetProperty("value",0)};STK.UpdatePolicy={ALWAYS:0,IF_VALID:1};STK.SpinType={STEP_FORWARD:0,STEP_BACKWARD:1,PAGE_FORWARD:2,PAGE_BACKWARD:3,HOME:4,END:5,UNDEFINED:6};STK.Upload=function(a){STK.Widget.apply(this);this.RegisterProperty("name",a,SEK.Delegate(this,"OnNameChanged"));this.RegisterProperty("size",40,SEK.Delegate(this,"OnSizeChanged"));this.OnNameChanged=this.OnSizeChanged=function(d,f,e,c){this.GetElement("frame").SetAttribute(f,c);if(f=="size"){this.Emit("size-request")}};var b=new SEK.Element.Input();b.SetAttribute("type","file");b.SetAttribute("name",this.GetProperty("name"));b.SetAttribute("size",this.GetProperty("size"));b.Listen("mousedown",function(c){c.StopPropagation()});this.SetElement("frame",b);this.Measure=function(){var c=SLK.Text.GetAverageCharSize(new SLK.TextStyle(this._frame));c.w*=Number(this.GetProperty("size"));return c};this.Reallocate=function(c,d){return};this.Map=function(c){c.Add(this.GetElement("frame"));this.StkWidgetMap()};this.CreateType("Upload")};STK.Alignment=function(d,c,b,a){STK.Bin.apply(this);this.RegisterProperty("left-padding",0,SEK.Delegate(this,"OnLeftPaddingChanged"));this.RegisterProperty("bottom-padding",0,SEK.Delegate(this,"OnBottomPaddingChanged"));this.RegisterProperty("right-padding",0,SEK.Delegate(this,"OnRightPaddingChanged"));this.RegisterProperty("top-padding",0,SEK.Delegate(this,"OnTopPaddingChanged"));this.RegisterProperty("xalign",0.5,SEK.Delegate(this,"OnXalignChanged"));this.RegisterProperty("yalign",0.5,SEK.Delegate(this,"OnYalignChanged"));this.RegisterProperty("xscale",1,SEK.Delegate(this,"OnXscaleChanged"));this.RegisterProperty("yscale",1,SEK.Delegate(this,"OnYscaleChanged"));this.SetElement("alignment-frame",new SEK.Element.Div());this.OnLeftPaddingChanged=this.OnRightPaddingChanged=this.OnBottomPaddingChanged=this.OnTopPaddingChanged=this.OnXalignChanged=this.OnYalignChanged=this.OnXscaleChanged=this.OnYscaleChanged=function(f,h,g,e){this.Emit("size-request")};this._ApplyData=function(){var i=this.GetElement("alignment-frame");var e=this.GetData("__top_align__");var j=this.GetData("__left_align__");if(e==undefined){e=0}if(j==undefined){j=0}var k=this.GetProperty("top-padding");var h=this.GetProperty("bottom-padding");var f=this.GetProperty("left-padding");var g=this.GetProperty("right-padding");i.SetStyle("paddingTop",parseInt(k)+parseInt(e)+"px");i.SetStyle("paddingBottom",parseInt(h)+"px");i.SetStyle("paddingLeft",parseInt(f)+parseInt(j)+"px");i.SetStyle("paddingRight",parseInt(g)+"px")};this.Set=function(h,g,f,e){this.SetProperty("xalign",h);this.SetProperty("yalign",g);this.SetProperty("xscale",f);this.SetProperty("yscale",e)};this.Get=function(){return{xalign:this.GetProperty("xalign"),yalign:this.GetProperty("yalign"),xscale:this.GetProperty("xscale"),yscale:this.GetProperty("yscale")}};this.GetPadding=function(){return{padding_top:this.GetProperty("top-padding"),padding_bottom:this.GetProperty("bottom-padding"),padding_left:this.GetProperty("left-padding"),padding_right:this.GetProperty("right-padding")}};this.SetPadding=function(h,e,g,f){this.CoerceProperty("left-padding",g);this.CoerceProperty("bottom-padding",e);this.CoerceProperty("right-padding",f);this.CoerceProperty("top-padding",h);this.Emit("size-request")};this.Measure=function(){var e=this.GetChild();var f={w:0,h:0};if(e){f=e.Measure()}this.SetData("__measured_w__",f.w);this.SetData("__measured_h__",f.h);f.w+=parseInt(this.GetProperty("left-padding"))+parseInt(this.GetProperty("right-padding"));f.h+=parseInt(this.GetProperty("top-padding"))+parseInt(this.GetProperty("bottom-padding"));return f};this.Reallocate=function(n,s){var j=this.GetChild();var v=this.GetElement("alignment-frame");var e=n-parseInt(this.GetProperty("left-padding")+this.GetProperty("right-padding"));var m=s-parseInt(this.GetProperty("top-padding")+this.GetProperty("bottom-padding"));var k=parseFloat(this.GetProperty("xscale"));var r=parseFloat(this.GetProperty("yscale"));var u=Math.max(this.GetData("__measured_w__"),Math.round(e*k));var g=Math.max(this.GetData("__measured_h__"),Math.round(m*r));if(j){j.Reallocate(u,g)}e-=u;m-=g;var i=u-this.GetData("__measured_w__");var p=g-this.GetData("__measured_h__");var t=parseFloat(this.GetProperty("xalign"));var f=parseFloat(this.GetProperty("yalign"));var o=Math.floor(Math.abs(e-i)*t);var x=Math.floor(Math.abs(m-p)*f);this.SetData("__left_align__",o);this.SetData("__top_align__",x);this._ApplyData();if(SEK.UserAgent.IsExplorer()){v.SetStyle("width",String(n)+"px");v.SetStyle("height",String(s)+"px")}else{var l=parseInt(v.GetStyle("paddingLeft"))+parseInt(v.GetStyle("paddingRight"));var q=parseInt(v.GetStyle("paddingTop"))+parseInt(v.GetStyle("paddingBottom"));v.SetStyle("width",String(n-l)+"px");v.SetStyle("height",String(s-q)+"px")}};this.Map=function(e){var f=this.GetElement("alignment-frame");e.Add(f);this.GetChild().Map(f);this.StkBinMap(e)};this.CreateType("Alignment");if(d!==undefined){this.SetProperty("xalign",d)}if(c!==undefined){this.SetProperty("yalign",c)}if(b!==undefined){this.SetProperty("xscale",b)}if(a!==undefined){this.SetProperty("yscale",a)}};STK.Builder=function(a){STK.Container.apply(this);this.RegisterProperty("connection-target-list",[]);this.RegisterProperty("widgets",{});this.Build=function(d){if(arguments.length>1){var b=[];for(var c=1;c<arguments.length;c++){b.push(arguments[c])}this.SetProperty("connection-target-list",b)}this.SetElement("frame",new SEK.Element.Wrapper(d));this.__Build(d);this.__Fixup();return this.GetProperty("widgets")};this.BuildFromString=function(e){if(arguments.length>1){var b=[];for(var d=1;d<arguments.length;d++){b.push(arguments[d])}this.SetProperty("connection-target-list",b)}var c=new SEK.Element.Div();c.SetContent(e);this.SetElement("frame",c);this.__Build(c.dom_elmt);this.__Fixup();return this.GetProperty("widgets")};this.BuildWithTargets=0;this.BuildFromStringWithTargets=0;this.GetWidget=function(b){return this.GetProperty("widgets")[b]};this.__Build=function(c){if(this.__GetAttr(c,"stk")){var d=this.__BuildWidget(c);if(d){this.__ShowWidget(d,c)}}else{for(var b=0;b<c.childNodes.length;b++){this.__Build(c.childNodes[b])}}};this.__BuildWidget=function(e,g){var f;if(!this.__GetAttr(e,"stk")){if(this.__NodeHasWidgetChildren(e)){f=new STK.Builder(e);f.Unmap()}else{if(e.nodeType!=3||SEK.String.Trim(e.nodeValue).length>0){f=new STK.Html(e)}}}else{var d=this.__GetAttr(e,"stk");f=this.__CreateWidget(d,e);if(f.HasType("Container")){var c=0;var b=e.childNodes.length;while(e.childNodes.length>0&&c<b){var h=this.__BuildWidget(e.childNodes[0],true);if(h){this.__PackWidget(f,c,h)}else{e.removeChild(e.childNodes[0])}c++}}if(g){e.parentNode.removeChild(e)}}return f};this.__CreateWidget=function(l,c){var h=STK[l];if(!h){return}var g=new h();var e=this.__GetStkAttrs(c);var j=e[0];var d=e[1];var m=e[2];var b=e[3];var f=e[4];for(var k in j){g.SetProperty(k,j[k])}for(var k in m){g.SetStyleProperty(k,m[k])}for(var k in d){g.Connect(k,d[k])}for(var k in f){g.SetData(k,f[k])}g.SetData("__pack_props__",b);var i=this.__GetAttr(c,"name");if(!i){i=g.Name()}this.GetProperty("widgets")[i]=g;return g};this.__ShowWidget=function(c,b){c.Map(new SEK.Element.Wrapper(b));c.Show();var d=c.Measure();c.Reallocate(d.w,d.h)};this.__PackWidget=function(b,i,c){var m=c.GetData("__pack_props__");if(!m){m={}}if(b.HasType("Box")){var n=Boolean(m.expand);var o=Boolean(m.fill);var l=Number(m.padding);if(isNaN(l)){l=0}b.PackStart(c,n,o,l)}else{if(b.HasType("Dialog")){var n=Boolean(m.expand);var o=Boolean(m.fill);var l=Number(m.padding);if(isNaN(l)){l=0}b.vbox.PackStart(c,n,o,l)}else{if(b.HasType("Table")){var q=Number(m.row);var e=Number(m.column);var f=m.xoptions;var d=m.yoptions;var h=Number(m.xpadding);var p=Number(m.ypadding);var g=Number(m.xalign);var j=Number(m.yalign);if(isNaN(h)){h=0}if(isNaN(p)){p=0}if(isNaN(g)){g=0.5}if(isNaN(j)){j=0.5}if(isNaN(q)||isNaN(e)){SEK.Log.Error("STK::Builder - attempting to pack a Table that has no row or column pack property at: %s(%s) into %s",c.Name(),c.GetType(),b.Name());return}b.AttachAt(c,q,e,f,d,h,p,g,j)}else{if(b.HasType("Frame")){var k=Boolean(m.label_widget);if(k){b.SetLabelWidget(c)}else{b.Add(c)}}else{b.Add(c)}}}}};this.__NodeHasWidgetChildren=function(c){if(this.__GetAttr(c,"stk")){return true}for(var b=0;b<c.childNodes.length;b++){var e=c.childNodes[b];var d=this.__NodeHasWidgetChildren(e);if(d){return true}}return false};this.__GetAttr=function(d,e){if(!d||!d.attributes){return false}for(var c=0;c<d.attributes.length;c++){var b=d.attributes[c];if(b.nodeName==e){return b.nodeValue}}return false};this.__GetStkAttrs=function(b){if(!b||!b.attributes){return[]}var m=this.GetProperty("connection-target-list");var l={};var d={};var o={};var n={};var f={};for(var g=0;g<b.attributes.length;g++){var k=b.attributes[g];if(k.nodeName.slice(0,1)=="#"){var c=k.nodeName.slice(1);o[c]=k.nodeValue}else{if(k.nodeName.slice(0,1)=="*"){var c=k.nodeName.slice(1);var p=k.nodeValue;for(var e=0;e<m.length;e++){if(m[e][p]!==undefined){d[c]=SEK.Delegate(m[e],p)}}}else{if(k.nodeName.slice(0,1)=="-"){var c=k.nodeName.slice(1);var h=k.nodeValue;if(h=="true"){h=true}else{if(h=="false"){h=false}}l[c]=h}else{if(k.nodeName.slice(0,1)=="^"){var c=k.nodeName.slice(1);var h=k.nodeValue;if(h=="true"){h=true}else{if(h=="false"){h=false}}n[c]=h}else{if(k.nodeName.slice(0,1)=="_"){var c=k.nodeName.slice(1);var h=k.nodeValue;if(h=="true"){h=true}else{if(h=="false"){h=false}}f[c]=h}}}}}}return[l,d,o,n,f]};this.__Fixup=function(){this.__FixupRadioButtonGroups()};this.__FixupRadioButtonGroups=function(){var b={};var e=this.GetProperty("widgets");for(var f in e){var c=e[f];if(c.GetType()=="RadioButton"){var d=c.GetData("group");if(b[d]!==undefined){c.SetGroup(b[d].GetGroup())}else{b[d]=c}}}for(var f in b){b[f].SetActive(true)}};this.Map=function(c){var b=this.GetElement("frame");if(!b){SEK.Log.Critical("STK::Builder::Map - no root");return}c.Add(b);this.StkWidgetMap()};this.Unmap=function(){var b=this.GetElement("frame");if(!b){return}b.Remove();this.StkWidgetUnmap()};this.CreateType("Builder");if(a){this.Build.apply(this,arguments)}};STK.Expander=function(j,a){STK.Bin.apply(this);this.RegisterProperty("expanded",false,SEK.Delegate(this,"OnExpandedChanged"));this.RegisterProperty("label","",SEK.Delegate(this,"OnLabelChanged"));this.Register("toggled");for(var d in STK.Expander.ClassStyles){if(STK.Expander.ClassStyles.hasOwnProperty(d)){this.SetStyleProperty(d,STK.Expander.ClassStyles[d])}}var h=new SEK.Element.Table();h.SetAttribute("cellSpacing",0);h.SetAttribute("cellPadding",0);var b=h.InsertRow(0);var k=b.InsertCell(0);k.SetAttribute("width",12);k.SetAttribute("height",12);var c=b.InsertCell(1);var f=h.InsertRow(1);var e=f.InsertCell(0);e.SetAttribute("colSpan",2);e.SetStyle("display","none");var l=new SEK.Element.Image();l.SetAttribute("width",12);l.SetAttribute("height",12);l.SetAttribute("src",this.GetStyleProperty("expander-collapsed"));k.Add(l);b.SetStyle("backgroundColor",this.GetStyleProperty("label-row-color"));b.Listen("mouseover",SEK.Delegate(this,"OnLabelRowMouseOver"));b.Listen("mouseout",SEK.Delegate(this,"OnLabelRowMouseOut"));b.Listen("click",SEK.Delegate(this,"OnLabelRowClick"));var g=new STK.Label(this.GetProperty("label"),true);g.SetProperty("xalign",0);g.SetProperty("xpad",4);g.SetStyleProperty("font-size","0.8em");g.Map(c);this.SetElement("frame",h);this.SetElement("expand-cell",k);this.SetElement("expander",l);this.SetElement("label-row",b);this.SetElement("label-cell",c);this.SetElement("child-cell",e);this.SetSubWidget("label",g);this.OnLabelRowMouseOver=function(m){var i=this.GetElement("expander");if(this.GetProperty("expanded")){i.SetAttribute("src",STK.Expander.ClassStyles["expander-expanded-hover"])}else{i.SetAttribute("src",STK.Expander.ClassStyles["expander-collapsed-hover"])}var n=this.GetElement("label-row");n.SetStyle("backgroundColor",this.GetStyleProperty("label-row-color-hover"))};this.OnLabelRowMouseOut=function(m){var i=this.GetElement("expander");if(this.GetProperty("expanded")){i.SetAttribute("src",STK.Expander.ClassStyles["expander-expanded"])}else{i.SetAttribute("src",STK.Expander.ClassStyles["expander-collapsed"])}var n=this.GetElement("label-row");n.SetStyle("backgroundColor",this.GetStyleProperty("label-row-color"))};this.OnLabelRowClick=function(i){this.SetProperty("expanded",!this.GetProperty("expanded"))};this.OnExpandedChanged=function(m,p,n,i){if(n==i){return}var o=this.GetElement("child-cell");if(i){o.SetStyle("display","table-cell")}else{o.SetStyle("display","none")}this.OnLabelRowMouseOver(null);this.Emit("size-request");this.Emit("toggled")};this.OnLabelChanged=function(n,p,o,i){var m=this.GetSubWidget("label");m.SetMarkup(i);this.Emit("size-request")};this.Map=function(i){if(this.IsMapped()){return}var m=this.GetElement("frame");i.Add(m);var o=this.GetElement("child-cell");var n=this.GetChild();if(n){n.Map(o)}this.StkBinMap()};this.Measure=function(){var o={w:12,h:12};var i=this.GetSubWidget("label");var m=i.Measure();o.w+=m.w;o.h=Math.max(o.h,m.h);this.SetData("__label_request__",m);var p=this.GetChild();if(p&&this.GetProperty("expanded")){var n=p.Measure();o.w=Math.max(o.w,n.w);o.h+=n.h}return o};this.Reallocate=function(i,o){var p=this.GetElement("frame");p.SetStyle("width",i+"px");p.SetStyle("height",o+"px");var m=this.GetSubWidget("label");var n=this.GetData("__label_request__");var r={w:i-12,h:12};if(m&&n){r={w:Math.max(i-12,n.w),h:Math.max(12,n.h)};m.Reallocate(r.w,r.h)}var q=this.GetChild();if(q&&this.GetProperty("expanded")){o-=r.h;q.Reallocate(i,o)}};this.Show=function(){this.StkBinShow();if(!this.GetProperty("expanded")){this.GetElement("child-cell").SetStyle("display","none")}};this.SetLabel=function(i){this.SetProperty("label",i)};this.GetLabel=function(){return this.GetProperty("label")};this.SetExpanded=function(i){this.SetProperty("expanded",i)};this.GetExpanded=function(){return this.GetProperty("expanded")};this.CreateType("Expander");if(j){this.SetProperty("label",j)}if(a){this.Add(a)}};STK.Expander.ClassStyles={"expander-expanded":STK.Path.FindImage("/theme/Plain/dataview/treeview/treeview_expander_down"),"expander-collapsed":STK.Path.FindImage("/theme/Plain/dataview/treeview/treeview_expander_up"),"expander-expanded-hover":STK.Path.FindImage("/theme/Plain/dataview/treeview/treeview_expander_down_hover"),"expander-collapsed-hover":STK.Path.FindImage("/theme/Plain/dataview/treeview/treeview_expander_up_hover"),"label-row-color":"transparent","label-row-color-hover":"#cfd9fb"};STK.ButtonBox=function(){this.RegisterProperty("layout-style",STK.ButtonBoxStyle.DEFAULT,SEK.Delegate(this,"OnLayoutStyleChanged"));this.OnLayoutStyleChanged=function(b,d,c,a){this.Emit("size-request")};this.GetLayout=function(){return this.GetProperty("layout-style")};this.SetLayout=function(a){this.SetProperty("layout-style",a)};this.GetChildSecondary=function(a){return this.GetChildProperty(a,"is-secondary")};this.SetChildSecondary=function(b,a){this.SetChildProperty(b,"is-secondary",a)};this._AllocateExtraSpace=function(c){var e=this.GetLayout();if(e==STK.ButtonBoxStyle.START){var b=this.GetChildren();var f=0;for(var a in b){if(b.hasOwnProperty(a)){f+=1}}this.ThemeSetChildPostPad(f-1,c)}else{if(e==STK.ButtonBoxStyle.END){this.ThemeSetChildPrePad(0,c)}else{if(e==STK.ButtonBoxStyle.SPREAD){var d=Math.floor(c/(this.Count()+1));var f=0;var b=this.GetChildren();for(var a in b){if(b.hasOwnProperty(a)){this.ThemeSetChildPrePad(f,d);f++}}}else{if(e==STK.ButtonBoxStyle.EDGE){if(this.Count()<=1){return}var d=Math.floor(c/(this.Count()-1));var f=0;var b=this.GetChildren();for(var a in b){if(b.hasOwnProperty(a)){if(f!=0){this.ThemeSetChildPrePad(f,d)}f++}}}}}}};this.CreateType("ButtonBox")};STK.ButtonBoxStyle={DEFAULT:0,SPREAD:1,EDGE:2,START:3,END:4};STK.HButtonBox=function(){STK.HBox.apply(this);STK.ButtonBox.apply(this);this.ThemeSetChildPrePad=function(d,b){var c=this.GetElement("box-frame");var a=c.GetRowAtOffset(0);var e=a.GetCellAtOffset(d);e.SetStyle("paddingLeft",String(b)+"px")};this.ThemeSetChildPostPad=function(d,b){var c=this.GetElement("box-frame");var a=c.GetRowAtOffset(0);var e=a.GetCellAtOffset(d);e.SetStyle("paddingRight",String(b)+"px")};this._AllocateScan=function(a,d){this.StkHBox_AllocateScan(a,d);var e=this.GetData("max-width");var c=this.GetData("max-child-width");var b=a-(this.Count()*c);this._AllocateExtraSpace(b)};this.CreateType("HButtonBox");this.SetHomogeneous(true)};STK.Notebook=function(){STK.Container.apply(this);var a=SEK.Delegate(this,"_OnTabClicked");this._Setup=function(){var e=new SEK.Element.Div();var d=new SEK.Element.Div();var c=new SEK.Element.Div();e.Add(d);e.Add(c);this.SetElement("frame",e);this.SetElement("buttons",d);this.SetElement("content",c);var b=new STK.HButtonBox();this.SetSubWidget("tabs",b);b.Map(d)};this.AppendPage=function(e,d){var c=new STK.ToggleButton(d);c.SetStyleProperty("border-radius-bottomleft",0);c.SetStyleProperty("border-radius-bottomright",0);c.SetStyleProperty("border-radius-topleft",9);c.SetStyleProperty("border-radius-topright",9);c.Connect("clicked",SEK.Delegate(this,"_OnTabClicked"));var b=this.GetSubWidget("tabs");b.PackEnd(c);c.Show();this.Add(e);this.SetChildProperty(e,"tab",c);c.SetData("content",e);c.SetData("position",this.Count()-1);this.SetCurrentPage(this.Count()-1);this.Emit("size-request")};this._OnTabClicked=function(b){this.SetCurrentPage(b.GetData("position"))};this.SetCurrentPage=function(e){var d=this.GetChildren();var f=this.GetElement("content");var g=null;for(var j in d){var h=d[j];var c=this.GetChildProperty(h,"tab");var b=c.GetData("position");if(b!=e){c.SetActive(false);h.Unmap()}else{g=h;c.SetActive(true)}}f.SetContent("");if(g){g.Map(f);g.Show()}this.Emit("size-request")};this.GetCurrentPage=function(){var c=this.GetChildren();for(var d in c){var b=this.GetChildProperty(c[d],"tab");if(b.GetActive()){return c[d]}}return null};this.Measure=function(){var b=this.GetSubWidget("tabs");var c=b.Measure();var e=this.GetCurrentPage();if(!e){return c}var d=e.Measure();return{w:Math.max(c.w,d.w),h:c.h+d.h}};this.Reallocate=function(d,e){var b=this.GetSubWidget("tabs");var c=b.Measure();b.Reallocate(d,c.h);var f=this.GetCurrentPage();if(!f){return}f.Reallocate(d,e-c.h)};this.Map=function(b){if(this.IsMapped()){return}b.Add(this.GetElement("frame"));this.StkContainerMap()};this.CreateType("Notebook");this._Setup()};STK.Table=function(c,a,b){STK.Container.apply(this);this.RegisterProperty("n-rows",c,SEK.Delegate(this,"OnRowsOrColumnsChanged"));this.RegisterProperty("n-columns",a,SEK.Delegate(this,"OnRowsOrColumnsChanged"));this.OnRowsOrColumnsChanged=function(p,f,l,m){var k=this.GetChildren();for(var o in k){if(k.hasOwnProperty(o)){var g=k[o];g.Unmap()}}var h=this.GetElement("frame");while(h.RowCount()>0){h.DeleteRow(0)}var u=parseInt(this.GetProperty("n-rows"));var s=parseInt(this.GetProperty("n-columns"));for(var o=0;o<u;o++){var e=h.InsertRow(o);for(var n=0;n<s;n++){var q=e.InsertCell(n)}}for(var o in k){if(k.hasOwnProperty(o)){var g=k[o];var e=this.GetChildProperty(g,"table-row");var q=this.GetChildProperty(g,"table-column");if(e<u&&q<s){var t=h.GetRowAtOffset(e).GetCellAtOffset(q);g.Map(t);this.__SetChildPacking(g,t)}}}};this.RegisterProperty("cell-spacing",0,SEK.Delegate(this,"OnCellSpacingChanged"));this.OnCellSpacingChanged=function(f,h,g,e){this.GetElement("frame").SetAttribute("cellSpacing",parseInt(e))};var d=new SEK.Element.Table();d.SetAttribute("cellPadding",0);d.SetAttribute("cellSpacing",0);this.SetElement("frame",d);this.AttachAt=function(e,m,g,h,f,i,n,j,k){if(!h){h="shrink"}if(!f){f="shrink"}if(!i){i=0}if(!n){n=0}if(j===undefined){j=0.5}if(k===undefined){k=0.5}this.Add(e);this.SetChildProperty(e,"table-row",m);this.SetChildProperty(e,"table-column",g);this.SetChildProperty(e,"table-xoptions",h);this.SetChildProperty(e,"table-yoptions",f);this.SetChildProperty(e,"table-xpadding",i);this.SetChildProperty(e,"table-ypadding",n);this.SetChildProperty(e,"table-xalign",j);this.SetChildProperty(e,"table-yalign",k);this.SetChildProperty(e,"need-measure",true);this.SetChildProperty(e,"need-alloc",true);e.Connect("size-request",SEK.Delegate(this,"OnChildSizeChanged"));var l=this.GetElement("frame").GetRowAtOffset(m).GetCellAtOffset(g);e.Map(l);this.__SetChildPacking(e,l);this.Emit("size-request")};this.__SetChildPacking=function(l,e){var h=this.GetChildProperty(l,"table-xoptions");var g=this.GetChildProperty(l,"table-yoptions");var k=this.GetChildProperty(l,"table-xpadding");var j=this.GetChildProperty(l,"table-ypadding");var i=this.GetChildProperty(l,"table-xalign");var f=this.GetChildProperty(l,"table-yalign");if(i<0.5){e.SetAttribute("align","left")}else{if(i>0.5){e.SetAttribute("align","right")}else{e.SetAttribute("align","center")}}if(f<0.5){e.SetAttribute("valign","top")}else{if(f>0.5){e.SetAttribute("valign","bottom")}else{e.SetAttribute("valign","middle")}}e.SetStyle("paddingLeft",k+"px");e.SetStyle("paddingRight",k+"px");e.SetStyle("paddingTop",j+"px");e.SetStyle("paddingBottom",j+"px")};this.Attach=function(e,k,n,l,j,g,f,i,o,h,m){this.AttachAt(e,l,k,g,f,i,o,h,m)};this.OnChildSizeChanged=function(e){this.SetChildProperty(e,"need-measure",true);this.SetChildProperty(e,"need-alloc",true);this.Emit("size-request")};this.Measure=function(){var v=0;var o=0;this._MeasureAllChildren();var n=parseInt(this.GetProperty("n-rows"));var g=parseInt(this.GetProperty("n-columns"));var r=[];for(var k=0;k<g;k++){r.push(0)}var t=0;var q=0;for(var m=0;m<n;m++){var l=0;var u=false;for(var k=0;k<g;k++){var f=this._GetChildAt(m,k);if(!f){continue}var x=this.GetChildProperty(f,"last-measured-w");var p=this.GetChildProperty(f,"last-measured-h");if(this.GetChildProperty(f,"table-yoptions")=="expand"){u=true}l=Math.max(l,p);r[k]=Math.max(r[k],x)}this.SetData("__row_"+String(m)+"_height__",l);this.SetData("__row_"+String(m)+"_expands__",u);if(u){t+=1}o+=l}for(var k=0;k<g;k++){v+=r[k]}for(var k=0;k<g;k++){var e=false;var s=0;for(var m=0;m<n;m++){var f=this._GetChildAt(m,k);if(!f){continue}var x=this.GetChildProperty(f,"last-measured-w");var p=this.GetChildProperty(f,"last-measured-h");if(this.GetChildProperty(f,"table-xoptions")=="expand"){e=true}s=Math.max(s,x)}this.SetData("__col_"+String(k)+"_width__",s);this.SetData("__col_"+String(k)+"_expands__",e);if(e){q+=1}}this.SetData("__min_width__",v);this.SetData("__min_height__",o);this.SetData("__n_expand_rows__",t);this.SetData("__n_expand_cols__",q);return{w:v,h:o}};this.Reallocate=function(n,A){var o=parseInt(this.GetProperty("n-rows"));var q=parseInt(this.GetProperty("n-columns"));var g=n-this.GetData("__min_width__");if(!g||g<=0){g=0}var p=A-this.GetData("__min_height__");if(!p||p<=0){p=0}var D=this.GetData("__n_expand_rows__");var E=this.GetData("__n_expand_cols__");var l=0;var k=0;if(D>0){l=p/D}if(E>0){k=g/E}for(var z=0;z<o;z++){var C=this.GetData("__row_"+String(z)+"_height__");var v=this.GetData("__row_"+String(z)+"_expands__");for(var y=0;y<q;y++){var B=this.GetData("__col_"+String(y)+"_width__");var t=this.GetData("__col_"+String(y)+"_expands__");var m=this._GetChildAt(z,y);if(!m){continue}if(this.GetChildProperty(m,"need-alloc")){var s=this.GetChildProperty(m,"table-xoptions");var f=this.GetChildProperty(m,"table-yoptions");var x=this.GetChildProperty(m,"last-measured-w");var e=this.GetChildProperty(m,"last-measured-h");if(s=="fill"){x=B}else{if(s=="expand"){x=B+k}}if(f=="fill"){e=C}else{if(f=="expand"){e=C+l}}var u=this.GetChildProperty(m,"table-xpadding");var r=this.GetChildProperty(m,"table-xpadding");x-=2*u;e-=2*r;m.Reallocate(x,e)}}}};this._MeasureAllChildren=function(){var f=this.GetChildren();for(var e in f){if(f.hasOwnProperty(e)){var j=f[e];if(this.GetChildProperty(j,"need-measure")){var h=this.GetChildProperty(j,"table-xpadding");var g=this.GetChildProperty(j,"table-xpadding");var i=j.Measure();this.SetChildProperty(j,"last-measured-w",i.w+h*2);this.SetChildProperty(j,"last-measured-h",i.h+g*2);this.SetChildProperty(j,"need-measure",false)}}}};this._GetChildAt=function(h,f){var g=this.GetChildren();for(var e in g){if(g.hasOwnProperty(e)){var m=g[e];var k=this.GetChildProperty(m,"table-row");var l=this.GetChildProperty(m,"table-column");if(k==h&&l==f){return m}}}return null};this.Map=function(e){if(this.IsMapped()){return}e.Add(this.GetElement("frame"));this.StkContainerMap()};this.CreateType("Table");this.TouchProperty("n-rows")};STK.AttachOptions={EXPAND:"expand",SHRINK:"shrink",FILL:"fill"};STK.VButtonBox=function(){STK.VBox.apply(this);STK.ButtonBox.apply(this);this.ThemeSetChildPrePad=function(d,b){var c=this.GetElement("box-frame");var a=c.GetRowAtOffset(d);var e=a.GetCellAtOffset(0);e.SetStyle("paddingTop",String(b)+"px")};this.ThemeSetChildPostPad=function(d,b){var c=this.GetElement("box-frame");var a=c.GetRowAtOffset(d);var e=a.GetCellAtOffset(0);e.SetStyle("paddingBottom",String(b)+"px")};this._AllocateScan=function(b,d){this.StkVBox_AllocateScan(b,d);var a=this.GetData("max-height");var e=this.GetData("max-child-height");var c=d-(this.Count()*e);this._AllocateExtraSpace(c)};this.CreateType("VButtonBox");this.SetHomogeneous(true)};STK.MenuShell=function(){STK.Container.apply(this);this.Register("selection-done");this.children=[];this.active=false;this.active_menu_item=null;this.parent_menu_shell=null;this.parent_menu_item=null;this.Append=function(a){this.children.push(a);a.SetProperty("owner-menu",this);this.Add(a)};this.Prepend=function(a){this.children.unshift(a);a.SetProperty("owner-menu",this);this.Add(a)};this.Insert=function(b,a){this.children.splice(a,0,b);b.SetProperty("owner-menu",this);this.Add(b)};this.Deactivate=function(){this.Emit("deactivate")};this.SelectItem=function(a){this.selected=a;a.Select()};this.SelectFirst=function(b){for(var a=0;a<this.children.length;a++){var c=this.children[a];if(!b||c.Get("sensitive")){c.Select();this.selected=c;return}}SEK.Log.Warning("MenuShell::SelectFirst - no first menu item")};this.Deselect=function(){if(!this.selected){SEK.Log.Warning("MenuShell::Deselect - none selected");return}this.selected.Deselect();this.selected=null};this.ActivateItem=function(a,b){a.Activate();if(b){this.Deactivate()}};this.Cancel=function(){};this.SetTakeFocus=function(a){this.SetProperties("take-focus",a)};this.GetTakeFocus=function(){return this.SetProperties("take-focus")};this.Show=function(){for(var a=0;a<this.children.length;a++){var b=this.children[a];b.Show()}this.StkContainerShow()};this.CreateType("MenuShell")};STK.Menu=function(){STK.MenuShell.apply(this);for(var a in STK.Menu.ClassStyles){this.SetStyleProperty(a,STK.Menu.ClassStyles[a])}this.OnStylePropertyChanged=function(e,g,f,d){var c=this.GetElement("content");switch(g){case"background-color":c.SetStyle("backgroundColor",d);break;case"background-image":if(!SEK.UserAgent.IsExplorer6()){c.SetStyle("backgroundImage",d)}break;case"border-left":c.SetStyle("borderLeft",d);break;case"border-right":c.SetStyle("borderRight",d);break;case"border-bottom":c.SetStyle("borderBottom",d);break;case"border-top":c.SetStyle("borderTop",d);break;case"border-radius-topright":c.SetStyleCSS("-moz-border-radius-topright",d+"px");break;case"border-radius-topleft":c.SetStyleCSS("-moz-border-radius-topleft",d+"px");break;case"border-radius-bottomright":c.SetStyleCSS("-moz-border-radius-bottomright",d+"px");break;case"border-radius-bottomright":c.SetStyleCSS("-moz-border-radius-bottomleft",d+"px");break}};var b=new SEK.Element.Table();b.SetAttribute("cellSpacing","0");b.SetAttribute("cellPadding","0");b.SetStyle("position","absolute");b.SetStyle("top","0px");b.SetStyle("left","0px");b.SetStyle("backgroundColor",this.GetStyleProperty("background-color"));if(!SEK.UserAgent.IsExplorer6()){b.SetStyle("backgroundImage",this.GetStyleProperty("background-image"))}b.SetStyle("backgroundRepeat","no-repeat");b.SetStyle("backgroundPosition","bottom right");b.SetStyle("borderLeft",this.GetStyleProperty("border-left"));b.SetStyle("borderRight",this.GetStyleProperty("border-right"));b.SetStyle("borderBottom",this.GetStyleProperty("border-bottom"));b.SetStyle("borderTop",this.GetStyleProperty("border-top"));b.SetStyleCSS("-moz-border-radius-topright",this.GetStyleProperty("border-radius-topright")+"px");b.SetStyleCSS("-moz-border-radius-topleft",this.GetStyleProperty("border-radius-topleft")+"px");b.SetStyleCSS("-moz-border-radius-bottomright",this.GetStyleProperty("border-radius-bottomright")+"px");b.SetStyleCSS("-moz-border-radius-bottomleft",this.GetStyleProperty("border-radius-bottomleft")+"px");this.SetElement("content",b);this.__SetupRow=function(c){c.SetStyle("height",STK.MenuItem.ClassStyles.height+"px")};this.Append=function(e){this.StkMenuShellAppend(e);var d=this.GetElement("content");var c=d.InsertRow(-1);this.__SetupRow(c);e.Map(c)};this.Prepend=function(e){this.StkMenuShellPrepend(e);var d=this.GetElement("content");var c=d.InsertRow(0);this.__SetupRow(c);e.Map(c)};this.Insert=function(f,e){this.StkMenuShellInsert(f,e);var d=this.GetElement("content");var c=d.InsertRow(e);this.__SetupRow(c);f.Map(c)};this.Popup=function(g,c,f){var d=this.GetElement("content");d.SetStyle("left",g.x+"px");d.SetStyle("top",g.y+"px");this._mu_handler=SEK.Doc.Listen("mouseup",SEK.Delegate(this,"OnBodyMouseUp"));var e=this.Measure();this.Reallocate(e.w,e.h);var d=this.GetElement("content");d.SetStyle("left",g.x);d.SetStyle("top",g.y);this.Show()};this.OnBodyMouseUp=function(c){SEK.Doc.Body().Unlisten(this._mu_handler);this.Popdown()};this.Popdown=function(){for(var c=0;c<this.children.length;c++){var d=this.children[c].GetSubmenu();if(d){d.Popdown()}}this.Hide()};this.Show=function(){if(!this.IsMapped()){var c=SEK.Doc.Body();this.Map(c)}this.StkMenuShellShow()};this.Map=function(c){if(this.IsMapped()){return}var d=this.GetElement("content");c.Add(d);this.StkMenuShellMap()};this.Measure=function(){var e={w:1,h:1};for(var d=0;d<this.children.length;d++){var c=this.children[d].Measure();e.w=Math.max(e.w,c.w);e.h+=c.h}return e};this.Reallocate=function(c,e){var f=this.GetElement("frame");for(var d=0;d<this.children.length;d++){}};this.OnChildSizeChanged=function(c){var d=this.Measure();this.Reallocate(d.w,d.h)};this.GetSubmenuPosition=function(d,l){var g=this.GetChildren();var j=0;for(var m in g){if(g.hasOwnProperty(m)){var f=g[m];var h=f.GetSubmenu();if(h&&h.Name()==d.Name()){break}j++}}var k=this.GetPosition();var e=this.Measure();var i=e.w;if(i===undefined){i=50}var n=k.y+j*STK.MenuItem.ClassStyles.height;var c=k.x+i;return{x:c,y:n}};this.GetPosition=function(){var c=this.GetElement("content");return{x:parseInt(c.GetStyle("left")),y:parseInt(c.GetStyle("top"))}};this.CreateType("Menu")};STK.Menu.ClassStyles={"background-color":"#E0E0F0","background-image":"url("+STK.Path.FindImage("/data/images/menu/background")+")","border-right":"1px solid #666","border-left":"1px solid #666","border-bottom":"1px solid #666","border-top":"1px solid #666","border-radius-bottomleft":3,"border-radius-bottomright":3,"border-radius-topleft":3,"border-radius-topright":3};STK.MenuItem=function(g,c,d,h){STK.Item.apply(this);this.ICON_WIDTH=20;this.Register("activate");this.Register("activate-item");this.RegisterProperty("owner-menu",null);this.RegisterProperty("submenu",null,SEK.Delegate(this,"OnSubmenuChanged"));this.OnSubmenuChanged=function(n,q,o,m){var p=this.GetElement("expander");if(m){p.SetAttribute("src",this.GetStyleProperty("expander-img"))}else{p.SetAttribute("src",this.GetStyleProperty("expander-img-blank"))}};this.RegisterProperty("auto-popout-time",100,SEK.Delegate(this,"OnAutoPopoutChanged"));this.OnAutoPopoutChanged=function(n,p,o,m){};for(var j in STK.MenuItem.ClassStyles){var b=STK.MenuItem.ClassStyles[j];this.SetStyleProperty(j,b)}this.OnStylePropertyChanged=function(p,r,q,o){var n=this.GetElement("style");var m=this.GetSubWidget("label");switch(r){case"style-width":n.SetStyle("width",o+"px");break;case"font-size":m.SetStyleProperty("font-size",o);break;case"label-color":m.SetStyleProperty("color",o);break}};this.selected=false;var a=new SEK.Element.Div();a.SetStyle("width","3px");var f=new STK.Image();var i=new STK.Label();i.SetProperty("xalign",0);i.SetStyleProperty("font-size",this.GetStyleProperty("font-size"));var e=new SEK.Element.Span();var l=new SEK.Element.Image();l.SetAttribute("width",7);l.SetAttribute("height",7);l.SetAttribute("src",this.GetStyleProperty("expander-img-blank"));this.SetElement("style",a);this.SetSubWidget("image",f);this.SetSubWidget("label",i);this.SetElement("accel",e);this.SetElement("expander",l);this.Getimage=function(m){return this.GetSubWidget("image")};this.SetImage=function(o){var m=this.GetSubWidget("image");this.SetSubWidget("image",o);m.Unmap();var n=this.GetElement("image-area");if(n){o.Map(n);o.Show()}};this.ImageSetFromStock=function(m){var n=this.GetSubWidget("image");n.SetFromStock(m,STK.IconSize.MENU)};this.ImageSetFromLocation=function(m){var n=this.GetSubWidget("image");n.SetFromLocation(m,16,16)};this.SetSubmenu=function(m){this.SetProperty("submenu",m)};this.RemoveSubmenu=function(){this.SetProperty("submenu",null)};this.GetSubmenu=function(){return this.GetProperty("submenu")};this.Activate=function(){this.Emit("activate");var m=this.GetProperty("owner-menu");if(this.GetSubmenu()){var n=m.GetSubmenuPosition(this.GetSubmenu());this.GetSubmenu().Popup(n,0,0)}else{while(m&&m.parent_menu_shell){m=m.parent_menu_shell}if(m){m.Emit("selection-done");m.Popdown()}else{SEK.Log.Error("In MenuItem::Activate - no toplevel owner")}}};this.Select=function(){this.selected=true;this.StkItemSelect()};this.Deselect=function(){this.selected=false;this.StkItemDeselect();var m=this.GetProperty("submenu");if(m){m.Deactivate()}};this.OnRowMouseDown=function(){this.Activate()};this.OnRowMouseUp=function(m){m.StopPropagation()};this.Map=function(p){p.Listen("mousedown",SEK.Delegate(this,"OnRowMouseDown"));p.Listen("mouseup",SEK.Delegate(this,"OnRowMouseUp"));var o=p.InsertCell(0);var q=p.InsertCell(1);var n=p.InsertCell(2);var m=p.InsertCell(3);var r=p.InsertCell(4);o.SetStyle("height",STK.MenuItem.ClassStyles.height+"px");o.SetStyle("width",this.GetStyleProperty("style-width"));o.SetStyle("backgroundColor",this.GetStyleProperty("style-background-color"));o.SetStyle("backgroundPosition","top right");o.SetStyle("backgroundRepeat","repeat-y");if(!SEK.UserAgent.IsExplorer6()){o.SetStyle("backgroundImage",this.GetStyleProperty("style-background-image"))}q.SetStyle("paddingLeft","4px");q.SetStyle("paddingRight","4px");r.SetStyle("width","11px");this.SetElement("style-area",o);this.SetElement("image-area",q);this.SetElement("label-area",n);this.SetElement("accel-area",m);this.SetElement("expander-area",r);o.Add(this.GetElement("style"));this.GetSubWidget("image").Map(q);this.GetSubWidget("label").Map(n);m.Add(this.GetElement("accel"));r.Add(this.GetElement("expander"));p.Listen("mouseover",SEK.Delegate(this,"OnMouseOver"));p.Listen("mouseout",SEK.Delegate(this,"OnMouseOut"));p.SetStyle("backgroundColor",this.GetStyleProperty("background-color"));p.SetStyle("backgroundRepeat",this.GetStyleProperty("background-repeat"));p.SetStyle("backgroundPosition",this.GetStyleProperty("background-position"));if(!SEK.UserAgent.IsExplorer6()){p.SetStyle("backgroundImage",this.GetStyleProperty("background-image"))}this.StkItemMap()};this.Measure=function(){var n=STK.MenuItem.ClassStyles.height;var o={w:4+n+11,h:n};var m=this.GetSubWidget("label").Measure();o.w+=m.w;return o};this.Reallocate=function(m,n){};this.OnMouseOver=function(o){var m=this.GetElement("style-area");m.SetStyle("backgroundColor",this.GetStyleProperty("style-background-color-hover"));if(!SEK.UserAgent.IsOpera()){var n=m.GetParent();n.SetStyle("backgroundColor",this.GetStyleProperty("background-color-hover"));if(!SEK.UserAgent.IsExplorer6()){n.SetStyle("backgroundImage",this.GetStyleProperty("background-image-hover"))}}};this.OnMouseOut=function(q){if(SEK.UserAgent.IsExplorer()){var s=this.GetElement("style-area").GetParent();var t=s.GetPosition();var p=s.GetSize();var m=(SEK.UserAgent.Version()>=8)?0:2;if(q.x()>(t.x+m)&&q.x()<(t.x+p.w-m)&&q.y()>(t.y+m)&&q.y()<(t.y+p.h-m)){return}}var n=this.GetElement("style-area");n.SetStyle("backgroundColor",this.GetStyleProperty("style-background-color"));if(!SEK.UserAgent.IsOpera()){var o=n.GetParent();o.SetStyle("backgroundColor",this.GetStyleProperty("background-color"));if(!SEK.UserAgent.IsExplorer6()){o.SetStyle("backgroundImage",this.GetStyleProperty("background-image"))}}};if(g){var k=STK.StockItemsStack.Lookup(g,STK.IconSize.MENU);if(k){this.GetSubWidget("label").SetText(k.label);this.GetSubWidget("image").SetFromIconSet(k.icon)}else{this.GetSubWidget("label").SetText(g)}}this.CreateType("MenuItem")};STK.MenuItem.ClassStyles={height:24,"background-color":"transparent","background-image":"","background-position":"top left","background-repeat":"repeat-x","background-color-hover":"#e5e5f4","background-image-hover":"url("+STK.Path.FindImage("/data/images/menu/shine")+")","style-background-color":"#4088db","style-background-color-hover":"#dba540","style-background-image":"url("+STK.Path.FindImage("/data/images/menu/border_merge")+")","style-width":"4px","font-size":"11pt","label-color":"#000000","expander-img-blank":STK.Path.FindImage("/data/images/menu/menuitem_expander_blank"),"expander-img":STK.Path.FindImage("/data/images/menu/menuitem_expander")};STK.SimpleComboBox=function(){STK.Widget.apply(this);this.Register("changed");this._items=Array();this._active=undefined;this.Setup=function(){var a=new SEK.Element.Select();a.Listen("change",SEK.Delegate(this,"OnSelectChanged"));a.Listen("mousedown",SEK.Delegate(this,"OnSelectMouseDown"));this.SetElement("frame",a);if(SEK.UserAgent.IsExplorer6()){STK.Requeue(SEK.Delegate(this,"ThemeUpdate"))}else{this.ThemeUpdate()}};this.OnSelectMouseDown=function(a){a.StopPropagation()};this.OnSelectChanged=function(c){var b=this.GetElement("frame").dom_elmt;for(var a=b.length-1;a>=0;a--){if(b.options[a].selected){this._active=Number(a);this.Emit("changed")}}};this.Measure=function(){return this.GetElement("frame").GetSize()};this.Reallocate=function(a,b){};this.Map=function(a){var b=this.GetElement("frame");a.Add(b);this.StkWidgetMap()};this.OnSensitiveChanged=function(c,e,d,b){var a=this.GetElement("frame");a.SetSensitive(this.GetSensitive())};this.ThemeUpdate=function(){var a=this.GetElement("frame");for(var c=a.GetLength()-1;c>=0;c--){a.Remove(c)}for(var c in this._items){var b=new SEK.Element.Option();b.SetText(this._items[c][0]);b.SetValue(this._items[c][1]);a.Append(b)}a.SetSelected(this._active)};this.ReplaceAll=function(a){this._items=a;this._active=this._items.length-1;this.ThemeUpdate()};this.Append=function(b,a){if(a===undefined){a=b}this._items.push([b,a]);this._active=this._items.length-1;this.ThemeUpdate()};this.Prepend=function(b,a){if(a===undefined){a=b}this._items.unshift([b,a]);this._active=0;this.ThemeUpdate()};this.Insert=function(c,b,a){c=Number(c);if(c>this._items.length){return this.Append(b,a)}else{if(c<=0){return this.Prepend(b,a)}}if(a===undefined){a=b}this._items=Array().concat(this._items.slice(0,c),[[b,a]],this._items.slice(c));this._active=c;this.ThemeUpdate()};this.Remove=function(b){for(var a in this._items){if(this._items[a][0]==b){return this.RemoveOffset(a)}}return false};this.RemoveOffset=function(a){a=Number(a);if(a<=0){this._items.shift()}else{if(a>=this._items.length){this._items.pop()}else{this._items=this._items.slice(0,a).concat(this._items.slice(a+1))}}if(this._items.length>0){this._active=Math.min(a,this._items.length-1)}else{this._active=undefined}this.ThemeUpdate();return true};this.RemoveKey=function(b){for(var a in this._items){if(this._items[a][1]==b){return this.RemoveOffset(a)}}return false};this.RemoveAll=function(){this._items=Array();this.ThemeUpdate()};this.GetActiveText=function(){if(this._active===undefined||this._active<0||this._active>=this._items.length){return undefined}return this._items[this._active][0]};this.SetActiveText=function(b){for(var a in this._items){if(b==this._items[a][0]){this._active=Number(a);this.ThemeUpdate();return true}}return false};this.GetActiveKey=function(){if(this._active===undefined||this._active<0||this._active>=this._items.length){return undefined}return this._items[this._active][1]};this.SetActiveKey=function(b){for(var a in this._items){if(b==this._items[a][1]){this._active=Number(a);this.ThemeUpdate();return true}}return false};this.GetActiveIndex=function(){return this._active};this.SetActiveIndex=function(a){this._active=Number(a);this.ThemeUpdate()};this.CreateType("SimpleComboBox");this.Setup()};STK.EventBox=function(b){STK.Bin.apply(this);var a=new SEK.Element.Div();this.SetElement("frame",a);this.Map=function(c){if(this.IsMapped()){return}var d=this.GetElement("frame");var e=this.GetChild();e.Map(d);c.Add(d);this.StkBinMap()};this.Measure=function(){return this.GetChild().Measure()};this.Reallocate=function(c,d){return this.GetChild().Reallocate(c,d)};this.CreateType("EventBox");if(b){this.Add(b)}};STK.Form=function(b,c){STK.Bin.apply(this);var a=new SEK.Element.Form();a.Listen("submit",SEK.Payload(SEK.Delegate(this,"Emit"),"submit"));a.Listen("reset",SEK.Payload(SEK.Delegate(this,"Emit"),"reset"));a.SetStyle("margin","0px");a.SetStyle("padding","0px");a.SetAttribute("action",b);a.SetAttribute("method","POST");a.SetAttribute("enctype","application/x-www-form-urlencoded");a.SetAttribute("encoding","application/x-www-form-urlencoded");a.SetAttribute("accept-charset","utf-8");a.SetAttribute("target","");this.SetElement("frame",a);this.RegisterProperty("action",b,SEK.Delegate(this,"OnActionChanged"));this.OnActionChanged=function(e,g,f,d){this.GetElement("frame").SetAttribute("action",d)};this.RegisterProperty("method","POST",SEK.Delegate(this,"OnMethodChanged"));this.OnMethodChanged=function(e,g,f,d){this.GetElement("frame").SetAttribute("method",d)};this.RegisterProperty("enctype","application/x-www-form-urlencoded",SEK.Delegate(this,"OnEncTypeChanged"));this.OnEncTypeChanged=function(e,g,f,d){this.GetElement("frame").SetAttribute("enctype",d);this.GetElement("frame").SetAttribute("encoding",d)};this.RegisterProperty("accept",null,SEK.Delegate(this,"OnAcceptChanged"));this.OnAcceptChanged=function(e,g,f,d){this.GetElement("frame").SetAttribute("accept",d)};this.RegisterProperty("name",null,SEK.Delegate(this,"OnNameChanged"));this.OnNameChanged=function(e,g,f,d){this.GetElement("frame").SetAttribute("name",d)};this.RegisterProperty("accept-charset","utf-8",SEK.Delegate(this,"OnAcceptCharsetChanged"));this.OnAcceptCharsetChanged=function(e,g,f,d){this.GetElement("frame").SetAttribute(g,d)};this.RegisterProperty("target","",SEK.Delegate(this,"OnTargetChanged"));this.OnTargetChanged=function(e,g,f,d){this.GetElement("frame").SetAttribute(g,d)};this.Register("submit");this.Register("reset");this.Measure=function(){return this.GetChild().Measure()};this.Reallocate=function(d,e){this.GetChild().Reallocate(d,e)};this.Map=function(d){if(this.IsMapped()){return}var e=this.GetChild();if(e){e.Map(this.GetElement("frame"))}d.Add(this.GetElement("frame"));this.StkBinMap(d)};this.Submit=function(){this.GetElement("frame").Submit()};this.Reset=function(){this.GetElement("frame").Reset()};if(c){this.Add(c)}this.CreateType("Form")};STK.Frame=function(a){STK.Bin.apply(this);this.SetSubWidget("label-widget",null);var e=new SEK.Element.Div();var c=new SEK.Element.Div();var d=new SEK.Element.Div();e.Add(c);e.Add(d);this.SetElement("frame",e);this.SetElement("label-cell",c);this.SetElement("child-cell",d);d.SetStyle("border","1px solid #AAAAAA");if(SEK.UserAgent.IsGecko()){d.SetStyleRaw("-moz-border-radius-topright","6px");d.SetStyleRaw("-moz-border-radius-bottomright","6px");d.SetStyleRaw("-moz-border-radius-bottomleft","6px")}d.SetStyle("backgroundColor","#bebebe");d.SetStyle("border","1px solid #000000");d.SetStyle("backgroundImage","url("+STK.Path.FindImage("/data/images/frame/bg")+")");d.SetStyle("backgroundRepeat","repeat-x");this.RegisterProperty("label","",SEK.Delegate(this,"OnLabelChanged"));this.OnLabelChanged=function(g,i,h,f){this.SetProperty("label-widget",new STK.Label(f,true))};this.RegisterProperty("label-widget",null,SEK.Delegate(this,"OnLabelWidgetChanged"));this.OnLabelWidgetChanged=function(g,i,h,f){if(h){h.Unmap()}this.SetSubWidget("label-widget",f);f.Map(this.GetElement("label-cell"));this.TouchProperty("label-xalign");this.TouchProperty("label-yalign");this.Emit("size-request")};this.RegisterProperty("label-xalign",0,SEK.Delegate(this,"OnLabelXAlignChanged"));this.OnLabelXAlignChanged=function(h,j,i,f){var g=this.GetSubWidget("label-widget");if(!g){return}if(g.HasProperty("xalign")){g.SetProperty("xalign",this.GetProperty("label-xalign"))}};this.RegisterProperty("label-yalign",0,SEK.Delegate(this,"OnLabelYAlignChanged"));this.OnLabelYAlignChanged=function(h,j,i,f){var g=this.GetSubWidget("label-widget");if(!g){return}if(g.HasProperty("yalign")){g.SetProperty("yalign",this.GetProperty("label-yalign"))}};for(var b in STK.Frame.ClassStyles){this.SetStyleProperty(b,STK.Frame.ClassStyles[b])}this.OnStylePropertyChanged=function(g,i,h,f){if(i=="background-color"){this.GetElement("child-cell").SetStyle("backgroundColor",f)}};this.SetLabel=function(f){this.SetProperty("label",f)};this.GetLabel=function(f){return this.GetProperty("label")};this.SetLabelWidget=function(f){this.SetProperty("label-widget",f)};this.GetLabelWidget=function(){return this.GetProperty("label-widget")};this.Add=function(g){this.StkBinAdd(g);var f=g.Connect("size-request",SEK.Payload(SEK.Delegate(this,"Emit"),"size-request"));this.SetData("__child_sr_sig__",f);if(this.IsMapped()){g.Map(this.GetElement("child-cell"))}this.Emit("size-request")};this.Remove=function(g){var f=this.GetData("__child_sr_sig__");this.RemoveData("__child_sr_sig__");g.Disconnect(f);this.StkBinRemove(g);g.Unmap();this.Emit("size-request")};this.Map=function(g){if(this.IsMapped()){return}var f=this.GetElement("child-cell");if(this.GetChild()){this.GetChild().Map(f)}var h=this.GetElement("frame");g.Add(h);this.StkBinMap(g)};this.Measure=function(){var h={w:0,h:0};var g=this.GetSubWidget("label-widget");var i=this.GetChild();this.SetData("__label_height__",0);if(g){var f=g.Measure();h.w=Math.max(h.w,f.w);h.h+=f.h;this.SetData("__label_height__",f.h)}if(i){var f=i.Measure();h.w=Math.max(h.w,f.w);h.h+=f.h}h.w+=2;h.h+=2;return h};this.Reallocate=function(f,g){var j=this.GetSubWidget("label-widget");var l=this.GetChild();var i=this.GetData("__label_height__");if(j){j.Reallocate(f-2,i)}g-=i;if(l){l.Reallocate(f-2,g-2)}var k=this.GetElement("child-cell")};this.CreateType("Frame");if(a){if(typeof a=="string"){this.SetProperty("label",a)}else{this.SetProperty("label-widget",a)}}};STK.Frame.ClassStyles={"background-color":"#bebebe","border-color":"#000000","background-image":"url("+STK.Path.FindImage("/data/images/frame/bg")+")"};STK.FrameShadow={NONE:0,IN:1,OUT:2,ETCHED_IN:3,ETCHED_OUT:4};STK.Separator=function(){STK.Widget.apply(this);this.CreateType("Separator")};STK.VSeparator=function(){STK.Separator.apply(this);var a=new SEK.Element.Div();a.SetStyle("width","1px");a.SetStyle("maxWidth","1px");a.SetStyle("minWidth","1px");a.SetStyle("fontSize","1pt");a.SetStyle("marginTop","1px");a.SetStyle("borderTop","1px solid #C0C0C0");a.SetStyle("backgroundColor","#AAAAAA");a.SetStyle("borderBottom","1px solid #909090");a.SetStyle("marginBottom","1px");this.SetElement("frame",a);this.Map=function(b){if(this.IsMapped()){return}b.Add(this.GetElement("frame"));this.StkSeparatorMap(b)};this.Measure=function(){return{w:5,h:1}};this.Reallocate=function(b,c){var d=this.GetElement("frame");d.SetStyle("height",String(c)+"px")};this.CreateType("VSeparator")};STK.PannedWindow=function(){STK.Bin.apply(this);var j=new SEK.Element.Table();j.SetStyle("position","relative");var i=j.InsertRow(0);var k=j.InsertRow(1);var q=j.InsertRow(2);var d=i.InsertCell(0);var g=i.InsertCell(1);var a=i.InsertCell(2);var e=k.InsertCell(0);var u=k.InsertCell(1);var o=k.InsertCell(2);var c=q.InsertCell(0);var h=q.InsertCell(1);var r=q.InsertCell(2);this.SetElement("frame",j);this.SetElement("cell-child",u);this.SetElement("cell-left",e);this.SetElement("cell-right",o);this.SetElement("cell-up",g);this.SetElement("cell-down",h);var f=new SEK.Element.Div();f.SetStyle("position","relative");f.SetStyle("overflow","hidden");f.SetStyle("left","0px");f.SetStyle("top","0px");u.Add(f);this.SetElement("inner-frame",f);var n=new SEK.Element.Div();n.SetStyle("position","relative");n.SetStyle("left","0px");n.SetStyle("top","0px");f.Add(n);this.SetElement("child-frame",n);var p=new STK.Image(STK.Path.FindImage("/data/images/scrolling/panned-window-left"),4,12);var l=new STK.Button("",p);l.Connect("pressed",SEK.Callback(SEK.Delegate(this,"OnHButtonPressed"),-1));l.Connect("released",SEK.Delegate(this,"OnButtonReleased"));l.Connect("leave",SEK.Delegate(this,"OnButtonReleased"));l.SetStyleProperty("inner-border-left",1);l.SetStyleProperty("inner-border-right",1);l.SetStyleProperty("inner-border-top",0);l.SetStyleProperty("inner-border-bottom",0);l.SetStyleProperty("border-radius-topright",0);l.SetStyleProperty("border-radius-bottomright",0);var p=new STK.Image(STK.Path.FindImage("/data/images/scrolling/panned-window-right"),4,12);var s=new STK.Button("",p);s.Connect("pressed",SEK.Callback(SEK.Delegate(this,"OnHButtonPressed"),1));s.Connect("released",SEK.Delegate(this,"OnButtonReleased"));s.Connect("leave",SEK.Delegate(this,"OnButtonReleased"));s.SetStyleProperty("inner-border-left",1);s.SetStyleProperty("inner-border-right",1);s.SetStyleProperty("inner-border-top",0);s.SetStyleProperty("inner-border-bottom",0);s.SetStyleProperty("border-radius-topleft",0);s.SetStyleProperty("border-radius-bottomleft",0);l.Map(e);s.Map(o);this.SetSubWidget("button-left",l);this.SetSubWidget("button-right",s);this.OnHButtonPressed=function(m,b){var y=this.GetHAdjustment();var t=y.GetProperty("step-increment");var x=y.GetValue()+(b*t);if(x<0){x=0}if(x>y.GetProperty("upper")-y.GetProperty("page-size")){x=y.GetProperty("upper")-y.GetProperty("page-size")}y.SetValue(x);y.ValueChanged();var w=y.GetProperty("page-size")/4;var v=new STK.PannedWindow.HoldMove(SEK.Callback(SEK.Delegate(this,"_OnHoldUpdate"),"h",1),y.GetValue(),b,w);v.Start();this.SetData("__animator__",v)};this._OnHoldUpdate=function(v,m,b){if(!v){return}var t=this.GetHAdjustment();if(v<0){v=0}if(v>t.GetProperty("upper")-t.GetProperty("page-size")){v=t.GetProperty("upper")-t.GetProperty("page-size")}t.SetValue(v);t.ValueChanged()};this.OnButtonReleased=function(b){var m=this.GetData("__animator__");this.SetData("__animator__",null);if(m){m.Stop()}};this.RegisterProperty("h-adjustment",null,SEK.Delegate(this,"OnHAdjustmentChanged"));this.OnHAdjustmentChanged=function(t,w,v,b){if(v){var m=this.GetData("__hadjust_sig_id__");v.Disconnect(m)}var m=b.Connect("value-changed",SEK.Delegate(this,"OnHAdjustValueChanged"));this.SetData("__hadjust_sig_id__",m);this.Emit("size-request")};this.OnHAdjustValueChanged=function(m){var b=this.GetElement("child-frame");b.SetStyle("left",-(m.GetValue())+"px")};this.SetHAdjustment=function(b){this.SetProperty("h-adjustment",b)};this.GetHAdjustment=function(){return this.GetProperty("h-adjustment")};this.Add=function(b){b.Connect("size-request",SEK.Delegate(this,"OnChildSizeRequest"));this.StkBinAdd(b)};this.OnChildSizeRequest=function(){this.Emit("size-request")};this.Map=function(m){var t=this.GetElement("frame");var b=this.GetElement("child-frame");m.Add(t);var v=this.GetChild();if(v){v.Map(b)}this.StkBinMap();m.SetStyle("position","relative");m.SetStyle("left","0px");m.SetStyle("top","0px")};this.Unmap=function(){var b=this.GetElement("frame");b.Remove();this.StkBinUnmap()};this.Show=function(){this.StkBinShow();this.Emit("size-request")};this.Measure=function(){var y,t;if(!this.GetData("__left_size__")){y=this.GetSubWidget("button-left").Measure();t=this.GetSubWidget("button-right").Measure();this.SetData("__left_size__",y);this.SetData("__right_size__",t)}else{y=this.GetData("__left_size__");t=this.GetData("__right_size__")}var x=this.GetChild().Measure();this.SetData("__child_size__",x);var m=y.w+x.w+t.w;var v=x.h;var b=this.GetSizeRequest();if(b.w>0){m=b.w}if(b.h>0){v=b.h}return{w:m,h:v}};this.Reallocate=function(b,x){var v=this.GetData("__child_size__");this.GetChild().Reallocate(v.w,v.h);this.GetProperty("h-adjustment").SetProperty("upper",v.w);var z=0;if(b>=v.w){this.GetSubWidget("button-left").Hide();this.GetSubWidget("button-right").Hide()}else{this.GetSubWidget("button-left").Show();this.GetSubWidget("button-right").Show();var y=this.GetData("__left_size__");var m=this.GetData("__right_size__");z=y.w+m.w;this.GetSubWidget("button-left").Reallocate(y.w,x);this.GetSubWidget("button-right").Reallocate(m.w,x);this.GetElement("cell-left").SetStyle("width",y.w+"px");this.GetElement("cell-right").SetStyle("width",m.w+"px")}var t=this.GetElement("child-frame");t.SetStyle("width",(b-(z))+"px");t.SetStyle("height",x+"px");this.GetProperty("h-adjustment").SetProperty("page-size",b-z);var A=this.GetElement("frame");A.SetStyle("width",b+"px");A.SetStyle("height",x+"px");this.GetProperty("h-adjustment").SetProperty("page-increment",b)};this.SetProperty("h-adjustment",new STK.Adjustment(0,0,20,5,20,20))};STK.PannedWindow.HoldMove=function(d,b,c,a){SEK.Animator.Base.apply(this,[d,0]);this.RegisterProperty("base",b);this.RegisterProperty("direction",c);this.RegisterProperty("speed",a);this.Update=function(){var h=this.GetProperty("base");var e=this.GetProperty("direction");var g=this.GetProperty("speed");var f=SEK.Timer.GetTime()-this.GetProperty("start-time");if(f<0.5){return}f-=0.5;var i=h+(e*g*f);this.SetProperty("value",Math.round(i))};this.SetProperty("value",0)};STK.SimpleScrolledWindow=function(b){STK.Bin.apply(this);var a=new SEK.Element.Div();a.SetStyle("overflow","scroll");this.SetElement("frame",a);this.Map=function(c){if(this.IsMapped()){return}var d=this.GetElement("frame");var e=this.GetChild();if(e){e.Map(d)}c.Add(d);this.StkBinMap(d)};this.Measure=function(){return this.GetSizeRequest()};this.Reallocate=function(c,d){var e=this.GetElement("frame");e.SetStyle("width",c+"px");e.SetStyle("height",d+"px")};this.CreateType("SimpleScrolledWindow");if(b){this.Add(b)}};STK.SimpleTextEdit=function(){STK.Widget.apply(this);this.SetData("text","");this.SetData("rows",25);this.SetData("columns",80);this.Register("changed");this.SetText=function(a){this.SetData("text",a);this.Emit("changed")};this.GetText=function(){return this.GetData("text")};this.SetRows=function(a){this.SetData("rows",a)};this.GetRows=function(){return this.GetData("rows")};this.SetColumns=function(a){this.SetData("columns",a)};this.GetColumns=function(){return this.GetData("columns")};this.CreateType("SimpleTextEdit")};STK.EmbeddedWindow=function(b,a){STK.Bin.apply(this);this.RegisterProperty("target",null,SEK.Delegate(this,"OnTargetChanged"));this.OnTargetChanged=function(d,h,f,c){var g=this.GetChild();if(!g){return}if(this.IsMapped()){g.Unmap();g.Map(new SEK.Element.Wrapper(c));var e=g.Measure();g.Reallocate(e.w,e.h);g.Show()}};this.Add=function(e){this.StkBinAdd(e);this.SetSubWidget("child",e);var c=e.Connect("size-request",SEK.Delegate(this,"OnChildSizeRequest"));this.SetData("__child_size_request__",c);if(this.IsMapped()){if(!this.GetProperty("target")){return}e.Map(new SEK.Element.Wrapper(this.GetProperty("target")));var d=e.Measure();e.Reallocate(d.w,d.h);e.Show()}};this.Remove=function(d){var d=this.GetChild();if(!d){return}this.SetSubWidget("child",null);var c=this.GetData("__child_size_request__");if(c){d.Disconnect(c)}if(d){d.Unmap();this.StkBinRemove(d)}};this.OnChildSizeRequest=function(c){var e=this.GetChild();var d=e.Measure();e.Reallocate(d.w,d.h)};this.SetTarget=function(c){this.SetProperty("target",c)};this.SetTargetId=function(c){var d=SEK.doc.getElementById(c);this.SetProperty("target",d)};this.Map=function(c){if(!this.GetChild()){return}if(this.GetChild().IsMapped()){return}var f=this.GetChild();var e=new SEK.Element.Wrapper(this.GetProperty("target"));f.Map(e);var d=f.Measure();f.Reallocate(d.w,d.h)};this.Show=function(){this.StkBinShow();var d=this.GetChild();if(!d){return}var c=d.Measure();d.Reallocate(c.w,c.h)};this.CreateType("EmbeddedWindow");if(b){if(typeof b=="string"){this.SetTargetId(b)}else{this.SetTarget(b)}}if(a){this.Add(a)}};STK.WindowPosition={NONE:0,CENTER:1,MOUSE:2,CENTER_ALWAYS:3,CENTER_ON_PARENT:4};STK.Direction={NORTH:"north",NORTH_EAST:"north-east",EAST:"east",SOUTH_EAST:"south-east",SOUTH:"south",SOUTH_WEST:"south-west",WEST:"west",NORTH_WEST:"north-west"};STK.Window=function(e,d,c){STK.Bin.apply(this);this.MIN_WIDTH=50;this.MIN_HEIGHT=16;this.RegisterProperty("deletable",STK.Window.class_styles.deletable,SEK.Delegate(this,"OnDeletableChanged"));this.OnDeletableChanged=function(g,i,h,f){this.win_titlebar.SetDeletable(f)};this.RegisterProperty("modal",false);this.OnModalChanged=function(g,i,h,f){};this.RegisterProperty("parent",null,SEK.Delegate(this,"OnParentChanged"));this.OnParentChanged=function(g,i,h,f){};this.RegisterProperty("destroy-with-parent",false,SEK.Delegate(this,"OnDestroyWithParentChanged"));this.OnDestroyWithParentChanged=function(g,i,h,f){};this.RegisterProperty("title","Window",SEK.Delegate(this,"OnTitleChanged"));this.OnTitleChanged=function(g,i,h,f){this.win_titlebar.SetProperty("title",f)};this.Register("delete-event");for(var b in STK.Window.class_styles){this.SetStyleProperty(b,STK.Window.class_styles[b])}this.win_shadow=new STK.Window.Shadow();this.win_resize=new STK.Window.Resize();this.win_titlebar=new STK.Window.Titlebar();this.win_shadow.shadow_content.Add(this.win_resize.resize_frame);this.win_resize.resize_content.Add(this.win_titlebar.title_frame);var a=new SEK.Element.Div();a.SetStyle("overflow","hidden");this.win_titlebar.title_content.Add(a);this.SetElement("content",a);this.SetElement("frame",this.win_shadow.shadow_frame);if(SEK.UserAgent.IsExplorer6()){this.SetElement("frame-hide",this.win_shadow.shadow_hidewindow)}this.win_titlebar.Connect("drag-begin",SEK.Delegate(this,"OnDragBegin"));this.win_resize.Connect("resize-begin",SEK.Delegate(this,"OnResizeBegin"));this.OnDragBegin=function(f,i){var h=SEK.Doc.Listen("mousemove",SEK.Delegate(this,"OnDragMove"));var g=SEK.Doc.Listen("mouseup",SEK.Delegate(this,"OnDragEnd"));this.SetData("__mm_listener__",h);this.SetData("__mu_listener__",g);this.SetData("__drag_origin__",{x:parseInt(this.win_shadow.shadow_frame.GetStyle("left")),y:parseInt(this.win_shadow.shadow_frame.GetStyle("top"))});this.SetData("__drag_init__",i)};this.OnDragMove=function(h){var g=h.Location();var f=this.GetData("__drag_origin__");var i=this.GetData("__drag_init__");var k={x:g.x-i.x,y:g.y-i.y};var j={x:f.x+k.x,y:f.y+k.y};this.Move(j.x,j.y)};this.OnDragEnd=function(g){var h=this.GetData("__mm_listener__");var f=this.GetData("__mu_listener__");SEK.Doc.Body().Unlisten(h);SEK.Doc.Body().Unlisten(f)};this.OnResizeBegin=function(j,l){var i=SEK.Doc.Listen("mousemove",SEK.Delegate(this,"OnResizeMove"));var n=SEK.Doc.Listen("mouseup",SEK.Delegate(this,"OnResizeEnd"));this.SetData("__mm_listener__",i);this.SetData("__mu_listener__",n);var g=new SEK.Element.Div();var k=this.win_shadow.shadow_content.GetSize();g.SetStyle("backgroundColor","#76b7ff");g.SetStyle("border","3px solid #0061CF");g.SetStyle("position","absolute");g.SetStyle("left",this.win_shadow.shadow_frame.GetStyle("left"));g.SetStyle("top",this.win_shadow.shadow_frame.GetStyle("top"));g.SetStyle("width",(k.w-6)+"px");g.SetStyle("height",(k.h-6)+"px");g.SetOpacity(0.5);SEK.Doc.Body().Add(g);this.SetData("__resize_start_left__",parseInt(this.win_shadow.shadow_frame.GetStyle("left")));this.SetData("__resize_start_top__",parseInt(this.win_shadow.shadow_frame.GetStyle("top")));var h=this.win_shadow.shadow_content.GetSize();this.SetData("__resize_start_width__",h.w);this.SetData("__resize_start_height__",h.h);var m=this.Measure();var f=this.win_titlebar.GetExtraSize();var o=this.win_titlebar.GetMinSize();m.w+=f.w;m.h+=f.h;m.w=Math.max(m.w,o.w);m.h=Math.max(m.h,o.h);this.SetData("__resize_minimum__",m);this.SetData("__resize_direction__",l);this.SetData("__resize_overlay__",g)};this.OnResizeMove=function(n){var j=this.GetData("__resize_overlay__");var p=this.GetData("__resize_direction__");var q=this.GetData("__resize_minimum__");if(p.indexOf("east")!=-1){var r=n.Location().x-parseInt(j.GetStyle("left"));r=Math.max(q.w,r);j.SetStyle("width",(r-6)+"px")}else{if(p.indexOf("west")!=-1){var k=this.GetData("__resize_start_width__")-6;var u=this.GetData("__resize_start_left__");var t=u-n.Location().x;var g=n.Location().x;var o=k+t;if(o<q.w){g+=(o-q.w);o=q.w}j.SetStyle("width",o+"px");j.SetStyle("left",g+"px")}}if(p.indexOf("south")!=-1){var l=n.Location().y-parseInt(j.GetStyle("top"));l=Math.max(q.h,l);j.SetStyle("height",(l-0)+"px")}else{if(p.indexOf("north")!=-1){var f=this.GetData("__resize_start_height__")-6;var m=this.GetData("__resize_start_top__");var t=m-n.Location().y;var s=n.Location().y;var i=f+t;if(i<q.h){s+=(i-q.h);i=q.h}j.SetStyle("height",i+"px");j.SetStyle("top",s+"px")}}if(SEK.UserAgent.IsExplorer()){SEK.Doc.dom_elmt.selection.empty()}};this.OnResizeEnd=function(l){var i=this.GetData("__resize_overlay__");var k=i.GetSize();var h=parseInt(i.GetStyle("left"));var g=parseInt(i.GetStyle("top"));this.SetData("__resize_overlay__",null);i.Remove();delete i;var m=this.GetData("__mm_listener__");var j=this.GetData("__mu_listener__");SEK.Doc.Body().Unlisten(m);SEK.Doc.Body().Unlisten(j);var f=this.win_titlebar.GetExtraSize();k.w-=f.w;k.h-=f.h;k.w-=6;k.h-=6;this.Reallocate(k.w,k.h);this.Move(h,g);this.Resize(k.w,k.h)};this.SetDeletable=function(f){this.SetProperty("deletable",f)};this.GetDeletable=function(){return this.GetProperty("deletable")};this.SetDestroyWithParent=function(f){this.SetProperty("destroy-with-parent",f)};this.GetDestroyWithParent=function(){return this.GetProperty("destroy-with-parent")};this.SetModal=function(f){this.SetProperty("modal",f)};this.GetModal=function(){return this.GetProperty("modal")};this.SetTransientFor=function(f){this.SetProperty("parent",f)};this.GetTransientFor=function(){return this.GetProperty("parent")};this.SetTitle=function(f){this.SetProperty("title",f)};this.Move=function(f,g){this.win_shadow.Move(f,g)};this.Resize=function(f,j){f=Math.max(this.MIN_WIDTH,f);j=Math.max(this.MIN_HEIGHT,j);var k=this.GetElement("content");k.SetStyle("width",f+"px");k.SetStyle("height",j+"px");this.win_titlebar.Resize(f,j);var i=this.win_titlebar.GetExtraSize();this.win_resize.Resize(f+i.w,j+i.h);var g=this.win_resize.GetExtraSize();this.win_shadow.Resize(f+i.w+g.w,j+i.h+g.h)};this.GetSize=function(){var f=this.GetElement("content");return{w:Math.max(this.MIN_WIDTH,parseInt(f.GetStyle("width"))),h:Math.max(this.MIN_HEIGHT,parseInt(f.GetStyle("height")))}};this.Map=function(g){if(this.IsMapped()){return}var h=this.GetElement("content");var m=this.GetChild();if(m){m.Map(h)}var j={w:100,h:100};if(m){var j=m.Measure();this.Resize(j.w,j.h);m.Reallocate(j.w,j.h)}this.win_shadow.MapInto(g);var i=SEK.Win.GetScreenSize();var k=SEK.Win.GetScreenOffset();var f=Math.round(((i.w-j.w)/2)+k.x);var l=Math.round(((i.h-j.h)/2)+k.y);f=Math.min(Math.max(f,k.x),i.w+k.x);l=Math.min(Math.max(l,k.y),i.h+k.y);this.win_shadow.Move(f,l);this.StkBinMap()};this.Unmap=function(){if(!this.IsMapped()){return}this.win_shadow.Remove();this.StkBinUnmap()};this.Measure=function(){if(!this.GetChild()){return{w:0,h:0}}return this.GetChild().Measure()};this.Reallocate=function(f,g){if(!this.GetChild()){return}this.GetChild().Reallocate(f,g)};this.OnSizeChanged=function(h){var i=this.Measure();var j=this.GetElement("content").GetSize();var f=Math.max(i.w,j.w);var g=Math.max(i.h,j.h);this.Resize(f,g);this.Reallocate(f,g)};this.Add=function(g){this.StkBinAdd(g);var f=g.Connect("size-request",SEK.Delegate(this,"OnSizeChanged"));this.SetData("__child_size_change_handler__",f);if(this.IsMapped()){g.Map(this.GetElement("win-frame"));this.Emit("size-request")}};this.Remove=function(g){var f=this.GetData("__child_size_change_handler__");g.Disconnect(f);if(this.IsMapped()){g.Unmap()}};this.OnWindowAllocationChanged=function(g,f,i){if(this.GetChild()){this.GetChild().Reallocate(f,i)}};this.Show=function(k,h,i){this.StkBinShow();if(k||(h&&i)){var l=this.win_resize.resize_frame.GetSize();var j=this.win_resize.resize_frame.GetPosition();if(k){var i=k.GetElement("frame").GetSize();var h=k.GetElement("frame").GetPosition()}var g=new SEK.Element.Div();g.SetStyle("backgroundColor",this.GetStyleProperty("animate-color"));g.SetStyle("border",this.GetStyleProperty("animate-border"));g.SetStyle("position","absolute");g.SetStyle("left",String(h.x)+"px");g.SetStyle("top",String(h.y)+"px");g.SetStyle("width",String(i.w)+"px");g.SetStyle("height",String(i.h)+"px");SEK.Doc.Body().Add(g);this.SetData("__ani_elmt__",g);var f=new SEK.Animator.Rect(SEK.Delegate(this,"OnAnimate"),[h.x,h.y],[i.w,i.h]);f.Connect("done",SEK.Delegate(this,"OnAnimateDone"));f.MoveTo([j.x,j.y],[l.w,l.h],this.GetStyleProperty("animate-time"));this.Hide(null);f.Connect("done",SEK.Payload(SEK.Delegate(this,"Show"),null))}};this.Hide=function(l,j,k){if(l||(j&&k)){var i=this.win_resize.resize_frame.GetSize();var h=this.win_resize.resize_frame.GetPosition();if(l){var k=l.GetElement("frame").GetSize();var j=l.GetElement("frame").GetPosition()}var g=new SEK.Element.Div();g.SetStyle("backgroundColor",this.GetStyleProperty("animate-color"));g.SetStyle("border",this.GetStyleProperty("animate-border"));g.SetStyle("position","absolute");g.SetStyle("left",String(h.x)+"px");g.SetStyle("top",String(h.y)+"px");g.SetStyle("width",String(i.w)+"px");g.SetStyle("height",String(i.h)+"px");g.SetOpacity(0.5);SEK.Doc.Body().Add(g);this.SetData("__ani_elmt__",g);var f=new SEK.Animator.Rect(SEK.Delegate(this,"OnAnimate"),[h.x,h.y],[i.w,i.h]);f.Connect("done",SEK.Delegate(this,"OnAnimateDone"));f.MoveTo([j.x,j.y],[k.w,k.h],this.GetStyleProperty("animate-time"))}this.StkBinHide()};this.OnAnimate=function(g,h,i){var f=this.GetData("__ani_elmt__");if(!f){return}f.SetStyle("left",String(g[0])+"px");f.SetStyle("top",String(g[1])+"px");f.SetStyle("width",String(h[0])+"px");f.SetStyle("height",String(h[1])+"px")};this.OnAnimateDone=function(){var f=this.GetData("__ani_elmt__");if(f){f.Remove()}this.SetData("__ani_elmt__",null)};this.CreateType("Window");this.Connect("size-request",SEK.Delegate(this,"OnSizeChanged"));if(d){this.Add(d)}if(e){this.SetTitle(e)}};STK.Window.class_styles={min_width:34,min_height:8,deletable:false,"animate-border":"2px solid black","animate-color":"#777","animate-time":0.18};STK.HSeparator=function(){STK.Separator.apply(this);var a=new SEK.Element.Div();a.SetStyle("height","1px");a.SetStyle("maxHeight","1px");a.SetStyle("minHeight","1px");a.SetStyle("fontSize","1pt");a.SetStyle("marginTop","1px");a.SetStyle("borderTop","1px solid #C0C0C0");a.SetStyle("backgroundColor","#AAAAAA");a.SetStyle("borderBottom","1px solid #909090");a.SetStyle("marginBottom","1px");this.SetElement("frame",a);this.Map=function(b){if(this.IsMapped()){return}b.Add(this.GetElement("frame"));this.StkSeparatorMap(b)};this.Measure=function(){return{w:1,h:5}};this.Reallocate=function(b,c){var d=this.GetElement("frame");d.SetStyle("width",String(b)+"px")};this.CreateType("HSeparator")};STK.Dialog=function(f,e,d,c,a){STK.Window.apply(this,[f,null,c]);this.vbox=new STK.VBox();this.action_area=new STK.HButtonBox();var b=new STK.HSeparator();this.action_area.SetLayout(STK.ButtonBoxStyle.END);if(e){this.vbox.PackStart(e,true,true,0)}this.vbox.PackEnd(b,false,true,0);this.vbox.PackEnd(this.action_area,false,true,2);this.Add(this.vbox);this.SetSubWidget("vbox",this.vbox);this.SetSubWidget("separator",b);this.SetSubWidget("action_area",this.action_area);this.RegisterProperty("has-separator",true,SEK.Delegate(this,"OnHasSeparatorChanged"));this.OnHasSeparatorChanged=function(i,k,j,g){var h=this.GetSubWidget("separator");if(g){this.vbox.PackEnd(h,false,true,0)}else{h.Unmap();this.vbox.Remove(h)}};this.RegisterProperty("buttons",[],SEK.Delegate(this,"OnButtonsChanged"));this.OnButtonsChanged=function(q,g,k,m){var j=this.action_area.GetChildren();for(var o in j){if(j.hasOwnProperty(o)){var h=j[o];if(h.IsMapped()){h.Unmap()}this.action_area.Remove(h)}}for(var o in m){var n=m[o];var p=n[0];var l;var r=n[1];if(typeof(p)=="array"){p=p[0];l=p[1]}var s=new STK.Button();var t=STK.StockItemsStack.Lookup(p,STK.IconSize.BUTTON);if(t){s.SetUseStock(true)}s.SetLabel(p,l);s.Connect("clicked",SEK.Callback(SEK.Delegate(this,"_ResponseMarshaller"),r));this.action_area.PackStart(s,false,false,2);m[o].push(s)}};this.Register("response");this.SetHasSeparator=function(g){this.SetData("has-separator",Boolean(g))};this.GetHasSeparator=function(){return this.GetData("has-separator")};this.AddButton=function(h,g){var i=this.GetProperty("buttons");i=i.slice();i.push([h,g]);this.SetProperty("buttons",i)};this.AddButtons=function(h){for(var g in h){this.AddButton(h[g][0],h[g][1])}};this.SetDefaultResponse=function(g){_default_response=g};this._ResponseMarshaller=function(h,g){this.Response(g)};this.Response=function(g){this.Emit("response",g)};if(a){if((a&STK.DialogFlag.MODAL)>0){this.SetModal(true)}if((a&STK.DialogFlag.DESTROY_WITH_PARENT)>0){}if((a&STK.DialogFlag.NO_SEPARATOR)>0){}}if(d){this.AddButtons(d)}this.CreateType("Dialog")};STK.DialogFlag={MODAL:1,DESTROY_WITH_PARENT:2,NO_SEPARATOR:4};STK.DialogResponse={NONE:-1,REJECT:-2,ACCEPT:-3,DELETE_EVENT:-4,OK:-5,CANCEL:-6,CLOSE:-7,YES:-8,NO:-9,APPLY:-10,HELP:-11,none:-1,reject:-2,accept:-3,"delete-event":-4,ok:-5,cancel:-6,close:-7,yes:-8,no:-9,apply:-10,help:-11};STK.MessageDialog=function(i,h,m,l,b){this._parent=STK.Dialog;var g=new STK.Image();var a=new STK.HBox();var d=new STK.VBox();var c=new STK.Label("",true);var f=new STK.Alignment(0,0,0,0);var k=new STK.Label("",true);this.SetText=function(n){this.SetData("text",n);c.SetMarkup('<span style="font-weight:bold;font-family:sans-serif;">'+n+"</span>")};this.SetSecondaryText=function(o){this.SetData("secondary-text",o);k.SetMarkup('<span style="font-family:sans-serif;">'+o+"</span>");var n=f.Measure();f.Reallocate(n.w,n.h)};this.SetImage=function(n){this.SetData("image",n)};this.GetImage=function(){return this.GetData("image")};var j="";if(typeof(i)=="string"){i=STK.MessageDialogType[i]}switch(i){case STK.MessageDialogType.INFO:j="Information";g.SetFromStock(STK.Stock.DIALOG_INFO,STK.IconSize.DIALOG);break;case STK.MessageDialogType.WARNING:j="Warning";g.SetFromStock(STK.Stock.DIALOG_WARNING,STK.IconSize.DIALOG);break;case STK.MessageDialogType.QUESTION:j="Question";g.SetFromStock(STK.Stock.DIALOG_QUESTION,STK.IconSize.LARGE_TOOLBAR);break;case STK.MessageDialogType.ERROR:j="Error";g.SetFromStock(STK.Stock.DIALOG_ERROR,STK.IconSize.DIALOG);break;case STK.MessageDialogType.BUSY:j="Please Wait";g.SetFromStock(STK.Stock.BUSY,STK.IconSize.DIALOG);break;case STK.MessageDialogType.OTHER:j="Message";g.SetFromStock(STK.Stock.DIALOG_INFO,STK.IconSize.DIALOG);break}var e=[];if(typeof(h)=="string"){h=STK.MessageDialogButtons[h]}switch(h){case STK.MessageDialogButtons.NONE:break;case STK.MessageDialogButtons.OK:e=[["gtk-ok",STK.DialogResponse.OK]];break;case STK.MessageDialogButtons.CLOSE:e=[["gtk-close",STK.DialogResponse.CLOSE]];break;case STK.MessageDialogButtons.CANCEL:e=[["gtk-cancel",STK.DialogResponse.CANCEL]];break;case STK.MessageDialogButtons.YES_NO:e=[["gtk-yes",STK.DialogResponse.YES],["gtk-no",STK.DialogResponse.NO]];break;case STK.MessageDialogButtons.OK_CANCEL:e=[["gtk-ok",STK.DialogResponse.OK],["gtk-cancel",STK.DialogResponse.CANCEL]];break}this._parent(j,null,e,l,b);c.SetAlignment(0,0.5);c.SetWidthChars(40);c.SetWrap(STK.WrapMode.WORD);k.SetAlignment(0,0.5);k.SetWidthChars(40);k.SetWrap(STK.WrapMode.WORD);f.SetPadding(0,0,20,0);d.SetHomogeneous(false);f.Add(k);d.PackStart(c,false,false,3);d.PackStart(f,false,false,3);a.PackStart(g,false,true,10);a.PackStart(d,true,false,4);this.vbox.PackStart(a,true,true,0);this.SetData("buttons",h);this.SetData("message-type",i);this.SetData("image",g);this.SetData("secondary-text","");this.SetData("secondary-use-markup",true);this.SetData("use-markup",true);this.SetText(m)};STK.MessageDialogType={INFO:1,WARNING:2,QUESTION:3,ERROR:4,BUSY:5,OTHER:0,info:1,warning:2,question:3,error:4,other:0,busy:5};STK.MessageDialogButtons={NONE:0,OK:1,CLOSE:2,CANCEL:3,YES_NO:4,OK_CANCEL:5,none:0,ok:1,close:2,cancel:3,"yes-no":4,"ok-cancel":5};STK.Window.Resize=function(){SEK.Object.apply(this);this.DRAG_SIZE=3;this.Register("resize-begin");this.resize_frame=new SEK.Element.Table();var a=this.resize_frame.InsertRow(-1);this.resize_nw=a.InsertCell(-1);this.resize_n=a.InsertCell(-1);this.resize_ne=a.InsertCell(-1);var a=this.resize_frame.InsertRow(-1);this.resize_w=a.InsertCell(-1);this.resize_content=a.InsertCell(-1);this.resize_e=a.InsertCell(-1);var a=this.resize_frame.InsertRow(-1);this.resize_sw=a.InsertCell(-1);this.resize_s=a.InsertCell(-1);this.resize_se=a.InsertCell(-1);this.resize_frame.SetStyleCSS("border-left","1px solid #0061cf");this.resize_frame.SetStyleCSS("border-right","1px solid #0061cf");this.resize_frame.SetStyleRaw("-moz-border-radius-bottomleft","3px");this.resize_frame.SetStyleRaw("-moz-border-radius-topleft","3px");this.resize_frame.SetStyleRaw("-moz-border-radius-topright","3px");this.resize_nw.SetStyleCSS("width",this.DRAG_SIZE+"px");this.resize_nw.SetStyleCSS("height",this.DRAG_SIZE+"px");this.resize_nw.SetStyleCSS("background-color","#0061cf");this.resize_nw.SetStyleCSS("cursor","nw-resize");this.resize_nw.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/resize/resize-n")+")");this.resize_nw.SetStyleCSS("background-repeat","repeat-x");this.resize_nw.SetStyleCSS("background-position","bottom left");this.resize_nw.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.NORTH_WEST));this.resize_n.SetStyleCSS("height",this.DRAG_SIZE+"px");this.resize_n.SetStyleCSS("background-color","#0061cf");this.resize_n.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/resize/resize-n")+")");this.resize_n.SetStyleCSS("background-repeat","repeat-x");this.resize_n.SetStyleCSS("background-position","bottom left");this.resize_n.SetStyleCSS("cursor","n-resize");this.resize_n.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.NORTH));this.resize_ne.SetStyleCSS("width",this.DRAG_SIZE+"px");this.resize_ne.SetStyleCSS("height",this.DRAG_SIZE+"px");this.resize_ne.SetStyleCSS("background-color","#0061cf");this.resize_ne.SetStyleCSS("cursor","ne-resize");this.resize_ne.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/resize/resize-n")+")");this.resize_ne.SetStyleCSS("background-repeat","repeat-x");this.resize_ne.SetStyleCSS("background-position","bottom left");this.resize_ne.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.NORTH_EAST));this.resize_w.SetStyleCSS("width",this.DRAG_SIZE+"px");this.resize_w.SetStyleCSS("background-color","#0061cf");this.resize_w.SetStyleCSS("cursor","w-resize");this.resize_w.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/resize/resize-sides")+")");this.resize_w.SetStyleCSS("background-repeat","repeat-x");this.resize_w.SetStyleCSS("background-position","top right");this.resize_w.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.WEST));this.resize_e.SetStyleCSS("width",this.DRAG_SIZE+"px");this.resize_e.SetStyleCSS("background-color","#0061cf");this.resize_e.SetStyleCSS("cursor","e-resize");this.resize_e.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/resize/resize-sides")+")");this.resize_e.SetStyleCSS("background-repeat","repeat-x");this.resize_e.SetStyleCSS("background-position","top left");this.resize_e.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.EAST));this.resize_sw.SetStyleCSS("width",this.DRAG_SIZE+"px");this.resize_sw.SetStyleCSS("height",this.DRAG_SIZE+"px");this.resize_sw.SetStyleCSS("background-color","#0061cf");this.resize_sw.SetStyleCSS("cursor","sw-resize");this.resize_sw.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.SOUTH_WEST));this.resize_s.SetStyleCSS("height",this.DRAG_SIZE+"px");this.resize_s.SetStyleCSS("background-color","#0061cf");this.resize_s.SetStyleCSS("cursor","s-resize");this.resize_s.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.SOUTH));this.resize_se.SetStyleCSS("width",this.DRAG_SIZE+"px");this.resize_se.SetStyleCSS("height",this.DRAG_SIZE+"px");this.resize_se.SetStyleCSS("background-color","#0061cf");this.resize_se.SetStyleCSS("cursor","se-resize");this.resize_se.Listen("mousedown",SEK.Callback(SEK.Delegate(this,"OnMouseDown"),STK.Direction.SOUTH_EAST));this.Resize=function(b,c){this.resize_frame.SetStyle("width",(b+6)+"px");this.resize_frame.SetStyle("height",(c+6)+"px")};this.GetExtraSize=function(){return{w:6,h:6}};this.OnMouseDown=function(c,b){this.Emit("resize-begin",b);c.StopAll();return false};this.Resize(100,124)};STK.Window.Shadow=function(){SEK.Object.apply(this);this.RegisterProperty("content-size",{w:100,h:100},SEK.Delegate(this,"OnContentSizeChanged"));this.OnContentSizeChanged=function(f,i,g,d){var a=0;var c=d.w;var e=d.h;if(SEK.UserAgent.IsExplorer6()){this.shadow_frame.SetStyleCSS("width",c+"px");this.shadow_frame.SetStyleCSS("height",e+"px");this.shadow_content.SetStyleCSS("width",c+"px");this.shadow_content.SetStyleCSS("height",e+"px");this.shadow_hidewindow.SetStyleCSS("width",c+"px");this.shadow_hidewindow.SetStyleCSS("height",e+"px");return}this.shadow_frame.SetStyleCSS("width",(c+11)+"px");this.shadow_upper.SetStyleCSS("width",c+"px");this.shadow_upper.SetStyleCSS("height",e+"px");this.shadows_e.SetStyleCSS("height",(e)+"px");this.shadows_e.SetStyleCSS("margin-left",(c)+"px");this.shadow_e.SetStyleCSS("height",(e-11)+"px");this.shadow_content.SetStyleCSS("top",-(e)+"px");this.shadows_s.SetStyleCSS("width",(c+11)+"px");this.shadow_s.SetStyleCSS("width",(c-11)+"px");this.shadow_se.SetStyleCSS("margin-left",(c-11)+"px")};this.RegisterProperty("position",{x:0,y:0},SEK.Delegate(this,"OnPositionChanged"));this.OnPositionChanged=function(b,d,c,a){this.shadow_frame.SetStyleCSS("left",parseInt(a.x)+"px");this.shadow_frame.SetStyleCSS("top",parseInt(a.y)+"px");if(SEK.UserAgent.IsExplorer6()){this.shadow_hidewindow.SetStyleCSS("left",parseInt(a.x)+"px");this.shadow_hidewindow.SetStyleCSS("top",parseInt(a.y)+"px")}};this._Setup=function(){if(SEK.UserAgent.IsExplorer6()){this.shadow_hidewindow=new SEK.Element.IFrame();this.shadow_hidewindow.dom_elmt.src="javascript:'<html></html>';";this.shadow_hidewindow.SetStyleCSS("position","absolute");this.shadow_hidewindow.SetStyleCSS("left","0px");this.shadow_hidewindow.SetStyleCSS("top","0px");this.shadow_frame=new SEK.Element.Div();this.shadow_frame.SetStyleCSS("position","absolute");this.shadow_frame.SetStyleCSS("left","0px");this.shadow_frame.SetStyleCSS("top","0px");this.shadow_content=new SEK.Element.Div();this.shadow_content.SetStyleCSS("position","relative");this.shadow_content.SetStyleCSS("background-color","#ffffff");this.shadow_frame.Add(this.shadow_content);return}this.shadow_frame=new SEK.Element.Div();this.shadow_upper=new SEK.Element.Div();this.shadows_e=new SEK.Element.Div();this.shadow_ne=new SEK.Element.Div();this.shadow_e=new SEK.Element.Div();this.shadow_content=new SEK.Element.Div();this.shadows_s=new SEK.Element.Div();this.shadow_sw=new SEK.Element.Div();this.shadow_s=new SEK.Element.Div();this.shadow_se=new SEK.Element.Div();this.shadow_s.Add(this.shadow_se);this.shadow_sw.Add(this.shadow_s);this.shadows_s.Add(this.shadow_sw);this.shadows_e.Add(this.shadow_ne);this.shadows_e.Add(this.shadow_e);this.shadow_upper.Add(this.shadows_e);this.shadow_upper.Add(this.shadow_content);this.shadow_frame.Add(this.shadow_upper);this.shadow_frame.Add(this.shadows_s);this.shadow_frame.SetStyleCSS("position","absolute");this.shadow_frame.SetStyleCSS("left","0px");this.shadow_frame.SetStyleCSS("top","0px");this.shadow_upper.SetStyleCSS("background-color","#ffffff");this.shadows_e.SetStyleCSS("width","11px");this.shadow_ne.SetStyleCSS("width","11px");this.shadow_ne.SetStyleCSS("height","11px");this.shadow_ne.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/shadow/shadow-ne")+")");this.shadow_ne.SetStyleCSS("background-repeat","no-repeat");this.shadow_ne.SetStyleCSS("background-position","bottom left");this.shadow_e.SetStyleCSS("width","11px");this.shadow_e.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/shadow/shadow-e")+")");this.shadow_e.SetStyleCSS("background-repeat","repeat-y");this.shadow_e.SetStyleCSS("background-position","top right");this.shadow_content.SetStyleCSS("position","relative");this.shadows_s.SetStyleCSS("height","11px");this.shadow_sw.SetStyleCSS("width","11px");this.shadow_sw.SetStyleCSS("height","11px");this.shadow_sw.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/shadow/shadow-sw")+")");this.shadow_sw.SetStyleCSS("background-repeat","no-repeat");this.shadow_sw.SetStyleCSS("background-position","top left");this.shadow_s.SetStyleCSS("height","11px");this.shadow_s.SetStyleCSS("margin-left","11px");this.shadow_s.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/shadow/shadow-s")+")");this.shadow_s.SetStyleCSS("background-repeat","repeat-x");this.shadow_s.SetStyleCSS("background-position","top left");this.shadow_se.SetStyleCSS("width","11px");this.shadow_se.SetStyleCSS("height","11px");this.shadow_se.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/shadow/shadow-se")+")");this.shadow_se.SetStyleCSS("background-repeat","no-repeat");this.shadow_se.SetStyleCSS("background-position","bottom left")};this._Setup();this.Resize=function(a,b){this.SetProperty("content-size",{w:a,h:b})};this.Move=function(a,b){this.SetProperty("position",{x:a,y:b})};this.MapInto=function(a){if(SEK.UserAgent.IsExplorer6()){a.Add(this.shadow_hidewindow)}a.Add(this.shadow_frame)};this.Remove=function(){if(SEK.UserAgent.IsExplorer6()){this.shadow_hidewindow.Remove()}this.shadow_frame.Remove()};this.CreateType("WindowShadow");this.Resize(106,130)};STK.Window.Titlebar=function(){SEK.Object.apply(this);this.RegisterProperty("title","Window",SEK.Delegate(this,"OnTitleChanged"));this.OnTitleChanged=function(c,f,d,b){var e=b.replace(/ /g,"&nbsp;");this.title_text.SetContent(e)};this.Register("drag-begin");this.title_frame=new SEK.Element.Table();this.title_row=this.title_frame.InsertRow(-1);this.title_icon_area=this.title_row.InsertCell(-1);this.title_icon=new SEK.Element.Image();this.title_text_area=this.title_row.InsertCell(-1);this.title_text_lock=new SEK.Element.Div();this.title_text=new SEK.Element.Span();this.title_minimize=this.title_row.InsertCell(-1);this.title_maximize=this.title_row.InsertCell(-1);this.title_close_area=this.title_row.InsertCell(-1);this.title_close=new SEK.Element.Image();var a=this.title_frame.InsertRow(-1);this.title_content=a.InsertCell(-1);this.title_content.SetAttribute("colSpan",5);this.title_row.SetStyleCSS("background-color","#0061cf");this.title_row.SetStyleCSS("background-image","url("+STK.Path.FindImage("/data/images/window/titlebar/background")+")");this.title_row.SetStyleCSS("height","24px");this.title_row.SetStyleCSS("cursor","move");this.title_row.Listen("mousedown",SEK.Delegate(this,"OnTitleRowMouseDown"),true);this.title_row.Listen("selectstart",function(b){b.PreventDefault()});this.title_icon.SetAttribute("width",18);this.title_icon.SetAttribute("height",18);this.title_icon.SetStyleCSS("margin-bottom","4px");this.title_icon.SetAttribute("src",STK.Path.FindImage("/data/images/window/titlebar/default-icon-18x18"));this.title_icon_area.SetStyleCSS("width","18px");this.title_icon_area.SetStyleCSS("padding","0px");this.title_icon_area.Add(this.title_icon);this.title_text.SetStyleCSS("color","#ffffff");this.title_text.SetStyleCSS("font-family","sans-serif");this.title_text.SetStyleCSS("font-size","8pt");this.title_text.SetStyleCSS("font-weight","bold");this.title_text.SetStyleCSS("padding-left","4px");this.title_text.SetStyleCSS("padding-right","4px");this.title_text.SetStyleCSS("padding-top","2px");this.title_text.SetStyleCSS("-moz-border-radius","6px");this.title_text.SetStyleCSS("border","1px solid #0061CF");this.title_text.SetContent("Window");this.title_text_lock.SetStyleCSS("height","19px");this.title_text_lock.SetStyleCSS("padding-top","5px");this.title_text_lock.SetStyleCSS("overflow","hidden");this.title_text_lock.Add(this.title_text);this.title_text_area.SetStyleCSS("text-align","center");this.title_text_area.SetStyleCSS("height","24px");this.title_text_area.Add(this.title_text_lock);this.title_close.SetAttribute("width",8);this.title_close.SetAttribute("height",8);this.title_close.SetAttribute("src",STK.Path.FindImage("/data/images/window/titlebar/icon-close"));this.title_close.SetStyleCSS("margin-bottom","4px");this.title_close.SetStyleCSS("position","relative");this.title_close.SetStyleCSS("left","2px");this.title_close.SetStyleCSS("display","none");this.title_close_area.SetStyleCSS("width","12px");this.title_close_area.SetStyleCSS("padding","0px");this.title_close_area.Add(this.title_close);this.OnTitleRowMouseDown=function(b){b.PreventDefault();this.Emit("drag-begin",b.Location())};this.Resize=function(b,d){this.title_frame.SetStyleCSS("width",b+"px");this.title_frame.SetStyleCSS("height",(d+24)+"px");this.title_content.SetStyleCSS("width",b+"px");this.title_content.SetStyleCSS("height",d+"px");var c=b-(18+0+0+12);if(SEK.UserAgent.IsExplorer()){c-=15}this.title_text_lock.SetStyleCSS("width",c+"px")};this.GetExtraSize=function(){return{w:0,h:24}};this.GetMinSize=function(){return{w:75,h:28}};this.SetDeletable=function(b){if(b){this.title_close.SetStyle("visibility","visible")}else{this.title_close.SetStyle("visibility","hidden")}};this.Resize(100,100)};