/*
* freeradio_spip-min.js
* franck ruzzin
* le 10 mai 2011
*/

m_freeradio_swfUrl="swf/freeradio.1.0.swf";		//Chemin et nom vers le fichier swf "freeradio.swf"
m_express_swfUrl="swf/expressInstall.swf";		//Chemin et nom vers le fichier swf "expressInstall.swf"

freeRadio={radioArray:new Array(),embedRadio:function(a,c,b){loc_freeradio_swfUrl=freeradioRoot+m_freeradio_swfUrl;loc_express_swfUrl=freeradioRoot+m_express_swfUrl;myRadio=new Object;myRadio.isReady=false;myRadio.onVolumeChange_cb=a.onVolumeChange;myRadio.onPanChange_cb=a.onPanChange;myRadio.onStop_cb=a.onStop;myRadio.onPlay_cb=a.onPlay;if(typeof myRadio.onVolumeChange_cb!="function"&&typeof onVolumeChange=="function"){myRadio.onVolumeChange_cb=onVolumeChange}if(typeof myRadio.onPanChange_cb!="function"&&typeof onPanChange=="function"){myRadio.onPanChange_cb=onPanChange}if(typeof myRadio.onStop_cb!="function"&&typeof onStop=="function"){myRadio.onStop_cb=onStop}if(typeof myRadio.onPlay_cb!="function"&&typeof onPlay=="function"){myRadio.onPlay_cb=onPlay}this.radioArray[b.altContentId]=myRadio;c.menu="false";c.scale="noScale";c.allowScriptAccess="always";if(b.style){suffix=" "+b.style}else{suffix=""}b.styleclass="freeRadio"+suffix;b.name=b.altContentId;swfobject.embedSWF(loc_freeradio_swfUrl,b.altContentId,"118px","70px","10.0.0",loc_express_swfUrl,a,c,b,freeRadio.onEmbedded)},isReady:function(a){return this.radioArray[a].isReady},theMovie:function(a){if(navigator.appName.indexOf("Microsoft")!=-1){return window[a]}else{return document[a]}},onEmbedded:function(a){if(a.success){freeRadio.radioArray[a.ref.name].isReady=true}},play:function(a){this.theMovie(a).play()},stop:function(a){this.theMovie(a).stop()},isPlaying:function(a){return this.theMovie(a).isPlaying()},getVolume:function(a){return this.theMovie(a).getVolume()},setVolume:function(a,b){this.theMovie(a).setVolume(b)},getPan:function(a){return this.theMovie(a).getPan()},setPan:function(a,b){this.theMovie(a).setPan(b)},getRadioUrl:function(a){return this.theMovie(a).getRadioUrl()},setRadioUrl:function(b,a){this.theMovie(b).setRadioUrl(a)},onVolumeChange:function(a,b){if(typeof this.radioArray[a].onVolumeChange_cb=="function"){this.callFunction(this.radioArray[a].onVolumeChange_cb,a,b)}},onPanChange:function(b,a){if(typeof this.radioArray[b].onPanChange_cb=="function"){this.callFunction(this.radioArray[b].onPanChange_cb,b,a)}},onStop:function(a){if(typeof this.radioArray[a].onStop_cb=="function"){this.callFunction(this.radioArray[a].onStop_cb,a)}},onPlay:function(a){if(typeof this.radioArray[a].onPlay_cb=="function"){this.callFunction(this.radioArray[a].onPlay_cb,a)}},callFunction:function(e,d,c){if((e!=undefined)&&(typeof e=="function")){e(d,c)}}};
