function LoadLibrary(a){if(!a){a=window}a.SEK=window.SEK}var SEK={win:window,doc:document,Callback:function(c){var a=[];for(var b=1;b<arguments.length;b++){a.push(arguments[b])}var d=function(){var e=Array();for(var f=0;f<arguments.length;f++){e.push(arguments[f])}e=e.concat(a);c.apply(this,e)};return d},Payload:function(d){var b=Array();for(var c=1;c<arguments.length;c++){b.push(arguments[c])}var e=function(){d.apply(this,b)};return e},Delegate:function(a,b){return function(){return a[b].apply(a,arguments)}}};if(window.Saki){SEK.win=window.parent.window;SEK.doc=window.parent.document}SEK.String={EscapeHtml:function(a){if(!a){return""}a=a.toString();if(a.length==0){return""}a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a},MarkupHtml:function(a){if(!a){return""}a=a.toString();if(a.length==0){return""}a=a.replace(/\n/g,"<br/>");return a},RenderHtml:function(a){return SEK.String.MarkupHtml(SEK.String.EscapeHtml(a))},Format:function(c){var a=c[0];for(var b=1;b<c.length;b++){a=a.replace("%s",c[b])}return a},Trim:function(a){if(a.trim!==undefined){return a.trim()}return SEK.String.TrimRight(SEK.String.TrimLeft(a))},TrimLeft:function(a){if(a.trimLeft!==undefined){return a.trimLeft()}return a.replace(/^(\s)*/,"")},TrimRight:function(a){if(a.trimRight!==undefined){return a.trimRight()}return a.replace(/(\s)*$/,"")}};SEK.Event=function(a){this._event;this.Location=function(){return{x:this.x(),y:this.y()}};this.x=function(){var b=0;if(this._event.pageX){b=this._event.pageX}else{if(this._event.clientX){if(!SEK.doc.body){b=this._event.clientX}else{b=this._event.clientX+SEK.doc.body.scrollLeft}}}return b};this.y=function(){var b=0;if(this._event.pageY){b=this._event.pageY}else{if(this._event.clientY){if(!SEK.doc.body){b=this._event.clientY}else{b=this._event.clientY+SEK.doc.body.scrollTop}}}return b};this.IsBubbling=function(){if(!this._event||!this._event.type){return true}if(this._event.eventPhase==3){return true}return false};this.Target=function(){var b=false;if(this._event.target!=undefined){b=this._event.target}else{if(this._event.srcElement!=undefined){b=this._event.srcElement}}if(b&&b.nodeType==3){b=b.parentNode}return b};this.IsChar=function(){return true};this.GetChar=function(){if(this._event.shiftKey){return String.fromCharCode(this._event.keyCode)}else{return String.fromCharCode(this._event.keyCode).toLowerCase()}};this.CharCode=function(){return this._event.keyCode};this.ScrollAmount=function(){if(this._event.detail){if(this._event.detail>0){return -1}else{if(this._event.detail<0){return 1}}}if(this._event.wheelDelta){if(this._event.wheelDelta>0){return 1}else{if(this._event.wheelDelta<0){return -1}}}return 0};this.StopPropagation=function(){if(this._event.stopPropagation){this._event.stopPropagation()}else{this._event.cancelBubble=true}};this.PreventDefault=function(){if(this._event.preventDefault){this._event.preventDefault()}else{this._event.returnValue=false}};this.StopAll=function(){this.StopPropagation();this.PreventDefault()};this._event=a;if(this._event==null){this._event=SEK.win.event}};SEK.Event.Register=function(b,c,d,a){if(b.addEventListener){if(!a){a=false}if(c=="mousewheel"&&SEK.UserAgent.IsGecko()){c="DOMMouseScroll"}b.addEventListener(c,d,a)}else{if(b.attachEvent){b.attachEvent("on"+c,d)}else{b["on"+c]=d}}};SEK.Event.Unregister=function(b,c,d,a){if(b.removeEventListener){if(!a){a=false}if(c=="mousewheel"&&SEK.UserAgent.IsGecko()){c="DOMMouseScroll"}b.removeEventListener(c,d,a)}else{if(b.attachEvent){b.detachEvent("on"+c,d)}else{delete b["on"+c]}}};SEK.Timer={autocancel:{},Start:function(b,a){return SEK.win.setTimeout(b,a*1000)},Stop:function(a){SEK.win.clearTimeout(a)},StartRepeating:function(c,a){var b=SEK.win.setInterval(c,parseInt(a*1000));if(SEK.UserAgent.IsGecko()){SEK.Timer.autocancel[b]=true}return b},StopRepeating:function(a){if(SEK.UserAgent.IsGecko()){delete SEK.Timer.autocancel[a]}SEK.win.clearInterval(a)},GetTime:function(){if(Date.now){return Date.now()/1000}else{return(new Date()).getTime()/1000}},OnUnload:function(b){for(var a in SEK.Timer.autocancel){SEK.win.clearInterval(a)}SEK.Timer.autocancel={}},__guard:null};if(navigator&&navigator.userAgent){if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){SEK.Event.Register(SEK.win,"unload",SEK.Timer.OnUnload)}}SEK.UserAgent={_version:-1,_agent:"",_engine:"",_DetectVersion:function(a){if(a.version_prefix){var b=navigator.userAgent.indexOf(a.version_prefix);if(b==-1){return}b+=a.version_prefix.length+1;SEK.UserAgent._version=parseFloat(navigator.userAgent.substring(b));return}SEK.UserAgent._version=parseFloat(navigator.appVersion)},_DoDetect:function(){for(var a=0;a<SEK.UserAgent.browser_db.length;a++){var b=SEK.UserAgent.browser_db[a];if(b.fingerprint){SEK.UserAgent._agent=b.identity;SEK.UserAgent._engine=b.engine;SEK.UserAgent._DetectVersion(b);return}if(b.haystack&&b.haystack.indexOf(b.needle)!=-1){SEK.UserAgent._agent=b.identity;SEK.UserAgent._engine=b.engine;SEK.UserAgent._DetectVersion(b);return}}},Agent:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return SEK.UserAgent._agent},Engine:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return SEK.UserAgent._engine},Version:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return SEK.UserAgent._version},IsExplorer:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return SEK.UserAgent._engine=="Explorer"},IsExplorer6:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return(SEK.UserAgent._engine=="Explorer")&&(Math.floor(SEK.UserAgent._version)==6)},IsExplorer7:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return(SEK.UserAgent._engine=="Explorer")&&(Math.floor(SEK.UserAgent._version)==7)},IsExplorer8:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return(SEK.UserAgent._engine=="Explorer")&&(Math.floor(SEK.UserAgent._version)==8)},IsGecko:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return SEK.UserAgent._engine=="Gecko"},IsKhtml:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return SEK.UserAgent._engine=="KHTML"},IsOpera:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return(SEK.UserAgent._engine=="Opera")},IsWebKit:function(){if(SEK.UserAgent._agent.length==0){SEK.UserAgent._DoDetect()}return SEK.UserAgent._engine=="Webkit"},browser_db:[{identity:"Chrome",engine:"Webkit",haystack:navigator.userAgent,needle:"Chrome"},{identity:"OmniWeb",engine:"Webkit",haystack:navigator.userAgent,needle:"OmniWeb",version_prefix:"OmniWeb/"},{identity:"Safari",engine:"Webkit",haystack:navigator.vendor,needle:"Apple",version_prefix:"Version"},{identity:"Opera",engine:"Opera",fingerprint:window.opera},{identity:"iCab",engine:"Webkit",haystack:navigator.vendor,needle:"iCab"},{identity:"Konqueror",engine:"KHTML",haystack:navigator.vendor,needle:"KDE"},{identity:"Firefox",engine:"Gecko",haystack:navigator.userAgent,needle:"Firefox",version_prefix:"Firefox/"},{identity:"Camino",engine:"Gecko",haystack:navigator.vendor,needle:"Camino"},{identity:"Netscape",engine:"Netscape",haystack:navigator.userAgent,needle:"Netscape"},{identity:"Explorer",engine:"Explorer",haystack:navigator.userAgent,needle:"MSIE",version_prefix:"MSIE"},{identity:"Mozilla",engine:"Gecko",haystack:navigator.userAgent,needle:"Gecko",version_prefix:"rv"},{identity:"Netscape",engine:"Netscape",haystack:navigator.userAgent,needle:"Mozilla",version_prefix:"Mozilla"}],guard:null};SEK.Element={prior_id:1,trace:false,sanitycheck:true,EnableTrace:function(){SEK.Element.trace=true},DisableTrace:function(){SEK.Element.trace=false},EnableSanityCheck:function(){SEK.Element.sanitycheck=true},DisableSanityCheck:function(){SEK.Element.sanitycheck=false},Base:function(b){this.AsString=function(){return this.dom_elmt.tagName.toLowerCase()+"-"+String(this.dom_elmt.id.slice(2))};this.Destroy=function(){this.Remove();delete this.dom_elmt;this.dom_elmt=null};this.Add=function(d){try{this.dom_elmt.appendChild(d.dom_elmt)}catch(c){SEK.Log.Critical("SEK::Element::Base::Add - failed to add element %s to %s:",d.toString(),this.toString(),c.toString())}};this.Remove=function(){var c=this.dom_elmt.parentNode;if(!c){return}c.removeChild(this.dom_elmt)};this.Show=function(){switch(String(this.GetAttribute("tagName")).toLowerCase()){default:case"div":this.SetStyle("display","block");break;case"span":this.SetStyle("display","inline");break;case"table":if(SEK.UserAgent.IsExplorer()){this.SetStyle("display","block")}else{this.SetStyle("display","table")}break;case"tr":if(SEK.UserAgent.IsExplorer()){this.SetStyle("display","")}else{this.SetStyle("display","table-row")}break;case"td":if(SEK.UserAgent.IsExplorer()){this.SetStyle("display","block")}else{this.SetStyle("display","table-cell")}break}};this.Hide=function(){this.SetStyle("display","none")};this.GetAttribute=function(c){return this.dom_elmt[c]};this.SetAttribute=function(c,d){var e=this.dom_elmt[c];this.dom_elmt[c]=d;return e};this.SetStyles=function(d){for(var c in d){this.SetStyle(c,d[c])}};this.SetStyle=function(c,d){if(SEK.Element.trace){SEK.Log.Debug("%s: SetStyle( %s, '%s' )",this.AsString(),String(c),String(d))}this.dom_elmt.style[String(c)]=String(d)};this.SetStyleCSS=function(c,d){this.SetStyleRaw(c,d,"")};this.SetStyleRaw=function(c,f,h){if(!this.dom_elmt.style.setProperty){var e=c;if(-1!=c.indexOf("-")){var g=c.split("-");for(var d=1;d<g.length;d++){g[d]=g[d].charAt(0).toUpperCase()+g[d].slice(1)}e=g.join("")}this.SetStyle(e,f)}else{if(!h){h=null}this.dom_elmt.style.setProperty(String(c),String(f),h)}};this.GetStyle=function(c){return this.dom_elmt.style[c]};this.SetOpacity=function(c){if(!SEK.UserAgent.IsExplorer()){this.SetStyle("opacity",String(c))}else{var d=String(Math.round(c*100));this.SetStyle("filter","alpha( opacity="+d+" )")}};this.SetSelectable=function(c){if(SEK.UserAgent.IsExplorer()){if(c){this.SetAttribute("unselectable","off")}else{this.SetAttribute("unselectable","on")}}else{if(SEK.UserAgent.IsGecko()){if(c){this.SetStyleRaw("-moz-user-select","text","")}else{this.SetStyleRaw("-moz-user-select","none","")}}else{if(SEK.UserAgent.IsWebKit()){if(c){this.SetStyleRaw("-khtml-user-select","text","")}else{this.SetStyleRaw("-khtml-user-select","none","")}}else{if(SEK.UserAgent.IsKhtml()){}else{if(c){this.SetStyleRaw("user-select","text","")}else{this.SetStyleRaw("user-select","none","")}}}}}};this.Listen=function(e,f,c){var d=[this.dom_elmt,e,function(g){return f(new SEK.Event(g))},c];SEK.Event.Register(d[0],d[1],d[2],d[3]);return d};this.ListenRaw=function(e,f,c){var d=[this.dom_elmt,e,f,c];SEK.Event.Register(d[0],d[1],d[2],d[3]);return d};this.Unlisten=function(c){SEK.Event.Unregister(c[0],c[1],c[2],c[3])};this.OverrideHandler=function(d,c){this.dom_elmt[d]=c};this.SetContent=function(c){this.dom_elmt.innerHTML=c};this.GetContent=function(){return this.dom_elmt.innerHTML};this.GetSize=function(){var d=(this.dom_elmt.offsetWidth===undefined)?0:this.dom_elmt.offsetWidth;var c=(this.dom_elmt.offsetHeight===undefined)?0:this.dom_elmt.offsetHeight;return{w:d,h:c}};this.GetPosition=function(){var d={x:0,y:0};var c=this.dom_elmt;if(!c){return d}if(c.offsetParent){while(c&&c.offsetParent){d.x+=c.offsetLeft;d.y+=c.offsetTop;c=c.offsetParent}}else{if(c.x){d.x+=c.x;d.y+=c.y}}return d};this.GetPositionRelative=function(d){var g={x:0,y:0};var f=this.dom_elmt;var c=d.dom_elmt;if(!f){return g}if(!c){return g}if(!c.id){return g}if(f.offsetParent){while(f&&f.offsetParent&&(!f.id||f.id!=c.id)){g.x+=f.offsetLeft;g.y+=f.offsetTop;f=f.offsetParent}}return g};this.GetChild=function(c){return new SEK.Element.Wrapper(this.dom_elmt.childNodes[c])};this.GetParent=function(){var c=this.dom_elmt.parentNode;if(!c){return undefined}return new SEK.Element.Wrapper(c)};this.GetChildCount=function(){return this.dom_elmt.childNodes.length};this.GetTagName=function(){if(!this.dom_elmt.tagName){return false}return this.dom_elmt.tagName.toLowerCase()},this.GetElement=function(){return this.dom_elmt};if(b!==undefined){this.dom_elmt=SEK.Doc.dom_elmt.createElement(b)}if(this.dom_elmt.id===undefined){var a="id"+String(SEK.Element.prior_id);if(SEK.UserAgent.IsExplorer()&&this.dom_elmt.nodeName&&this.dom_elmt.nodeName=="#text"){}else{this.dom_elmt.id=a}SEK.Element.prior_id+=1}},Wrapper:function(a){this.dom_elmt=a;SEK.Element.Base.apply(this)},Div:function(){SEK.Element.Base.apply(this,["div"])},Span:function(){SEK.Element.Base.apply(this,["span"])},Form:function(){SEK.Element.Base.apply(this,["form"]);this.Submit=function(){this.dom_elmt.submit()};this.Reset=function(){this.dom_elmt.reset()}},Input:function(){SEK.Element.Base.apply(this,["input"])},Image:function(){SEK.Element.Base.apply(this,["img"])},Select:function(){SEK.Element.Base.apply(this,["select"]);this.GetLength=function(){return this.dom_elmt.length};this.Remove=function(a){return this.dom_elmt.remove(a)};this.Append=function(b){try{this.dom_elmt.add(b.dom_elmt,null)}catch(a){this.dom_elmt.add(b.dom_elmt)}};this.SetSelected=function(a){this.dom_elmt.selectedIndex=a};this.SetSensitive=function(a){this.dom_elmt.disabled=!a}},Option:function(){SEK.Element.Base.apply(this,["option"]);this.SetText=function(a){this.dom_elmt.text=a};this.SetValue=function(a){this.dom_elmt.value=a}},Table:function(){SEK.Element.Base.apply(this,["table"]);this.SetAttribute("cellSpacing",0);this.SetAttribute("cellPadding",0);this.InsertRow=function(b){var a=this.dom_elmt.insertRow(b);return new SEK.Element.TableRow(a)};this.DeleteRow=function(a){this.dom_elmt.deleteRow(a)};this.RowCount=function(){return this.dom_elmt.rows.length};this.GetRowAtOffset=function(b){var a=this.dom_elmt.rows[b];if(!a){return false}return new SEK.Element.TableRow(a)}},TableRow:function(a){SEK.Element.Wrapper.apply(this,[a]);this.CellCount=function(){return this.dom_elmt.cells.length};this.InsertCell=function(c){var b=this.dom_elmt.insertCell(c);return new SEK.Element.TableCell(b)};this.GetCellAtOffset=function(c){var b=this.dom_elmt.cells[c];if(!b){return}return new SEK.Element.TableCell(b)}},TableCell:function(a){SEK.Element.Wrapper.apply(this,[a])},IFrame:function(){SEK.Element.Base.apply(this,["iframe"]);this.SetSource=function(a){this.SetAttribute("src",a)}}};SEK.__Win__=function(){SEK.Element.Wrapper.apply(this,[SEK.win]);this.GetScreenSize=function(){var a={w:-1,h:-1};if(SEK.win.innerWidth){a.w=SEK.win.innerWidth;a.h=SEK.win.innerHeight}else{a=SEK.Doc.__GetScreenSize()}return a};this.GetScreenOffset=function(){if(SEK.win.pageXOffset!==undefined){return{x:SEK.win.pageXOffset,y:SEK.win.pageYOffset}}return SEK.Doc.__GetScreenOffset()}};SEK.Win=new SEK.__Win__();if(window.Saki){Saki.Library.Require(["sek","0.0.x"]);function main(){}}function LoadLibrary(a){if(!a){a=window}a.SLK=window.SLK}var SLK={};SLK.EllipsizeMode={NONE:"none",START:"start",MIDDLE:"middle",END:"end"};SLK.WrapMode={NONE:"none",WORD:"word",CHAR:"char"};SLK.Text={_hit_count:0,_miss_count:0,_total:0,_s_widths:{},_c_widths:{},_element:null,GetCacheHitRatio:function(){return SLK.Text._hit_count/SLK.Text._total},GetMeasureCount:function(){return SLK.Text._total},GetCacheHits:function(){return SLK.Text._hit_count},GetCacheMisses:function(){return SLK.Text._miss_count}};SLK.TextRegion=function(b,a){this._text="";this._style;this._tags={};this.Describe=function(){var d="";var e=this._style.GetStyles();for(var c in e){if(e.hasOwnProperty(c)){d+="&nbsp;&nbsp;&nbsp;&nbsp;"+c+": "+e[c]+"<br/>"}}return d};this.GetText=function(){return this._text};this.GetMarkup=function(){return["<span ",this._style.GetStyleForMarkup(),">",SEK.String.EscapeHtml(this.GetText()),"</span>"].join("")};this.GetMarkupEllipsized=function(d,e){var c=SLK.Text.EllipsizeEnd(d,this.GetText(),this._style);return["<span ",this._style.GetStyleForMarkup(),">",SEK.String.EscapeHtml(c),"</span>"].join("")};this.GetMarkupWrapped=function(e,i,h,d){var c=SLK.Text.Wrap(e,this.GetText(),this.GetStyle(),i,h);if(d){var g=c.slice(c.lastIndexOf("\n"));var f=SLK.Text.Measure(g,this.GetStyle());d.w=f.w}return["<span ",this._style.GetStyleForMarkup(),">",SEK.String.EscapeHtml(c),"</span>"].join("")};this.GetStyle=function(){return this._style};this.Measure=function(){var c=SLK.Text.Measure(this.GetText(),this.GetStyle());return c};this._text=b.nodeValue;this._style=new SLK.TextStyle(a);if(SEK.UserAgent.IsGecko()){if(a.nodeName.toUpperCase()=="B"){this._style.SetStyle("font-weight","bold")}}};SLK.Text.Ellipsize=function(a,d,b,c){if(c==SLK.EllipsizeMode.END){return SLK.Text.EllipsizeEnd(a,d,b)}return SLK.Text.EllipsizeEnd(a,d,b)};SLK.Text.EllipsizeEnd=function(m,k,a){var l=SLK.Text.Measure(k,a);if(l.w<m){return k}var g="...";var d=SLK.Text.Measure(g,a);if(d.w>m){g="..";d=SLK.Text.Measure(g,a);if(d.w>m){g=".";d=SLK.Text.Measure(g,a);if(d.w>m){return""}return g}return g}var b=0;var e="";for(var f=0;f<k.length;f++){var j=k.charAt(f);var h=SLK.Text.MeasureChar(j,a);if(b+h.w+d.w>m){return e+"..."}b+=h.w;e+=j}return e};SLK.Text._InitMeasure=function(){SLK.Text._element=new SEK.Element.Span();SLK.Text._element.SetStyle("display","none");SLK.Text._element.SetStyle("visibility","hidden");SEK.Doc.Body().Add(SLK.Text._element)};SLK.Text._NeedsBrokenLetterSpacingHack=function(a){return(SEK.UserAgent.IsExplorer())&&a.GetStyle("letter-spacing")!="normal"};SLK.Text.Measure=function(o,e){SLK.Text._total+=1;var q=e.Hash();if(q.length==0){q="default"}if(((q+o) in SLK.Text._s_widths)){SLK.Text._hit_count+=1;return{w:Number(SLK.Text._s_widths[(q+o)]["w"]),h:Number(SLK.Text._s_widths[(q+o)]["h"])}}SLK.Text._miss_count+=1;var a;if(SLK.Text._NeedsBrokenLetterSpacingHack(e)){var l=e.Copy();l.SetStyle("letter-spacing","normal");a=SLK.Text.MeasureChar("a",l);delete l}if(!SLK.Text._element){SLK.Text._InitMeasure()}if(!(q in SLK.Text._c_widths)){SLK.Text._c_widths[q]={}}var d=SLK.Text._c_widths[q];e.SetStyleOnElement(SLK.Text._element);SLK.Text._element.SetStyle("display","inline");var p=0;var b=0;var g=0;var n=0;for(var f=0;f<o.length;f++){var m=o.charAt(f);if(m=="\n"){if(b==0&&n==0){n=SLK.Text.Measure(" ",e).h}p=Math.max(p,b);g+=n;b=0;n=0;continue}if(m in d){b+=Number(d[m].w);n=Math.max(n,Number(d[m].h));continue}var k=m;switch(m){case"&":k="&amp;";break;case">":k="&gt;";break;case"<":k="&lt;";break;case" ":k="&nbsp;";break;default:break}if(SLK.Text._NeedsBrokenLetterSpacingHack(e)){k=k+"a"}SLK.Text._element.SetContent(k);var j=SLK.Text._element.GetSize();if(SLK.Text._NeedsBrokenLetterSpacingHack(e)){j.w-=a.w}d[m]={w:j.w,h:j.h};b+=j.w;n=Math.max(n,j.h)}p=Math.max(p,b);g+=n;SLK.Text._element.SetStyle("display","none");SLK.Text._s_widths[(q+o)]={w:p,h:g};return{w:p,h:g}};SLK.Text.MeasureChar=function(i,e){var d=e.Hash();if(d.length==0){d="default"}if(!(d in SLK.Text._c_widths)){SLK.Text._c_widths[d]={}}var b=SLK.Text._c_widths[d];if(i=="\n"){return{w:0,h:0}}if(i in b){return{w:Number(b[i].w),h:Number(b[i].h)}}var g;if(SLK.Text._NeedsBrokenLetterSpacingHack(e)){var h=e.Copy();h.SetStyle("letter-spacing","normal");g=SLK.Text.MeasureChar("a",h);delete h}if(!SLK.Text._element){SLK.Text._InitMeasure()}e.SetStyleOnElement(SLK.Text._element);SLK.Text._element.SetStyle("display","inline");var f=i;switch(i){case"&":f="&amp;";break;case">":f="&gt;";break;case"<":f="&lt;";break;case" ":f="&nbsp;";break;default:break}if(SLK.Text._NeedsBrokenLetterSpacingHack(e)){f=f+"a"}SLK.Text._element.SetContent(f);var a=SLK.Text._element.GetSize();if(SLK.Text._NeedsBrokenLetterSpacingHack(e)){a.w-=g.w}b[i]={w:a.w,h:a.h};SLK.Text._element.SetStyle("display","none");return{w:a.w,h:a.h}};SLK.Text.GetAverageCharSize=function(a){var b=SLK.Text.Measure("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",a);b.w=b.w/62;return b};SLK.Text.Wrap=function(a,e,c,d,b){if(d==SLK.WrapMode.WORD){return SLK.Text.WrapWord(a,e,c,b)}else{if(d==SLK.WrapMode.CHAR){return SLK.Text.WrapChar(a,e,c,b)}}return SLK.Text.WrapWord(a,e,c,b)};SLK.Text.WrapWord=function(p,n,b,k){var h=n.split(" ");var o=SLK.Text.MeasureChar(" ",b);var f="";var a=(k===undefined)?0:k;for(var g=0;g<h.length;g++){var d=h[g];var m=SLK.Text.Measure(d,b);if(g!=0){f+=" ";a+=o.w}if(a+m.w<p){f+=d;a+=m.w}else{if(m.w>p){var c=SLK.Text.WrapChar(p,d,b,a);if(a>0){f+="\n"}f+=c;var e=c.split("\n");var l=e[e.length-1];var j=SLK.Text.Measure(l,b);a=j.w}else{f+="\n";f+=d;a=m.w}}}return f};SLK.Text.WrapChar=function(n,m,b,h){var d=[];var a=(h===undefined)?0:h;for(var f=0;f<m.length;f++){var l=m.charAt(f);var k=SLK.Text.MeasureChar(l,b);if(k.w+a<n){a+=k.w}else{a=k.w;d.push(f)}}d.reverse();for(var e=0;e<d.length;e++){var g=d[e];m=m.slice(0,g)+"\n"+m.slice(g)}return m};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.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)};SEK.__Doc__=function(){SEK.Element.Wrapper.apply(this,[SEK.doc]);var a=null;this.__GetScreenSize=function(){var d=this.GetAttribute("documentElement");if(d&&d.clientHeight){return{w:d.clientWidth,h:d.clientHeight}}var c=this.GetAttribute("body");if(c){return{w:c.clientWidth,h:c.clientHeight}}return{w:-1,h:-1}};this.__GetScreenOffset=function(){var d=this.GetAttribute("documentElement");if(d&&d.scrollLeft!==undefined){return{x:d.scrollLeft,y:d.scrollTop}}var c=this.GetAttribute("body");if(c&&c.scrollLeft!==undefined){return{x:c.scrollLeft,y:c.scrollTop}}return{x:0,y:0}};this.Body=function(){if(a==null){a=new SEK.Element.Wrapper(this.dom_elmt.body)}return a};this.GetId=function(c){var b=SEK.doc.getElementById(c);if(!b){return null}return new SEK.Element.Wrapper(b)};this.GetSize=function(){var d={w:0,h:0};var f;if(SEK.doc.width){f=SEK.doc.width}else{if(SEK.doc.body&&SEK.doc.body.offsetWidth){f=SEK.doc.body.offsetWidth}else{if(SEK.doc.documentElement&&SEK.doc.documentElement.offsetWidth){f=SEK.doc.documentElement.offsetWidth}else{f=0}}}var e;if(SEK.doc.height){e=SEK.doc.height}else{if(SEK.doc.body&&SEK.doc.body.offsetHeight){e=SEK.doc.body.offsetHeight}else{if(SEK.doc.documentElement&&SEK.doc.documentElement.offsetHeight){e=SEK.doc.documentElement.offsetHeight}else{e=0}}}var c;if(SEK.doc.documentElement&&SEK.doc.documentElement.clientWidth){c=SEK.doc.documentElement.clientWidth}else{if(SEK.doc.body&&SEK.doc.body.clientWidth){c=SEK.doc.body.clientWidth}else{c=0}}var b;if(SEK.doc.body&&SEK.doc.body.clientHeight){b=SEK.doc.body.clientHeight}else{if(SEK.doc.documentElement&&SEK.doc.documentElement.clientHeight){b=SEK.doc.documentElement.clientHeight}else{b=0}}d.w=Math.max(c,f);d.h=Math.max(b,e);return d};this.ClearSelection=function(){if(SEK.doc.selection&&SEK.doc.selection.empty){SEK.doc.selection.empty()}else{if(SEK.win.getSelection){var b=SEK.win.getSelection();if(b&&b.removeAllRanges){b.removeAllRanges()}}}}};SEK.Doc=new SEK.__Doc__();SEK.Object=function(){var f=[];var a={};var b={};var c={};var d=1;this.CreateType=function(h){f.push(h);for(var g in this){if(this.hasOwnProperty(g)){if(typeof this[g]=="function"&&g.slice(0,3)!="Stk"&&g.slice(0,2)!="__"){this["Stk"+h+g]=this[g]}}}};this.GetType=function(){return f[f.length-1]};this.GetMRO=function(){return f};this.HasType=function(h){for(var g=0;g<f.length;g++){if(f[g]==h){return true}}return false};this.Name=function(){return this.GetData("__name__")};this.SetData=function(g,h){c[g]=h};this.GetData=function(g){return c[g]};this.RemoveData=function(g){delete c[g]};this.HasProperty=function(g){return g in b};this.RegisterProperty=function(i,g,h){if(b[i]!=undefined){SEK.Log.Error("Object.RegisterProperty: property with name %s is already registerd.",i);return}b[i]=new SEK.Object.Property(i,g,h)};this.CoerceProperty=function(g,h){var i=b[g];if(i==undefined){SEK.Log.Error("Object.CoerceProperty: this object has no property named: %s",g);return}i.value=h};this.SetProperty=function(h,j){var k=b[h];if(k==undefined){SEK.Log.Error("Object.SetProperty: this object has no property named: %s",h);return}if(k.value===j){return}var i=k.value;k.value=j;if(k.callback){var g=k.callback(this,h,i,k.value);if(g===true){k.value=i}}this.Emit("property-changed",h)};this.SetProperties=function(h){for(var g in h){if(h.hasOwnProperty(g)){this.SetProperty(g,h[g])}}};this.GetProperty=function(g){var h=b[g];if(h==undefined){SEK.Log.Error("Object.GetProperty: this object has no property named: %s",g);return}return h.value};this.TouchProperties=function(){for(var g in b){if(b.hasOwnProperty(g)){this.SetProperty(g,this.GetProperty(g))}}};this.TouchProperty=function(g){var h=b[g];if(h==undefined){SEK.Log.Error("Object.TouchProperty: this object has no property named: %s",g);return}if(h.callback){h.callback(this,g,h.value,h.value)}};this.Register=function(g){if(g in a){return}a[g]=[]};this.Unregister=function(g){this.DisconnectAll(g);delete a[g]};this.Emit=function(k){if(!(k in a)){SEK.Log.Error("StkObject::Emit - on an unknown signal: "+k);return}if(a[k].length==0){return}var g=[this];var j;for(j=1;j<arguments.length;j++){g.push(arguments[j])}var h;for(j=0;j<a[k].length;j++){if(!(j in a[k])){continue}h=a[k][j].handler.apply(this,g)}return h};this.Connect=function(j,i,h){if(!(j in a)){SEK.Log.Error("StkObject::Connect - on an unknown signal: "+j);return false}var g=d++;a[j].push(new SEK.Object.Signal(g,i,h,0));a[j].sort(SEK.Object.Signal.Order);return g};this.ConnectFirst=function(j,i,h){if(!(j in a)){SEK.Log.Error("StkObject::ConnectFirst - on an unknown signal: "+j);return false}var g=d++;a[j].unshift(new SEK.Object.Signal(g,i,h,-1));a[j].sort(SEK.Object.Signal.Order);return g};this.ConnectLast=function(j,i,h){if(!(j in a)){SEK.Log.Error("StkObject::ConnectLast - on an unknown signal: "+j);return false}var g=d++;a[j].push(new SEK.Object.Signal(g,i,h,1));a[j].sort(SEK.Object.Signal.Order);return g};this.Disconnect=function(h){for(var g in a){for(var j in a[g]){if(a[g][j].id==h){delete a[g][j];return true}}}return false};this.DisconnectAll=function(g){if(!(g in a)){SEK.Log.Error("StkObject::DisconnectAll - on an unknown signal: "+g);return false}a[g]=[];return true};this.PrintSignals=function(){SEK.Log.Debug("Printing Signals for Object: %s / %s",this.Name(),this._type);for(var g in a){SEK.Log.Debug("    SID: %s",g);for(var h in a[g]){SEK.Log.Debug("        HID: %s",a[g][h].id)}}};var e="obj"+SEK.Object.last_id;SEK.Object.last_id+=1;this.SetData("__name__",String(e));this.Register("property-changed");this.CreateType("Object")};SEK.Object.last_id=1;SEK.Object.Signal=function(d,c,b,a){this.id=d;this.handler=c;this.userdata=b;this.position=Number(a)};SEK.Object.Signal.Order=function(d,c){return d.position-c.position};SEK.Object.Property=function(c,a,b){this.key=c;this.value=a;this.callback=b};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")};SEK.Animator={};SEK.Animator.Base=function(b,a){SEK.Object.apply(this);this.RegisterProperty("callback",b);this.RegisterProperty("interval",SEK.Animator.Base.ClassStyles.interval);this.RegisterProperty("value",a);this.RegisterProperty("active",false,SEK.Delegate(this,"OnActiveChanged"));this.RegisterProperty("start-time",1);this.Register("done");this.OnActiveChanged=function(e,g,d,c){if(d==c){return}var f;if(c){f=SEK.Timer.StartRepeating(SEK.Delegate(this,"OnTimeout"),this.GetProperty("interval"));this.SetData("__id__",f);this.SetProperty("start-time",SEK.Timer.GetTime())}else{this.SetProperty("start-time",-1);f=this.GetData("__id__");SEK.Timer.StopRepeating(f);this.Emit("done")}};this.OnTimeout=function(){this.Update();this.Trigger()};this.Start=function(){this.SetProperty("active",true)};this.Stop=function(){this.SetProperty("active",false);this.Emit("done")};this.Update=function(){};this.Trigger=function(){var c=this.GetProperty("callback");if(c){c(this.GetValue())}};this.GetValue=function(){return this.GetProperty("value")};this.SetValue=function(c){this.SetProperty("value",c);this.Trigger()};this.CreateType("AnimatorBase")};SEK.Animator.Base.ClassStyles={interval:0.05};SEK.Animator.Vec3=function(c,a,b){SEK.Animator.Base.apply(this,[c]);this.RegisterProperty("start",[0,0,0]);this.RegisterProperty("target",[0,0,0]);this.RegisterProperty("base-rate",b);this.RegisterProperty("rate",1);this.MoveTo=function(e,d){this.Stop();this.SetProperty("start",this.GetProperty("value"));this.SetProperty("target",e);if(!d){d=this.GetProperty("base-rate")}this.SetProperty("rate",d);this.Start()};this._sub=function(e,d){return[e[0]-d[0],e[1]-d[1],e[2]-d[2]]};this._dot=function(e,d){return e[0]*d[0]+e[1]*d[1]+e[2]*d[2]};this._len=function(d){return Math.sqrt(this._dot(d,d))};this._scale=function(d,e){return[d[0]*e,d[1]*e,d[2]*e]};this._add=function(e,d){return[e[0]+d[0],e[1]+d[1],e[2]+d[2]]};this._unitize=function(d){var e=1/this._len(d);return[d[0]*e,d[1]*e,d[2]*e]};this.Update=function(){var d=this.GetProperty("start");var j=this.GetProperty("target");var k=this.GetProperty("rate");var l=this.GetProperty("value");var e=k*this.GetProperty("interval");var i=this._len(this._sub(j,l));if(e>=i){this.SetProperty("value",j);this.Stop();return}var g=this._sub(j,d);var f=this._unitize(g);var h=this._scale(f,e);var m=this._add(l,h);this.SetProperty("value",m)};if(!a){a=[0,0,0]}this.SetProperty("value",a)};SEK.Animator.Sin=function(c,b){SEK.Animator.Base.apply(this,[c,0]);var a=false;this.RegisterProperty("period",1);this.Update=function(){var d=(2*Math.PI)/parseFloat(this.GetProperty("period"));var f=SEK.Timer.GetTime()-this.GetProperty("start-time");var e=Math.sin(d*f);if(a){var g=this.GetProperty("value");if((g<0&&e>=0)||(g>0&&e<=0)){this.SetProperty("value",0);this.Stop();a=false}}this.SetProperty("value",e)};this.Start=function(){a=false;this.StkAnimatorBaseStart()};this.Finish=function(){a=true};this.SetProperty("value",0);if(b){this.SetProperty("period",b)}};SEK.Color={};SEK.Color.FromString=function(b){if(!b){return[1,0,1]}var a=[];var c=parseInt(b.replace("#","0x"));a.push((c>>16)/255);a.push(((c>>8)&255)/255);a.push((c&255)/255);return a};SEK.Color.ToString=function(a){return"#"+SEK.Color.ComponentToString(a[0])+SEK.Color.ComponentToString(a[1])+SEK.Color.ComponentToString(a[2])};SEK.Color.ComponentToString=function(a){var d=Math.min(1,Math.max(0,a));var b=Math.round(255*d).toString(16);if(b.length==1){b="0"+b}return b};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}};SLK.TextLayout=function(b,a){this._regions=[];this.Describe=function(){var c="";for(var d=0;d<this._regions.length;d++){c+="Region: "+this._regions[d].GetText()+"\n";c+=this._regions[d].Describe()}return c};this.GetText=function(){var c=[];for(var d=0;d<this._regions.length;d++){c.push(this._regions[d].GetText())}return c.join("")};this.GetMarkup=function(){var d=[];var c=[];for(var g=0;g<this._regions.length;g++){var l=this._regions[g];if(l.GetText().indexOf("\n")==-1){c.push(l.GetMarkup())}else{var k=l.GetText().split("\n");for(var f=0;f<k.length;f++){var h=k[f];if(h==""){d.push(c.join(""));c=[];continue}var e=["<span ",l.GetStyle().GetStyleForMarkup(),">",SEK.String.EscapeHtml(h),"</span>"].join("");c.push(e);if(f!=(k.length-1)){d.push(c.join(""));c=[]}}}}d.push(c.join(""));return d.join("<br/>")};this.SetMarkup=function(d,c){delete this._regions;var f=new SEK.Element.Span();f.SetContent(d);f.SetStyle("position","absolute");f.SetStyle("visibility","hidden");if(c){c.SetStyleOnElement(f)}SEK.Doc.Body().Add(f);this._regions=this._LinearizeRegions(f.dom_elmt);f.Destroy();delete f};this.Measure=function(){var l=0;var g=0;var c=0;var k=0;for(var f=0;f<this._regions.length;f++){if(this._regions[f].GetText().indexOf("\n")==-1){var m=this._regions[f].Measure();c+=m.w;k=Math.max(k,m.h)}else{var d=this._regions[f].GetText().split("\n");for(var e=0;e<d.length;e++){var n=d[e];if(n==""){n="\n"}var m=SLK.Text.Measure(n,this._regions[f].GetStyle());c+=m.w;k=Math.max(k,m.h);if(e!=(d.length-1)){l=Math.max(l,c);g+=k;c=0;k=0}}}}l=Math.max(l,c);g+=k;return{w:l,h:g}};this.GetMarkupEllipsized=function(c,d){if(d==SLK.EllipsizeMode.END){return this.GetMarkupEllipsizedEnd(c)}return this.GetMarkupEllipsizedEnd(c)};this.GetMarkupEllipsizedEnd=function(e){if(isNaN(e)||e===undefined){return this.GetMarkup()}var d=0;var o=[];var p=[];for(var h=0;h<this._regions.length;h++){if(this._regions[h].GetText().indexOf("\n")==-1){var k=this._regions[h].Measure();if(d+k.w<e){d+=k.w;o.push(this._regions[h].GetMarkup())}else{var c=e-d;if(c>0){o.push(this._regions[h].GetMarkupEllipsized(c,SLK.EllipsizeMode.END));d+=c}}}else{var g=this._regions[h].GetText().split("\n");for(var f=0;f<g.length;f++){var n=g[f];if(n==""){p.push(o.join(""));o=[];d=0;continue}var k=SLK.Text.Measure(n,this._regions[h].GetStyle());if(d+k.w<e){var m=["<span ",this._regions[h].GetStyle().GetStyleForMarkup(),">",SEK.String.EscapeHtml(n),"</span>"].join("");o.push(m);d+=k.w}else{var c=e-d;if(c>0){var l=SLK.Text.Ellipsize(c,n,this._regions[h].GetStyle(),SLK.EllipsizeMode.END);var m=["<span ",this._regions[h].GetStyle().GetStyleForMarkup(),">",SEK.String.EscapeHtml(l),"</span>"].join("");o.push(m);d+=c}}if(f!=(g.length-1)){p.push(o.join(""));o=[];d=0}}}}p.push(o.join(""));return p.join("<br/>")};this.GetMarkupWrapped=function(d,g){if(!d||isNaN(d)){return this.GetMarkup()}var e="";var c=0;for(var f=0;f<this._regions.length;f++){var l=this._regions[f];var k=l.Measure();if(c+k.w<d){e+=l.GetMarkup();c+=k.w}else{var h={};var j=l.GetMarkupWrapped(d,g,c,h);c=h.w;e+=j}}return e};this._LinearizeRegions=function(g){var h=[];for(var c in g.childNodes){if(g.childNodes[c].nodeType==3){var f=new SLK.TextRegion(g.childNodes[c],g);h.push(f)}else{if(g.childNodes[c].nodeType==1){var d=this._LinearizeRegions(g.childNodes[c]);h=h.concat(d)}}}return h};this.SetMarkup(b,a)};SLK.TextStyle=function(a){this._cached_hash=null;this._styles=null;this.Reset=function(){this._styles={};for(var b in SLK.TextStyle.style_defaults){this._styles[b]=SLK.TextStyle.style_defaults[b]}};this.Copy=function(){var c=new SLK.TextStyle();for(var b in this._styles){if(this._styles.hasOwnProperty(b)){c._styles[b]=this._styles[b]}}if(this._cached_hash){c._cached_hash=new String(this._cached_hash)}return c};this._FilterOperaFontFamily=function(b){b=b.replace(/["]/g,"");b=b.replace(/\[.*\]/g,"");b=b.replace(/\s/g,"");b=b.toLowerCase();return b};this.LoadFromElement=function(f){if(!f||typeof f!="object"){SEK.Log.Error("SLK::TextStyle::LoadFromElement - expected element of type object");return}var j=SEK.UserAgent.IsOpera();var g={};try{if(SEK.doc.defaultView&&SEK.doc.defaultView.getComputedStyle){var d=SEK.doc.defaultView.getComputedStyle(f,null);if(d){for(var c in SLK.TextStyle.style_properties){g[c]=d.getPropertyValue(c);if(j&&c=="font-family"){g[c]=this._FilterOperaFontFamily(g[c])}}}}else{if(f.currentStyle){for(var c in SLK.TextStyle.style_properties){var b=SLK.TextStyle.style_properties[c];var h=String(f.currentStyle[b]);if(h!="undefined"){g[c]=h}else{g[c]=this._styles[c]}}}}}catch(i){SEK.Log.Error("Excepted when loading Styles From element: %s",i)}for(var c in SLK.TextStyle.style_defaults){this._styles[c]=g[c]}return g};this.LoadFromStyles=function(c){for(var b in SLK.TextStyle.style_properties){this.SetStyle(b,c.GetStyleProperty(b))}};this.Hash=function(){if(this._cached_hash){return this._cached_hash}var c=[];for(var b in this._styles){c=c.concat(this._styles[b])}this._cached_hash=c.join("");return this._cached_hash};this.GetStyleForMarkup=function(){var c=['style="'];for(var b in this._styles){if(this._styles[b]&&this._styles[b].length>0){c=c.concat(b,":",this._styles[b],";")}}c=c.concat('"');return c.join("")};this.SetStyleOnElement=function(d){for(var c in this._styles){if(this._styles.hasOwnProperty(c)){if(d.SetStyleCSS){d.SetStyleCSS(c,this._styles[c])}else{var b=SLK.TextStyle.style_properties[c];d.style[b]=this._styles[c]}}}};this.SetStyle=function(b,c){this._styles[b]=c;this._cached_hash=null};this.GetStyle=function(b){return this._styles[b]};this.GetStyles=function(){return this._styles};this.Reset();if(a){this.LoadFromElement(a)}};SLK.TextStyle.style_defaults={"font-family":"","font-size":"","font-size-adjust":"","font-stretch":"","font-style":"","font-variant":"","font-weight":"",color:"",direction:"","line-height":"","letter-spacing":"","text-decoration":"","text-shadow":"","text-transform":"","unicode-bidi":"","word-spacing":""};SLK.TextStyle.style_properties={"font-family":"fontFamily","font-size":"fontSize","font-size-adjust":"fontSizeAdjust","font-stretch":"fontStretch","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight",color:"color",direction:"direction","line-height":"lineHeight","letter-spacing":"letterSpacing","text-decoration":"textDecoration","text-shadow":"textShadow","text-transform":"textTransform","unicode-bidi":"unicodeBidi","word-spacing":"wordSpacing"};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"};if(window.Saki!=undefined){SEK.Log=Saki.Log}else{SEK.Log={handlers:{},channel:{critical:{type:"page",target:"body"},error:{type:"page",target:"body"},warning:{type:"page",target:"body"},notice:{type:"page",target:"body"},debug:{type:"page",target:"body"}},AddMessageHandler:function(b,c){var a=SEK.Log.handlers[b];SEK.Log.handlers[b]=c;return a},AddChannel:function(b,c,a){SEK.Log.channel[b]={type:c,target:a}},SetChannelHandler:function(b,c,a){SEK.Log.AddChannel(b,c,a)},SetTarget:function(d,b){SEK.Log.SetChannelHandler(d,"element",b);return;var e=SEK.Log.channel[d];if(!e){return}var a=e.target;e.target=b;return a},Msg:function(e,f){if(arguments.length>2){var d=[];for(var a=1;a<arguments.length;a++){d.push(arguments[a])}f=SEK.String.Format(d)}var g=SEK.Log.channel[e];if(!g){if(e!="error"){SEK.Log.Msg("error","ERROR: no channel for name '"+e+"'!")}return}var b=SEK.Log.handlers[g.type];if(typeof b!="function"){if(e!="error"){SEK.Log.Msg("error","ERROR: handle for name '"+g.type+"' is not a function!")}return}b(g.target,f)},Critical:function(a){SEK.Log.Msg("critical",SEK.String.Format(arguments))},Error:function(a){SEK.Log.Msg("error",SEK.String.Format(arguments))},Warning:function(a){SEK.Log.Msg("warning",SEK.String.Format(arguments))},Notice:function(a){SEK.Log.Msg("notice",SEK.String.Format(arguments))},Debug:function(a){SEK.Log.Msg("debug",SEK.String.Format(arguments))},_Format:function(c){var a=c[0];for(var b=1;b<c.length;b++){a=a.replace("%s",c[b])}return a},_SendNull:function(b,a){},_SendAlert:function(b,a){window.alert(a)},_SendTag:function(d,c){var b=document.getElementsByTagName(d);if(!b||b.length<1){return}var a=b[0];if(!a){return}a.appendChild(document.createTextNode(c));a.appendChild(document.createElement("br"))},_SendElement:function(c,b){var a=document.getElementById(c);if(!a){return}a.appendChild(document.createTextNode(b));a.appendChild(document.createElement("br"))}};SEK.Log.AddMessageHandler("null",SEK.Log._SendNull);SEK.Log.AddMessageHandler("alert",SEK.Log._SendAlert);SEK.Log.AddMessageHandler("page",SEK.Log._SendTag);SEK.Log.AddMessageHandler("element",SEK.Log._SendElement)}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.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.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.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)}};
