/**
 * Example Usage:
 * <script type="text/javascript" src="/js/swfobject.js"></script>
 * <script type="text/javascript" src="/js/createplayer.js"></script>
 * <script type="text/javascript">
 * 		createPlayer('russVid', '/fla/mpowerment/russ_20080516_320.flv', null, true, 320, 240, null);
 * </script>
 * <div id="russVid">You will need to <a href="http://www.macromedia.com/go/getflashplayer">Get Flash</a> to view this Video</div>
 *
 */

function createPlayer(thePlace, theFile, theImage, go, width, height, logo, showcontrols, flashvars ) {
    if ( showcontrols )
    {
		var s = new SWFObject('/fla/mediaplayer.swf','playerID',width,height+20,'8');
		s.addVariable("height",height+20);
    }
    else
    {
		var s = new SWFObject('/fla/mediaplayer.swf','playerID',width,height,'8');
		s.addVariable("height",height);
    }
	s.addParam("allowscriptaccess", "always");
	s.addParam("wmode", "transparent");
	s.addParam("allowfullscreen","true");
	if ( flashvars ) s.addParam("flashvars",flashvars);
	if ( theFile ) s.addVariable("file",theFile);
	s.addVariable("width",width);
	s.addVariable("displayheight",height);
	s.addVariable("overstretch","fit");
	if ( logo ) s.addVariable('logo', logo);
	if ( theImage ) s.addVariable("image",theImage);
	s.addVariable("showicons","false");
	if (go) { s.addVariable("autostart","true"); }

	s.write(thePlace);
}
