function vlc_embed(id,w,h)
{
	var have_vlc = false;

	if ( navigator.appVersion.match(/MSIE/) )
	{
		have_vlc = false;
	}
	else if ( navigator.plugins )
	{
		for (var i = 0; i < navigator.plugins.length; i++ )
		{
			if ( navigator.plugins[i].filename.match(/vlc/) )
			{
				have_vlc = true;
			}
		}
	}
	else
	{
		have_vlc = false;
	}

	if ( have_vlc )
	{
		var video_element = document.getElementById(id);
		if ( video_element )
		{
			var video_source = null;
			if ( video_element.href )
			{
				video_source = video_element.href;
			}
			else if ( video_element.src )
			{
				video_source = video_element.src;
			}
			if ( video_source )
			{
				var video_container = document.createElement('div');
				video_container.className = video_element.className;
				video_container.style.whiteSpace = 'nowrap';
				video_container.innerHTML = '<embed id="'+id+'" type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" version="VideoLAN.VLCPlugin.2" target="'+video_source+'" width="'+w+'" height="'+h+'" autoplay="off" loop="off" style="margin:auto;width:'+w+'px;height:'+h+'px;" /><br>'
				+ '<span class="fakeButton" onclick="vlc_play(\''+id+'\')" ><img src="http://assets.kuhlmann-software.at/icons/control_play_blue.png">Wiedergabe</span>'
				+ '<span class="fakeButton" onclick="vlc_pause(\''+id+'\')"><img src="http://assets.kuhlmann-software.at/icons/control_stop_blue.png">Stop</span>'
				+ '<span class="fakeButton" onclick="vlc_mute(\''+id+'\')"><img src="http://assets.kuhlmann-software.at/icons/sound_mute.png">Ton aus</span>'
				+ '<span class="fakeButton" onclick="vlc_unmute(\''+id+'\')"><img src="http://assets.kuhlmann-software.at/icons/sound.png">Ton ein</span>';
				video_element.parentNode.replaceChild(video_container,video_element);
				$('#video_info_1').hide();
			}
		}
	}
}

function vlc_play(id)
{
	var vlc = document.getElementById(id);
	if ( vlc )
	{
		vlc.playlist.stop();
		vlc.playlist.play();
	}
}

function vlc_pause(id)
{
	var vlc = document.getElementById(id);
	if ( vlc )
	{
		vlc.playlist.stop();
	}
}

function vlc_mute(id)
{
	var vlc = document.getElementById(id);
	if ( vlc )
	{
		vlc.audio.mute = true;
	}
}

function vlc_unmute(id)
{
	var vlc = document.getElementById(id);
	if ( vlc )
	{
		vlc.audio.mute = false;
	}
}

