// JavaScript Document

function getVideoPlayer( src, w, h, videoPath, skinBackgroundColor, autoPlay, previewPath )
{
	var rel = src;
	
	if ( rel.lastIndexOf("/") >= 0 )
		rel = rel.substr(0, rel.lastIndexOf("/") + 1);
	else
		rel = "./";
		
	if ( autoPlay == false )
		autoPlay = "no";
	else
		autoPlay = "yes";
		
	if ( previewPath === undefined )
		previewPath = "";
	
	var FlashVars = "w=" + w + "&h=" + h + "&skinBackgroundColor=" + skinBackgroundColor + "&videoPath=" + videoPath + "&previewPath=" + previewPath + "&rel=" + rel + "&autoplay=" + autoPlay;

	// add to the height of the video the height of the controls skin
	h += 45;

	return AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','wmode','transparent','width',w,'height',h,'src',src,'quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie',src.substr(0, src.lastIndexOf("." ) ),'FlashVars',FlashVars);
}

function insertVideoPlayer( src, w, h, videoPath, skinBackgroundColor, autoPlay, previewPath )
{
	document.write(getVideoPlayer( src, w, h, videoPath, skinBackgroundColor, autoPlay, previewPath ));
}