var radio=$("#radioControl");var radioWidget={options:{onLoadSLFunction:function(b,a,c){radio.radio("option","slHost",c.getHost())},silverlightVersion:"3.0.40818.0",autostart:true,slHost:null,width:"100%",height:"50px",cssClass:"g_4",background:"white",SLAppPath:"/ClientBin/slAudioPlayer.php",debug:"false"},_isSilverlightPresent:function(){return typeof Silverlight!="undefined"&&Silverlight.isInstalled(this.options.silverlightVersion)},_Silverlight:function(a){return Silverlight.createObject(this.options.SLAppPath,null,null,{width:this.options.width,height:this.options.height,version:this.options.silverlightVersion,background:this.options.background,windowless:"true"},{onLoad:this.options.onLoadSLFunction,onError:function(c,b){var d="Silverlight Error: \n\n";d+="Error Type:    "+errorArgs.errorType+"\n";d+="Error Message: "+errorArgs.errorMessage+"\n";d+="Error Code:    "+errorArgs.errorCode+"\n";switch(errorArgs.errorType){case"RuntimeError":if(errorArgs.lineNumber!=0){d+="Line: "+errorArgs.lineNumber+"\n";d+="Position: "+errorArgs.charPosition+"\n"}d+="MethodName: "+errorArgs.methodName+"\n";break;case"ParserError":d+="Xaml File:      "+errorArgs.xamlFile+"\n";d+="Xml Element:    "+errorArgs.xmlElement+"\n";d+="Xml Attribute:  "+errorArgs.xmlAttribute+"\n";d+="Line:           "+errorArgs.lineNumber+"\n";d+="Position:       "+errorArgs.charPosition+"\n";break;default:break}alert(d)}},"Url="+a+",AutoPlay="+this.options.autostart+",Debug="+this.options.debug,null)},_isActivexPresent:function(){return !!window.ActiveXObject},_Activex:function(a){return'<object classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" name="MC1" class="'+this.options.cssClass+'" height="'+this.options.height+'" align="left" standby="Cargando los componentes de Windows Media Player..." id="MC1" bbclient="1"><param name="FileName" value="'+a+'"><param name="AutoStart" value="True"><param name="ShowStatusBar" value="True"><param name="ShowGotoBar" value="False"><param name="TransparentAtStart" value="True"><param name="ShowPositionControls" value="False"><param name="ShowTracker" value="False"></object>'},_isPluginPresent:function(){return navigator.plugins["Microsoft\u00AE Windows Media Player Firefox Plugin"]||navigator.plugins["Windows Media Player Plug-in 10 (compatible; Totem)"]},_Plugin:function(a){return'<object id="MC1" type="application/x-ms-wmp" data="'+a+'" class="'+this.options.cssClass+'" height="'+this.options.height+'" align="left><param name="autoStart" value="true"><param name="ShowPositionControls" value="False"></object>'},_Link:function(b){var a='<div align="left">Hacé <a id="linkArinfo" href="'+b+'">click aquí</a> para escuchar ArInfo</div>';if(navigator.userAgent.toLowerCase().indexOf("windows nt")>=0){a+="<div>podés bajarte el plugin para Windows Media Player de <a id='wmpLink' href='http://port25.technet.com/videos/downloads/wmpfirefoxplugin.exe'>este link</a></div>"}return a},display:function(a){var c=this.element;if(a==null){a=c.attr("data-url");if(a==null){a=c.attr("url")}}if(this._isSilverlightPresent()){c.html(this._Silverlight(a))}else{if(this._isActivexPresent()){c.html(this._Activex(a))}else{if(this._isPluginPresent()){c.html(this._Plugin(a))}else{var b="<div id='radioDialog'>"+this._Silverlight(a)+this._Link(a)+"</div>";c.html(b);$("#radioDialog").dialog({width:450,title:"Requerimientos de ArInfo",focus:function(d,e){doFlashyOrange($("#linkArinfo"),"click aquí");doFlashyOrange($("#wmpLink"),"este link")}})}}}},hasSLPlayer:function(){return this.options.slHost!=null&&this.options.slHost.Content!=null&&this.options.slHost.Content.player!=null},stop:function(){try{if(this._isSilverlightPresent()){if(this.hasSLPlayer()){this.options.slHost.Content.player.Stop()}}else{if(this._isActivexPresent()){MC1.stop()}else{if(this._isPluginPresent()){MC1.controls.stop()}}}}catch(a){alert("stop: "+a)}},start:function(){try{if(this._isSilverlightPresent()){if(this.hasSLPlayer()){this.options.slHost.Content.player.Play()}}else{if(this._isActivexPresent()){MC1.play()}else{if(this._isPluginPresent){MC1.controls.play()}}}}catch(a){alert("start: "+a)}}};$.widget("ui.radio",$.Widget,radioWidget);radio.radio();function onSilverlightError(c,a){var b="";if(c!=null&&c!=0){b=c.getHost().Source}var f=a.ErrorType;var d=a.ErrorCode;if(f=="ImageError"||f=="MediaError"){return}var e="Ocurrió un error en la aplicación Silverlight "+b+"\n";e+="Código: "+d+"    \n";e+="Categoría: "+f+"       \n";e+="Mensaje: "+a.ErrorMessage+"     \n";if(f=="ParserError"){e+="Archivo: "+a.xamlFile+"     \n";e+="Línea: "+a.lineNumber+"     \n";e+="Posición: "+a.charPosition+"     \n"}else{if(f=="RuntimeError"){if(a.lineNumber!=0){e+="Linea: "+a.lineNumber+"     \n";e+="Posicion: "+a.charPosition+"     \n"}e+="Nombre del método: "+a.methodName+"     \n"}}throw new Error(e)};
