// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------

/*
use flashembed to place flowplayer into HTML element 
whose id is "example" (below this script tag)
*/
flashembed("video", 
	/* 
		first argument supplies standard Flash parameters. See full list:
		http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
	*/
	{
		src:'../videos/FlowPlayerLight.swf',
		width: 320, 
		height: 200
	},
	/*
		second argument is Flowplayer specific configuration. See full list:
		http://flowplayer.org/player/configuration.html
	*/
	{config: {   
		autoPlay: false,
		autoBuffering: true,
		loop: false,
		/*controlBarBackgroundColor:'0x2e8860',*/
		controlBarBackgroundColor:'0xff8d00',
		initialScale: 'fit',
		videoFile: '../videos/Kreuzung512K_Stream.mp4'
	}} 
);

function showVideo(id) {
	var parent = document.getElementById("videoDiv");
	if ( parent.hasChildNodes() )
	{
	    while ( parent.childNodes.length >= 1 )
	    {
	    	parent.removeChild( parent.firstChild );       
	    } 
	}
	
	var element = document.createElement("div");
	element.setAttribute("id", "video");
	parent.appendChild(element);

	var headline = document.createElement("h3");
	parent.appendChild(headline);
	headline.style.marginTop = '20px';

	var table = document.createElement("table");
	parent.appendChild(table);
	table.style.fontSize = '0.9em';
	var tbody = document.createElement("tbody");
	table.appendChild(tbody);
	var row = document.createElement("tr");
	tbody.appendChild(row);
	var cell1 = document.createElement("td");
	row.appendChild(cell1);
	cell1.style.verticalAlign = 'top';
	cell1.innerHTML = '<span class="bold">Location:</span>';
	var cell2 = document.createElement("td");
	row.appendChild(cell2);
	
	if(id == 'selector1')
	{
		/*
		use flashembed to place flowplayer into HTML element 
		whose id is "example" (below this script tag)
		*/
		flashembed("video", 
			/* 
				first argument supplies standard Flash parameters. See full list:
				http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
			*/
			{
				src:'../videos/FlowPlayerLight.swf',
				width: 320, 
				height: 200
			},
			/*
				second argument is Flowplayer specific configuration. See full list:
				http://flowplayer.org/player/configuration.html
			*/
			{config: {   
				autoPlay: true,
				autoBuffering: true,
				loop: false,
				/*controlBarBackgroundColor:'0x2e8860',*/
				controlBarBackgroundColor:'0xff8d00',
				initialScale: 'fit',
				videoFile: '../videos/Kreuzung512K_Stream.mp4'
			}} 
		);
		headline.innerHTML = streetHeader;
					
		cell2.innerHTML = streetText;
	}	
	else if(id == 'selector2')
	{
		/*
		use flashembed to place flowplayer into HTML element 
		whose id is "example" (below this script tag)
		*/
		flashembed("video", 
			/* 
				first argument supplies standard Flash parameters. See full list:
				http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
			*/
			{
				src:'../videos/FlowPlayerLight.swf',
				width: 320, 
				height: 200
			},
			/*
				second argument is Flowplayer specific configuration. See full list:
				http://flowplayer.org/player/configuration.html
			*/
			{config: {   
				autoPlay: true,
				autoBuffering: true,
				loop: false,
				/*controlBarBackgroundColor:'0x2e8860',*/
				controlBarBackgroundColor:'0xff8d00',
				initialScale: 'fit',
				videoFile: '../videos/Metzger512K_Stream.mp4'
			}} 
		);
		headline.innerHTML = butcherHeader;
		
		cell2.innerHTML = butcherText;
	}
	else if(id == 'selector3')
	{
		/*
		use flashembed to place flowplayer into HTML element 
		whose id is "example" (below this script tag)
		*/
		flashembed("video", 
			/* 
				first argument supplies standard Flash parameters. See full list:
				http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
			*/
			{
				src:'../videos/FlowPlayerLight.swf',
				width: 320, 
				height: 200
			},
			/*
				second argument is Flowplayer specific configuration. See full list:
				http://flowplayer.org/player/configuration.html
			*/
			{config: {   
				autoPlay: true,
				autoBuffering: true,
				loop: false,
				controlBarBackgroundColor:'0xff8d00',
				initialScale: 'fit',
				videoFile: '../videos/Karussell512K_Stream.mp4'
			}} 
		);
		headline.innerHTML = carrouselHeader;

		cell2.innerHTML = carrouselText;
	}
	else if(id == 'selector4')
	{
		/*
		use flashembed to place flowplayer into HTML element 
		whose id is "example" (below this script tag)
		*/
		flashembed("video", 
			/* 
				first argument supplies standard Flash parameters. See full list:
				http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701
			*/
			{
				src:'../videos/FlowPlayerLight.swf',
				width: 320, 
				height: 200
			},
			/*
				second argument is Flowplayer specific configuration. See full list:
				http://flowplayer.org/player/configuration.html
			*/
			{config: {   
				autoPlay: true,
				autoBuffering: true,
				loop: false,
				/*controlBarBackgroundColor:'0x2e8860',*/
				controlBarBackgroundColor:'0xff8d00',
				initialScale: 'fit',
				videoFile: '../videos/Ziegel512K_Stream.mp4'
			}} 
		);
		headline.innerHTML = buildingHeader;

		cell2.innerHTML = buildingText;
	}
}

