﻿// Copyright © 2008 Vertigo Software, Inc. All rights reserved.

if(!window.Silverlight){window.Silverlight={}}Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot='http://go2.microsoft.com/fwlink/?LinkID=';Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};Silverlight.isInstalled=function(a){if(a==undefined)a=null;var b=false;var c=null;try{var d=null;var f=false;if(window.ActiveXObject){try{d=new ActiveXObject('AgControl.AgControl');if(a===null){b=true}else if(d.IsVersionSupported(a)){b=true}d=null}catch(e){f=true}}else{f=true}if(f){var g=navigator.plugins["Silverlight Plug-In"];if(g){if(a===null){b=true}else{var h=g.description;if(h==="1.0.30226.2")h="2.0.30226.2";var i=h.split(".");while(i.length>3){i.pop()}while(i.length<4){i.push(0)}var j=a.split(".");while(j.length>4){j.pop()}var k;var l;var m=0;do{k=parseInt(j[m]);l=parseInt(i[m]);m++}while(m<j.length&&k===l);if(k<=l&&!isNaN(k)){b=true}}}}}catch(e){b=false}if(c){document.body.removeChild(c)}return b};Silverlight.WaitForInstallCompletion=function(){if(!Silverlight.isBrowserRestartRequired&&Silverlight.onSilverlightInstalled){try{navigator.plugins.refresh()}catch(e){}if(Silverlight.isInstalled(null)&&!Silverlight.__onSilverlightInstalledCalled){Silverlight.onSilverlightInstalled();Silverlight.__onSilverlightInstalledCalled=true}else{setTimeout(Silverlight.WaitForInstallCompletion,3000)}}};Silverlight.__startup=function(){navigator.plugins.refresh();Silverlight.isBrowserRestartRequired=Silverlight.isInstalled(null);if(!Silverlight.isBrowserRestartRequired){Silverlight.WaitForInstallCompletion();if(!Silverlight.__installationEventFired){Silverlight.onInstallRequired();Silverlight.__installationEventFired=true}}else if(window.navigator.mimeTypes){var a=navigator.mimeTypes["application/x-silverlight-2"];var b=navigator.mimeTypes["application/x-silverlight-2-b2"];var c=navigator.mimeTypes["application/x-silverlight-2-b1"];var d=c;if(b)d=b;if(!a&&(c||b)){if(!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}}else if(a&&d){if(a.enabledPlugin&&d.enabledPlugin){if(a.enabledPlugin.description!=d.enabledPlugin.description){if(!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}}}}}if(!Silverlight.disableAutoStartup){if(window.removeEventListener){window.removeEventListener('load',Silverlight.__startup,false)}else{window.detachEvent('onload',Silverlight.__startup)}}};if(!Silverlight.disableAutoStartup){if(window.addEventListener){window.addEventListener('load',Silverlight.__startup,false)}else{window.attachEvent('onload',Silverlight.__startup)}}Silverlight.createObject=function(b,c,d,e,f,g,h){var i=new Object();var j=e;var k=f;i.version=j.version;j.source=b;i.alt=j.alt;if(g)j.initParams=g;if(j.isWindowless&&!j.windowless)j.windowless=j.isWindowless;if(j.framerate&&!j.maxFramerate)j.maxFramerate=j.framerate;if(d&&!j.id)j.id=d;delete j.ignoreBrowserVer;delete j.inplaceInstallPrompt;delete j.version;delete j.isWindowless;delete j.framerate;delete j.data;delete j.src;delete j.alt;if(Silverlight.isInstalled(i.version)){for(var l in k){if(k[l]){if(l=="onLoad"&&typeof k[l]=="function"&&k[l].length!=1){var m=k[l];k[l]=function(a){return m(document.getElementById(d),h,a)}}var n=Silverlight.__getHandlerName(k[l]);if(n!=null){j[l]=n;k[l]=null}else{throw"typeof events."+l+" must be 'function' or 'string'";}}}slPluginHTML=Silverlight.buildHTML(j)}else{slPluginHTML=Silverlight.buildPromptHTML(i)}if(c){c.innerHTML=slPluginHTML}else{return slPluginHTML}};Silverlight.buildHTML=function(a){var b=[];b.push('<object type=\"application/x-silverlight\" data="data:application/x-silverlight,"');if(a.id!=null){b.push(' id="'+a.id+'"')}if(a.width!=null){b.push(' width="'+a.width+'"')}if(a.height!=null){b.push(' height="'+a.height+'"')}b.push(' >');delete a.id;delete a.width;delete a.height;for(var c in a){if(a[c]){b.push('<param name="'+Silverlight.HtmlAttributeEncode(c)+'" value="'+Silverlight.HtmlAttributeEncode(a[c])+'" />')}}b.push('<\/object>');return b.join('')};Silverlight.createObjectEx=function(a){var b=a;var c=Silverlight.createObject(b.source,b.parentElement,b.id,b.properties,b.events,b.initParams,b.context);if(b.parentElement==null){return c}};Silverlight.buildPromptHTML=function(a){var b="";var c=Silverlight.fwlinkRoot;var d=a.version;if(a.alt){b=a.alt}else{if(!d){d=""}b="<a href='javascript:Silverlight.getSilverlight(\"{1}\");' style='text-decoration: none;'><img src='{2}' alt='Get Microsoft Silverlight' style='border-style: none'/></a>";b=b.replace('{1}',d);b=b.replace('{2}',c+'108181')}return b};Silverlight.getSilverlight=function(a){if(Silverlight.onGetSilverlight){Silverlight.onGetSilverlight()}var b="";var c=String(a).split(".");if(c.length>1){var d=parseInt(c[0]);if(isNaN(d)||d<2){b="1.0"}else{b=c[0]+'.'+c[1]}}var e="";if(b.match(/^\d+\056\d+$/)){e="&v="+b}Silverlight.followFWLink("114576"+e)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(a){var c;var b='';if(a==null){return null}for(var d=0;d<a.length;d++){c=a.charCodeAt(d);if(((c>96)&&(c<123))||((c>64)&&(c<91))||((c>43)&&(c<58)&&(c!=47))||(c==95)){b=b+String.fromCharCode(c)}else{b=b+'&#'+c+';'}}return b};Silverlight.default_error_handler=function(a,b){var c;var d=b.ErrorType;c=b.ErrorCode;var e="\nSilverlight error message     \n";e+="ErrorCode: "+c+"\n";e+="ErrorType: "+d+"       \n";e+="Message: "+b.ErrorMessage+"     \n";if(d=="ParserError"){e+="XamlFile: "+b.xamlFile+"     \n";e+="Line: "+b.lineNumber+"     \n";e+="Position: "+b.charPosition+"     \n"}else if(d=="RuntimeError"){if(b.lineNumber!=0){e+="Line: "+b.lineNumber+"     \n";e+="Position: "+b.charPosition+"     \n"}e+="MethodName: "+b.methodName+"     \n"}alert(e)};Silverlight.__cleanup=function(){for(var i=Silverlight._silverlightCount-1;i>=0;i--){window['__slEvent'+i]=null}Silverlight._silverlightCount=0;if(window.removeEventListener){window.removeEventListener('unload',Silverlight.__cleanup,false)}else{window.detachEvent('onunload',Silverlight.__cleanup)}};Silverlight.__getHandlerName=function(a){var b="";if(typeof a=="string"){b=a}else if(typeof a=="function"){if(Silverlight._silverlightCount==0){if(window.addEventListener){window.addEventListener('onunload',Silverlight.__cleanup,false)}else{window.attachEvent('onunload',Silverlight.__cleanup)}}var c=Silverlight._silverlightCount++;b="__slEvent"+c;window[b]=a}else{b=null}return b};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){alert("Please restart your browser and return to this page.")};Silverlight.onUpgradeRequired=function(){};Silverlight.onInstallRequired=function(){};Silverlight.IsVersionAvailableOnError=function(a,b){var c=false;try{if(b.ErrorCode==8001&&!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}else if(b.ErrorCode==8002&&!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}else if(b.ErrorCode==5014){if(Silverlight.__verifySilverlight2UpgradeSuccess(b.getHost())){c=true}}}catch(e){}return c};Silverlight.IsVersionAvailableOnLoad=function(a){var b=false;try{if(Silverlight.__verifySilverlight2UpgradeSuccess(a.getHost())){b=true}}catch(e){}return b};Silverlight.__verifySilverlight2UpgradeSuccess=function(a){var b=false;var c="2.0.31005";var d=null;try{if(a.IsVersionSupported(c+".99")){d=Silverlight.onRequiredVersionAvailable;b=true}else if(a.IsVersionSupported(c+".0")){d=Silverlight.onRestartRequired}else{d=Silverlight.onUpgradeRequired}if(d&&!Silverlight.__installationEventFired){d();Silverlight.__installationEventFired=true}}catch(e){}return b};Silverlight.supportedUserAgent=function(a,b){try{var c=null;if(b){c=b}else{c=window.navigator.userAgent}var d={OS:'Unsupported',Browser:'Unsupported'};if(c.indexOf('Windows NT')>=0||c.indexOf('Mozilla/4.0 (compatible; MSIE 6.0)')>=0){d.OS='Windows'}else if(c.indexOf('PPC Mac OS X')>=0){d.OS='MacPPC'}else if(c.indexOf('Intel Mac OS X')>=0){d.OS='MacIntel'}if(d.OS!='Unsupported'){if(c.indexOf('MSIE')>=0){if(navigator.userAgent.indexOf('Win64')==-1){if(parseInt(c.split('MSIE')[1])>=6){d.Browser='MSIE'}}}else if(c.indexOf('Firefox')>=0){var f=c.split('Firefox/')[1].split('.');var g=parseInt(f[0]);if(g>=2){d.Browser='Firefox'}else{var h=parseInt(f[1]);if((g==1)&&(h>=5)){d.Browser='Firefox'}}}else if(c.indexOf('Safari')>=0){d.Browser='Safari'}}var i=(!(d.OS=='Unsupported'||d.Browser=='Unsupported'||(d.OS=='Windows'&&d.Browser=='Safari')||(d.OS.indexOf('Mac')>=0&&d.Browser=='MSIE')));if(a=='2.0'){return(i&&(d.OS!='MacPPC'))}else if(a=='1.0'){return(i&&(c.indexOf('Windows NT 5.0')<0))}else{return(i)}}catch(e){return false}};Silverlight.check=function(a,b,c){var d={};d.version=a||"1.0";d.isVersionSupported=Silverlight.supportedUserAgent(d.version.substring(0,1).concat(".0"));d.isVersionInstalled=Silverlight.isInstalled(d.version);d.isUpgradeRequired=!d.isVersionInstalled&&Silverlight.isInstalled(null);d.data=c;if(b)b(d);return d};