﻿function LoadFlashPlayer(url,width,height) 
{
      document.write("<div id='swfloadingstate' style='height:18px;line-height:18px;'><span id='swfloadingprocess' style='border:1px solid #cc;width:200px;background-color:green;'></span><span>loading player...</span><span id='swfloadingpercent'></span></div>")
      document.write("<object id=\"player\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" height=\""+ height +"\" width=\"" + width + "\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" viewastext> ");  
      document.write("<param name=\"FlashVars\" value=\"\">");
      document.write("<param name=\"Movie\" value=\"" + url + "\">");
      document.write("<param name=\"Src\" value=\""+ url +"\">");
      document.write("<param name=\"Play\" value=\"-1\">");
      document.write("<param name=\"Loop\" value=\"-1\">");
      document.write("<param name=\"Quality\" value=\"High\">");;
      document.write("<param name=\"AllowScriptAccess\" value=\"sameDomain\">");     
      document.write("<embed src=\"" + url + "\" width=\"" +width + "\" height=\"" + height+"\"");
			document.write(" allowscriptaccess=\"sameDomain\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" />");
      document.write("</object>");
      
      var obj = document.getElementById("swfloading");
      if(obj != null)
      {
      	obj.style.display="none";
      }

      percent();
}


function percent() {
	swfloadingprocess.style.width=2 * player.PercentLoaded();
	swfloadingpercent.innerHTML=player.PercentLoaded() + '%';
	if (player.PercentLoaded() == 100)
	{
		swfloadingstate.style.display="none";
	}else{
	var timeout = setTimeout('percent()',10);
	}
}

