		var sounds=new Array();
		var soundCount=0;
		
		function swapImages(vorl_id)
		{
			var theImg=document.getElementById("userpic");
			var sendFormvorlage=document.getElementById("vorlage_id_sendform");
			sendFormvorlage.value=vorl_id;
			var theApplet=document.getElementById("appl");
			theApplet.setVorlage(vorl_id);
		}
		
		function addPlayer(soundno)
		{			
			var name="player"+soundno;
			name="div"+name;
			swfobject.embedSWF("/media/flash/musicplayer_f6.swf?playlist_url=/media/sound/song"+soundno+".xspf&amp;repeat=true", name, "0", "0", "7"); 
			sounds[soundCount]=soundno;
			soundCount++;			
		}
		
		function play(soundno)
		{			
			stopAll();			
			var name="player"+soundno;
			var flashvars = {
				autoplay:"true"
			};
			var params = {};
			var attributes = {};
			name="div"+name;
			swfobject.embedSWF("/media/flash/musicplayer_f6.swf?playlist_url=/media/sound/song"+soundno+".xspf&amp;repeat=true", name, "0", "0", "7",false,flashvars,params,attributes); 
		}

		function playWithTitle(soundno)
		{
			stopAll();
			var flashvars = {
				playlist:"/media/sound/song"+soundno+".xspf",
				repeat:"yes",
				autostart:"yes"
			};
			var params = {};
			var attributes = {};
			var name="player"+soundno;
			name="div"+name;
			swfobject.embedSWF("/media/flash/emff_gib.swf", name, "134", "28", "7",false,flashvars,params,attributes); 
			var theNowplaying=document.getElementById("nowplaying");
			if(theNowplaying!=null)
				theNowplaying.style.visibility='visible';
		}

		function stop(soundno)
		{			
			var name="player"+soundno;
			name="div"+name;
			swfobject.embedSWF("/media/flash/musicplayer_f6.swf?playlist_url=/media/sound/song"+soundno+".xspf&amp;repeat=true&amp;autostart=false", name, "0", "0", "7"); 
			var theNowplaying=document.getElementById("nowplaying");
			if(theNowplaying!=null)
				theNowplaying.style.visibility='hidden';
		}
		
		function selectRadio(radioid)
		{
			var radioButton=document.getElementById(radioid);
			radioButton.checked=true;
		}
		
		function stopAll()
		{
			for(i=0;i<soundCount;i++)
				stop(sounds[i]);
		}
		
		function getReq()
		{
			if (window.XMLHttpRequest)
			{
					req = new XMLHttpRequest();
			}
			else if (window.ActiveXObject)
			{
					req = new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		
		function soundonoff(mode)
		{
				var rand = Math.random();
				url="/servlet/gib.bravony.servlet.SoundOnOffServlet?rnd="+rand+"&mode="+mode;
				getReq();
				if (req != undefined)
				{				
						req.open("GET", url, true);
						req.send("");
				}				
		}		

