function createPlayer(config) {
	var hostLoc = config["domain"];
	var defaultPlayer = "testPlaylist.swf";
	var playlistPlayer = "testPlaylist2.swf";
	var useJW = true;
	var rand = Math.random();
	if (useJW)
	{
	    document.write("<div id=\"mediaspace" + rand + "\" style=\"padding:20px 10px 20px 10px;\"><p>You do not have Flash installed. You can download the latest version <a href='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=shockwaveFlash'>here</a>.</p> </div>");
		
		//var so = new SWFObject(hostLoc + 'mediaplayer.swf','player','480','325','8');
		var so = new SWFObject(hostLoc + 'mediaplayer.swf','player','480','412','8');
		so.addParam("allowfullscreen","true");
		so.addParam("bgcolor","#000000");
		so.addVariable('file',hostLoc + "?key=" + config["key"]);
		so.addVariable('lightcolor','0x557722');
		so.addVariable('searchbar','false');
		//so.addVariable('screencolor','0xFCFCFC');
		so.addVariable('screencolor','0x000000');
		//so.addVariable('shownavigation','false');
		so.addVariable("width","480");
		//so.addVariable("height","325");
		so.addVariable("height","412");
		if (config["autoplay"] == true)
			so.addVariable("autostart","true");
		// FOLLOWING THREE LINES ARE FOR GAPRO PLUGIN
		so.addParam("allowscriptaccess", "always");
		so.addVariable('plugins', 'gapro-1');
		so.addVariable('gapro.accountid', 'UA-130806-41');
		// END PLUGIN
		so.write('mediaspace'  + rand);
		document.write("<div id=\"vidFaq\" style=\"text-align:center\">Having problems viewing our videos? See our <a href=\"http://www.kalmbach.com/kpc/default.aspx?c=a&id=322\" target=\"_blank\">Video FAQ</a> for possible solutions!</div>");
	} else {
	if (config["playlist"] == true)
	{
		document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"550\" height=\"412\" id=\"testPlayer\" align=\"middle\">");
		document.write("  <param name=\"movie\" value=\"" + hostLoc + playlistPlayer + "\" />");
		document.write("  <param name=\"FlashVars\" value=\"xmlFile="+ hostLoc + "?key=" + config["key"] + "\"/>");
		document.write("  <param name=\"quality\" value=\"high\" />");
		document.write("  <param name=\"bgcolor\" value=\"#000000\" />");
		document.write("  <embed src=\"" + hostLoc + playlistPlayer + "\" FlashVars=\"xmlFile=" + hostLoc + "?key=" + config["key"] + "\" quality=\"high\" bgcolor=\"#000000\" width=\"550\" height=\"412\" name=\"testPlayer\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" />");
		document.write("</object>");
	} else // use default player
	{
		document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"550\" height=\"412\" id=\"testPlayer\" align=\"middle\">");
		document.write("  <param name=\"movie\" value=\"" + hostLoc + defaultPlayer + "\" />");
		document.write("  <param name=\"FlashVars\" value=\"xmlFile="+ hostLoc + "?key=" + config["key"] + "\"/>");
		document.write("  <param name=\"quality\" value=\"high\" />");
		document.write("  <param name=\"bgcolor\" value=\"#000000\" />");
		document.write("  <embed src=\"" + hostLoc + defaultPlayer + "\" FlashVars=\"xmlFile=" + hostLoc + "?key=" + config["key"] + "\" quality=\"high\" bgcolor=\"#000000\" width=\"550\" height=\"412\" name=\"testPlayer\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.adobe.com/go/getflashplayer\" />");
		document.write("</object>");
	}
	}
}