		var playon, playoff, loading;
	
		var images = [];
		function preloadImage(src) {
			var idx = images.length;
			images[idx] = new Image();
			images[idx].src = src;
		}
		var icons = [];
		icons['big'] = ['http://www.babyradio.pl/sound/pbot.gif',  'http://www.babyradio.pl/sound/pstop.gif','http://www.babyradio.pl/sound/pbuff.gif'];

	
		for(var i in icons) for(var j = 0; j < icons[i].length; j++) preloadImage(icons[i][j]);
	
		var isIE = navigator.appName == 'Microsoft Internet Explorer';
	
		var MP3File = '';
		var action = '';
		var activeImage = null;
		var activeType = null;
		
		function play(f,image) {
			type='big';
			if(!isInit) return;
			var flashObject = getFlashObject('MP3Player');
			if(!flashObject) return;
			


			if(!headPlayed) {
					fTarget = f;
					imageTarget = image;
					typeTarget = type;
					f = 'hok.mp3';
			}
			
			flashObject.SetVariable('_root.MP3File',f);
			action = f == MP3File ? action == 'play' && image == activeImage ? 'stop' : 'play' : 'play';
			
			if(action == 'play') {
				playoff = icons[type][0];
				playon = icons[type][1];
				loading = icons[type][2];
				document.images[image].src = loading;
			}

			if(activeImage && (action == 'stop' || image != activeImage)) document.images[activeImage].src = icons[activeType][0];
	
			playoff = icons[type][0];	
			flashObject.SetVariable('_root.action',action);
			MP3File = f;
			activeImage = image;
			activeType = type;
		}
	
		var minFlashVer	= 6;
		var swf = 'Shockwave Flash';
		var plugin = 0;
		if(navigator.mimeTypes && navigator.mimeTypes['application/x-shockwave-flash'] && navigator.mimeTypes['application/x-shockwave-flash'].enabledPlugin) {
			var pos = 0;
			if(navigator.plugins && navigator.plugins[swf]) pos = navigator.plugins[swf].description.indexOf(swf) + swf.length + 1;
			var swver = navigator.plugins[swf].description.substr(pos,1);
			if(swver >= minFlashVer) plugin = true;
		} else if(isIE && navigator.userAgent.indexOf('Windows') > -1) with(document) {
			write('<SCRIPT LANGUAGE=VBScript\> \n');
			write('on error resume next \n');
			write('if ( minFlashVer = 3 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
			write('if (( minFlashVer <= 4) and (plugin <= 0 )) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
			write('if (( minFlashVer <= 5) and (plugin <= 0 )) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
			write('if (( minFlashVer <= 6) and (plugin <= 0 )) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
			write('</SCR'+'IPT\> \n');
		}
	
		var autoplayFile = '';
		var autoplayFileKind = '';
		var isInit = false;

	
	
		function MP3Player_DoFSCommand(command, args) {
			if(command == 'loadingDone') {
				document.images[activeImage].src = playon;
			} else if(command == 'playingDone') {
				action = 'stop';
				document.images[activeImage].src = playoff;
				if (!headPlayed) {
					headPlayed = true;
					play(fTarget, imageTarget, typeTarget);
				}
			}
		}
	
		if(navigator.appName && navigator.appName.indexOf('Microsoft') != -1 && navigator.userAgent.indexOf('Windows') != -1 && navigator.userAgent.indexOf('Windows 3.1') == -1) with(document) {
			write('<SCRIPT LANGUAGE=VBScript\> \n');
			write('on error resume next \n');
			write('Sub MP3Player_FSCommand(ByVal command, ByVal args)\n');
			write('  call MP3Player_DoFSCommand(command, args)\n');
			write('end sub\n');
			write('</SCRIPT\> \n');
		}
	
		function getFlashObject(movieName) {
			return isIE ? window[movieName] : document[movieName] 
			}

			isInit = true;
			headPlayed = true;
			/*
			if(autoplayFile != '') {
				if(isIE) play(autoplayFile, 'autoplay_ringtone',autoplayFileKind);
				else setTimeout("play(autoplayFile,'autoplay_ringtone',autoplayFileKind)",100);
			}
		*/

