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.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};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.Rect=function(c,b,a){SEK.Animator.Base.apply(this,[c,0]);this.RegisterProperty("move-time",1);this.RegisterProperty("start-position",[0,0]);this.RegisterProperty("start-size",[0,0]);this.RegisterProperty("end-position",[0,0]);this.RegisterProperty("end-size",[0,0]);this.RegisterProperty("current-position",[0,0]);this.RegisterProperty("current-size",[0,0]);this.Update=function(){var e=this.GetProperty("start-position");var m=this.GetProperty("end-position");var l=this.GetProperty("start-size");var i=this.GetProperty("end-size");var d=this.GetProperty("start-time");var f=SEK.Timer.GetTime();var g=this.GetProperty("move-time");var j=(f-d)/g;this.SetProperty("value",j);if(j>1){this.SetProperty("current-position",m);this.SetProperty("current-size",i);this.Trigger();this.Stop();return}var h=[e[0]+(m[0]-e[0])*j,e[1]+(m[1]-e[1])*j];var k=[l[0]+(i[0]-l[0])*j,l[1]+(i[1]-l[1])*j];this.SetProperty("current-position",h);this.SetProperty("current-size",k)};this.Trigger=function(){var d=this.GetProperty("callback");if(d){d(this.GetProperty("current-position"),this.GetProperty("current-size"),this.GetProperty("value"))}};this.MoveTo=function(d,f,e){this.SetProperty("end-size",f);this.SetProperty("end-position",d);this.SetProperty("move-time",e);this.Start()};this.SetProperty("value",0);this.SetProperty("start-position",b);this.SetProperty("start-size",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.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.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};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.__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__();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)}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.StringEx={WordWrap:function(e,d){var b=new Array();var c;var a=0;var f=d;while(a<e.length){if(f>e.length){f=e.length}else{while((e.charAt(f)!=" ")&&(f>a)){f--}if(f==a){f=a+d}}b.push(e.substring(a,f));a=f;f=a+d}return b},HtmlWordWrap:function(e,d){var b="";var a=SEK.StringEx.WordWrap(e,d);for(var c in a){b+=SEK.String.EscapeHtml(a[c])+"<br/>\n"}return b},WordSplitNear:function(c,e){var b=new Array();var a=0;var d=e;if(d>c.length){d=c.length}else{while((c.charAt(d)!=" ")&&(d>a)){d--}if(d==a){d=a+e}}b.push(c.substring(a,d));b.push(c.substring(d,c.length));return b},HtmlWordSplitNear:function(d,e){var b="";var a=SEK.StringEx.WordSplitNear(d,e);for(var c in a){b+=SEK.String.EscapeHtml(a[c])+"<br/>\n"}return b},CanonicalSIUnits:function(a){if(typeof a==Number){return SEK.StringEx._CanonicalSIUnits31(a)}a=String(a);if(!/^\d+$/.test(a)){return"NaN bytes"}if(a.length<=9){return SEK.StringEx._CanonicalSIUnits31(Number(a))}return SEK.StringEx._CanonicalSIUnitsBig(a)},_CanonicalSIUnits31:function(a){var b=SEK.StringEx._CanonicalSIUnitsInner(a);return b[0]+" "+b[1]},_CanonicalSIUnitsBig:function(a){var e="B";var b=0;while(a.length>9){a=a.substr(0,a.length-3);b++}var c=Number(a);while(c>1024){c/=1024;b++}switch(b){default:e="B";break;case 0:e="B";break;case 1:e="KiB";break;case 2:e="MiB";break;case 3:e="GiB";break;case 4:e="TiB";break;case 5:e="PiB";break;case 6:e="EiB";break;case 7:e="ZiB";break;case 8:e="YiB";break}c=Math.round(c*100)/100;var d="";switch(String(c-Math.floor(c)).length){case 0:d="0.00";break;case 1:d=".00";break;case 2:d="00";break;case 3:d="0";break;default:d="";break}return String(c)+d+" "+e},_CanonicalSIUnitsInner:function(a){var c=Number(a);var e="B";var b=0;while(c>1024){c/=1024;b++}switch(b){default:e="B";break;case 0:e="B";break;case 1:e="KiB";break;case 2:e="MiB";break;case 3:e="GiB";break;case 4:e="TiB";break;case 5:e="PiB";break;case 6:e="EiB";break;case 7:e="ZiB";break;case 8:e="YiB";break}c=Math.round(c*100)/100;var d="";if(e!="B"){switch(String(c-Math.floor(c)).length){case 0:d="0.00";break;case 1:d=".00";break;case 2:d="00";break;case 3:d="0";break;default:d="";break}}return[String(c)+d,e]},guard:null};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.__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__();