function show_flash_free_trailer(filename, producer, producer_link)
{
	$.fn.colorbox({
		html: "<a id='flowplayer_free_movie' style='width: 100%; height: 300px; display: block;'></a><div style='margin-top:10px;'><div style='margin: 0 auto;' class='buttonrots'><a class='buttonredss pt_new_register' href='" + producer_link + "'>"+ producer +"</a></div></div>",
        width: '500px',
		height: '400px',
		open: true
	});

	$f(
		'flowplayer_free_movie',
		'/javascripts/flowplayer.commercial-3.2.2.swf',
	    {
		    key : '#@d515fa833877a5e8ea4',
            canvas:
            {
                backgroundGradient: "none",
                backgroundColor: "#000000"
            },
			clip:
			{
				scaling: 'fit',
				autoPlay: 'true',
				url: filename
			}
		}
	);
	return false;
}



function show_flash_teaser(teaser_link, movie_link, movie_link_text)
{
return show_flash_teaser(teaser_link, movie_link, movie_link_text, 0);
}
function show_flash_teaser(teaser_link, movie_link, movie_link_text, teaser_id)
{
	$.fn.colorbox({
		html: "<a id='flowplayer_trailer' style='width: 100%; height: 300px; display: block;'></a><div><div style='margin: 0 auto;' class='buttonrots'><a class='buttonredss' href='" + movie_link + "'>" + movie_link_text + "</a></div></div>",
		width: '500px',
		height: '400px',
		open: true
	});
	$f(
		'flowplayer_trailer',
		'./javascripts/flowplayer.commercial-3.2.2.swf',
		{
            key : '#@d515fa833877a5e8ea4',
			clip:
			{
				scaling: 'orig',
				autoPlay: 'true',
				url: teaser_link
			}
		}
	);

	// JE Tracking
	track_event('teaser_id', teaser_id);

	return false;
}

function show_flash_trailer(trailer_link)
{
	$.fn.colorbox({
		html: "<a id='flowplayer_trailer' style='width: 100%; height: 100%; display: block;'></a>",
		width: '500px',
		height: '400px',
		open: true
	});
	$f(
		'flowplayer_trailer',
		'./javascripts/flowplayer.commercial-3.2.2.swf',
		{
            key : ['#@d515fa833877a5e8ea4'], 
			clip:
			{
				scaling: 'orig',
				autoPlay: 'true',
				url: trailer_link
			}
		}
	);
	return false;
}

function show_flash_movie(movie_id, user_id, partner_id)
{
	$.ajax({
		url: 'ajax_flash_player.html?movie_id=' + movie_id,
		dataType: 'json',
		success: function (data)
		{
			if (data == null) return;

			if (data.status == 0)
			{
				$.fn.colorbox({
					html: "<p class='error'>" + data.error + "</p>",
					width: '500px',
					height: '400px',
					open: true
				});
			}
			else
			{
				$.fn.colorbox({
					html: "<a id='flowplayer_movie' style='width: 100%; height: 100%; display: block;'></a>",
					width: '500px',
					height: '400px',
					open: true
				});
				$f(
					'flowplayer_movie',
					'./javascripts/flowplayer.commercial-3.2.2.swf',
					{
						clip:
						{
							scaling: 'orig',
							provider: 'rtmp',
							autoPlay: 'true',
							url: data.filename,
							connectionArgs: [
								true,
								user_id,
								partner_id,
								data.content_id,
								data.token
							]
						},
						plugins:
						{
							rtmp:
							{
								url: '/javascripts/flowplayer.rtmp-3.1.3.swf',
								netConnectionUrl: 'rtmp://fms.blitzeis.com/movieon4'
							}
						}
					}
				);
			}
		}
	});
	return false;
}

function show_flash_liveclub_movie(movie_id, codec_id, session_id, token)
{
	$.fn.colorbox({
		html: "<a id='flowplayer_movie' style='width: 100%; height: 100%; display: block;'></a>",
		width: ((codec_id == 78) ? '1024px' : '500px'),
		height: ((codec_id == 78) ? '768px' : '400px'),
		open: true
	});
	$f(
		'flowplayer_movie',
		'./javascripts/flowplayer.commercial-3.2.2.swf',
		{
		    key : ['#@d515fa833877a5e8ea4'],
			clip:
			{
				scaling: 'fit',
				provider: 'rtmp',
				autoPlay: 'true',
				url: filename,
				connectionArgs: [
					true,
					movie_id,
					codec_id,
					session_id,
					token
				]
			},
			plugins:
			{
				rtmp:
				{
					url: '/javascripts/flowplayer.rtmp-3.1.3.swf',
					netConnectionUrl: 'rtmp://fms.blitzeis.com/bu_lc18'
				}
			}
		}
	);
	return false;
}

