/*
	script take care Queue list
	24/08/04 Shay Lapid
*/
var StatisticsGlobalQueue=new Array();

function StatisticQueue(sObjectName)
{
	//onerror=function (sError,sURL,iLine){	return ClassException('StatisticQueue',sError,sURL,iLine); }
	function ReleaseQueue(sFunction)
	{
		var sVal=new String()
		var sIds=''
		while (Sem && document.readyState != "complete"){}
		Sem=true;

		for (i=0;i<arrQueue.length;i++)
		{
			sIds+=arrQueue[i]+',';
		}
		sIds=sIds.substr(0,sIds.length-1);
		var sFullURL=naSTATISTICS_COLLECT_URL+'ObjectName='+sObjectName+'&InstanceID='+sIds;
		var oFake=new Image()
		oFake.src=sFullURL ;
		delete oFake;
		delete arrQueue;
		arrQueue=null;
		arrQueue=new Array();
		Sem=false;
	}

	function AddToQueue(iId)
	{
		while (Sem){}
		Sem=true;
		arrQueue[arrQueue.length]=iId;
		clearTimeout(this.Interval);
		this.Interval=setTimeout(ReleaseQueue,1000)
		Sem=false;
	}

StatisticsGlobalQueue[StatisticsGlobalQueue.length]=this;

var Sem=false;
var arrQueue=new Array();
this.Interval;

this.Name=sObjectName;
this.Item=StatisticsGlobalQueue.length-1;
this.Add=AddToQueue;
//this.Release=ReleaseQueue ;
}

//Statistic function
function ClickStat(iNodeID){
	var oStatImg = new Image();
	
	oStatImg.src = naSTATISTICS_COLLECT_URL + "ObjectName=ForumMessage&InstanceID=" + iNodeID;
	
	delete oStatImg;
}