﻿///////////////////////////////////////////////////////////////////////////////
//
//  SilverlightChecker.js
//
//  This file includes Silverlight.js and Silverlight.supportedUserAgent.js 
//  provided by Microsoft for Silverlight 2 Beta 2. Additionally, this file 
//  includes the Silverlight.check function and was minified using:
//  http://dean.edwards.name/packer/
// 
//  Copyright (c) 2008 Vertigo Software, Inc. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////

if(!window.Silverlight){window.Silverlight={}}
Silverlight._silverlightCount=0;
Silverlight.fwlinkRoot='http://go2.microsoft.com/fwlink/?LinkID=';
Silverlight.onGetSilverlight=null;
Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};
Silverlight.isInstalled=function(a){var b=false;var c=null;try{var d=null;try{d=new ActiveXObject('AgControl.AgControl');if(a==null){b=true}else if(d.IsVersionSupported(a)){b=true}d=null}catch(e){var f=navigator.plugins["Silverlight Plug-In"];if(f){if(a===null){b=true}else{var g=f.description;if(g==="1.0.30226.2")g="2.0.30226.2";var h=g.split(".");while(h.length>3){h.pop()}while(h.length<4){h.push(0)}var i=a.split(".");while(i.length>4){i.pop()}var j;var k;var l=0;do{j=parseInt(i[l]);k=parseInt(h[l]);l++}while(l<i.length&&j===k);if(j<=k&&!isNaN(j)){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.onSilverlightInstalled()}else{setTimeout(Silverlight.WaitForInstallCompletion,3000)}}};
Silverlight.__startup=function(){Silverlight.isBrowserRestartRequired=Silverlight.isInstalled(null);if(!Silverlight.isBrowserRestartRequired){Silverlight.WaitForInstallCompletion()}if(window.removeEventListener){window.removeEventListener('load',Silverlight.__startup,false)}else{window.detachEvent('onload',Silverlight.__startup)}};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.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){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=='IE')));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(!noSupport)}}catch(e){return false}};
Silverlight.check=function(a,b,c,d){try{var f=a||"1.0";var g=f.substring(0,1).concat(".0");if(Silverlight.isInstalled(f)){if(b)b({version:f,isSupported:Silverlight.supportedUserAgent(g),isInstalled:true,data:d});return true}else{if(c)c({version:f,isSupported:Silverlight.supportedUserAgent(g),isInstalled:Silverlight.isInstalled(null),data:d});return false}}catch(e){return false}};