var lo_quality = 0;
function SetLow()
{
 lo_quality = 1;
}
var old_req_percent=-1;
function getUpdate(typ,pr1,pr2,swf) { 
var client = new XMLHttpRequest();
  if(typ == 'state' && pr1 == 2) {
   s = getDuration(swf);
   setStopPoints(swf, s);
   sp = getStopPoints(swf);
   //test.innerHTML = sp;
  }
  if(typ == 'time')
  {
    var percent =(pr1/duration)*100;
  var percent = Math.round(percent);
 //alert("pr1" + pr1 + "duration" + duration + "percent" + percent);
	if(old_req_percent == percent)
	{
	return;
	}
	else
	{
	old_req_percent = percent;
	if(percent % 10 == 0)
	{
	//alert('/system/loficount.php?st=0&percent=' + percent + '&trackid=' + itemid);
	var cl = new XMLHttpRequest();
	var client_target = '/system/loficount.php?st=0&percent=' + percent + '&trackid=' + swf; 
	//test.innerHTML = client_target;
	cl.open("GET", client_target);
	cl.send();
	}
	}
  //test.innerHTML = sp.length;
   // for(i=0;i<sp.length;i++)
   // {
    // if(pr1 == sp[i])
	// {
	 // var percent = (sp[i]/s)*100;
	 // percent = Math.round(percent);
	  // if(old_req_percent == percent)
	// {
	//test.innerHTML = old_req_percent + " return\n";
	// return;
	// }
	// else
	// {
	// old_req_percent = percent;
	//test
	// }
	 // client.open("GET", '/system/loficount.php?st=0&percent=' + percent + '&trackid=' + swf);
     // client.send();
    // }
   // }   
  }
};
	var lenghtArr = Array();
	var stopPoints = Array();
	function getDuration(swf)
	{
	var tmp = swf.replace("p", "");
	return lenghtArr[tmp];
	}
	function setDuration(id, duration)
	{
	lenghtArr[id] = duration;
	}
	function setStopPoints(swf, curDuration)
	{
	 var points = new Array();
	 var j=0;
	 for(i=0;i<=curDuration;i+=10)
	 {
	  points[j]=i;
	  
	  j++;
	 }
	 stopPoints[swf]=points;
	}
	function getStopPoints(swf)
	{
	 return stopPoints[swf]
	}

