﻿function embedFlashVideo(targetContainerName,file,autostart)
{
   
    var flashvars = {};   
	flashvars.config = "flash/playerconfig.aspx";
    flashvars.file = escape(file);       
    flashvars.autostart = autostart;              
	var params = {};
	params.wmode = "transparent";
	params.allowfullscreen = "true";
	params.allowscriptaccess = "always";
	var attributes = {};
	swfobject.embedSWF("flash/player.swf", targetContainerName , "320", "275", "9.0.115.0", "flash/expressInstall.swf", flashvars, params, attributes);    
  
}

function createContainer(parentContainer,divId)
{    
     var newdiv = document.createElement('div');
     newdiv.setAttribute('id', divId);     
     document.getElementById(parentContainer).appendChild(newdiv);
}

function createAndEmbed(parentContainer,targetContainerName,file,autostart)
{    
     createContainer(parentContainer,targetContainerName);
     embedFlashVideo(targetContainerName,file,autostart);
    return ('');
}