﻿Type.registerNamespace("Sys.Preview.UI.Xaml");Sys.Preview.UI.Xaml.scriptVersion="1.0.070716.0";Sys.Preview.UI.Xaml.ScaleMode=function(){throw Error.notImplemented()};Sys.Preview.UI.Xaml.ScaleMode.prototype={none:0,zoom:1,stretch:2};Sys.Preview.UI.Xaml.ScaleMode.registerEnum("Sys.Preview.UI.Xaml.ScaleMode");Sys.Preview.UI.Xaml.ErrorEventArgs=function(a){this._xamlError=a;Sys.Preview.UI.Xaml.ErrorEventArgs.initializeBase(this)};Sys.Preview.UI.Xaml.ErrorEventArgs.prototype={_xamlError:null,get_error:function(){return this._xamlError}};Sys.Preview.UI.Xaml.ErrorEventArgs.registerClass("Sys.Preview.UI.Xaml.ErrorEventArgs",Sys.CancelEventArgs);Sys.Preview.UI.Xaml.Control=function(a){Sys.Preview.UI.Xaml.Control.initializeBase(this,[a])};Sys.Preview.UI.Xaml.Control.prototype={_minimumVersion:"1.0",_xamlSource:null,_xamlInitialized:false,_scaleMode:Sys.Preview.UI.Xaml.ScaleMode.none,_resizeDelegate:null,_boundEvents:null,add_xamlError:function(a){this.get_events().addHandler("xamlError",a)},remove_xamlError:function(a){this.get_events().removeHandler("xamlError",a)},add_resize:function(a){this.get_events().addHandler("resize",a)},remove_resize:function(a){this.get_events().removeHandler("resize",a)},add_xamlInitialized:function(a){this.get_events().addHandler("xamlInitialized",a)},remove_xamlInitialized:function(a){this.get_events().removeHandler("xamlInitialized",a)},get_scaleMode:function(){return this._scaleMode},set_scaleMode:function(a){this._scaleMode=a;if(this._xamlInitialized&&a!==Sys.Preview.UI.Xaml.ScaleMode.none)this._ensureTransform()},get_minimumSilverlightVersion:function(){return this._minimumVersion||""},set_minimumSilverlightVersion:function(a){this._minimumVersion=a},get_xamlSource:function(){return this._xamlSource||""},set_xamlSource:function(a){this._xamlSource=a},addEventListener:function(b,a,d){if(!this._boundEvents)this._boundEvents=[];var c=b.addEventListener(a,d);this._boundEvents[this._boundEvents.length]={element:b,eventName:a,token:c};return c},addEventListeners:function(f,d,c){var e={};for(var a in d){var b=d[a];if(c)b=Function.createDelegate(c,b);e[a]=this.addEventListener(f,a,b)}return e},dispose:function(){var a=this.get_element();if(a){if(this._resizeDelegate){a.content.onResize=null;this._resizeDelegate=null}a.OnLoad=null;a.OnError=null}if(this._xamlInitialized){this.xamlDispose();this._xamlInitialized=false}if(this._boundEvents){for(var c=0,d=this._boundEvents.length;c<d;c++){var b=this._boundEvents[c];b.element.removeEventListener(b.eventName,b.token)}this._boundEvents=null}Sys.Preview.UI.Xaml.Control.callBaseMethod(this,"dispose")},initialize:function(){Sys.Preview.UI.Xaml.Control.callBaseMethod(this,"initialize");if(Sys.Preview.UI.Xaml.Control._ensureVersion(this)){var a=this.get_element();a.OnError=Function.createDelegate(this,this._xamlError);var b=this.get_xamlSource();if(b&&(typeof a.Source==="undefined"||a.Source!==b)){a.OnLoad=Function.createDelegate(this,this._xamlLoaded);a.Source=b}else this._raiseXamlInitialize()}},onResize:function(){},onXamlError:function(){},xamlDispose:function(){},xamlInitialize:function(){},_ensureTransform:function(){var b=this.get_element().content.root,a=Sys.Preview.UI.Xaml.Control._computeScale(b),c,d;if(this.get_scaleMode()===Sys.Preview.UI.Xaml.ScaleMode.zoom)c=d=Math.min(a.horizontal,a.vertical);else{c=a.horizontal;d=a.vertical}Sys.Preview.UI.Xaml.Control._ensureScale(b,c,d);if(!this._resizeDelegate){this._resizeDelegate=Function.createDelegate(this,this._onResize);b.getHost().content.onResize=this._resizeDelegate}},_onResize:function(){var c=this.get_element();if(c&&this.get_scaleMode()!==Sys.Preview.UI.Xaml.ScaleMode.none){this._ensureTransform();var b=Sys.EventArgs.Empty;this.onResize(b);var a=this.get_events().getHandler("resize");if(a)a(this,b)}},_raiseXamlError:function(c,a){this.onXamlError(a);if(!a.get_cancel()){var b=this.get_events().getHandler("xamlError");if(b)b(this,a)}},_raiseXamlInitialize:function(){if(this.get_scaleMode()!==Sys.Preview.UI.Xaml.ScaleMode.none)this._ensureTransform();this._xamlInitialized=true;this.xamlInitialize();var a=this.get_events().getHandler("xamlInitialized");if(a)a(this,Sys.EventArgs.Empty)},_xamlError:function(b,c){var a=this.get_element();if(a)this._raiseXamlError(b,new Sys.Preview.UI.Xaml.ErrorEventArgs(c))},_xamlLoaded:function(){var a=this.get_element();if(a){a.OnLoad=null;this._raiseXamlInitialize()}}};Sys.Preview.UI.Xaml.Control._computeScale=function(a){var c=a.width,b=a.height,d=a.getHost(),e=c?d.content.ActualWidth/c:0,f=b?d.content.ActualHeight/b:0;return {horizontal:e,vertical:f}};Sys.Preview.UI.Xaml.Control._ensureScale=function(b,c,d){var a=b.RenderTransform;if(!a)b.RenderTransform=a=b.getHost().content.createFromXaml('<ScaleTransform ScaleX="1" ScaleY="1"/>');a.ScaleX=c;a.ScaleY=d};Sys.Preview.UI.Xaml.Control.registerClass("Sys.Preview.UI.Xaml.Control",Sys.UI.Control);Sys.Preview.UI.Xaml.Control._ensureVersion=function(a){if(!Sys.Preview.UI.Xaml.Control._isMinimumVersion(a)){Sys.Preview.UI.Xaml.Control._showInstallPrompt(a);return false}else return true};Sys.Preview.UI.Xaml.Control._baseFWLink="http://go.microsoft.com/fwlink/?LinkID=";Sys.Preview.UI.Xaml.Control._getFWLinksAlpha=function(b){b=b&&navigator.userAgent.indexOf("PPC Mac OS X")===-1;var a={image2:null,privacy:null,eula:null};a.image1=Sys.Preview.UI.Xaml.Control._installed?"94378":"92810";if(b){if(navigator.userAgent.indexOf("Windows NT")!==-1)a.install="92809";else if(navigator.userAgent.indexOf("Mac OS X")!==-1)a.install="92813"}else a.install="92821";var c=Sys.Preview.UI.Xaml.Control._baseFWLink;a.image1=c+a.image1;a.installHtml=Sys.Preview.UI.Xaml.Res.linkedInstallHtml;return a};Sys.Preview.UI.Xaml.Control._getFWLinks=function(e){var c=Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version>=6&&navigator.userAgent.indexOf("Win64")===-1&&navigator.userAgent.indexOf("Mac OS X")===-1||Sys.Browser.agent===Sys.Browser.Firefox&&Sys.Browser.version>=1.5||Sys.Browser.agent===Sys.Browser.Safari&&navigator.userAgent.indexOf("Windows NT")===-1,d=0;try{d=parseFloat(e)}catch(f){}if(d>=1.1)return Sys.Preview.UI.Xaml.Control._getFWLinksAlpha(c);var a={install:"92822",eula:"93481",privacy:"93483"};if(Sys.Preview.UI.Xaml.Control._installed){a.image1="94376";a.image2="94382"}else{a.image1="92802";a.image2="94381"}if(c)if(navigator.userAgent.indexOf("Windows NT")!==-1){a.install="92799";a.eula="92803";a.privacy="92805"}else if(navigator.userAgent.indexOf("PPC Mac OS X")!==-1){a.install="92807";a.eula="92815";a.privacy="92816"}else if(navigator.userAgent.indexOf("Intel Mac OS X")!==-1){a.install="92808";a.eula="92804";a.privacy="92806"}var b=Sys.Preview.UI.Xaml.Control._baseFWLink;a.image1=b+a.image1;a.image2=b+a.image2;a.eula=b+a.eula;a.privacy=b+a.privacy;a.installHtml=Sys.Preview.UI.Xaml.Res.inlineInstallHtml;return a};Sys.Preview.UI.Xaml.Control._isMinimumVersion=function(b){var a=b.get_minimumSilverlightVersion();if(!a)return true;var c=b.get_element();if(typeof c.IsVersionSupported!=="undefined"){Sys.Preview.UI.Xaml.Control._installed=true;return c.IsVersionSupported(a)}Sys.Preview.UI.Xaml.Control._installed=false;return false};Sys.Preview.UI.Xaml.Control._replacePlugin=function(d,a){var b=d.get_element(),c=Sys.UI.DomElement._getCurrentStyle(b);a.style.width=c.width;a.style.height=c.height;a.style.display="";var e=b.parentNode;e.insertBefore(a,b);e.removeChild(b);d._element=a};Sys.Preview.UI.Xaml.Control._followFWLink=function(a){window.top.location=Sys.Preview.UI.Xaml.Control._baseFWLink+a};Sys.Preview.UI.Xaml.Control._showInstallPrompt=function(c){var b=document.createElement("div"),a=Sys.Preview.UI.Xaml.Control._getFWLinks(c.get_minimumSilverlightVersion());b.innerHTML=String.format(a.installHtml,a.install,a.image1,a.eula,a.privacy,a.image2);var d=c.get_element();b.id=d.id;this._replacePlugin(c,b)};Type.registerNamespace('Sys.Preview.UI.Xaml');Sys.Preview.UI.Xaml.Res={"inlineInstallHtml":"\u003ctable border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"205px\"\u003e\u003ctr\u003e\u003ctd\u003e\u003cimg title=\"Get Microsoft Silverlight\" onclick=\"javascript:Sys.Preview.UI.Xaml.Control._followFWLink({0});\" style=\"border:0; cursor:pointer; display:block\" src=\"{1}\"/\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd style=\"background:#C7C7BD; text-align: center; color: black; font-family: Verdana; font-size: 9px; padding-bottom: 0.05cm; padding-top: 0.05cm\" \u003eBy clicking \u003cb\u003eGet Microsoft Silverlight\u003c/b\u003e you accept the \u003ca title=\"Silverlight License Agreement\" href=\"{2}\" target=\"_top\" style=\"text-decoration: underline; color: #36A6C6\"\u003e\u003cb\u003eSilverlight license agreement\u003c/b\u003e\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd style=\"border-left-style: solid; border-right-style: solid; border-width: 2px; border-color:#c7c7bd; background: #817d77; color: #FFFFFF; text-align: center; font-family: Verdana; font-size: 9px\"\u003eSilverlight updates automatically, \u003ca title=\"Silverlight Privacy Statement\" href=\"{3}\" target=\"_top\" style=\"text-decoration: underline; color: #36A6C6\"\u003e\u003cb\u003elearn more\u003c/b\u003e\u003c/a\u003e.\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cimg src=\"{4}\" alt=\"\" style=\"display:block\"/\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e","linkedInstallHtml":"\u003cdiv style=\"width: 205px; height: 67px; background-color: #FFFFFF\"\u003e\u003cimg onclick=\"javascript:Sys.Preview.UI.Xaml.Control._followFWLink({0});\" style=\"border:0; cursor:pointer;display:block\" src=\"{1}\" alt=\"Get Microsoft Silverlight\"/\u003e\u003c/div\u003e"};if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();