var productURL;
var tsBegin, tsEnd, duration, speed;
var ms;

var data = "1000";

var c = 0;

var eImg = null;
var eTxt = null;

function showProgressState(complete)
{
	var barWidth = 218;
	if ( eImg == null ) eImg = document.getElementById("bar");
	if ( eTxt == null ) eTxt = document.getElementById("txt");

	eImg.style.clip = "rect(0px, " + Math.round(barWidth/100*complete) + "px, 15px, 0px)";
	eTxt.innerHTML = complete + " %";
	//alert(complete);
}

function writeFlash()
{
	var e = document.getElementById("box");
	
	var htmlCode = "";
	
	htmlCode += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="618" HEIGHT="353" id="speed_v01" ALIGN="">';
	htmlCode += '<PARAM NAME=movie VALUE="/swf/cs/test-rychlosti-propojeni/speed.swf?speed=' + parseInt(speed) + '&bg=../../../img/u/test-rychlosti-propojeni/bg-speed.jpg">';
	htmlCode += '<PARAM NAME=quality VALUE=high>';
	htmlCode += '<EMBED src="/swf/cs/test-rychlosti-propojeni/speed.swf?speed=' + parseInt(speed) + '&bg=../../../img/u/test-rychlosti-propojeni/bg-speed.jpg" quality=high WIDTH="618" HEIGHT="353" NAME="speed_v01" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
	htmlCode += '</OBJECT>';
	
	e.innerHTML = htmlCode;

}
function openProduct() {
	var w = window;
	if ( window.opener ) w = window.opener;
	
	w.location.href = productURL;

	if ( window.opener ) window.close();
	
	return false;
}

