function Queue(size) {
this.size=size;
this.data=new Array();
this.add=function(ele) {
if (this.data.length<this.size) {
this.data[this.data.length]=ele;
} else {
this.data.shift();
this.data[this.data.length]=ele;
}
};
this.getData=function() {
return this.data;
};
this.toCookieValue=function(delimiter) {
var result='';
for (var i=0;i<this.data.length ;i++ )
{
if(i==0) {
result=escape(this.data[i]);
} else {
result+=delimiter+escape(this.data[i]);
}
}
return result;
};
}