var flashVersion = "8";


function showSanagaPlayer(config) {

   var installFlash = "Hello, you either have JavaScript turned off or an old version of Macromedia's Flash Player. <a href=\"http://www.macromedia.com/go/getflashplayer/\">Click here</a> to get the latest flash player";

   // Width and Height parameters to pass into the SWF file.
   var width = config["width"];
   var height = config["height"];
   if (width == null) {
    width = "480";
   }
   if (height == null) {
    height = "360";
   }
   height += 35;

   // Background to pass into the SWF file.
   var bgColor = config["bgColor"];
   if (bgColor == null) {
    bgColor = "#FFFFFF";
   }
   

   // Affiliate Id to pass into the SWF file.
   var clientId = config["clientId"];
   if (clientId == null) {
    clientId = "sanaga";
   }

   // Movie Path to pass into the SWF file.
   var playList = config["playList"];

   // DIV id name for the Sanaga Player.
   var playerDiv = config["playerDiv"];
   if (playerDiv == null) {
       playerDiv = "sanagaPlayerDiv";
   }

   // Set the SWF file.
   var file = "http://www.sanaga.com/swf/SanagaPlayer.swf";

   // Write the Player.
   document.writeln("<div id=\"sanagaPlayerDiv\">");
   document.writeln("	<div style=\"padding: 20px; font-size:14px; font-weight: bold;\">" + installFlash + "</div>");
   document.writeln("	<script type=\"text/javascript\">");
   document.writeln("		var so = new SWFObject(\"" + file + "\", \"sanaga_player\", \"" + width + "\", \"" + height + "\"," + flashVersion  + ", \"" + bgColor + "\");");
   document.writeln("		so.addVariable(\"allowScriptAccess\" , \"always\");");
   document.writeln("		so.addVariable(\"video_id\",\"" + playList + "\");");
   document.writeln("		so.addVariable(\"clientId\",\"" + clientId + "\");");
   document.writeln("		so.write(\"" + playerDiv + "\");");
   document.writeln("	</script>");
   document.writeln("</div>");

}



