/*
  use flashembed to place flowplayer into HTML element 
  whose id is "example" (below this script tag)

  modified for QTV Webservice by R. Neubauer 200809
  modified for "small"=384x216 by J. Liebers, 2009-09-11
  modified for qtv_autoplay by J. Liebers, 2010-03-04
*/

function flowembed (size,serverurl,video) {
// divid: id of the div element which will contain the player component
// size: either "norm" for 4:3 or "wide" for 16:9 aspect ratio player
// barcolor: hex color value for the preshaded player control bar
// location: url of the .flv video file

//  qtv_autoplay soll global 'yes'/'no' gesetzt werden und kann dann hier abgefragt werden.
//  Danach wird flow_autoplay auf true/false gesetzt und unten an den Player übergeben.
    var import_autoplay = window.qtv_autoplay || 'yes';
    if (import_autoplay == 'no') { flow_autoplay = false; } else { flow_autoplay = true; }

	var video_width;
	var video_height;

	if (size == "norm") {
		video_width = 448;
		video_height = 366;
	}

	if (size == "wide") {
		video_width = 512;
		video_height = 318;
	}

	if (size == "small") {
		video_width = 384;
		video_height = 246;
	}

	flashembed('clipdiv', 
	{
		src:'http://www.quintessenz.de/webservices/FLOWPLAYER/FlowPlayerLight.swf',
		w3c: true,
		width: video_width, 
		height: video_height,
		version: [9, 115]
	},
	{config: {   
		autoPlay: flow_autoplay,
		loop: false,
		autoRewind: true,
		controlBarBackgroundColor: '0x444444',
		initialScale: 'scale',  // frueher: 'orig'
		bufferLength: 5,
		startingBufferLength: 2,
		streamingServerURL: serverurl, 
		videoFile: video,
		showMenu: false
	}} 
	);
	
//	$("#clipdiv").css("width", video_width);
//	$("#clipdiv").css("height", video_height);
//	$("#clipdiv h2").css("margin-top", "0");
//	$("#clipdiv h2").css("padding-top", "50");


} //end