//================================================================================
//	© 2007 PantherPanache, LLC.  All rights reserved. http://www.panachetech.com
//--------------------------------------------------------------------------------

function panResize(cx, cy)
{
	var pan_player = document.getElementById("PanVideoPlayer");
	var pan_player_div = document.getElementById("PanVideoPlayerDiv");
	if(panPlayer != null && pan_player_div != null)
	{
		pan_player.height="100%";
		pan_player.width="100%";		
		pan_player_div.style.width = cx+"px";
		pan_player_div.style.height = (cy+30)+"px";
	}
}

//--------------------------------------------------------------------------------

function panRenderPlayer()
{
	var qs = "videoUrl=" + video_url;
	if(mbdd != null)
		qs += "&MBDD=" + mbdd;
	qs += "&useMetadataSize=" + (use_metadata_size == true ? 1 : 0) +"&canMaximize=" + (can_maximize == true ? 1 : 0);
	qs += "&maximizeFullscreen=" + (maximize_fullscreen == true ? 1 : 0) +"&minVideoWidth=" + video_min_width;
	qs += "&minVideoHeight=" + video_min_height +"&maxVideoWidth=" + video_max_width;
	qs += "&maxVideoHeight=" + video_max_height +"&autostart=" + (autostart == true ? 1 : 0);
	qs += "&optIn=" + (opt_in == true ? 1 : 0) +"&clickToOptIn=" + (click_to_opt_in == true ? 1 : 0);
	qs += "&autoSeekElements=" + (auto_seek_elements == true ? 1 : 0);
	if(auto_seek_notification_duration == null)
		auto_seek_notification_duration = 0;
	qs += "&autoSeekNotificationDuration=" + auto_seek_notification_duration;
	qs += "&blockControls=" + (block_controls == true ? 1 : 0);
	qs += "&bitratePayloadUrl=" + bitrate_payload_url;
	if(load_buffer_size == null)
		load_buffer_size = 15;
	qs += "&loadBufferSize=" + load_buffer_size;
	if(play_buffer_size == null)
		play_buffer_size = 1;
	qs += "&playBufferSize=" + play_buffer_size;
	
	document.write("<div id='PanVideoPlayerDiv' style='width:" + video_min_width + "px;height:" + (video_min_height+30) + "px'>");
	
	if (AC_FL_RunContent == 0)
	{
		alert("This page requires AC_RunActiveContent.js.");
	}
	else
	{
			AC_FL_RunContent(
				'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0',
				'width', video_min_width.toString(),
				'height', (video_min_height+30).toString(),
				'src', ('PanVideoPlayer?' + qs),
				'quality', 'high',
				'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				'align', 'middle',
				'play', 'true',
				'loop', 'true',
				'scale', 'showall',
				'wmode', 'transparent',
				'devicefont', 'false',
				'id', 'PanVideoPlayer',
				'bgcolor', bk_color,
				'name', 'PanVideoPlayer',
				'menu', 'false',
				'allowFullScreen', maximize_fullscreen.toString(),
				'allowScriptAccess','always',
				'movie', ('PanVideoPlayer?' + qs),
				'salign', ''
				);
		}
	document.write("</div>");
}

//--------------------------------------------------------------------------------
//================================================================================