function show_flash_club_movie(movie_id, codec_id, user_id, partner_id, filename, token)
{
    var my_width, my_height;
    switch(codec_id)
    {
      case 65:
        my_width = "740px"; /* (720x404) +20 */
        my_height = "466px";  /* (720x404) +62 */
      break;
      case 78:
      case 74:
        my_width = "1024px";
        my_height = "768px";
      break;
      case 80:
        my_width = "588px";  /* (568x320) +20 */
        my_height = "382px"; /* (568x320) +62 */
      break;
      case 84:
        my_width = "1260px"; /* (1280x720) -20 */
        my_height = "658px"; /* (1280x720) -62 */
      break;
      default:
        my_width = "520px"; /* (500x400) +20 */
        my_height = "462px"; /* (500x400) +62 */
    }

	$.fn.colorbox({
		html: "<a id='flowplayer_movie' style='width: 100%; height: 100%; display: block;'></a>",
		width: my_width,
		height: my_height,
/*
        width: ((codec_id == 78) ? '1024px' : '500px'),
		height: ((codec_id == 78) ? '768px' : '400px'),
*/
		open: true
	});
	$f(
		'flowplayer_movie',
		'/javascripts/flowplayer.commercial-3.2.2.swf',
		{
		    key : ['#@d515fa833877a5e8ea4'],
			clip:
			{
				scaling: 'fit',
				provider: 'rtmp',
				autoPlay: 'true',
				url: filename,
				connectionArgs: [
					true,
					user_id,
					partner_id,
					movie_id,
					token,
					codec_id
				]
			},
			plugins:
			{
				rtmp:
				{
					url: '/javascripts/flowplayer.rtmp-3.1.3.swf',
					netConnectionUrl: 'rtmp://fms.blitzeis.com/njoyon'
				}
			}
		}
	);
	return false;
}


function show_flash_club_welcome(movie_id, codec_id, user_id, partner_id, filename, token)
{
    var my_width, my_height;
    switch(codec_id)
    {
      case 65:
        my_width = "740px"; /* (720x404) +20 */
        my_height = "466px";  /* (720x404) +62 */
      break;
      case 78:
      case 74:
        my_width = "1024px";
        my_height = "768px";
      break;
      case 80:
        my_width = "588px";  /* (568x320) +20 */
        my_height = "382px"; /* (568x320) +62 */
      break;
      case 84:
        my_width = "1260px"; /* (1280x720) -20 */
        my_height = "658px"; /* (1280x720) -62 */
      break;
      default:
        my_width = "520px"; /* (500x400) +20 */
        my_height = "462px"; /* (500x400) +62 */
    }

	$.fn.colorbox({
		html: "<a id='flowplayer_movie' style='width: 100%; height: 400px; display: block;'></a><div style='margin-top:10px;'><div style='margin: 0 auto;' class='buttonrotm'><a class='buttonredmm' href='join.php'>Jetzt in Hardcore sehen</a></div></div>",
		width: my_width,
		height: '510px',
/*
        width: ((codec_id == 78) ? '1024px' : '500px'),
		height: ((codec_id == 78) ? '768px' : '400px'),
*/
		open: true
	});
	$f(
		'flowplayer_movie',
		'./javascripts/flowplayer.commercial-3.2.2.swf',
		{
		    key : ['#@d515fa833877a5e8ea4'],
			clip:
			{
				scaling: 'fit',
				provider: 'rtmp',
				autoPlay: 'true',
				url: filename,
				connectionArgs: [
					true,
					user_id,
					partner_id,
					movie_id,
					token,
					codec_id
				]
			},
			plugins:
			{
				rtmp:
				{
					url: '/javascripts/flowplayer.rtmp-3.1.3.swf',
					netConnectionUrl: 'rtmp://fms.blitzeis.com/njoyon'
				}
			}
		}
	);
	return false;
}


