var scrollbar=function()
{
	if(typeof arguments == 'undefined')
	{
		alert("error arguments!");return;
	}
	
	this.container=new Element("marquee");
	this.container.setAttribute("direction","left");
	this.container.setAttribute("width","600");
	this.container.setAttribute("onmouseover","this.stop()");
	this.container.setAttribute("onmouseout","this.start()");
	this.list=new Array();

	this.parentId=arguments[0].id;
	this.list=arguments[0].list;
	
	this.sort=function()
	{
		for(var i=0;i<this.list.length;i++)
		{
			var t;
			for(var j=i;j<this.list.length;j++)
			{
				if(this.list[i].jobs<this.list[j].jobs)
				{
					t=this.list[i];
					this.list[i]=this.list[j];
					this.list[j]=t;
				}
			}
		}
	};
	
	this.show=function()
	{
		this.sort();
		for(var i=0;i<this.list.length;i++)
		{
			var link=new Element("a");
			link.setAttribute("href",list[i].profile);
			link.setAttribute("style","padding-right:30px;");
			link.appendChild(document.createTextNode(" "+list[i].companyName+", Jobs("+list[i].jobs+") "));

			this.container.appendChild(link);
		}

		document.getElementById(this.parentId).appendChild(this.container);
	};

};
